--- a/src/hotspot/share/c1/c1_LIRAssembler.cpp Thu May 30 11:42:53 2019 +0200
+++ b/src/hotspot/share/c1/c1_LIRAssembler.cpp Thu May 30 13:39:13 2019 +0300
@@ -162,6 +162,9 @@
return !method->is_static();
}
+bool LIR_Assembler::needs_clinit_barrier_on_entry(ciMethod* method) const {
+ return VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier();
+}
int LIR_Assembler::code_offset() const {
return _masm->offset();
@@ -621,6 +624,9 @@
}
offsets()->set_value(CodeOffsets::Verified_Entry, _masm->offset());
_masm->verified_entry();
+ if (needs_clinit_barrier_on_entry(compilation()->method())) {
+ clinit_barrier(compilation()->method());
+ }
build_frame();
offsets()->set_value(CodeOffsets::Frame_Complete, _masm->offset());
break;