Skip to content

Commit

Permalink
[Wisp] fix jvm crash when debugging coroutine switchTo problem
Browse files Browse the repository at this point in the history
Summary: Origin patch of the breakpoint crash has a bug, which compares a word-length immediate number and a word-length memory value by using double-word-length comq.

Test Plan: test/runtime/coroutine/coroutineBreakpointSwitchToTest.sh

Reviewers: 梁希,识月,三红

Issue: https://aone.alibaba-inc.com/task/19922832?from=ak&from=ak&

CR: <full URL of AOne code review task>
  • Loading branch information
zhengxiaolinX authored and Sere-Fu committed Aug 19, 2021
1 parent f37c1e6 commit f3780d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hotspot/cpu/x86/interp_masm_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,11 +790,11 @@ void InterpreterMacroAssembler::jump_from_interpreted(Register method, Register
cmpb(Address(temp, JavaThread::interp_only_mode_offset()), 0);
jccb(Assembler::zero, run_compiled_code);
if (EnableCoroutine) {
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_switchTo);
cmpw(Address(method, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_switchTo);
jcc(Assembler::zero, coroutine_skip_interpret);
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_switchToAndExit);
cmpw(Address(method, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_switchToAndExit);
jcc(Assembler::zero, coroutine_skip_interpret);
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_switchToAndTerminate);
cmpw(Address(method, Method::intrinsic_id_offset_in_bytes()), vmIntrinsics::_switchToAndTerminate);
jcc(Assembler::zero, coroutine_skip_interpret);
}
jmp(Address(method, Method::interpreter_entry_offset()));
Expand Down

0 comments on commit f3780d5

Please sign in to comment.