2013-05-03 21:42:16 +00:00
|
|
|
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2016-10-26 07:26:03 +00:00
|
|
|
#ifndef RUNTIME_VM_STACK_FRAME_X64_H_
|
|
|
|
#define RUNTIME_VM_STACK_FRAME_X64_H_
|
2013-05-03 21:42:16 +00:00
|
|
|
|
|
|
|
namespace dart {
|
|
|
|
|
|
|
|
/* X64 Dart Frame Layout
|
|
|
|
|
2013-05-07 18:06:21 +00:00
|
|
|
| | <- TOS
|
|
|
|
Callee frame | ... |
|
2013-09-09 15:39:26 +00:00
|
|
|
| saved PP |
|
2015-09-19 11:21:09 +00:00
|
|
|
| code object |
|
2013-05-14 23:23:54 +00:00
|
|
|
| saved RBP | (RBP of current frame)
|
|
|
|
| saved PC | (PC of current frame)
|
2013-05-07 18:06:21 +00:00
|
|
|
+--------------------+
|
2013-11-08 00:25:40 +00:00
|
|
|
Current frame | ... T| <- RSP of current frame
|
|
|
|
| first local T|
|
|
|
|
| caller's PP T|
|
2015-09-19 11:21:09 +00:00
|
|
|
| code object T| (current frame's code object)
|
2013-05-07 18:06:21 +00:00
|
|
|
| caller's RBP | <- RBP of current frame
|
|
|
|
| caller's ret addr | (PC of caller frame)
|
|
|
|
+--------------------+
|
|
|
|
Caller frame | last parameter | <- RSP of caller frame
|
|
|
|
| ... |
|
2013-11-08 00:25:40 +00:00
|
|
|
|
|
|
|
T against a slot indicates it needs to be traversed during GC.
|
2013-05-03 21:42:16 +00:00
|
|
|
*/
|
|
|
|
|
2013-09-09 15:39:26 +00:00
|
|
|
static const int kDartFrameFixedSize = 4; // PC marker, RBP, PP, PC.
|
2013-05-07 18:06:21 +00:00
|
|
|
static const int kSavedPcSlotFromSp = -1;
|
2013-09-09 15:39:26 +00:00
|
|
|
|
2015-09-19 11:21:09 +00:00
|
|
|
static const int kFirstObjectSlotFromFp = -1; // Used by GC to traverse stack.
|
2017-10-12 03:47:15 +00:00
|
|
|
static const int kLastFixedObjectSlotFromFp = -2;
|
2013-11-08 00:25:40 +00:00
|
|
|
|
2013-09-09 15:39:26 +00:00
|
|
|
static const int kFirstLocalSlotFromFp = -3;
|
|
|
|
static const int kSavedCallerPpSlotFromFp = -2;
|
2013-05-07 18:06:21 +00:00
|
|
|
static const int kPcMarkerSlotFromFp = -1;
|
|
|
|
static const int kSavedCallerFpSlotFromFp = 0;
|
2013-05-14 23:23:54 +00:00
|
|
|
static const int kSavedCallerPcSlotFromFp = 1;
|
2013-09-09 15:39:26 +00:00
|
|
|
|
2013-05-14 23:23:54 +00:00
|
|
|
static const int kParamEndSlotFromFp = 1; // One slot past last parameter.
|
2013-05-07 18:06:21 +00:00
|
|
|
static const int kCallerSpSlotFromFp = 2;
|
2013-09-09 15:39:26 +00:00
|
|
|
static const int kSavedAboveReturnAddress = 3; // Saved above return address.
|
2013-05-14 23:23:54 +00:00
|
|
|
|
2013-05-07 18:06:21 +00:00
|
|
|
// Entry and exit frame layout.
|
2014-06-06 12:14:15 +00:00
|
|
|
#if defined(_WIN64)
|
2015-09-19 11:21:09 +00:00
|
|
|
static const int kExitLinkSlotFromEntryFp = -32;
|
2014-06-06 12:14:15 +00:00
|
|
|
#else
|
2015-09-19 11:21:09 +00:00
|
|
|
static const int kExitLinkSlotFromEntryFp = -10;
|
2014-06-06 12:14:15 +00:00
|
|
|
#endif // defined(_WIN64)
|
2013-05-03 21:42:16 +00:00
|
|
|
|
|
|
|
} // namespace dart
|
|
|
|
|
2016-10-26 07:26:03 +00:00
|
|
|
#endif // RUNTIME_VM_STACK_FRAME_X64_H_
|