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