comparison src/share/vm/oops/method.hpp @ 7465:37a3e8b7a1e9

Merge
author zgu
date Tue, 08 Jan 2013 11:39:53 -0800
parents 4daebd4cc1dd
children ade95d680b42
comparison
equal deleted inserted replaced
7464:ecd24264898b 7465:37a3e8b7a1e9
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,
226 if (ik->annotations() == NULL) { 223 if (ik->annotations() == NULL) {
227 return NULL; 224 return NULL;
228 } 225 }
229 return ik->annotations()->get_method_default_annotations_of(method_idnum()); 226 return ik->annotations()->get_method_default_annotations_of(method_idnum());
230 } 227 }
228 AnnotationArray* type_annotations() const {
229 InstanceKlass* ik = method_holder();
230 Annotations* type_annos = ik->type_annotations();
231 if (type_annos == NULL)
232 return NULL;
233 return type_annos->get_method_annotations_of(method_idnum());
234 }
231 235
232 #ifdef CC_INTERP 236 #ifdef CC_INTERP
233 void set_result_index(BasicType type); 237 void set_result_index(BasicType type);
234 int result_index() { return _result_index; } 238 int result_index() { return _result_index; }
235 #endif 239 #endif
290 int verifier_max_stack() const { return constMethod()->max_stack(); } 294 int verifier_max_stack() const { return constMethod()->max_stack(); }
291 int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); } 295 int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); }
292 void set_max_stack(int size) { constMethod()->set_max_stack(size); } 296 void set_max_stack(int size) { constMethod()->set_max_stack(size); }
293 297
294 // max locals 298 // max locals
295 int max_locals() const { return _max_locals; } 299 int max_locals() const { return constMethod()->max_locals(); }
296 void set_max_locals(int size) { _max_locals = size; } 300 void set_max_locals(int size) { constMethod()->set_max_locals(size); }
297 301
298 int highest_comp_level() const; 302 int highest_comp_level() const;
299 void set_highest_comp_level(int level); 303 void set_highest_comp_level(int level);
300 int highest_osr_comp_level() const; 304 int highest_osr_comp_level() const;
301 void set_highest_osr_comp_level(int level); 305 void set_highest_osr_comp_level(int level);
309 313
310 int interpreter_throwout_count() const { return _interpreter_throwout_count; } 314 int interpreter_throwout_count() const { return _interpreter_throwout_count; }
311 void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; } 315 void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; }
312 316
313 // size of parameters 317 // size of parameters
314 int size_of_parameters() const { return _size_of_parameters; } 318 int size_of_parameters() const { return constMethod()->size_of_parameters(); }
319 void set_size_of_parameters(int size) { constMethod()->set_size_of_parameters(size); }
315 320
316 bool has_stackmap_table() const { 321 bool has_stackmap_table() const {
317 return constMethod()->has_stackmap_table(); 322 return constMethod()->has_stackmap_table();
318 } 323 }
319 324
586 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); } 591 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); }
587 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); } 592 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); }
588 #ifdef CC_INTERP 593 #ifdef CC_INTERP
589 static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); } 594 static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); }
590 #endif /* CC_INTERP */ 595 #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); } 596 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); }
594 static ByteSize code_offset() { return byte_offset_of(Method, _code); } 597 static ByteSize code_offset() { return byte_offset_of(Method, _code); }
595 static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); } 598 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); } 599 static ByteSize backedge_counter_offset() { return byte_offset_of(Method, _backedge_counter); }
597 static ByteSize method_data_offset() { 600 static ByteSize method_data_offset() {
792 // Helper routine used for method sorting 795 // Helper routine used for method sorting
793 static void sort_methods(Array<Method*>* methods, 796 static void sort_methods(Array<Method*>* methods,
794 Array<AnnotationArray*>* methods_annotations, 797 Array<AnnotationArray*>* methods_annotations,
795 Array<AnnotationArray*>* methods_parameter_annotations, 798 Array<AnnotationArray*>* methods_parameter_annotations,
796 Array<AnnotationArray*>* methods_default_annotations, 799 Array<AnnotationArray*>* methods_default_annotations,
800 Array<AnnotationArray*>* methods_type_annotations,
797 bool idempotent = false); 801 bool idempotent = false);
798
799 // size of parameters
800 void set_size_of_parameters(int size) { _size_of_parameters = size; }
801 802
802 // Deallocation function for redefine classes or if an error occurs 803 // Deallocation function for redefine classes or if an error occurs
803 void deallocate_contents(ClassLoaderData* loader_data); 804 void deallocate_contents(ClassLoaderData* loader_data);
804 805
805 // Printing 806 // Printing