src/share/vm/oops/methodOop.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6845426 Sdiff src/share/vm/oops

src/share/vm/oops/methodOop.hpp

Print this page
rev 2113 : 6845426: non-static <clinit> method with no args is called during the class initialization process
Summary: Only call <clinit> with ACC_STATIC for classfiles with version > 50
Reviewed-by:


 480   }
 481 
 482   // returns true if the method has any monitors.
 483   bool has_monitors() const                      { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
 484   bool has_monitor_bytecodes() const             { return access_flags().has_monitor_bytecodes(); }
 485 
 486   void set_has_monitor_bytecodes()               { _access_flags.set_has_monitor_bytecodes(); }
 487 
 488   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 489   // propererly nest in the method. It might return false, even though they actually nest properly, since the info.
 490   // has not been computed yet.
 491   bool guaranteed_monitor_matching() const       { return access_flags().is_monitor_matching(); }
 492   void set_guaranteed_monitor_matching()         { _access_flags.set_monitor_matching(); }
 493 
 494   // returns true if the method is an accessor function (setter/getter).
 495   bool is_accessor() const;
 496 
 497   // returns true if the method is an initializer (<init> or <clinit>).
 498   bool is_initializer() const;
 499 







 500   // compiled code support
 501   // NOTE: code() is inherently racy as deopt can be clearing code
 502   // simultaneously. Use with caution.
 503   bool has_compiled_code() const                 { return code() != NULL; }
 504 
 505   // sizing
 506   static int object_size(bool is_native);
 507   static int header_size()                       { return sizeof(methodOopDesc)/HeapWordSize; }
 508   int object_size() const                        { return method_size(); }
 509 
 510   bool object_is_parsable() const                { return method_size() > 0; }
 511 
 512   // interpreter support
 513   static ByteSize const_offset()                 { return byte_offset_of(methodOopDesc, _constMethod       ); }
 514   static ByteSize constants_offset()             { return byte_offset_of(methodOopDesc, _constants         ); }
 515   static ByteSize access_flags_offset()          { return byte_offset_of(methodOopDesc, _access_flags      ); }
 516 #ifdef CC_INTERP
 517   static ByteSize result_index_offset()          { return byte_offset_of(methodOopDesc, _result_index ); }
 518 #endif /* CC_INTERP */
 519   static ByteSize size_of_locals_offset()        { return byte_offset_of(methodOopDesc, _max_locals        ); }




 480   }
 481 
 482   // returns true if the method has any monitors.
 483   bool has_monitors() const                      { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
 484   bool has_monitor_bytecodes() const             { return access_flags().has_monitor_bytecodes(); }
 485 
 486   void set_has_monitor_bytecodes()               { _access_flags.set_has_monitor_bytecodes(); }
 487 
 488   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 489   // propererly nest in the method. It might return false, even though they actually nest properly, since the info.
 490   // has not been computed yet.
 491   bool guaranteed_monitor_matching() const       { return access_flags().is_monitor_matching(); }
 492   void set_guaranteed_monitor_matching()         { _access_flags.set_monitor_matching(); }
 493 
 494   // returns true if the method is an accessor function (setter/getter).
 495   bool is_accessor() const;
 496 
 497   // returns true if the method is an initializer (<init> or <clinit>).
 498   bool is_initializer() const;
 499 
 500   // returns true if the method is static OR if the classfile version < 51
 501   bool has_valid_initializer_flags() const;
 502 
 503   // returns true if the method name is <clinit> and the method has
 504   // valid static initializer flags.
 505   bool is_static_initializer() const;
 506 
 507   // compiled code support
 508   // NOTE: code() is inherently racy as deopt can be clearing code
 509   // simultaneously. Use with caution.
 510   bool has_compiled_code() const                 { return code() != NULL; }
 511 
 512   // sizing
 513   static int object_size(bool is_native);
 514   static int header_size()                       { return sizeof(methodOopDesc)/HeapWordSize; }
 515   int object_size() const                        { return method_size(); }
 516 
 517   bool object_is_parsable() const                { return method_size() > 0; }
 518 
 519   // interpreter support
 520   static ByteSize const_offset()                 { return byte_offset_of(methodOopDesc, _constMethod       ); }
 521   static ByteSize constants_offset()             { return byte_offset_of(methodOopDesc, _constants         ); }
 522   static ByteSize access_flags_offset()          { return byte_offset_of(methodOopDesc, _access_flags      ); }
 523 #ifdef CC_INTERP
 524   static ByteSize result_index_offset()          { return byte_offset_of(methodOopDesc, _result_index ); }
 525 #endif /* CC_INTERP */
 526   static ByteSize size_of_locals_offset()        { return byte_offset_of(methodOopDesc, _max_locals        ); }


src/share/vm/oops/methodOop.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File