621 622 // returns true if the method is a getter 623 bool is_getter() const; 624 625 // returns true if the method is a setter 626 bool is_setter() const; 627 628 // returns true if the method does nothing but return a constant of primitive type 629 bool is_constant_getter() const; 630 631 // returns true if the method is an initializer (<init> or <clinit>). 632 bool is_initializer() const; 633 634 // returns true if the method is static OR if the classfile version < 51 635 bool has_valid_initializer_flags() const; 636 637 // returns true if the method name is <clinit> and the method has 638 // valid static initializer flags. 639 bool is_static_initializer() const; 640 641 // compiled code support 642 // NOTE: code() is inherently racy as deopt can be clearing code 643 // simultaneously. Use with caution. 644 bool has_compiled_code() const { return code() != NULL; } 645 646 // sizing 647 static int header_size() { return sizeof(Method)/wordSize; } 648 static int size(bool is_native); 649 int size() const { return method_size(); } 650 #if INCLUDE_SERVICES 651 void collect_statistics(KlassSizeStats *sz) const; 652 #endif 653 void log_touched(TRAPS); 654 static void print_touched_methods(outputStream* out); 655 656 // interpreter support 657 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); } 658 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); } 659 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); } 660 static ByteSize code_offset() { return byte_offset_of(Method, _code); } | 621 622 // returns true if the method is a getter 623 bool is_getter() const; 624 625 // returns true if the method is a setter 626 bool is_setter() const; 627 628 // returns true if the method does nothing but return a constant of primitive type 629 bool is_constant_getter() const; 630 631 // returns true if the method is an initializer (<init> or <clinit>). 632 bool is_initializer() const; 633 634 // returns true if the method is static OR if the classfile version < 51 635 bool has_valid_initializer_flags() const; 636 637 // returns true if the method name is <clinit> and the method has 638 // valid static initializer flags. 639 bool is_static_initializer() const; 640 641 // returns true if the method name is <init> 642 bool is_object_initializer() const; 643 644 // compiled code support 645 // NOTE: code() is inherently racy as deopt can be clearing code 646 // simultaneously. Use with caution. 647 bool has_compiled_code() const { return code() != NULL; } 648 649 // sizing 650 static int header_size() { return sizeof(Method)/wordSize; } 651 static int size(bool is_native); 652 int size() const { return method_size(); } 653 #if INCLUDE_SERVICES 654 void collect_statistics(KlassSizeStats *sz) const; 655 #endif 656 void log_touched(TRAPS); 657 static void print_touched_methods(outputStream* out); 658 659 // interpreter support 660 static ByteSize const_offset() { return byte_offset_of(Method, _constMethod ); } 661 static ByteSize access_flags_offset() { return byte_offset_of(Method, _access_flags ); } 662 static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); } 663 static ByteSize code_offset() { return byte_offset_of(Method, _code); } |