comparison src/share/vm/oops/method.hpp @ 7402:fd74228fd5ca

8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing. Summary: Move _max_locals and _size_of_parameters to ConstMethod for better sharing. Reviewed-by: coleenp, minqi, jrose
author jiangli
date Tue, 11 Dec 2012 12:41:31 -0500
parents 5505fbbae3d3
children 4daebd4cc1dd 0c8717a92b2d
comparison
equal deleted inserted replaced
7396:4a2ed49abd51 7402:fd74228fd5ca
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_locals | 76 // | method_size | intrinsic_id| flags |
77 // | size_of_parameters | intrinsic_id| flags |
78 // |------------------------------------------------------| 77 // |------------------------------------------------------|
79 // | throwout_count | num_breakpoints | 78 // | throwout_count | num_breakpoints |
80 // |------------------------------------------------------| 79 // |------------------------------------------------------|
81 // | invocation_counter | 80 // | invocation_counter |
82 // | backedge_counter | 81 // | backedge_counter |
114 // note: can have vtables with >2**16 elements (because of inheritance) 113 // note: can have vtables with >2**16 elements (because of inheritance)
115 #ifdef CC_INTERP 114 #ifdef CC_INTERP
116 int _result_index; // C++ interpreter needs for converting results to/from stack 115 int _result_index; // C++ interpreter needs for converting results to/from stack
117 #endif 116 #endif
118 u2 _method_size; // size of this object 117 u2 _method_size; // size of this object
119 u2 _max_locals; // Number of local variables used by this method
120 u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
121 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none) 118 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
122 u1 _jfr_towrite : 1, // Flags 119 u1 _jfr_towrite : 1, // Flags
123 _force_inline : 1, 120 _force_inline : 1,
124 _hidden : 1, 121 _hidden : 1,
125 _dont_inline : 1, 122 _dont_inline : 1,
290 int verifier_max_stack() const { return constMethod()->max_stack(); } 287 int verifier_max_stack() const { return constMethod()->max_stack(); }
291 int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); } 288 int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); }
292 void set_max_stack(int size) { constMethod()->set_max_stack(size); } 289 void set_max_stack(int size) { constMethod()->set_max_stack(size); }
293 290
294 // max locals 291 // max locals
295 int max_locals() const { return _max_locals; } 292 int max_locals() const { return constMethod()->max_locals(); }
296 void set_max_locals(int size) { _max_locals = size; } 293 void set_max_locals(int size) { constMethod()->set_max_locals(size); }
297 294
298 int highest_comp_level() const; 295 int highest_comp_level() const;
299 void set_highest_comp_level(int level); 296 void set_highest_comp_level(int level);
300 int highest_osr_comp_level() const; 297 int highest_osr_comp_level() const;
301 void set_highest_osr_comp_level(int level); 298 void set_highest_osr_comp_level(int level);
309 306
310 int interpreter_throwout_count() const { return _interpreter_throwout_count; } 307 int interpreter_throwout_count() const { return _interpreter_throwout_count; }
311 void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; } 308 void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; }
312 309
313 // size of parameters 310 // size of parameters
314 int size_of_parameters() const { return _size_of_parameters; } 311 int size_of_parameters() const { return constMethod()->size_of_parameters(); }
312 void set_size_of_parameters(int size) { constMethod()->set_size_of_parameters(size); }
315 313
316 bool has_stackmap_table() const { 314 bool has_stackmap_table() const {
317 return constMethod()->has_stackmap_table(); 315 return constMethod()->has_stackmap_table();
318 } 316 }
319 317
586 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); } 584 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); }
587 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); } 585 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); }
588 #ifdef CC_INTERP 586 #ifdef CC_INTERP
589 static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); } 587 static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); }
590 #endif /* CC_INTERP */ 588 #endif /* CC_INTERP */
591 static ByteSize size_of_locals_offset() { return byte_offset_of(Method, _max_locals ); }
592 static ByteSize size_of_parameters_offset() { return byte_offset_of(Method, _size_of_parameters); }
593 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); } 589 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); }
594 static ByteSize code_offset() { return byte_offset_of(Method, _code); } 590 static ByteSize code_offset() { return byte_offset_of(Method, _code); }
595 static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); } 591 static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); }
596 static ByteSize backedge_counter_offset() { return byte_offset_of(Method, _backedge_counter); } 592 static ByteSize backedge_counter_offset() { return byte_offset_of(Method, _backedge_counter); }
597 static ByteSize method_data_offset() { 593 static ByteSize method_data_offset() {
793 static void sort_methods(Array<Method*>* methods, 789 static void sort_methods(Array<Method*>* methods,
794 Array<AnnotationArray*>* methods_annotations, 790 Array<AnnotationArray*>* methods_annotations,
795 Array<AnnotationArray*>* methods_parameter_annotations, 791 Array<AnnotationArray*>* methods_parameter_annotations,
796 Array<AnnotationArray*>* methods_default_annotations, 792 Array<AnnotationArray*>* methods_default_annotations,
797 bool idempotent = false); 793 bool idempotent = false);
798
799 // size of parameters
800 void set_size_of_parameters(int size) { _size_of_parameters = size; }
801 794
802 // Deallocation function for redefine classes or if an error occurs 795 // Deallocation function for redefine classes or if an error occurs
803 void deallocate_contents(ClassLoaderData* loader_data); 796 void deallocate_contents(ClassLoaderData* loader_data);
804 797
805 // Printing 798 // Printing