src/hotspot/share/oops/method.hpp
changeset 58226 408c445d04e8
parent 57710 05ff6e27de45
child 58273 08a5148e7c4e
--- a/src/hotspot/share/oops/method.hpp	Thu Sep 19 09:50:11 2019 +0200
+++ b/src/hotspot/share/oops/method.hpp	Thu Sep 19 10:52:22 2019 +0200
@@ -463,7 +463,17 @@
   address verified_code_entry();
   bool check_code() const;      // Not inline to avoid circular ref
   CompiledMethod* volatile code() const;
-  void clear_code(bool acquire_lock = true);    // Clear out any compiled code
+
+  // Locks CompiledMethod_lock if not held.
+  void unlink_code(CompiledMethod *compare);
+  // Locks CompiledMethod_lock if not held.
+  void unlink_code();
+
+private:
+  // Either called with CompiledMethod_lock held or from constructor.
+  void clear_code();
+
+public:
   static void set_code(const methodHandle& mh, CompiledMethod* code);
   void set_adapter_entry(AdapterHandlerEntry* adapter) {
     constMethod()->set_adapter_entry(adapter);