debug-ppc.cc 1.47 KB
Newer Older
1 2 3 4
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
#if V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64
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 14 15
namespace v8 {
namespace internal {

16 17
#define __ ACCESS_MASM(masm)

18 19 20 21 22 23
void DebugCodegen::GenerateHandleDebuggerStatement(MacroAssembler* masm) {
  {
    FrameScope scope(masm, StackFrame::INTERNAL);
    __ CallRuntime(Runtime::kHandleDebuggerStatement, 0);
  }
  __ MaybeDropFrames();
24

25 26 27
  // Return to caller.
  __ Ret();
}
28

29 30 31 32 33 34
void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
  // Frame is being dropped:
  // - Drop to the target frame specified by r4.
  // - Look up current function on the frame.
  // - Leave the frame.
  // - Restart the frame by calling the function.
35

36
  __ mr(fp, r4);
37
  __ LoadP(r4, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
38
  __ LeaveFrame(StackFrame::INTERNAL);
39 40
  __ LoadTaggedPointerField(
      r3, FieldMemOperand(r4, JSFunction::kSharedFunctionInfoOffset));
41
  __ lhz(r3,
42
         FieldMemOperand(r3, SharedFunctionInfo::kFormalParameterCountOffset));
43 44
  __ mr(r5, r3);

45
  __ InvokeFunction(r4, r5, r3, JUMP_FUNCTION);
46 47 48 49 50
}

const bool LiveEdit::kFrameDropperSupported = true;

#undef __
51 52
}  // namespace internal
}  // namespace v8
53

54
#endif  // V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64