Mercurial > hg > truffle
comparison src/share/vm/oops/method.hpp @ 7482:989155e2d07a
Merge with hs25-b15.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 16 Jan 2013 01:34:24 +0100 |
parents | 291ffc492eb6 18c3c3fa291b |
children | 5fc51c1ecdeb |
comparison
equal
deleted
inserted
replaced
7381:6761a8f854a4 | 7482:989155e2d07a |
---|---|
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, |
165 AccessFlags access_flags, | 162 AccessFlags access_flags, |
166 int compressed_line_number_size, | 163 int compressed_line_number_size, |
167 int localvariable_table_length, | 164 int localvariable_table_length, |
168 int exception_table_length, | 165 int exception_table_length, |
169 int checked_exceptions_length, | 166 int checked_exceptions_length, |
167 int method_parameters_length, | |
170 u2 generic_signature_index, | 168 u2 generic_signature_index, |
171 ConstMethod::MethodType method_type, | 169 ConstMethod::MethodType method_type, |
172 TRAPS); | 170 TRAPS); |
173 | 171 |
174 // CDS and vtbl checking can create an empty Method to get vtbl pointer. | 172 // CDS and vtbl checking can create an empty Method to get vtbl pointer. |
230 if (ik->annotations() == NULL) { | 228 if (ik->annotations() == NULL) { |
231 return NULL; | 229 return NULL; |
232 } | 230 } |
233 return ik->annotations()->get_method_default_annotations_of(method_idnum()); | 231 return ik->annotations()->get_method_default_annotations_of(method_idnum()); |
234 } | 232 } |
233 AnnotationArray* type_annotations() const { | |
234 InstanceKlass* ik = method_holder(); | |
235 Annotations* type_annos = ik->type_annotations(); | |
236 if (type_annos == NULL) | |
237 return NULL; | |
238 return type_annos->get_method_annotations_of(method_idnum()); | |
239 } | |
235 | 240 |
236 #ifdef CC_INTERP | 241 #ifdef CC_INTERP |
237 void set_result_index(BasicType type); | 242 void set_result_index(BasicType type); |
238 int result_index() { return _result_index; } | 243 int result_index() { return _result_index; } |
239 #endif | 244 #endif |
294 int verifier_max_stack() const { return constMethod()->max_stack(); } | 299 int verifier_max_stack() const { return constMethod()->max_stack(); } |
295 int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); } | 300 int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); } |
296 void set_max_stack(int size) { constMethod()->set_max_stack(size); } | 301 void set_max_stack(int size) { constMethod()->set_max_stack(size); } |
297 | 302 |
298 // max locals | 303 // max locals |
299 int max_locals() const { return _max_locals; } | 304 int max_locals() const { return constMethod()->max_locals(); } |
300 void set_max_locals(int size) { _max_locals = size; } | 305 void set_max_locals(int size) { constMethod()->set_max_locals(size); } |
301 | 306 |
302 int highest_comp_level() const; | 307 int highest_comp_level() const; |
303 void set_highest_comp_level(int level); | 308 void set_highest_comp_level(int level); |
304 int highest_osr_comp_level() const; | 309 int highest_osr_comp_level() const; |
305 void set_highest_osr_comp_level(int level); | 310 void set_highest_osr_comp_level(int level); |
313 | 318 |
314 int interpreter_throwout_count() const { return _interpreter_throwout_count; } | 319 int interpreter_throwout_count() const { return _interpreter_throwout_count; } |
315 void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; } | 320 void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; } |
316 | 321 |
317 // size of parameters | 322 // size of parameters |
318 int size_of_parameters() const { return _size_of_parameters; } | 323 int size_of_parameters() const { return constMethod()->size_of_parameters(); } |
324 void set_size_of_parameters(int size) { constMethod()->set_size_of_parameters(size); } | |
319 | 325 |
320 bool has_stackmap_table() const { | 326 bool has_stackmap_table() const { |
321 return constMethod()->has_stackmap_table(); | 327 return constMethod()->has_stackmap_table(); |
322 } | 328 } |
323 | 329 |
347 // an IllegalAccessError (bugid 4307310) or an OutOfMemoryError. | 353 // an IllegalAccessError (bugid 4307310) or an OutOfMemoryError. |
348 // If an exception is thrown, returns the bci of the | 354 // If an exception is thrown, returns the bci of the |
349 // exception handler which caused the exception to be thrown, which | 355 // exception handler which caused the exception to be thrown, which |
350 // is needed for proper retries. See, for example, | 356 // is needed for proper retries. See, for example, |
351 // InterpreterRuntime::exception_handler_for_exception. | 357 // InterpreterRuntime::exception_handler_for_exception. |
352 int fast_exception_handler_bci_for(KlassHandle ex_klass, int throw_bci, TRAPS); | 358 static int fast_exception_handler_bci_for(methodHandle mh, KlassHandle ex_klass, int throw_bci, TRAPS); |
353 | 359 |
354 // method data access | 360 // method data access |
355 MethodData* method_data() const { | 361 MethodData* method_data() const { |
356 return _method_data; | 362 return _method_data; |
357 } | 363 } |
485 // prints byte codes | 491 // prints byte codes |
486 void print_codes() const { print_codes_on(tty); } | 492 void print_codes() const { print_codes_on(tty); } |
487 void print_codes_on(outputStream* st) const PRODUCT_RETURN; | 493 void print_codes_on(outputStream* st) const PRODUCT_RETURN; |
488 void print_codes_on(int from, int to, outputStream* st) const PRODUCT_RETURN; | 494 void print_codes_on(int from, int to, outputStream* st) const PRODUCT_RETURN; |
489 | 495 |
496 // method parameters | |
497 int method_parameters_length() const | |
498 { return constMethod()->method_parameters_length(); } | |
499 MethodParametersElement* method_parameters_start() const | |
500 { return constMethod()->method_parameters_start(); } | |
501 | |
490 // checked exceptions | 502 // checked exceptions |
491 int checked_exceptions_length() const | 503 int checked_exceptions_length() const |
492 { return constMethod()->checked_exceptions_length(); } | 504 { return constMethod()->checked_exceptions_length(); } |
493 CheckedExceptionElement* checked_exceptions_start() const | 505 CheckedExceptionElement* checked_exceptions_start() const |
494 { return constMethod()->checked_exceptions_start(); } | 506 { return constMethod()->checked_exceptions_start(); } |
598 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); } | 610 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); } |
599 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); } | 611 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); } |
600 #ifdef CC_INTERP | 612 #ifdef CC_INTERP |
601 static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); } | 613 static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); } |
602 #endif /* CC_INTERP */ | 614 #endif /* CC_INTERP */ |
603 static ByteSize size_of_locals_offset() { return byte_offset_of(Method, _max_locals ); } | |
604 static ByteSize size_of_parameters_offset() { return byte_offset_of(Method, _size_of_parameters); } | |
605 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); } | 615 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); } |
606 static ByteSize code_offset() { return byte_offset_of(Method, _code); } | 616 static ByteSize code_offset() { return byte_offset_of(Method, _code); } |
607 static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); } | 617 static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); } |
608 static ByteSize backedge_counter_offset() { return byte_offset_of(Method, _backedge_counter); } | 618 static ByteSize backedge_counter_offset() { return byte_offset_of(Method, _backedge_counter); } |
609 static ByteSize method_data_offset() { | 619 static ByteSize method_data_offset() { |
808 // Helper routine used for method sorting | 818 // Helper routine used for method sorting |
809 static void sort_methods(Array<Method*>* methods, | 819 static void sort_methods(Array<Method*>* methods, |
810 Array<AnnotationArray*>* methods_annotations, | 820 Array<AnnotationArray*>* methods_annotations, |
811 Array<AnnotationArray*>* methods_parameter_annotations, | 821 Array<AnnotationArray*>* methods_parameter_annotations, |
812 Array<AnnotationArray*>* methods_default_annotations, | 822 Array<AnnotationArray*>* methods_default_annotations, |
823 Array<AnnotationArray*>* methods_type_annotations, | |
813 bool idempotent = false); | 824 bool idempotent = false); |
814 | |
815 // size of parameters | |
816 void set_size_of_parameters(int size) { _size_of_parameters = size; } | |
817 | 825 |
818 // Deallocation function for redefine classes or if an error occurs | 826 // Deallocation function for redefine classes or if an error occurs |
819 void deallocate_contents(ClassLoaderData* loader_data); | 827 void deallocate_contents(ClassLoaderData* loader_data); |
820 | 828 |
821 // Printing | 829 // Printing |