src/hotspot/share/opto/compile.cpp
changeset 55105 9ad765641e8f
parent 54960 e46fe26d7f77
child 55110 17f85a8780d5
--- a/src/hotspot/share/opto/compile.cpp	Thu May 30 11:42:53 2019 +0200
+++ b/src/hotspot/share/opto/compile.cpp	Thu May 30 13:39:13 2019 +0300
@@ -654,6 +654,7 @@
                   _trace_opto_output(directive->TraceOptoOutputOption),
 #endif
                   _has_method_handle_invokes(false),
+                  _clinit_barrier_on_entry(false),
                   _comp_arena(mtCompiler),
                   _barrier_set_state(BarrierSet::barrier_set()->barrier_set_c2()->create_barrier_state(comp_arena())),
                   _env(ci_env),
@@ -988,6 +989,7 @@
     _trace_opto_output(directive->TraceOptoOutputOption),
 #endif
     _has_method_handle_invokes(false),
+    _clinit_barrier_on_entry(false),
     _comp_arena(mtCompiler),
     _env(ci_env),
     _directive(directive),
@@ -1170,6 +1172,9 @@
     }
   }
 #endif
+  if (VM_Version::supports_fast_class_init_checks() && has_method() && !is_osr_compilation() && method()->needs_clinit_barrier()) {
+    set_clinit_barrier_on_entry(true);
+  }
   if (debug_info()->recording_non_safepoints()) {
     set_node_note_array(new(comp_arena()) GrowableArray<Node_Notes*>
                         (comp_arena(), 8, 0, NULL));