src/share/vm/oops/method.hpp

Print this page




 578   };
 579   void set_has_jsrs() {
 580     _access_flags.set_has_jsrs();
 581   }
 582 
 583   // returns true if the method has any monitors.
 584   bool has_monitors() const                      { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
 585   bool has_monitor_bytecodes() const             { return access_flags().has_monitor_bytecodes(); }
 586 
 587   void set_has_monitor_bytecodes()               { _access_flags.set_has_monitor_bytecodes(); }
 588 
 589   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 590   // propererly nest in the method. It might return false, even though they actually nest properly, since the info.
 591   // has not been computed yet.
 592   bool guaranteed_monitor_matching() const       { return access_flags().is_monitor_matching(); }
 593   void set_guaranteed_monitor_matching()         { _access_flags.set_monitor_matching(); }
 594 
 595   // returns true if the method is an accessor function (setter/getter).
 596   bool is_accessor() const;
 597 






 598   // returns true if the method does nothing but return a constant of primitive type
 599   bool is_constant_getter() const;
 600 
 601   // returns true if the method is an initializer (<init> or <clinit>).
 602   bool is_initializer() const;
 603 
 604   // returns true if the method is static OR if the classfile version < 51
 605   bool has_valid_initializer_flags() const;
 606 
 607   // returns true if the method name is <clinit> and the method has
 608   // valid static initializer flags.
 609   bool is_static_initializer() const;
 610 
 611   // compiled code support
 612   // NOTE: code() is inherently racy as deopt can be clearing code
 613   // simultaneously. Use with caution.
 614   bool has_compiled_code() const                 { return code() != NULL; }
 615 
 616   // sizing
 617   static int header_size()                       { return sizeof(Method)/HeapWordSize; }




 578   };
 579   void set_has_jsrs() {
 580     _access_flags.set_has_jsrs();
 581   }
 582 
 583   // returns true if the method has any monitors.
 584   bool has_monitors() const                      { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
 585   bool has_monitor_bytecodes() const             { return access_flags().has_monitor_bytecodes(); }
 586 
 587   void set_has_monitor_bytecodes()               { _access_flags.set_has_monitor_bytecodes(); }
 588 
 589   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 590   // propererly nest in the method. It might return false, even though they actually nest properly, since the info.
 591   // has not been computed yet.
 592   bool guaranteed_monitor_matching() const       { return access_flags().is_monitor_matching(); }
 593   void set_guaranteed_monitor_matching()         { _access_flags.set_monitor_matching(); }
 594 
 595   // returns true if the method is an accessor function (setter/getter).
 596   bool is_accessor() const;
 597 
 598   // returns true if the method is a getter
 599   bool is_getter() const;
 600 
 601   // returns true if the method is a setter
 602   bool is_setter() const;
 603 
 604   // returns true if the method does nothing but return a constant of primitive type
 605   bool is_constant_getter() const;
 606 
 607   // returns true if the method is an initializer (<init> or <clinit>).
 608   bool is_initializer() const;
 609 
 610   // returns true if the method is static OR if the classfile version < 51
 611   bool has_valid_initializer_flags() const;
 612 
 613   // returns true if the method name is <clinit> and the method has
 614   // valid static initializer flags.
 615   bool is_static_initializer() const;
 616 
 617   // compiled code support
 618   // NOTE: code() is inherently racy as deopt can be clearing code
 619   // simultaneously. Use with caution.
 620   bool has_compiled_code() const                 { return code() != NULL; }
 621 
 622   // sizing
 623   static int header_size()                       { return sizeof(Method)/HeapWordSize; }