602 };
603 void set_has_jsrs() {
604 _access_flags.set_has_jsrs();
605 }
606
607 // returns true if the method has any monitors.
608 bool has_monitors() const { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
609 bool has_monitor_bytecodes() const { return access_flags().has_monitor_bytecodes(); }
610
611 void set_has_monitor_bytecodes() { _access_flags.set_has_monitor_bytecodes(); }
612
613 // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
614 // propererly nest in the method. It might return false, even though they actually nest properly, since the info.
615 // has not been computed yet.
616 bool guaranteed_monitor_matching() const { return access_flags().is_monitor_matching(); }
617 void set_guaranteed_monitor_matching() { _access_flags.set_monitor_matching(); }
618
619 // returns true if the method is an accessor function (setter/getter).
620 bool is_accessor() const;
621
622 // returns true if the method is an initializer (<init> or <clinit>).
623 bool is_initializer() const;
624
625 // returns true if the method is static OR if the classfile version < 51
626 bool has_valid_initializer_flags() const;
627
628 // returns true if the method name is <clinit> and the method has
629 // valid static initializer flags.
630 bool is_static_initializer() const;
631
632 // compiled code support
633 // NOTE: code() is inherently racy as deopt can be clearing code
634 // simultaneously. Use with caution.
635 bool has_compiled_code() const { return code() != NULL; }
636
637 // sizing
638 static int header_size() { return sizeof(Method)/HeapWordSize; }
639 static int size(bool is_native);
640 int size() const { return method_size(); }
641 #if INCLUDE_SERVICES
|
602 };
603 void set_has_jsrs() {
604 _access_flags.set_has_jsrs();
605 }
606
607 // returns true if the method has any monitors.
608 bool has_monitors() const { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
609 bool has_monitor_bytecodes() const { return access_flags().has_monitor_bytecodes(); }
610
611 void set_has_monitor_bytecodes() { _access_flags.set_has_monitor_bytecodes(); }
612
613 // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
614 // propererly nest in the method. It might return false, even though they actually nest properly, since the info.
615 // has not been computed yet.
616 bool guaranteed_monitor_matching() const { return access_flags().is_monitor_matching(); }
617 void set_guaranteed_monitor_matching() { _access_flags.set_monitor_matching(); }
618
619 // returns true if the method is an accessor function (setter/getter).
620 bool is_accessor() const;
621
622 // returns true if the method does nothing but return a constant of primitive type
623 bool is_constant_getter() const;
624
625 // returns true if the method is an initializer (<init> or <clinit>).
626 bool is_initializer() const;
627
628 // returns true if the method is static OR if the classfile version < 51
629 bool has_valid_initializer_flags() const;
630
631 // returns true if the method name is <clinit> and the method has
632 // valid static initializer flags.
633 bool is_static_initializer() const;
634
635 // compiled code support
636 // NOTE: code() is inherently racy as deopt can be clearing code
637 // simultaneously. Use with caution.
638 bool has_compiled_code() const { return code() != NULL; }
639
640 // sizing
641 static int header_size() { return sizeof(Method)/HeapWordSize; }
642 static int size(bool is_native);
643 int size() const { return method_size(); }
644 #if INCLUDE_SERVICES
|