src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
changeset 55322 bc5baf205475
parent 55105 9ad765641e8f
child 58356 feff88c68082
--- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp	Tue Jun 11 09:27:51 2019 +0200
+++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp	Tue Jun 11 09:51:33 2019 +0200
@@ -80,7 +80,19 @@
 }
 
 void LIR_Assembler::clinit_barrier(ciMethod* method) {
-  ShouldNotReachHere(); // not implemented
+  assert(!method->holder()->is_not_initialized(), "initialization should have been started");
+
+  Label L_skip_barrier;
+  Register klass = R20;
+
+  metadata2reg(method->holder()->constant_encoding(), klass);
+  __ 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);
 }
 
 void LIR_Assembler::osr_entry() {