Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
stack_frame_ia32.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_IA32_H_
6#define RUNTIME_VM_STACK_FRAME_IA32_H_
7
8#if !defined(RUNTIME_VM_STACK_FRAME_H_)
9#error Do not include stack_frame_ia32.h directly; use stack_frame.h instead.
10#endif
11
12namespace dart {
13
14/* IA32 Dart Frame Layout
15
16 | | <- TOS
17Callee frame | ... |
18 | saved EBP | (EBP of current frame)
19 | saved PC | (PC of current frame)
20 +--------------------+
21Current frame | ... T| <- ESP of current frame
22 | first local T|
23 | code object T| (current frame's code object)
24 | caller's EBP | <- EBP of current frame
25 | caller's ret addr | (PC of caller frame)
26 +--------------------+
27Caller frame | last parameter | <- ESP of caller frame
28 | ... |
29
30 T against a slot indicates it needs to be traversed during GC.
31*/
32
33static constexpr int kDartFrameFixedSize = 3; // PC marker, EBP, PC.
34static constexpr int kSavedPcSlotFromSp = -1;
35
36static constexpr int kFirstObjectSlotFromFp =
37 -1; // Used by GC to traverse stack.
38static constexpr int kLastFixedObjectSlotFromFp = -1;
39
40static constexpr int kFirstLocalSlotFromFp = -2;
41static constexpr int kPcMarkerSlotFromFp = -1;
42static constexpr int kSavedCallerFpSlotFromFp = 0;
43static constexpr int kSavedCallerPcSlotFromFp = 1;
44static constexpr int kParamEndSlotFromFp = 1; // One slot past last parameter.
45static constexpr int kCallerSpSlotFromFp = 2;
46static constexpr int kLastParamSlotFromEntrySp = 1; // Skip return address.
47
48// No pool pointer on IA32 (indicated by aliasing saved fp).
50
51// Entry and exit frame layout.
52static constexpr int kExitLinkSlotFromEntryFp = -8;
53
54// All arguments are passed on the stack, so none need to be saved. Therefore
55// there is no frame for holding the saved arguments.
56//
57// If NativeCallbackTrampolines::Enabled(), then
58// kNativeCallbackTrampolineStackDelta must be added as well.
59constexpr intptr_t kCallbackSlotsBeforeSavedArguments = 0;
60
61// For FFI calls passing in TypedData, we save it on the stack before entering
62// a Dart frame. This denotes how to get to the backed up typed data.
64
65} // namespace dart
66
67#endif // RUNTIME_VM_STACK_FRAME_IA32_H_
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
static constexpr int kPcMarkerSlotFromFp
static constexpr int kFirstLocalSlotFromFp
static constexpr int kSavedCallerPpSlotFromFp
static constexpr int kLastFixedObjectSlotFromFp
constexpr intptr_t kCallbackSlotsBeforeSavedArguments