diff --git a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp --- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1310,10 +1310,8 @@ __ verify_oop(receiver); __ load_klass(rscratch1, receiver); __ cmpq(ic_reg, rscratch1); - __ jcc(Assembler::equal, ok); - - __ jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub())); - + Label icmiss; + __ jcc(Assembler::notEqual, icmiss); __ bind(ok); // Verified entry point must be aligned @@ -1656,37 +1654,15 @@ // check for safepoint operation in progress and/or pending suspend requests - { Label Continue; __ cmp32(ExternalAddress((address)SafepointSynchronize::address_of_state()), SafepointSynchronize::_not_synchronized); - - Label L; - __ jcc(Assembler::notEqual, L); + Label dealSyn; + __ jcc(Assembler::notEqual, dealSyn); __ cmpl(Address(r15_thread, JavaThread::suspend_flags_offset()), 0); - __ jcc(Assembler::equal, Continue); - __ bind(L); - - // Don't use call_VM as it will see a possible pending exception and forward it - // and never return here preventing us from clearing _last_native_pc down below. - // Also can't use call_VM_leaf either as it will check to see if rsi & rdi are - // preserved and correspond to the bcp/locals pointers. So we do a runtime call - // by hand. - // - save_native_result(masm, ret_type, stack_slots); - __ mov(c_rarg0, r15_thread); - __ mov(r12, rsp); // remember sp - __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows - __ andptr(rsp, -16); // align stack as required by ABI - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans))); - __ mov(rsp, r12); // restore sp - __ reinit_heapbase(); - // Restore any method result value - restore_native_result(masm, ret_type, stack_slots); + __ jcc(Assembler::notEqual, dealSyn); __ bind(Continue); - } - // change thread state __ movl(Address(r15_thread, JavaThread::thread_state_offset()), _thread_in_Java); @@ -1781,6 +1757,28 @@ // Return __ ret(0); + __ bind(icmiss); + __ jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub())); + __ jmp(ok); + + __ bind(dealSyn); + // Don't use call_VM as it will see a possible pending exception and forward it + // and never return here preventing us from clearing _last_native_pc down below. + // Also can't use call_VM_leaf either as it will check to see if rsi & rdi are + // preserved and correspond to the bcp/locals pointers. So we do a runtime call + // by hand. + // + save_native_result(masm, ret_type, stack_slots); + __ mov(c_rarg0, r15_thread); + __ mov(r12, rsp); // remember sp + __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows + __ andptr(rsp, -16); // align stack as required by ABI + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans))); + __ mov(rsp, r12); // restore sp + __ reinit_heapbase(); + // Restore any method result value + restore_native_result(masm, ret_type, stack_slots); + __ jmp(Continue); // Unexpected paths are out of line and go here