Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: runtime/vm/assembler_arm64_test.cc

Issue 241573002: Code patching for ARM64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 __ Push(PP); // Save caller's pool pointer and load a new one here. 1180 __ PushPP(); // 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 __ Pop(PP); 1183 __ PopPP();
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 __ Push(PP); // Save caller's pool pointer and load a new one here. 1195 __ PushPP(); // 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 __ Pop(PP); 1198 __ PopPP();
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 __ Push(PP); // Save caller's pool pointer and load a new one here. 1210 __ PushPP(); // 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 __ Pop(PP); 1213 __ PopPP();
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 __ Push(PP); // Save caller's pool pointer and load a new one here. 1225 __ PushPP(); // 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 __ Pop(PP); 1228 __ PopPP();
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 __ Push(PP); // Save caller's pool pointer and load a new one here. 1242 __ PushPP(); // 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 __ Pop(PP); 1245 __ PopPP();
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 __ Push(PP); // Save caller's pool pointer and load a new one here. 1258 __ PushPP(); // 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 __ Pop(PP); 1261 __ PopPP();
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 __ Push(PP); // Save caller's pool pointer and load a new one here. 1274 __ PushPP(); // 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 __ Pop(PP); 1277 __ PopPP();
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 } // namespace dart 1288 } // namespace dart
1289 1289
1290 #endif // defined(TARGET_ARCH_ARM64) 1290 #endif // defined(TARGET_ARCH_ARM64)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698