V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
debug-arm.cc
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_ARM
6 
7 #include "src/debug/debug.h"
8 
9 #include "src/assembler-inl.h"
10 #include "src/debug/liveedit.h"
11 #include "src/frames-inl.h"
12 #include "src/macro-assembler.h"
13 #include "src/objects-inl.h"
14 
15 namespace v8 {
16 namespace internal {
17 
18 #define __ ACCESS_MASM(masm)
19 
20 
21 void DebugCodegen::GenerateHandleDebuggerStatement(MacroAssembler* masm) {
22  {
23  FrameScope scope(masm, StackFrame::INTERNAL);
24  __ CallRuntime(Runtime::kHandleDebuggerStatement, 0);
25  }
26  __ MaybeDropFrames();
27 
28  // Return to caller.
29  __ Ret();
30 }
31 
32 void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
33  // Frame is being dropped:
34  // - Drop to the target frame specified by r1.
35  // - Look up current function on the frame.
36  // - Leave the frame.
37  // - Restart the frame by calling the function.
38  __ mov(fp, r1);
39  __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
40  __ LeaveFrame(StackFrame::INTERNAL);
41 
42  __ ldr(r0, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
43  __ ldrh(r0,
44  FieldMemOperand(r0, SharedFunctionInfo::kFormalParameterCountOffset));
45  __ mov(r2, r0);
46 
47  ParameterCount dummy1(r2);
48  ParameterCount dummy2(r0);
49  __ InvokeFunction(r1, dummy1, dummy2, JUMP_FUNCTION);
50 }
51 
52 
53 const bool LiveEdit::kFrameDropperSupported = true;
54 
55 #undef __
56 
57 } // namespace internal
58 } // namespace v8
59 
60 #endif // V8_TARGET_ARCH_ARM
Definition: libplatform.h:13