V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
debug-ia32.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_IA32
6 
7 #include "src/debug/debug.h"
8 
9 #include "src/debug/liveedit.h"
10 #include "src/frames-inl.h"
11 #include "src/macro-assembler.h"
12 
13 namespace v8 {
14 namespace internal {
15 
16 #define __ ACCESS_MASM(masm)
17 
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(0);
27 }
28 
29 void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
30  // Frame is being dropped:
31  // - Drop to the target frame specified by eax.
32  // - Look up current function on the frame.
33  // - Leave the frame.
34  // - Restart the frame by calling the function.
35  __ mov(ebp, eax);
36  __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
37  __ leave();
38 
39  __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
40  __ movzx_w(
41  eax, FieldOperand(eax, SharedFunctionInfo::kFormalParameterCountOffset));
42 
43  // The expected and actual argument counts don't matter as long as they match
44  // and we don't enter the ArgumentsAdaptorTrampoline.
45  ParameterCount dummy(0);
46  __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset));
47  __ InvokeFunctionCode(edi, no_reg, dummy, dummy, JUMP_FUNCTION);
48 }
49 
50 const bool LiveEdit::kFrameDropperSupported = true;
51 
52 #undef __
53 
54 } // namespace internal
55 } // namespace v8
56 
57 #endif // V8_TARGET_ARCH_IA32
Definition: libplatform.h:13