src/hotspot/share/oops/method.hpp
changeset 49340 4e82736053ae
parent 48557 2e867226b914
child 49348 fde3feaaa4ed
equal deleted inserted replaced
49339:e651c3ea6ea8 49340:4e82736053ae
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   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   address from_compiled_entry() const   { return OrderAccess::load_acquire(&_from_compiled_entry); }
   139   address from_compiled_entry() const;
   140   address from_compiled_entry_no_trampoline() const;
   140   address from_compiled_entry_no_trampoline() const;
   141   address from_interpreted_entry() const{ return OrderAccess::load_acquire(&_from_interpreted_entry); }
   141   address from_interpreted_entry() const;
   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 
   331   // method data access
   331   // method data access
   332   MethodData* method_data() const              {
   332   MethodData* method_data() const              {
   333     return _method_data;
   333     return _method_data;
   334   }
   334   }
   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
       
   338     // total store order (TSO) the reference may become visible before
       
   339     // the initialization of data otherwise.
       
   340     OrderAccess::release_store(&_method_data, data);
       
   341   }
       
   342 
   337 
   343   MethodCounters* method_counters() const {
   338   MethodCounters* method_counters() const {
   344     return _method_counters;
   339     return _method_counters;
   345   }
   340   }
   346 
   341 
   447   void remove_unshareable_info();
   442   void remove_unshareable_info();
   448 
   443 
   449   // nmethod/verified compiler entry
   444   // nmethod/verified compiler entry
   450   address verified_code_entry();
   445   address verified_code_entry();
   451   bool check_code() const;      // Not inline to avoid circular ref
   446   bool check_code() const;      // Not inline to avoid circular ref
   452   CompiledMethod* volatile code() const                 { assert( check_code(), "" ); return OrderAccess::load_acquire(&_code); }
   447   CompiledMethod* volatile code() const;
   453   void clear_code(bool acquire_lock = true);    // Clear out any compiled code
   448   void clear_code(bool acquire_lock = true);    // Clear out any compiled code
   454   static void set_code(const methodHandle& mh, CompiledMethod* code);
   449   static void set_code(const methodHandle& mh, CompiledMethod* code);
   455   void set_adapter_entry(AdapterHandlerEntry* adapter) {
   450   void set_adapter_entry(AdapterHandlerEntry* adapter) {
   456     constMethod()->set_adapter_entry(adapter);
   451     constMethod()->set_adapter_entry(adapter);
   457   }
   452   }
   660   bool is_object_initializer() const;
   655   bool is_object_initializer() const;
   661 
   656 
   662   // compiled code support
   657   // compiled code support
   663   // NOTE: code() is inherently racy as deopt can be clearing code
   658   // NOTE: code() is inherently racy as deopt can be clearing code
   664   // simultaneously. Use with caution.
   659   // simultaneously. Use with caution.
   665   bool has_compiled_code() const                 { return code() != NULL; }
   660   bool has_compiled_code() const;
   666 
   661 
   667 #ifdef TIERED
   662 #ifdef TIERED
   668   bool has_aot_code() const                      { return aot_code() != NULL; }
   663   bool has_aot_code() const                      { return aot_code() != NULL; }
   669 #endif
   664 #endif
   670 
   665