src/share/vm/oops/methodOop.hpp

Print this page
rev 1083 : code cache unloading for webrev 091214


 109   u2                _interpreter_throwout_count; // Count of times method was exited via exception while interpreting
 110   u2                _number_of_breakpoints;      // fullspeed debugging support
 111   InvocationCounter _invocation_counter;         // Incremented before each activation of the method - used to trigger frequency-based optimizations
 112   InvocationCounter _backedge_counter;           // Incremented before each backedge taken - used to trigger frequencey-based optimizations
 113 #ifndef PRODUCT
 114   int               _compiled_invocation_count;  // Number of nmethod invocations so far (for perf. debugging)
 115 #endif
 116   // Entry point for calling both from and to the interpreter.
 117   address _i2i_entry;           // All-args-on-stack calling convention
 118   // Adapter blob (i2c/c2i) for this methodOop. Set once when method is linked.
 119   AdapterHandlerEntry* _adapter;
 120   // Entry point for calling from compiled code, to compiled code if it exists
 121   // or else the interpreter.
 122   volatile address _from_compiled_entry;        // Cache of: _code ? _code->entry_point() : _adapter->c2i_entry()
 123   // The entry point for calling both from and to compiled code is
 124   // "_code->entry_point()".  Because of tiered compilation and de-opt, this
 125   // field can come and go.  It can transition from NULL to not-null at any
 126   // time (whenever a compile completes).  It can transition from not-null to
 127   // NULL only at safepoints (because of a de-opt).
 128   nmethod* volatile _code;                       // Points to the corresponding piece of native code

 129   volatile address           _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
 130 
 131  public:
 132 
 133   static const bool IsUnsafeConc         = false;
 134   static const bool IsSafeConc           = true;
 135 
 136   // accessors for instance variables
 137   constMethodOop constMethod() const             { return _constMethod; }
 138   void set_constMethod(constMethodOop xconst)    { oop_store_without_check((oop*)&_constMethod, (oop)xconst); }
 139 
 140 
 141   static address make_adapters(methodHandle mh, TRAPS);
 142   volatile address from_compiled_entry() const   { return (address)OrderAccess::load_ptr_acquire(&_from_compiled_entry); }
 143   volatile address from_interpreted_entry() const{ return (address)OrderAccess::load_ptr_acquire(&_from_interpreted_entry); }
 144 
 145   // access flag
 146   AccessFlags access_flags() const               { return _access_flags;  }
 147   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
 148 


 285 
 286   static void build_interpreter_method_data(methodHandle method, TRAPS);
 287 
 288   int interpreter_invocation_count() const       { return _interpreter_invocation_count; }
 289   void set_interpreter_invocation_count(int count) { _interpreter_invocation_count = count; }
 290   int increment_interpreter_invocation_count() { return ++_interpreter_invocation_count; }
 291 
 292 #ifndef PRODUCT
 293   int  compiled_invocation_count() const         { return _compiled_invocation_count; }
 294   void set_compiled_invocation_count(int count)  { _compiled_invocation_count = count; }
 295 #endif // not PRODUCT
 296 
 297   // Clear (non-shared space) pointers which could not be relevant
 298   // if this (shared) method were mapped into another JVM.
 299   void remove_unshareable_info();
 300 
 301   // nmethod/verified compiler entry
 302   address verified_code_entry();
 303   bool check_code() const;      // Not inline to avoid circular ref
 304   nmethod* volatile code() const                 { assert( check_code(), "" ); return (nmethod *)OrderAccess::load_ptr_acquire(&_code); }


 305   void clear_code();            // Clear out any compiled code

 306   void set_code(methodHandle mh, nmethod* code);
 307   void set_adapter_entry(AdapterHandlerEntry* adapter) {  _adapter = adapter; }
 308   address get_i2c_entry();
 309   address get_c2i_entry();
 310   address get_c2i_unverified_entry();
 311   AdapterHandlerEntry* adapter() {  return _adapter; }
 312   // setup entry points
 313   void link_method(methodHandle method, TRAPS);
 314   // clear entry points. Used by sharing code
 315   void unlink_method();
 316 
 317   // vtable index
 318   enum VtableIndexFlag {
 319     // Valid vtable indexes are non-negative (>= 0).
 320     // These few negative values are used as sentinels.
 321     highest_unused_vtable_index_value = -5,
 322     invalid_vtable_index    = -4,  // distinct from any valid vtable index
 323     garbage_vtable_index    = -3,  // not yet linked; no vtable layout yet
 324     nonvirtual_vtable_index = -2   // there is no need for vtable dispatch
 325     // 6330203 Note:  Do not use -1, which was overloaded with many meanings.




 109   u2                _interpreter_throwout_count; // Count of times method was exited via exception while interpreting
 110   u2                _number_of_breakpoints;      // fullspeed debugging support
 111   InvocationCounter _invocation_counter;         // Incremented before each activation of the method - used to trigger frequency-based optimizations
 112   InvocationCounter _backedge_counter;           // Incremented before each backedge taken - used to trigger frequencey-based optimizations
 113 #ifndef PRODUCT
 114   int               _compiled_invocation_count;  // Number of nmethod invocations so far (for perf. debugging)
 115 #endif
 116   // Entry point for calling both from and to the interpreter.
 117   address _i2i_entry;           // All-args-on-stack calling convention
 118   // Adapter blob (i2c/c2i) for this methodOop. Set once when method is linked.
 119   AdapterHandlerEntry* _adapter;
 120   // Entry point for calling from compiled code, to compiled code if it exists
 121   // or else the interpreter.
 122   volatile address _from_compiled_entry;        // Cache of: _code ? _code->entry_point() : _adapter->c2i_entry()
 123   // The entry point for calling both from and to compiled code is
 124   // "_code->entry_point()".  Because of tiered compilation and de-opt, this
 125   // field can come and go.  It can transition from NULL to not-null at any
 126   // time (whenever a compile completes).  It can transition from not-null to
 127   // NULL only at safepoints (because of a de-opt).
 128   nmethod* volatile _code;                       // Points to the corresponding piece of native code
 129   nmethod* volatile _saved_code;                 // remember nmethod while we attempt to clear code cache space
 130   volatile address           _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
 131 
 132  public:
 133 
 134   static const bool IsUnsafeConc         = false;
 135   static const bool IsSafeConc           = true;
 136 
 137   // accessors for instance variables
 138   constMethodOop constMethod() const             { return _constMethod; }
 139   void set_constMethod(constMethodOop xconst)    { oop_store_without_check((oop*)&_constMethod, (oop)xconst); }
 140 
 141 
 142   static address make_adapters(methodHandle mh, TRAPS);
 143   volatile address from_compiled_entry() const   { return (address)OrderAccess::load_ptr_acquire(&_from_compiled_entry); }
 144   volatile address from_interpreted_entry() const{ return (address)OrderAccess::load_ptr_acquire(&_from_interpreted_entry); }
 145 
 146   // access flag
 147   AccessFlags access_flags() const               { return _access_flags;  }
 148   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
 149 


 286 
 287   static void build_interpreter_method_data(methodHandle method, TRAPS);
 288 
 289   int interpreter_invocation_count() const       { return _interpreter_invocation_count; }
 290   void set_interpreter_invocation_count(int count) { _interpreter_invocation_count = count; }
 291   int increment_interpreter_invocation_count() { return ++_interpreter_invocation_count; }
 292 
 293 #ifndef PRODUCT
 294   int  compiled_invocation_count() const         { return _compiled_invocation_count; }
 295   void set_compiled_invocation_count(int count)  { _compiled_invocation_count = count; }
 296 #endif // not PRODUCT
 297 
 298   // Clear (non-shared space) pointers which could not be relevant
 299   // if this (shared) method were mapped into another JVM.
 300   void remove_unshareable_info();
 301 
 302   // nmethod/verified compiler entry
 303   address verified_code_entry();
 304   bool check_code() const;      // Not inline to avoid circular ref
 305   nmethod* volatile code() const                 { assert( check_code(), "" ); return (nmethod *)OrderAccess::load_ptr_acquire(&_code); }
 306   nmethod* saved_code() const                    { return _saved_code; }
 307   void set_saved_code(nmethod* code)             { _saved_code = code; }
 308   void clear_code();            // Clear out any compiled code
 309   void clear_code_hedge();      // Clear out any compiled code and save code ptr in attempt to clean up code cache
 310   void set_code(methodHandle mh, nmethod* code);
 311   void set_adapter_entry(AdapterHandlerEntry* adapter) {  _adapter = adapter; }
 312   address get_i2c_entry();
 313   address get_c2i_entry();
 314   address get_c2i_unverified_entry();
 315   AdapterHandlerEntry* adapter() {  return _adapter; }
 316   // setup entry points
 317   void link_method(methodHandle method, TRAPS);
 318   // clear entry points. Used by sharing code
 319   void unlink_method();
 320 
 321   // vtable index
 322   enum VtableIndexFlag {
 323     // Valid vtable indexes are non-negative (>= 0).
 324     // These few negative values are used as sentinels.
 325     highest_unused_vtable_index_value = -5,
 326     invalid_vtable_index    = -4,  // distinct from any valid vtable index
 327     garbage_vtable_index    = -3,  // not yet linked; no vtable layout yet
 328     nonvirtual_vtable_index = -2   // there is no need for vtable dispatch
 329     // 6330203 Note:  Do not use -1, which was overloaded with many meanings.