src/hotspot/cpu/s390/s390.ad
changeset 55343 03d417fd7d9a
parent 54960 e46fe26d7f77
child 58019 86b95fc6ca32
--- a/src/hotspot/cpu/s390/s390.ad	Wed Jun 12 14:21:36 2019 +0200
+++ b/src/hotspot/cpu/s390/s390.ad	Wed Jun 12 14:22:04 2019 +0200
@@ -867,6 +867,23 @@
 
   assert(framesize % wordSize == 0, "must preserve wordSize alignment");
 
+  if (C->clinit_barrier_on_entry()) {
+    assert(!C->method()->holder()->is_not_initialized(), "initialization should have been started");
+
+    Label L_skip_barrier;
+    Register klass = Z_R1_scratch;
+
+    // Notify OOP recorder (don't need the relocation)
+    AddressLiteral md = __ constant_metadata_address(C->method()->holder()->constant_encoding());
+    __ load_const_optimized(klass, md.value());
+    __ clinit_barrier(klass, Z_thread, &L_skip_barrier /*L_fast_path*/);
+
+    __ load_const_optimized(klass, SharedRuntime::get_handle_wrong_method_stub());
+    __ z_br(klass);
+
+    __ 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