8182720: In InstanceKlass.cpp, get init_lock from handle
authorhseigel
Fri, 23 Jun 2017 09:54:52 -0400
changeset 46562 6608152658ca
parent 46561 8ad8a9d89965
child 46563 cfca8fbb4051
8182720: In InstanceKlass.cpp, get init_lock from handle Summary: Replace init_lock() calls with h_init_lock() calls Reviewed-by: sspitsyn, coleenp
hotspot/src/share/vm/oops/instanceKlass.cpp
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Jun 23 01:08:42 2017 +0000
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Fri Jun 23 09:54:52 2017 -0400
@@ -436,7 +436,7 @@
   EXCEPTION_MARK;
   HandleMark hm(THREAD);
   Handle h_init_lock(THREAD, init_lock());
-  ObjectLocker ol(h_init_lock, THREAD, init_lock() != NULL);
+  ObjectLocker ol(h_init_lock, THREAD, h_init_lock() != NULL);
 
   // abort if someone beat us to the initialization
   if (!is_not_initialized()) return;  // note: not equivalent to is_initialized()
@@ -584,7 +584,7 @@
   {
     HandleMark hm(THREAD);
     Handle h_init_lock(THREAD, init_lock());
-    ObjectLocker ol(h_init_lock, THREAD, init_lock() != NULL);
+    ObjectLocker ol(h_init_lock, THREAD, h_init_lock() != NULL);
     // rewritten will have been set if loader constraint error found
     // on an earlier link attempt
     // don't verify or rewrite if already rewritten
@@ -710,7 +710,7 @@
   // Step 1
   {
     Handle h_init_lock(THREAD, init_lock());
-    ObjectLocker ol(h_init_lock, THREAD, init_lock() != NULL);
+    ObjectLocker ol(h_init_lock, THREAD, h_init_lock() != NULL);
 
     Thread *self = THREAD; // it's passed the current thread
 
@@ -846,13 +846,13 @@
 
 void InstanceKlass::set_initialization_state_and_notify(ClassState state, TRAPS) {
   Handle h_init_lock(THREAD, init_lock());
-  if (init_lock() != NULL) {
+  if (h_init_lock() != NULL) {
     ObjectLocker ol(h_init_lock, THREAD);
     set_init_state(state);
     fence_and_clear_init_lock();
     ol.notify_all(CHECK);
   } else {
-    assert(init_lock() != NULL, "The initialization state should never be set twice");
+    assert(h_init_lock() != NULL, "The initialization state should never be set twice");
     set_init_state(state);
   }
 }