comparison src/share/vm/oops/method.hpp @ 7183:b2dbd323c668

8003848: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Summary: Make ConstMethod::generic_signature_index optional and move Method::_max_stack to ConstMethod. Reviewed-by: bdelsart, sspitsyn, coleenp
author jiangli
date Tue, 27 Nov 2012 17:03:56 -0500
parents 18fb7da42534
children 5505fbbae3d3
comparison
equal deleted inserted replaced
7165:e1d42ba865de 7183:b2dbd323c668
71 // | access_flags | 71 // | access_flags |
72 // | vtable_index | 72 // | vtable_index |
73 // |------------------------------------------------------| 73 // |------------------------------------------------------|
74 // | result_index (C++ interpreter only) | 74 // | result_index (C++ interpreter only) |
75 // |------------------------------------------------------| 75 // |------------------------------------------------------|
76 // | method_size | max_stack | 76 // | method_size | max_locals |
77 // | max_locals | size_of_parameters | 77 // | size_of_parameters | intrinsic_id| flags |
78 // |------------------------------------------------------| 78 // |------------------------------------------------------|
79 // |intrinsic_id| flags | throwout_count | 79 // | throwout_count | num_breakpoints |
80 // |------------------------------------------------------|
81 // | num_breakpoints | (unused) |
82 // |------------------------------------------------------| 80 // |------------------------------------------------------|
83 // | invocation_counter | 81 // | invocation_counter |
84 // | backedge_counter | 82 // | backedge_counter |
85 // |------------------------------------------------------| 83 // |------------------------------------------------------|
86 // | prev_time (tiered only, 64 bit wide) | 84 // | prev_time (tiered only, 64 bit wide) |
116 // note: can have vtables with >2**16 elements (because of inheritance) 114 // note: can have vtables with >2**16 elements (because of inheritance)
117 #ifdef CC_INTERP 115 #ifdef CC_INTERP
118 int _result_index; // C++ interpreter needs for converting results to/from stack 116 int _result_index; // C++ interpreter needs for converting results to/from stack
119 #endif 117 #endif
120 u2 _method_size; // size of this object 118 u2 _method_size; // size of this object
121 u2 _max_stack; // Maximum number of entries on the expression stack
122 u2 _max_locals; // Number of local variables used by this method 119 u2 _max_locals; // Number of local variables used by this method
123 u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words 120 u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
124 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none) 121 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
125 u1 _jfr_towrite : 1, // Flags 122 u1 _jfr_towrite : 1, // Flags
126 _force_inline : 1, 123 _force_inline : 1,
164 AccessFlags access_flags, 161 AccessFlags access_flags,
165 int compressed_line_number_size, 162 int compressed_line_number_size,
166 int localvariable_table_length, 163 int localvariable_table_length,
167 int exception_table_length, 164 int exception_table_length,
168 int checked_exceptions_length, 165 int checked_exceptions_length,
166 u2 generic_signature_index,
169 ConstMethod::MethodType method_type, 167 ConstMethod::MethodType method_type,
170 TRAPS); 168 TRAPS);
171 169
172 Method() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } 170 Method() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
173 171
286 ConstantPool* constants() const { return constMethod()->constants(); } 284 ConstantPool* constants() const { return constMethod()->constants(); }
287 void set_constants(ConstantPool* c) { constMethod()->set_constants(c); } 285 void set_constants(ConstantPool* c) { constMethod()->set_constants(c); }
288 286
289 // max stack 287 // max stack
290 // return original max stack size for method verification 288 // return original max stack size for method verification
291 int verifier_max_stack() const { return _max_stack; } 289 int verifier_max_stack() const { return constMethod()->max_stack(); }
292 int max_stack() const { return _max_stack + extra_stack_entries(); } 290 int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); }
293 void set_max_stack(int size) { _max_stack = size; } 291 void set_max_stack(int size) { constMethod()->set_max_stack(size); }
294 292
295 // max locals 293 // max locals
296 int max_locals() const { return _max_locals; } 294 int max_locals() const { return _max_locals; }
297 void set_max_locals(int size) { _max_locals = size; } 295 void set_max_locals(int size) { _max_locals = size; }
298 296
604 #endif // not PRODUCT 602 #endif // not PRODUCT
605 static ByteSize native_function_offset() { return in_ByteSize(sizeof(Method)); } 603 static ByteSize native_function_offset() { return in_ByteSize(sizeof(Method)); }
606 static ByteSize from_interpreted_offset() { return byte_offset_of(Method, _from_interpreted_entry ); } 604 static ByteSize from_interpreted_offset() { return byte_offset_of(Method, _from_interpreted_entry ); }
607 static ByteSize interpreter_entry_offset() { return byte_offset_of(Method, _i2i_entry ); } 605 static ByteSize interpreter_entry_offset() { return byte_offset_of(Method, _i2i_entry ); }
608 static ByteSize signature_handler_offset() { return in_ByteSize(sizeof(Method) + wordSize); } 606 static ByteSize signature_handler_offset() { return in_ByteSize(sizeof(Method) + wordSize); }
609 static ByteSize max_stack_offset() { return byte_offset_of(Method, _max_stack ); }
610 607
611 // for code generation 608 // for code generation
612 static int method_data_offset_in_bytes() { return offset_of(Method, _method_data); } 609 static int method_data_offset_in_bytes() { return offset_of(Method, _method_data); }
613 static int interpreter_invocation_counter_offset_in_bytes() 610 static int interpreter_invocation_counter_offset_in_bytes()
614 { return offset_of(Method, _interpreter_invocation_count); } 611 { return offset_of(Method, _interpreter_invocation_count); }