• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/init/v8.h"
6 
7 #if V8_TARGET_ARCH_S390
8 
9 #include "src/debug/debug.h"
10 
11 #include "src/codegen/macro-assembler.h"
12 #include "src/debug/liveedit.h"
13 #include "src/execution/frames-inl.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, StandardFrameConstants::kFunctionOffset));
40   __ LeaveFrame(StackFrame::INTERNAL);
41   __ LoadTaggedPointerField(
42       r2, FieldMemOperand(r3, JSFunction::kSharedFunctionInfoOffset));
43   __ LoadLogicalHalfWordP(
44       r2, FieldMemOperand(r2, SharedFunctionInfo::kFormalParameterCountOffset));
45   __ LoadRR(r4, r2);
46 
47   __ InvokeFunction(r3, r4, r2, JUMP_FUNCTION);
48 }
49 
50 const bool LiveEdit::kFrameDropperSupported = true;
51 
52 #undef __
53 }  // namespace internal
54 }  // namespace v8
55 
56 #endif  // V8_TARGET_ARCH_S390
57