Commit 4fb3051d authored by bjaideep's avatar bjaideep Committed by Commit bot

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

Port 8d90210a

R=yangguo@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=v8:4483
LOG=N

Review-Url: https://codereview.chromium.org/2040803003
Cr-Commit-Position: refs/heads/master@{#36750}
parent d048ed80
...@@ -723,21 +723,25 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { ...@@ -723,21 +723,25 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset)); __ LoadP(r7, FieldMemOperand(r4, 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());
__ mov(ip, Operand(step_in_enabled)); __ mov(ip, Operand(step_in_enabled));
__ lbz(ip, MemOperand(ip)); __ lbz(ip, MemOperand(ip));
__ cmpi(ip, Operand::Zero()); __ cmpi(ip, Operand::Zero());
__ beq(&skip_flooding); __ bne(&prepare_step_in_if_stepping);
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); // Flood function if we need to continue stepping in the suspended generator.
__ Push(r4, r5, r7);
__ CallRuntime(Runtime::kDebugPrepareStepInIfStepping); ExternalReference debug_suspended_generator =
__ Pop(r4, r5); ExternalReference::debug_suspended_generator_address(masm->isolate());
__ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset));
} __ mov(ip, Operand(debug_suspended_generator));
__ bind(&skip_flooding); __ LoadP(ip, MemOperand(ip));
__ cmp(ip, r4);
__ beq(&prepare_step_in_suspended_generator);
__ bind(&stepping_prepared);
// Push receiver. // Push receiver.
__ LoadP(ip, FieldMemOperand(r4, JSGeneratorObject::kReceiverOffset)); __ LoadP(ip, FieldMemOperand(r4, JSGeneratorObject::kReceiverOffset));
...@@ -843,6 +847,26 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) { ...@@ -843,6 +847,26 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
__ Jump(r6); __ Jump(r6);
} }
} }
__ bind(&prepare_step_in_if_stepping);
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r4, r5, r7);
__ CallRuntime(Runtime::kDebugPrepareStepInIfStepping);
__ Pop(r4, r5);
__ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset));
}
__ b(&stepping_prepared);
__ bind(&prepare_step_in_suspended_generator);
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r4, r5);
__ CallRuntime(Runtime::kDebugPrepareStepInSuspendedGenerator);
__ Pop(r4, r5);
__ LoadP(r7, FieldMemOperand(r4, JSGeneratorObject::kFunctionOffset));
}
__ b(&stepping_prepared);
} }
void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) { void Builtins::Generate_ConstructedNonConstructable(MacroAssembler* masm) {
......
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