| 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 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 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/os.h" | 10 #include "vm/os.h" |
| (...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 | 1170 |
| 1171 | 1171 |
| 1172 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg4, test) { | 1172 ASSEMBLER_TEST_RUN(LoadImmediateMedNeg4, test) { |
| 1173 typedef int (*SimpleCode)(); | 1173 typedef int (*SimpleCode)(); |
| 1174 EXPECT_EQ(-0x12341234, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1174 EXPECT_EQ(-0x12341234, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1175 } | 1175 } |
| 1176 | 1176 |
| 1177 | 1177 |
| 1178 // Loading immediate values with the object pool. | 1178 // Loading immediate values with the object pool. |
| 1179 ASSEMBLER_TEST_GENERATE(LoadImmediatePPSmall, assembler) { | 1179 ASSEMBLER_TEST_GENERATE(LoadImmediatePPSmall, assembler) { |
| 1180 __ PushPP(); // Save caller's pool pointer and load a new one here. | 1180 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 1181 __ LoadPoolPointer(PP); | 1181 __ LoadPoolPointer(PP); |
| 1182 __ LoadImmediate(R0, 42, PP); | 1182 __ LoadImmediate(R0, 42, PP); |
| 1183 __ PopPP(); | 1183 __ PopAndUntagPP(); |
| 1184 __ ret(); | 1184 __ ret(); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 | 1187 |
| 1188 ASSEMBLER_TEST_RUN(LoadImmediatePPSmall, test) { | 1188 ASSEMBLER_TEST_RUN(LoadImmediatePPSmall, test) { |
| 1189 typedef int (*SimpleCode)(); | 1189 typedef int (*SimpleCode)(); |
| 1190 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1190 EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1191 } | 1191 } |
| 1192 | 1192 |
| 1193 | 1193 |
| 1194 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed, assembler) { | 1194 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed, assembler) { |
| 1195 __ PushPP(); // Save caller's pool pointer and load a new one here. | 1195 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 1196 __ LoadPoolPointer(PP); | 1196 __ LoadPoolPointer(PP); |
| 1197 __ LoadImmediate(R0, 0xf1234123, PP); | 1197 __ LoadImmediate(R0, 0xf1234123, PP); |
| 1198 __ PopPP(); | 1198 __ PopAndUntagPP(); |
| 1199 __ ret(); | 1199 __ ret(); |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 | 1202 |
| 1203 ASSEMBLER_TEST_RUN(LoadImmediatePPMed, test) { | 1203 ASSEMBLER_TEST_RUN(LoadImmediatePPMed, test) { |
| 1204 typedef int (*SimpleCode)(); | 1204 typedef int (*SimpleCode)(); |
| 1205 EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1205 EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 | 1208 |
| 1209 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed2, assembler) { | 1209 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed2, assembler) { |
| 1210 __ PushPP(); // Save caller's pool pointer and load a new one here. | 1210 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 1211 __ LoadPoolPointer(PP); | 1211 __ LoadPoolPointer(PP); |
| 1212 __ LoadImmediate(R0, 0x4321f1234124, PP); | 1212 __ LoadImmediate(R0, 0x4321f1234124, PP); |
| 1213 __ PopPP(); | 1213 __ PopAndUntagPP(); |
| 1214 __ ret(); | 1214 __ ret(); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 | 1217 |
| 1218 ASSEMBLER_TEST_RUN(LoadImmediatePPMed2, test) { | 1218 ASSEMBLER_TEST_RUN(LoadImmediatePPMed2, test) { |
| 1219 typedef int (*SimpleCode)(); | 1219 typedef int (*SimpleCode)(); |
| 1220 EXPECT_EQ(0x4321f1234124, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1220 EXPECT_EQ(0x4321f1234124, EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1221 } | 1221 } |
| 1222 | 1222 |
| 1223 | 1223 |
| 1224 ASSEMBLER_TEST_GENERATE(LoadImmediatePPLarge, assembler) { | 1224 ASSEMBLER_TEST_GENERATE(LoadImmediatePPLarge, assembler) { |
| 1225 __ PushPP(); // Save caller's pool pointer and load a new one here. | 1225 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 1226 __ LoadPoolPointer(PP); | 1226 __ LoadPoolPointer(PP); |
| 1227 __ LoadImmediate(R0, 0x9287436598237465, PP); | 1227 __ LoadImmediate(R0, 0x9287436598237465, PP); |
| 1228 __ PopPP(); | 1228 __ PopAndUntagPP(); |
| 1229 __ ret(); | 1229 __ ret(); |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 | 1232 |
| 1233 ASSEMBLER_TEST_RUN(LoadImmediatePPLarge, test) { | 1233 ASSEMBLER_TEST_RUN(LoadImmediatePPLarge, test) { |
| 1234 typedef int (*SimpleCode)(); | 1234 typedef int (*SimpleCode)(); |
| 1235 EXPECT_EQ(static_cast<int64_t>(0x9287436598237465), | 1235 EXPECT_EQ(static_cast<int64_t>(0x9287436598237465), |
| 1236 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1236 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1237 } | 1237 } |
| 1238 | 1238 |
| 1239 | 1239 |
| 1240 // LoadObject null. | 1240 // LoadObject null. |
| 1241 ASSEMBLER_TEST_GENERATE(LoadObjectNull, assembler) { | 1241 ASSEMBLER_TEST_GENERATE(LoadObjectNull, assembler) { |
| 1242 __ PushPP(); // Save caller's pool pointer and load a new one here. | 1242 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 1243 __ LoadPoolPointer(PP); | 1243 __ LoadPoolPointer(PP); |
| 1244 __ LoadObject(R0, Object::null_object(), PP); | 1244 __ LoadObject(R0, Object::null_object(), PP); |
| 1245 __ PopPP(); | 1245 __ PopAndUntagPP(); |
| 1246 __ ret(); | 1246 __ ret(); |
| 1247 } | 1247 } |
| 1248 | 1248 |
| 1249 | 1249 |
| 1250 ASSEMBLER_TEST_RUN(LoadObjectNull, test) { | 1250 ASSEMBLER_TEST_RUN(LoadObjectNull, test) { |
| 1251 typedef int (*SimpleCode)(); | 1251 typedef int (*SimpleCode)(); |
| 1252 EXPECT_EQ(reinterpret_cast<int64_t>(Object::null()), | 1252 EXPECT_EQ(reinterpret_cast<int64_t>(Object::null()), |
| 1253 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1253 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 | 1256 |
| 1257 ASSEMBLER_TEST_GENERATE(LoadObjectTrue, assembler) { | 1257 ASSEMBLER_TEST_GENERATE(LoadObjectTrue, assembler) { |
| 1258 __ PushPP(); // Save caller's pool pointer and load a new one here. | 1258 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 1259 __ LoadPoolPointer(PP); | 1259 __ LoadPoolPointer(PP); |
| 1260 __ LoadObject(R0, Bool::True(), PP); | 1260 __ LoadObject(R0, Bool::True(), PP); |
| 1261 __ PopPP(); | 1261 __ PopAndUntagPP(); |
| 1262 __ ret(); | 1262 __ ret(); |
| 1263 } | 1263 } |
| 1264 | 1264 |
| 1265 | 1265 |
| 1266 ASSEMBLER_TEST_RUN(LoadObjectTrue, test) { | 1266 ASSEMBLER_TEST_RUN(LoadObjectTrue, test) { |
| 1267 typedef int (*SimpleCode)(); | 1267 typedef int (*SimpleCode)(); |
| 1268 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::True().raw()), | 1268 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::True().raw()), |
| 1269 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1269 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1270 } | 1270 } |
| 1271 | 1271 |
| 1272 | 1272 |
| 1273 ASSEMBLER_TEST_GENERATE(LoadObjectFalse, assembler) { | 1273 ASSEMBLER_TEST_GENERATE(LoadObjectFalse, assembler) { |
| 1274 __ PushPP(); // Save caller's pool pointer and load a new one here. | 1274 __ TagAndPushPP(); // Save caller's pool pointer and load a new one here. |
| 1275 __ LoadPoolPointer(PP); | 1275 __ LoadPoolPointer(PP); |
| 1276 __ LoadObject(R0, Bool::False(), PP); | 1276 __ LoadObject(R0, Bool::False(), PP); |
| 1277 __ PopPP(); | 1277 __ PopAndUntagPP(); |
| 1278 __ ret(); | 1278 __ ret(); |
| 1279 } | 1279 } |
| 1280 | 1280 |
| 1281 | 1281 |
| 1282 ASSEMBLER_TEST_RUN(LoadObjectFalse, test) { | 1282 ASSEMBLER_TEST_RUN(LoadObjectFalse, test) { |
| 1283 typedef int (*SimpleCode)(); | 1283 typedef int (*SimpleCode)(); |
| 1284 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::False().raw()), | 1284 EXPECT_EQ(reinterpret_cast<int64_t>(Bool::False().raw()), |
| 1285 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); | 1285 EXECUTE_TEST_CODE_INT64(SimpleCode, test->entry())); |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 | 1288 |
| 1289 // Called from assembler_test.cc. | 1289 // Called from assembler_test.cc. |
| 1290 // LR: return address. | 1290 // LR: return address. |
| 1291 // R0: context. | 1291 // R0: context. |
| 1292 // R1: value. | 1292 // R1: value. |
| 1293 // R2: growable array. | 1293 // R2: growable array. |
| 1294 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { | 1294 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { |
| 1295 __ PushPP(); | 1295 __ TagAndPushPP(); |
| 1296 __ LoadPoolPointer(PP); | 1296 __ LoadPoolPointer(PP); |
| 1297 __ Push(CTX); | 1297 __ Push(CTX); |
| 1298 __ Push(LR); | 1298 __ Push(LR); |
| 1299 __ mov(CTX, R0); | 1299 __ mov(CTX, R0); |
| 1300 __ StoreIntoObject(R2, | 1300 __ StoreIntoObject(R2, |
| 1301 FieldAddress(R2, GrowableObjectArray::data_offset()), | 1301 FieldAddress(R2, GrowableObjectArray::data_offset()), |
| 1302 R1); | 1302 R1); |
| 1303 __ Pop(LR); | 1303 __ Pop(LR); |
| 1304 __ Pop(CTX); | 1304 __ Pop(CTX); |
| 1305 __ PopPP(); | 1305 __ PopAndUntagPP(); |
| 1306 __ ret(); | 1306 __ ret(); |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 } // namespace dart | 1309 } // namespace dart |
| 1310 | 1310 |
| 1311 #endif // defined(TARGET_ARCH_ARM64) | 1311 #endif // defined(TARGET_ARCH_ARM64) |
| OLD | NEW |