diff -r a72e187adb54 -r 9ad765641e8f src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp Thu May 30 11:42:53 2019 +0200 +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp Thu May 30 13:39:13 2019 +0300 @@ -359,6 +359,23 @@ return offset; } +void LIR_Assembler::clinit_barrier(ciMethod* method) { + assert(VM_Version::supports_fast_class_init_checks(), "sanity"); + assert(method->holder()->is_being_initialized() || method->holder()->is_initialized(), + "initialization should have been started"); + + Label L_skip_barrier; + Register klass = rscratch1; + Register thread = LP64_ONLY( r15_thread ) NOT_LP64( noreg ); + assert(thread != noreg, "x86_32 not implemented"); + + __ mov_metadata(klass, method->holder()->constant_encoding()); + __ clinit_barrier(klass, thread, &L_skip_barrier /*L_fast_path*/); + + __ jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub())); + + __ bind(L_skip_barrier); +} void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo* info) { jobject o = NULL;