| 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 } | 1079 } |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 | 1082 |
| 1083 void Assembler::LeaveFrame() { | 1083 void Assembler::LeaveFrame() { |
| 1084 mov(SP, FP); | 1084 mov(SP, FP); |
| 1085 PopPair(LR, FP); | 1085 PopPair(LR, FP); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 | 1088 |
| 1089 void Assembler::EnterDartFrame(intptr_t frame_size) { | 1089 void Assembler::EnterDartFrame(intptr_t frame_size, Register new_pp) { |
| 1090 ASSERT(!constant_pool_allowed()); | 1090 ASSERT(!constant_pool_allowed()); |
| 1091 // Setup the frame. | 1091 // Setup the frame. |
| 1092 adr(TMP, Immediate(-CodeSize())); // TMP gets PC marker. | 1092 adr(TMP, Immediate(-CodeSize())); // TMP gets PC marker. |
| 1093 EnterFrame(0); | |
| 1094 TagAndPushPPAndPcMarker(TMP); // Save PP and PC marker. | |
| 1095 | |
| 1096 // Load the pool pointer. | |
| 1097 LoadPoolPointer(); | |
| 1098 | |
| 1099 // Reserve space. | |
| 1100 if (frame_size > 0) { | |
| 1101 AddImmediate(SP, SP, -frame_size); | |
| 1102 } | |
| 1103 } | |
| 1104 | |
| 1105 | |
| 1106 void Assembler::EnterDartFrameWithInfo(intptr_t frame_size, Register new_pp) { | |
| 1107 ASSERT(!constant_pool_allowed()); | |
| 1108 // Setup the frame. | |
| 1109 adr(TMP, Immediate(-CodeSize())); // TMP gets PC marker. | |
| 1110 EnterFrame(0); | 1093 EnterFrame(0); |
| 1111 TagAndPushPPAndPcMarker(TMP); // Save PP and PC marker. | 1094 TagAndPushPPAndPcMarker(TMP); // Save PP and PC marker. |
| 1112 | 1095 |
| 1113 // Load the pool pointer. | 1096 // Load the pool pointer. |
| 1114 if (new_pp == kNoRegister) { | 1097 if (new_pp == kNoRegister) { |
| 1115 LoadPoolPointer(); | 1098 LoadPoolPointer(); |
| 1116 } else { | 1099 } else { |
| 1117 mov(PP, new_pp); | 1100 mov(PP, new_pp); |
| 1118 set_constant_pool_allowed(true); | 1101 set_constant_pool_allowed(true); |
| 1119 } | 1102 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1145 set_constant_pool_allowed(true); | 1128 set_constant_pool_allowed(true); |
| 1146 } | 1129 } |
| 1147 | 1130 |
| 1148 if (extra_size > 0) { | 1131 if (extra_size > 0) { |
| 1149 AddImmediate(SP, SP, -extra_size); | 1132 AddImmediate(SP, SP, -extra_size); |
| 1150 } | 1133 } |
| 1151 } | 1134 } |
| 1152 | 1135 |
| 1153 | 1136 |
| 1154 void Assembler::LeaveDartFrame() { | 1137 void Assembler::LeaveDartFrame() { |
| 1155 // LeaveDartFrame is called from stubs (pp disallowed) and from Dart code (pp | |
| 1156 // allowed), so there is no point in checking the current value of | |
| 1157 // constant_pool_allowed(). | |
| 1158 set_constant_pool_allowed(false); | 1138 set_constant_pool_allowed(false); |
| 1159 // Restore and untag PP. | 1139 // Restore and untag PP. |
| 1160 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize); | 1140 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize); |
| 1161 sub(PP, PP, Operand(kHeapObjectTag)); | 1141 sub(PP, PP, Operand(kHeapObjectTag)); |
| 1162 LeaveFrame(); | 1142 LeaveFrame(); |
| 1163 } | 1143 } |
| 1164 | 1144 |
| 1165 | 1145 |
| 1166 void Assembler::EnterCallRuntimeFrame(intptr_t frame_size) { | 1146 void Assembler::EnterCallRuntimeFrame(intptr_t frame_size) { |
| 1167 EnterFrame(0); | 1147 EnterFrame(0); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 void Assembler::EnterStubFrame() { | 1205 void Assembler::EnterStubFrame() { |
| 1226 set_constant_pool_allowed(false); | 1206 set_constant_pool_allowed(false); |
| 1227 EnterFrame(0); | 1207 EnterFrame(0); |
| 1228 // Save caller's pool pointer. Push 0 in the saved PC area for stub frames. | 1208 // Save caller's pool pointer. Push 0 in the saved PC area for stub frames. |
| 1229 TagAndPushPPAndPcMarker(ZR); | 1209 TagAndPushPPAndPcMarker(ZR); |
| 1230 LoadPoolPointer(); | 1210 LoadPoolPointer(); |
| 1231 } | 1211 } |
| 1232 | 1212 |
| 1233 | 1213 |
| 1234 void Assembler::LeaveStubFrame() { | 1214 void Assembler::LeaveStubFrame() { |
| 1235 set_constant_pool_allowed(false); | 1215 LeaveDartFrame(); |
| 1236 // Restore and untag PP. | |
| 1237 LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize); | |
| 1238 sub(PP, PP, Operand(kHeapObjectTag)); | |
| 1239 LeaveFrame(); | |
| 1240 } | 1216 } |
| 1241 | 1217 |
| 1242 | 1218 |
| 1243 void Assembler::UpdateAllocationStats(intptr_t cid, | 1219 void Assembler::UpdateAllocationStats(intptr_t cid, |
| 1244 Heap::Space space, | 1220 Heap::Space space, |
| 1245 bool inline_isolate) { | 1221 bool inline_isolate) { |
| 1246 ASSERT(cid > 0); | 1222 ASSERT(cid > 0); |
| 1247 intptr_t counter_offset = | 1223 intptr_t counter_offset = |
| 1248 ClassTable::CounterOffsetFor(cid, space == Heap::kNew); | 1224 ClassTable::CounterOffsetFor(cid, space == Heap::kNew); |
| 1249 if (inline_isolate) { | 1225 if (inline_isolate) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 add(base, array, Operand(index, LSL, shift)); | 1443 add(base, array, Operand(index, LSL, shift)); |
| 1468 } | 1444 } |
| 1469 const OperandSize size = Address::OperandSizeFor(cid); | 1445 const OperandSize size = Address::OperandSizeFor(cid); |
| 1470 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1446 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
| 1471 return Address(base, offset, Address::Offset, size); | 1447 return Address(base, offset, Address::Offset, size); |
| 1472 } | 1448 } |
| 1473 | 1449 |
| 1474 } // namespace dart | 1450 } // namespace dart |
| 1475 | 1451 |
| 1476 #endif // defined TARGET_ARCH_ARM64 | 1452 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |