Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
stack_frame_arm.h
Go to the documentation of this file.
1// Copyright (c) 2013, 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_ARM_H_
6#define RUNTIME_VM_STACK_FRAME_ARM_H_
7
8#if !defined(RUNTIME_VM_STACK_FRAME_H_)
9#error Do not include stack_frame_arm.h directly; use stack_frame.h instead.
10#endif
11
12namespace dart {
13
14/* ARM Dart Frame Layout
15
16 | | <- TOS
17Callee frame | ... |
18 | saved PP | (PP of current frame)
19 | code object |
20 | saved FP | (FP of current frame)
21 | saved LR | (PC of current frame)
22 +--------------------+
23Current frame | ... T| <- SP of current frame
24 | first local T|
25 | caller's PP T|
26 | code object T| (current frame's code object)
27 | caller's FP | <- FP of current frame
28 | caller's LR | (PC of caller frame)
29 +--------------------+
30Caller frame | last parameter | <- SP of caller frame
31 | ... |
32
33 T against a slot indicates it needs to be traversed during GC.
34*/
35
36static constexpr int kDartFrameFixedSize = 4; // PP, FP, LR, PC marker.
37static constexpr int kSavedPcSlotFromSp = -1;
38
39static constexpr int kFirstObjectSlotFromFp =
40 -1; // Used by GC to traverse stack.
41static constexpr int kLastFixedObjectSlotFromFp = -2;
42
43static constexpr int kFirstLocalSlotFromFp = -3;
44static constexpr int kSavedCallerPpSlotFromFp = -2;
45static constexpr int kPcMarkerSlotFromFp = -1;
46static constexpr int kSavedCallerFpSlotFromFp = 0;
47static constexpr int kSavedCallerPcSlotFromFp = 1;
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_MACOS) || defined(DART_TARGET_OS_MACOS_IOS)
54static constexpr int kExitLinkSlotFromEntryFp = -27;
57#else
58static constexpr int kExitLinkSlotFromEntryFp = -28;
61#endif
62
63// For FFI native -> Dart callbacks, the number of stack slots between arguments
64// passed on stack and arguments saved in callback prologue.
65//
66// 2 = return address (1) + saved frame pointer (1).
67//
68// If NativeCallbackTrampolines::Enabled(), then
69// kNativeCallbackTrampolineStackDelta must be added as well.
71
72// For FFI calls passing in TypedData, we save it on the stack before entering
73// a Dart frame. This denotes how to get to the backed up typed data.
74//
75// Note: This is not kCallerSpSlotFromFp on arm.
76//
77// [fp] holds callers fp, [fp+4] holds callers lr, [fp+8] is space for
78// return address, [fp+12] is our pushed TypedData pointer.
80
81} // namespace dart
82
83#endif // RUNTIME_VM_STACK_FRAME_ARM_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