3386 __ jump(RuntimeAddress(StubRoutines::forward_exception_entry())); |
3386 __ jump(RuntimeAddress(StubRoutines::forward_exception_entry())); |
3387 |
3387 |
3388 // No exception case |
3388 // No exception case |
3389 __ bind(noException); |
3389 __ bind(noException); |
3390 |
3390 |
3391 Label no_adjust, bail; |
3391 Label no_adjust, bail, no_prefix; |
3392 if (SafepointMechanism::uses_thread_local_poll() && !cause_return) { |
3392 if (SafepointMechanism::uses_thread_local_poll() && !cause_return) { |
3393 // If our stashed return pc was modified by the runtime we avoid touching it |
3393 // If our stashed return pc was modified by the runtime we avoid touching it |
3394 __ cmpptr(rbx, Address(rbp, wordSize)); |
3394 __ cmpptr(rbx, Address(rbp, wordSize)); |
3395 __ jccb(Assembler::notEqual, no_adjust); |
3395 __ jccb(Assembler::notEqual, no_adjust); |
3396 |
3396 |
3397 #ifdef ASSERT |
|
3398 // Verify the correct encoding of the poll we're about to skip. |
3397 // Verify the correct encoding of the poll we're about to skip. |
3399 // See NativeInstruction::is_safepoint_poll() |
3398 // See NativeInstruction::is_safepoint_poll() |
3400 __ cmpb(Address(rbx, 0), NativeTstRegMem::instruction_rex_b_prefix); |
3399 __ cmpb(Address(rbx, 0), NativeTstRegMem::instruction_rex_b_prefix); |
3401 __ jcc(Assembler::notEqual, bail); |
3400 __ jcc(Assembler::notEqual, no_prefix); |
3402 __ cmpb(Address(rbx, 1), NativeTstRegMem::instruction_code_memXregl); |
3401 __ addptr(rbx, 1); |
|
3402 __ bind(no_prefix); |
|
3403 #ifdef ASSERT |
|
3404 __ cmpb(Address(rbx, 0), NativeTstRegMem::instruction_code_memXregl); |
3403 __ jcc(Assembler::notEqual, bail); |
3405 __ jcc(Assembler::notEqual, bail); |
3404 // Mask out the modrm bits |
3406 // Mask out the modrm bits |
3405 __ testb(Address(rbx, 2), NativeTstRegMem::modrm_mask); |
3407 __ testb(Address(rbx, 1), NativeTstRegMem::modrm_mask); |
3406 // rax encodes to 0, so if the bits are nonzero it's incorrect |
3408 // rax encodes to 0, so if the bits are nonzero it's incorrect |
3407 __ jcc(Assembler::notZero, bail); |
3409 __ jcc(Assembler::notZero, bail); |
3408 #endif |
3410 #endif |
3409 // Adjust return pc forward to step over the safepoint poll instruction |
3411 // Adjust return pc forward to step over the safepoint poll instruction |
3410 __ addptr(Address(rbp, wordSize), 3); |
3412 __ addptr(rbx, 2); |
|
3413 __ movptr(Address(rbp, wordSize), rbx); |
3411 } |
3414 } |
3412 |
3415 |
3413 __ bind(no_adjust); |
3416 __ bind(no_adjust); |
3414 // Normal exit, restore registers and exit. |
3417 // Normal exit, restore registers and exit. |
3415 RegisterSaver::restore_live_registers(masm, save_vectors); |
3418 RegisterSaver::restore_live_registers(masm, save_vectors); |