• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #if V8_TARGET_ARCH_MIPS64
6 
7 #include "src/debug/debug.h"
8 
9 #include "src/codegen/macro-assembler.h"
10 #include "src/debug/liveedit.h"
11 #include "src/execution/frames-inl.h"
12 
13 namespace v8 {
14 namespace internal {
15 
16 #define __ ACCESS_MASM(masm)
17 
GenerateHandleDebuggerStatement(MacroAssembler * masm)18 void DebugCodegen::GenerateHandleDebuggerStatement(MacroAssembler* masm) {
19   {
20     FrameScope scope(masm, StackFrame::INTERNAL);
21     __ CallRuntime(Runtime::kHandleDebuggerStatement, 0);
22   }
23   __ MaybeDropFrames();
24 
25   // Return to caller.
26   __ Ret();
27 }
28 
GenerateFrameDropperTrampoline(MacroAssembler * masm)29 void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
30   // Frame is being dropped:
31   // - Drop to the target frame specified by a1.
32   // - Look up current function on the frame.
33   // - Leave the frame.
34   // - Restart the frame by calling the function.
35   __ mov(fp, a1);
36   __ Ld(a1, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
37 
38   // Pop return address and frame.
39   __ LeaveFrame(StackFrame::INTERNAL);
40 
41   __ Ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
42   __ Lhu(a0,
43          FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
44   __ mov(a2, a0);
45 
46   __ InvokeFunction(a1, a2, a0, JUMP_FUNCTION);
47 }
48 
49 
50 const bool LiveEdit::kFrameDropperSupported = true;
51 
52 #undef __
53 
54 }  // namespace internal
55 }  // namespace v8
56 
57 #endif  // V8_TARGET_ARCH_MIPS64
58