src/hotspot/share/oops/method.hpp
changeset 47634 6a0c42c40cd1
parent 47216 71c04702a3d5
child 47799 1772ebf07d1f
equal deleted inserted replaced
47633:1c21c60f51bf 47634:6a0c42c40cd1
   134   ConstMethod* constMethod() const             { return _constMethod; }
   134   ConstMethod* constMethod() const             { return _constMethod; }
   135   void set_constMethod(ConstMethod* xconst)    { _constMethod = xconst; }
   135   void set_constMethod(ConstMethod* xconst)    { _constMethod = xconst; }
   136 
   136 
   137 
   137 
   138   static address make_adapters(const methodHandle& mh, TRAPS);
   138   static address make_adapters(const methodHandle& mh, TRAPS);
   139   volatile address from_compiled_entry() const   { return (address)OrderAccess::load_ptr_acquire(&_from_compiled_entry); }
   139   address from_compiled_entry() const   { return OrderAccess::load_acquire(&_from_compiled_entry); }
   140   volatile address from_compiled_entry_no_trampoline() const;
   140   address from_compiled_entry_no_trampoline() const;
   141   volatile address from_interpreted_entry() const{ return (address)OrderAccess::load_ptr_acquire(&_from_interpreted_entry); }
   141   address from_interpreted_entry() const{ return OrderAccess::load_acquire(&_from_interpreted_entry); }
   142 
   142 
   143   // access flag
   143   // access flag
   144   AccessFlags access_flags() const               { return _access_flags;  }
   144   AccessFlags access_flags() const               { return _access_flags;  }
   145   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
   145   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
   146 
   146 
   335 
   335 
   336   void set_method_data(MethodData* data)       {
   336   void set_method_data(MethodData* data)       {
   337     // The store into method must be released. On platforms without
   337     // The store into method must be released. On platforms without
   338     // total store order (TSO) the reference may become visible before
   338     // total store order (TSO) the reference may become visible before
   339     // the initialization of data otherwise.
   339     // the initialization of data otherwise.
   340     OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
   340     OrderAccess::release_store(&_method_data, data);
   341   }
   341   }
   342 
   342 
   343   MethodCounters* method_counters() const {
   343   MethodCounters* method_counters() const {
   344     return _method_counters;
   344     return _method_counters;
   345   }
   345   }
   346 
   346 
   347   void clear_method_counters() {
   347   void clear_method_counters() {
   348     _method_counters = NULL;
   348     _method_counters = NULL;
   349   }
   349   }
   350 
   350 
   351   bool init_method_counters(MethodCounters* counters) {
   351   bool init_method_counters(MethodCounters* counters);
   352     // Try to install a pointer to MethodCounters, return true on success.
       
   353     return Atomic::cmpxchg_ptr(counters, (volatile void*)&_method_counters, NULL) == NULL;
       
   354   }
       
   355 
   352 
   356 #ifdef TIERED
   353 #ifdef TIERED
   357   // We are reusing interpreter_invocation_count as a holder for the previous event count!
   354   // We are reusing interpreter_invocation_count as a holder for the previous event count!
   358   // We can do that since interpreter_invocation_count is not used in tiered.
   355   // We can do that since interpreter_invocation_count is not used in tiered.
   359   int prev_event_count() const                   {
   356   int prev_event_count() const                   {
   450   void remove_unshareable_info();
   447   void remove_unshareable_info();
   451 
   448 
   452   // nmethod/verified compiler entry
   449   // nmethod/verified compiler entry
   453   address verified_code_entry();
   450   address verified_code_entry();
   454   bool check_code() const;      // Not inline to avoid circular ref
   451   bool check_code() const;      // Not inline to avoid circular ref
   455   CompiledMethod* volatile code() const                 { assert( check_code(), "" ); return (CompiledMethod *)OrderAccess::load_ptr_acquire(&_code); }
   452   CompiledMethod* volatile code() const                 { assert( check_code(), "" ); return OrderAccess::load_acquire(&_code); }
   456   void clear_code(bool acquire_lock = true);    // Clear out any compiled code
   453   void clear_code(bool acquire_lock = true);    // Clear out any compiled code
   457   static void set_code(const methodHandle& mh, CompiledMethod* code);
   454   static void set_code(const methodHandle& mh, CompiledMethod* code);
   458   void set_adapter_entry(AdapterHandlerEntry* adapter) {
   455   void set_adapter_entry(AdapterHandlerEntry* adapter) {
   459     constMethod()->set_adapter_entry(adapter);
   456     constMethod()->set_adapter_entry(adapter);
   460   }
   457   }