| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_STACK_FRAME_X64_H_ | 5 #ifndef VM_STACK_FRAME_X64_H_ |
| 6 #define VM_STACK_FRAME_X64_H_ | 6 #define VM_STACK_FRAME_X64_H_ |
| 7 | 7 |
| 8 namespace dart { | 8 namespace dart { |
| 9 | 9 |
| 10 /* X64 Dart Frame Layout | 10 /* X64 Dart Frame Layout |
| 11 | 11 |
| 12 | | <- TOS | 12 | | <- TOS |
| 13 Callee frame | ... | | 13 Callee frame | ... | |
| 14 | current ret addr | (PC of current frame) | 14 | current ret addr | (PC of current frame) |
| 15 +-------------------+ | 15 +--------------------+ |
| 16 Current frame | ... | <- RSP of current frame | 16 Current frame | ... | <- RSP of current frame |
| 17 | first local | | 17 | first local | |
| 18 | PC Marker | (current frame's code entry) | 18 | PC marker | (current frame's code entry + offset) |
| 19 | caller's RBP | <- RBP of current frame | 19 | caller's RBP | <- RBP of current frame |
| 20 | caller's ret addr | (PC of caller frame) | 20 | caller's ret addr | (PC of caller frame) |
| 21 +-------------------+ | 21 +--------------------+ |
| 22 Caller frame | last parameter | | 22 Caller frame | last parameter | <- RSP of caller frame |
| 23 | ... | | 23 | ... | |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 static const int kLastParamSlotIndex = 2; // From fp. | 26 static const int kSavedPcSlotFromSp = -1; |
| 27 static const int kFirstLocalSlotIndex = -2; // From fp. | 27 static const int kFirstLocalSlotFromFp = -2; |
| 28 static const int kPcSlotIndexFromSp = -1; | 28 static const int kPcMarkerSlotFromFp = -1; |
| 29 static const int kSavedCallerFpSlotFromFp = 0; |
| 30 static const int kParamEndSlotFromFp = 1; // Same slot as caller's ret addr. |
| 31 static const int kCallerSpSlotFromFp = 2; |
| 32 |
| 33 // Entry and exit frame layout. |
| 34 static const int kSavedContextSlotFromEntryFp = -9; |
| 35 static const int kExitLinkSlotFromEntryFp = -8; |
| 29 | 36 |
| 30 } // namespace dart | 37 } // namespace dart |
| 31 | 38 |
| 32 #endif // VM_STACK_FRAME_X64_H_ | 39 #endif // VM_STACK_FRAME_X64_H_ |
| 33 | 40 |
| OLD | NEW |