src/hotspot/cpu/ppc/ppc.ad
changeset 55322 bc5baf205475
parent 54780 f8d182aedc92
child 55344 0c20dbc3d547
--- a/src/hotspot/cpu/ppc/ppc.ad	Tue Jun 11 09:27:51 2019 +0200
+++ b/src/hotspot/cpu/ppc/ppc.ad	Tue Jun 11 09:51:33 2019 +0200
@@ -1400,6 +1400,24 @@
     ___(mflr) mflr(return_pc);
   }
 
+  if (C->clinit_barrier_on_entry()) {
+    assert(!C->method()->holder()->is_not_initialized(), "initialization should have been started");
+
+    Label L_skip_barrier;
+    Register klass = toc_temp;
+
+    // Notify OOP recorder (don't need the relocation)
+    AddressLiteral md = __ constant_metadata_address(C->method()->holder()->constant_encoding());
+    __ load_const_optimized(klass, md.value(), R0);
+    __ clinit_barrier(klass, R16_thread, &L_skip_barrier /*L_fast_path*/);
+
+    __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub(), R0);
+    __ mtctr(klass);
+    __ bctr();
+
+    __ bind(L_skip_barrier);
+  }
+
   // Calls to C2R adapters often do not accept exceptional returns.
   // We require that their callers must bang for them. But be
   // careful, because some VM calls (such as call site linkage) can