Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
stack_frame_arm64.h
Go to the documentation of this file.
1// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_STACK_FRAME_ARM64_H_
6#define RUNTIME_VM_STACK_FRAME_ARM64_H_
7
8#if !defined(RUNTIME_VM_STACK_FRAME_H_)
9#error Do not include stack_frame_arm64.h directly; use stack_frame.h instead.
10#endif
11
12namespace dart {
13
14/* ARM64 Dart Frame Layout
15 | | <- TOS
16Callee frame | ... |
17 | saved PP |
18 | code object |
19 | saved FP | (FP of current frame)
20 | saved PC | (PC of current frame)
21 +--------------------+
22Current frame | ... T| <- SP of current frame
23 | first local T|
24 | caller's PP T|
25 | code object T| (current frame's code object)
26 | caller's FP | <- FP of current frame
27 | caller's LR | (PC of caller frame)
28 +--------------------+
29Caller frame | last parameter | <- SP of caller frame
30 | ... |
31
32 T against a slot indicates it needs to be traversed during GC.
33*/
34
35static constexpr int kDartFrameFixedSize = 4; // PP, FP, LR, PC marker.
36static constexpr int kSavedPcSlotFromSp = -1;
37
38static constexpr int kFirstObjectSlotFromFp =
39 -1; // Used by GC to traverse stack.
40static constexpr int kLastFixedObjectSlotFromFp = -2;
41
42static constexpr int kFirstLocalSlotFromFp = -3;
43static constexpr int kSavedCallerPpSlotFromFp = -2;
44static constexpr int kPcMarkerSlotFromFp = -1;
45static constexpr int kSavedCallerFpSlotFromFp = 0;
46static constexpr int kSavedCallerPcSlotFromFp = 1;
47
48static constexpr int kParamEndSlotFromFp = 1; // One slot past last parameter.
49static constexpr int kCallerSpSlotFromFp = 2;
50static constexpr int kLastParamSlotFromEntrySp = 0;
51
52// Entry and exit frame layout.
53#if defined(DART_TARGET_OS_FUCHSIA)
54static constexpr int kExitLinkSlotFromEntryFp = -24;
56#else
57static constexpr int kExitLinkSlotFromEntryFp = -23;
59#endif
61
62// For FFI native -> Dart callbacks, this is the number of stack slots between
63// arguments passed on stack and arguments saved in callback prologue.
64//
65// 2 = return address (1) + saved frame pointer (1).
66//
67// If NativeCallbackTrampolines::Enabled(), then
68// kNativeCallbackTrampolineStackDelta must be added as well.
69constexpr intptr_t kCallbackSlotsBeforeSavedArguments = 2;
70
71// For FFI calls passing in TypedData, we save it on the stack before entering
72// a Dart frame. This denotes how to get to the backed up typed data.
74
75} // namespace dart
76
77#endif // RUNTIME_VM_STACK_FRAME_ARM64_H_
#define COMPILE_ASSERT(expr)
Definition assert.h:339
static constexpr int kExitLinkSlotFromEntryFp
static constexpr int kSavedCallerPcSlotFromFp
static constexpr int kLastParamSlotFromEntrySp
static constexpr int kFirstObjectSlotFromFp
static constexpr int kDartFrameFixedSize
static constexpr int kFfiCallerTypedDataSlotFromFp
static constexpr int kSavedCallerFpSlotFromFp
static constexpr int kParamEndSlotFromFp
static constexpr int kCallerSpSlotFromFp
static constexpr int kSavedPcSlotFromSp
const int kAbiPreservedCpuRegCount
const int kAbiPreservedFpuRegCount
static constexpr int kPcMarkerSlotFromFp
static constexpr int kFirstLocalSlotFromFp
static constexpr int kSavedCallerPpSlotFromFp
static constexpr int kLastFixedObjectSlotFromFp
constexpr intptr_t kCallbackSlotsBeforeSavedArguments