Index: src/debug/mips/debug-mips.cc |
diff --git a/src/debug/mips/debug-mips.cc b/src/debug/mips/debug-mips.cc |
index c6daf2d2261b629e1206ee2f1e738869597eadc8..5b809e6a405362d5f10c09c7494b7982fa331ee3 100644 |
--- a/src/debug/mips/debug-mips.cc |
+++ b/src/debug/mips/debug-mips.cc |
@@ -69,16 +69,6 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
- // Load padding words on stack. |
- __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); |
- __ Subu(sp, sp, |
- Operand(kPointerSize * LiveEdit::kFramePaddingInitialSize)); |
- for (int i = LiveEdit::kFramePaddingInitialSize - 1; i >= 0; i--) { |
- __ sw(at, MemOperand(sp, kPointerSize * i)); |
- } |
- __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingInitialSize))); |
- __ push(at); |
- |
// Push arguments for DebugBreak call. |
if (mode == SAVE_RESULT_REGISTER) { |
// Break on return. |
@@ -104,47 +94,47 @@ void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
} |
} |
} |
- |
- // Don't bother removing padding bytes pushed on the stack |
- // as the frame is going to be restored right away. |
- |
// Leave the internal frame. |
} |
- // Now that the break point has been handled, resume normal execution by |
- // jumping to the target address intended by the caller and that was |
- // overwritten by the address of DebugBreakXXX. |
- ExternalReference after_break_target = |
- ExternalReference::debug_after_break_target_address(masm->isolate()); |
- __ li(t9, Operand(after_break_target)); |
- __ lw(t9, MemOperand(t9)); |
- __ Jump(t9); |
+ __ MaybeDropFrames(); |
+ |
+ // Return to caller. |
+ __ Ret(); |
} |
+void DebugCodegen::GenerateHandleDebuggerStatement(MacroAssembler* masm) { |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ CallRuntime(Runtime::kHandleDebuggerStatement, 0); |
+ } |
+ __ MaybeDropFrames(); |
+ |
+ // Return to caller. |
+ __ Ret(); |
+} |
-void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
- // We do not know our frame height, but set sp based on fp. |
- __ lw(a1, MemOperand(fp, FrameDropperFrameConstants::kFunctionOffset)); |
+void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) { |
+ // Frame is being dropped: |
+ // - Drop to the target frame specified by a1. |
+ // - Look up current function on the frame. |
+ // - Leave the frame. |
+ // - Restart the frame by calling the function. |
+ __ mov(fp, a1); |
+ __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
// Pop return address and frame. |
__ LeaveFrame(StackFrame::INTERNAL); |
- ParameterCount dummy(0); |
- __ CheckDebugHook(a1, no_reg, dummy, dummy); |
- |
- // Load context from the function. |
- __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
- |
- // Clear new.target as a safety measure. |
- __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); |
- |
- // Get function code. |
- __ lw(at, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
- __ lw(at, FieldMemOperand(at, SharedFunctionInfo::kCodeOffset)); |
- __ Addu(t9, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
+ __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
+ __ lw(a0, |
+ FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset)); |
+ __ mov(a2, a0); |
- // Re-run JSFunction, a1 is function, cp is context. |
- __ Jump(t9); |
+ ParameterCount dummy1(a2); |
+ ParameterCount dummy2(a0); |
+ __ InvokeFunction(a1, dummy1, dummy2, JUMP_FUNCTION, |
+ CheckDebugStepCallWrapper()); |
} |