src/share/vm/oops/method.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8161987 Sdiff src/share/vm/oops

src/share/vm/oops/method.hpp

Print this page
rev 8156 : 8157181: Compilers accept modification of final fields outside initializer methods
Summary: Track initialized final field updates; disable constant folding if an update is detected.
Reviewed-by: vlivanov, dnsimon, forax, never, kvn, coleenp


 610   // has not been computed yet.
 611   bool guaranteed_monitor_matching() const       { return access_flags().is_monitor_matching(); }
 612   void set_guaranteed_monitor_matching()         { _access_flags.set_monitor_matching(); }
 613 
 614   // returns true if the method is an accessor function (setter/getter).
 615   bool is_accessor() const;
 616 
 617   // returns true if the method does nothing but return a constant of primitive type
 618   bool is_constant_getter() const;
 619 
 620   // returns true if the method is an initializer (<init> or <clinit>).
 621   bool is_initializer() const;
 622 
 623   // returns true if the method is static OR if the classfile version < 51
 624   bool has_valid_initializer_flags() const;
 625 
 626   // returns true if the method name is <clinit> and the method has
 627   // valid static initializer flags.
 628   bool is_static_initializer() const;
 629 



 630   // compiled code support
 631   // NOTE: code() is inherently racy as deopt can be clearing code
 632   // simultaneously. Use with caution.
 633   bool has_compiled_code() const                 { return code() != NULL; }
 634 
 635   // sizing
 636   static int header_size()                       { return sizeof(Method)/HeapWordSize; }
 637   static int size(bool is_native);
 638   int size() const                               { return method_size(); }
 639 #if INCLUDE_SERVICES
 640   void collect_statistics(KlassSizeStats *sz) const;
 641 #endif
 642 
 643   // interpreter support
 644   static ByteSize const_offset()                 { return byte_offset_of(Method, _constMethod       ); }
 645   static ByteSize access_flags_offset()          { return byte_offset_of(Method, _access_flags      ); }
 646   static ByteSize from_compiled_offset()         { return byte_offset_of(Method, _from_compiled_entry); }
 647   static ByteSize code_offset()                  { return byte_offset_of(Method, _code); }
 648   static ByteSize method_data_offset()           {
 649     return byte_offset_of(Method, _method_data);




 610   // has not been computed yet.
 611   bool guaranteed_monitor_matching() const       { return access_flags().is_monitor_matching(); }
 612   void set_guaranteed_monitor_matching()         { _access_flags.set_monitor_matching(); }
 613 
 614   // returns true if the method is an accessor function (setter/getter).
 615   bool is_accessor() const;
 616 
 617   // returns true if the method does nothing but return a constant of primitive type
 618   bool is_constant_getter() const;
 619 
 620   // returns true if the method is an initializer (<init> or <clinit>).
 621   bool is_initializer() const;
 622 
 623   // returns true if the method is static OR if the classfile version < 51
 624   bool has_valid_initializer_flags() const;
 625 
 626   // returns true if the method name is <clinit> and the method has
 627   // valid static initializer flags.
 628   bool is_static_initializer() const;
 629 
 630   // returns true if the method name is <init>
 631   bool is_object_initializer() const;
 632 
 633   // compiled code support
 634   // NOTE: code() is inherently racy as deopt can be clearing code
 635   // simultaneously. Use with caution.
 636   bool has_compiled_code() const                 { return code() != NULL; }
 637 
 638   // sizing
 639   static int header_size()                       { return sizeof(Method)/HeapWordSize; }
 640   static int size(bool is_native);
 641   int size() const                               { return method_size(); }
 642 #if INCLUDE_SERVICES
 643   void collect_statistics(KlassSizeStats *sz) const;
 644 #endif
 645 
 646   // interpreter support
 647   static ByteSize const_offset()                 { return byte_offset_of(Method, _constMethod       ); }
 648   static ByteSize access_flags_offset()          { return byte_offset_of(Method, _access_flags      ); }
 649   static ByteSize from_compiled_offset()         { return byte_offset_of(Method, _from_compiled_entry); }
 650   static ByteSize code_offset()                  { return byte_offset_of(Method, _code); }
 651   static ByteSize method_data_offset()           {
 652     return byte_offset_of(Method, _method_data);


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