OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS 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 | 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 #include "vm/globals.h" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 // real stack limit, we could just set CSP to a value near it during | 1095 // real stack limit, we could just set CSP to a value near it during |
1096 // SetupDartSP, but we do not know the real stack limit for the initial | 1096 // SetupDartSP, but we do not know the real stack limit for the initial |
1097 // thread or threads created by the embedder. | 1097 // thread or threads created by the embedder. |
1098 // TODO(26472): It would be safer to use CSP as the Dart stack pointer, but | 1098 // TODO(26472): It would be safer to use CSP as the Dart stack pointer, but |
1099 // this requires adjustments to stack handling to maintain the 16-byte | 1099 // this requires adjustments to stack handling to maintain the 16-byte |
1100 // alignment. | 1100 // alignment. |
1101 const intptr_t kMaxDartFrameSize = 4096; | 1101 const intptr_t kMaxDartFrameSize = 4096; |
1102 sub(TMP, SP, Operand(kMaxDartFrameSize)); | 1102 sub(TMP, SP, Operand(kMaxDartFrameSize)); |
1103 andi(CSP, TMP, Immediate(~15)); | 1103 andi(CSP, TMP, Immediate(~15)); |
1104 | 1104 |
1105 PushPair(LR, FP); | 1105 PushPair(FP, LR); // low: FP, high: LR. |
1106 mov(FP, SP); | 1106 mov(FP, SP); |
1107 | 1107 |
1108 if (frame_size > 0) { | 1108 if (frame_size > 0) { |
1109 sub(SP, SP, Operand(frame_size)); | 1109 sub(SP, SP, Operand(frame_size)); |
1110 } | 1110 } |
1111 } | 1111 } |
1112 | 1112 |
1113 | 1113 |
1114 void Assembler::LeaveFrame() { | 1114 void Assembler::LeaveFrame() { |
1115 mov(SP, FP); | 1115 mov(SP, FP); |
1116 PopPair(LR, FP); | 1116 PopPair(FP, LR); // low: FP, high: LR. |
1117 } | 1117 } |
1118 | 1118 |
1119 | 1119 |
1120 void Assembler::EnterDartFrame(intptr_t frame_size, Register new_pp) { | 1120 void Assembler::EnterDartFrame(intptr_t frame_size, Register new_pp) { |
1121 ASSERT(!constant_pool_allowed()); | 1121 ASSERT(!constant_pool_allowed()); |
1122 // Setup the frame. | 1122 // Setup the frame. |
1123 EnterFrame(0); | 1123 EnterFrame(0); |
1124 TagAndPushPPAndPcMarker(); // Save PP and PC marker. | 1124 TagAndPushPPAndPcMarker(); // Save PP and PC marker. |
1125 | 1125 |
1126 // Load the pool pointer. | 1126 // Load the pool pointer. |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 str(tmp, Address(addr, 7), kUnsignedByte); | 1571 str(tmp, Address(addr, 7), kUnsignedByte); |
1572 if (sz == kDoubleWord) { | 1572 if (sz == kDoubleWord) { |
1573 return; | 1573 return; |
1574 } | 1574 } |
1575 UNIMPLEMENTED(); | 1575 UNIMPLEMENTED(); |
1576 } | 1576 } |
1577 | 1577 |
1578 } // namespace dart | 1578 } // namespace dart |
1579 | 1579 |
1580 #endif // defined TARGET_ARCH_ARM64 | 1580 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |