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

5
#if V8_TARGET_ARCH_ARM64
6

7 8
#include "src/debug/debug.h"

9
#include "src/arm64/macro-assembler-arm64-inl.h"
10
#include "src/debug/liveedit.h"
11
#include "src/frame-constants.h"
12
#include "src/frames-inl.h"
13
#include "src/objects-inl.h"
14 15 16 17 18 19

namespace v8 {
namespace internal {

#define __ ACCESS_MASM(masm)

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

27 28 29 30 31 32 33 34 35 36 37
  // Return to caller.
  __ Ret();
}

void DebugCodegen::GenerateFrameDropperTrampoline(MacroAssembler* masm) {
  // Frame is being dropped:
  // - Drop to the target frame specified by x1.
  // - Look up current function on the frame.
  // - Leave the frame.
  // - Restart the frame by calling the function.
  __ Mov(fp, x1);
38
  __ AssertStackConsistency();
39
  __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
40

41 42
  __ Mov(masm->StackPointer(), Operand(fp));
  __ Pop(fp, lr);  // Frame, Return address.
43

44 45 46 47
  __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset));
  __ Ldr(x0,
         FieldMemOperand(x0, SharedFunctionInfo::kFormalParameterCountOffset));
  __ mov(x2, x0);
48

49 50
  ParameterCount dummy1(x2);
  ParameterCount dummy2(x0);
51
  __ InvokeFunction(x1, dummy1, dummy2, JUMP_FUNCTION);
52 53
}

54

55
const bool LiveEdit::kFrameDropperSupported = true;
56

57 58
}  // namespace internal
}  // namespace v8
59

60 61
#undef __

62
#endif  // V8_TARGET_ARCH_ARM64