8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing

Move _max_locals and _size_of_parameters to ConstMethod for better sharing.

Reviewed-by: coleenp, minqi, jrose
This commit is contained in:
Jiangli Zhou 2012-12-11 12:41:31 -05:00
parent ba2a5a260d
commit 511a9d8982
13 changed files with 132 additions and 74 deletions

View file

@ -73,8 +73,7 @@
// |------------------------------------------------------|
// | result_index (C++ interpreter only) |
// |------------------------------------------------------|
// | method_size | max_locals |
// | size_of_parameters | intrinsic_id| flags |
// | method_size | intrinsic_id| flags |
// |------------------------------------------------------|
// | throwout_count | num_breakpoints |
// |------------------------------------------------------|
@ -116,8 +115,6 @@ class Method : public Metadata {
int _result_index; // C++ interpreter needs for converting results to/from stack
#endif
u2 _method_size; // size of this object
u2 _max_locals; // Number of local variables used by this method
u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
u1 _jfr_towrite : 1, // Flags
_force_inline : 1,
@ -292,8 +289,8 @@ class Method : public Metadata {
void set_max_stack(int size) { constMethod()->set_max_stack(size); }
// max locals
int max_locals() const { return _max_locals; }
void set_max_locals(int size) { _max_locals = size; }
int max_locals() const { return constMethod()->max_locals(); }
void set_max_locals(int size) { constMethod()->set_max_locals(size); }
int highest_comp_level() const;
void set_highest_comp_level(int level);
@ -311,7 +308,8 @@ class Method : public Metadata {
void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; }
// size of parameters
int size_of_parameters() const { return _size_of_parameters; }
int size_of_parameters() const { return constMethod()->size_of_parameters(); }
void set_size_of_parameters(int size) { constMethod()->set_size_of_parameters(size); }
bool has_stackmap_table() const {
return constMethod()->has_stackmap_table();
@ -588,8 +586,6 @@ class Method : public Metadata {
#ifdef CC_INTERP
static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); }
#endif /* CC_INTERP */
static ByteSize size_of_locals_offset() { return byte_offset_of(Method, _max_locals ); }
static ByteSize size_of_parameters_offset() { return byte_offset_of(Method, _size_of_parameters); }
static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); }
static ByteSize code_offset() { return byte_offset_of(Method, _code); }
static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); }
@ -796,9 +792,6 @@ class Method : public Metadata {
Array<AnnotationArray*>* methods_default_annotations,
bool idempotent = false);
// size of parameters
void set_size_of_parameters(int size) { _size_of_parameters = size; }
// Deallocation function for redefine classes or if an error occurs
void deallocate_contents(ClassLoaderData* loader_data);