debug-mips64.cc 1.44 KB
Newer Older
1 2 3 4 5 6
// Copyright 2012 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.

#if V8_TARGET_ARCH_MIPS64

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 24 25 26 27 28 29 30 31 32 33 34 35
void DebugCodegen::GenerateHandleDebuggerStatement(MacroAssembler* masm) {
  {
    FrameScope scope(masm, StackFrame::INTERNAL);
    __ CallRuntime(Runtime::kHandleDebuggerStatement, 0);
  }
  __ MaybeDropFrames();

  // Return to caller.
  __ Ret();
}

void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
  // Frame is being dropped:
  // - Drop to the target frame specified by a1.
  // - Look up current function on the frame.
  // - Leave the frame.
  // - Restart the frame by calling the function.
  __ mov(fp, a1);
36
  __ Ld(a1, MemOperand(fp, StandardFrameConstants::kFunctionOffset));
37

38 39
  // Pop return address and frame.
  __ LeaveFrame(StackFrame::INTERNAL);
40

41
  __ Ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
42 43
  __ Lhu(a0,
         FieldMemOperand(a0, SharedFunctionInfo::kFormalParameterCountOffset));
44
  __ mov(a2, a0);
45

46
  __ InvokeFunction(a1, a2, a0, JUMP_FUNCTION);
47 48 49 50 51 52 53
}


const bool LiveEdit::kFrameDropperSupported = true;

#undef __

54 55
}  // namespace internal
}  // namespace v8
56 57

#endif  // V8_TARGET_ARCH_MIPS64