Index: src/debug/mips64/debug-mips64.cc |
diff --git a/src/debug/mips64/debug-mips64.cc b/src/debug/mips64/debug-mips64.cc |
index 0230f13145745a2829ce9ad1d2cb04a43859570f..b8dbbfb45ee033e10f834b5488292e95018865ef 100644 |
--- a/src/debug/mips64/debug-mips64.cc |
+++ b/src/debug/mips64/debug-mips64.cc |
@@ -65,22 +65,23 @@ bool DebugCodegen::DebugBreakSlotIsPatched(Address pc) { |
return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); |
} |
+void DebugCodegen::GenerateHandleDebuggerStatement(MacroAssembler* masm) { |
+ { |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
+ __ CallRuntime(Runtime::kHandleDebuggerStatement, 0); |
+ } |
+ __ MaybeDropFrames(); |
+ |
+ // Return to caller. |
+ __ Ret(); |
+} |
+ |
void DebugCodegen::GenerateDebugBreakStub(MacroAssembler* masm, |
DebugBreakCallHelperMode mode) { |
__ RecordComment("Debug break"); |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
- // Load padding words on stack. |
- __ li(at, Operand(Smi::FromInt(LiveEdit::kFramePaddingValue))); |
- __ Dsubu(sp, sp, |
- Operand(kPointerSize * LiveEdit::kFramePaddingInitialSize)); |
- for (int i = LiveEdit::kFramePaddingInitialSize - 1; i >= 0; i--) { |
- __ sd(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. |
@@ -107,46 +108,36 @@ 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)); |
- __ ld(t9, MemOperand(t9)); |
- __ Jump(t9); |
-} |
+ __ MaybeDropFrames(); |
+ // Return to caller. |
+ __ Ret(); |
+} |
-void DebugCodegen::GenerateFrameDropperLiveEdit(MacroAssembler* masm) { |
- // We do not know our frame height, but set sp based on fp. |
- __ ld(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); |
+ __ ld(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. |
- __ ld(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
- |
- // Clear new.target as a safety measure. |
- __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); |
- |
- // Get function code. |
- __ ld(at, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
- __ ld(at, FieldMemOperand(at, SharedFunctionInfo::kCodeOffset)); |
- __ Daddu(t9, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
+ __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
+ __ ld(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()); |
} |