Commit 1763a9e5 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [debug] implement intuitive semantics for stepping over await call.

  port 8d90210a (r36718)

  original commit message:

BUG=

Review-Url: https://codereview.chromium.org/2039743002
Cr-Commit-Position: refs/heads/master@{#36728}
parent 973823e4
...@@ -408,22 +408,19 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { ...@@ -408,22 +408,19 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset)); __ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset));
// Flood function if we are stepping. // Flood function if we are stepping.
Label skip_flooding; Label prepare_step_in_if_stepping, prepare_step_in_suspended_generator;
Label stepping_prepared;
ExternalReference step_in_enabled = ExternalReference step_in_enabled =
ExternalReference::debug_step_in_enabled_address(masm->isolate()); ExternalReference::debug_step_in_enabled_address(masm->isolate());
__ cmpb(Operand::StaticVariable(step_in_enabled), Immediate(0)); __ cmpb(Operand::StaticVariable(step_in_enabled), Immediate(0));
__ j(equal, &skip_flooding); __ j(not_equal, &prepare_step_in_if_stepping);
{
FrameScope scope(masm, StackFrame::INTERNAL); // Flood function if we need to continue stepping in the suspended generator.
__ Push(ebx); ExternalReference debug_suspended_generator =
__ Push(edx); ExternalReference::debug_suspended_generator_address(masm->isolate());
__ Push(edi); __ cmp(ebx, Operand::StaticVariable(debug_suspended_generator));
__ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); __ j(equal, &prepare_step_in_suspended_generator);
__ Pop(edx); __ bind(&stepping_prepared);
__ Pop(ebx);
__ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset));
}
__ bind(&skip_flooding);
// Pop return address. // Pop return address.
__ PopReturnAddressTo(eax); __ PopReturnAddressTo(eax);
...@@ -519,6 +516,31 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { ...@@ -519,6 +516,31 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ mov(eax, ebx); // Continuation expects generator object in eax. __ mov(eax, ebx); // Continuation expects generator object in eax.
__ jmp(edx); __ jmp(edx);
} }
__ bind(&prepare_step_in_if_stepping);
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(ebx);
__ Push(edx);
__ Push(edi);
__ CallRuntime(Runtime::kDebugPrepareStepInIfStepping);
__ Pop(edx);
__ Pop(ebx);
__ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset));
}
__ jmp(&stepping_prepared);
__ bind(&prepare_step_in_suspended_generator);
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(ebx);
__ Push(edx);
__ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator);
__ Pop(edx);
__ Pop(ebx);
__ mov(edi, FieldOperand(ebx, JSGeneratorObject::kFunctionOffset));
}
__ jmp(&stepping_prepared);
} }
static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1, static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch1,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment