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

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

Issue 300143007: Generate better ARM64 code for indexed loads and stores. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 offset, 1260 offset,
1261 &offset_mask))) { 1261 &offset_mask))) {
1262 assembler->AddImmediate(base, offset & ~offset_mask); 1262 assembler->AddImmediate(base, offset & ~offset_mask);
1263 offset = offset & offset_mask; 1263 offset = offset & offset_mask;
1264 } 1264 }
1265 return Address(base, offset); 1265 return Address(base, offset);
1266 } 1266 }
1267 1267
1268 1268
1269 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1269 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1270 // The array register points to the backing store for external arrays.
1270 const Register array = locs()->in(0).reg(); 1271 const Register array = locs()->in(0).reg();
1271 const Location index = locs()->in(1); 1272 const Location index = locs()->in(1);
1272 1273
1273 Address element_address(kNoRegister, 0); 1274 Address element_address = index.IsRegister()
1274 element_address = index.IsRegister()
1275 ? ElementAddressForRegIndex(compiler->assembler(), 1275 ? ElementAddressForRegIndex(compiler->assembler(),
1276 true, // Load. 1276 true, // Load.
1277 IsExternal(), class_id(), index_scale(), 1277 IsExternal(), class_id(), index_scale(),
1278 array, index.reg()) 1278 array, index.reg())
1279 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), 1279 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(),
1280 array, Smi::Cast(index.constant()).Value()); 1280 array, Smi::Cast(index.constant()).Value());
1281 // Warning: element_address may use register IP as base. 1281 // Warning: element_address may use register IP as base.
1282 1282
1283 if ((representation() == kUnboxedDouble) || 1283 if ((representation() == kUnboxedDouble) ||
1284 (representation() == kUnboxedFloat32x4) || 1284 (representation() == kUnboxedFloat32x4) ||
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 break; 1328 break;
1329 default: 1329 default:
1330 UNREACHABLE(); 1330 UNREACHABLE();
1331 break; 1331 break;
1332 } 1332 }
1333 return; 1333 return;
1334 } 1334 }
1335 1335
1336 ASSERT(representation() == kTagged); 1336 ASSERT(representation() == kTagged);
1337 1337
1338 Register result = locs()->out(0).reg(); 1338 const Register result = locs()->out(0).reg();
1339 switch (class_id()) { 1339 switch (class_id()) {
1340 case kTypedDataInt8ArrayCid: 1340 case kTypedDataInt8ArrayCid:
1341 ASSERT(index_scale() == 1); 1341 ASSERT(index_scale() == 1);
1342 __ ldrsb(result, element_address); 1342 __ ldrsb(result, element_address);
1343 __ SmiTag(result); 1343 __ SmiTag(result);
1344 break; 1344 break;
1345 case kTypedDataUint8ArrayCid: 1345 case kTypedDataUint8ArrayCid:
1346 case kTypedDataUint8ClampedArrayCid: 1346 case kTypedDataUint8ClampedArrayCid:
1347 case kExternalTypedDataUint8ArrayCid: 1347 case kExternalTypedDataUint8ArrayCid:
1348 case kExternalTypedDataUint8ClampedArrayCid: 1348 case kExternalTypedDataUint8ClampedArrayCid:
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 break; 1478 break;
1479 default: 1479 default:
1480 UNREACHABLE(); 1480 UNREACHABLE();
1481 return NULL; 1481 return NULL;
1482 } 1482 }
1483 return locs; 1483 return locs;
1484 } 1484 }
1485 1485
1486 1486
1487 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1487 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1488 // The array register points to the backing store for external arrays.
1488 const Register array = locs()->in(0).reg(); 1489 const Register array = locs()->in(0).reg();
1489 Location index = locs()->in(1); 1490 const Location index = locs()->in(1);
1490 1491
1491 Address element_address(kNoRegister, 0); 1492 Address element_address = index.IsRegister()
1492 element_address = index.IsRegister() 1493 ? ElementAddressForRegIndex(compiler->assembler(),
1493 ? ElementAddressForRegIndex(compiler->assembler(), 1494 false, // Store.
1494 false, // Store. 1495 IsExternal(), class_id(), index_scale(),
1495 IsExternal(), class_id(), index_scale(), 1496 array, index.reg())
1496 array, index.reg()) 1497 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(),
1497 : ElementAddressForIntIndex(IsExternal(), class_id(), index_scale(), 1498 array, Smi::Cast(index.constant()).Value());
1498 array, Smi::Cast(index.constant()).Value());
1499 1499
1500 switch (class_id()) { 1500 switch (class_id()) {
1501 case kArrayCid: 1501 case kArrayCid:
1502 if (ShouldEmitStoreBarrier()) { 1502 if (ShouldEmitStoreBarrier()) {
1503 const Register value = locs()->in(2).reg(); 1503 const Register value = locs()->in(2).reg();
1504 __ StoreIntoObject(array, element_address, value); 1504 __ StoreIntoObject(array, element_address, value);
1505 } else if (locs()->in(2).IsConstant()) { 1505 } else if (locs()->in(2).IsConstant()) {
1506 const Object& constant = locs()->in(2).constant(); 1506 const Object& constant = locs()->in(2).constant();
1507 __ StoreIntoObjectNoBarrier(array, element_address, constant); 1507 __ StoreIntoObjectNoBarrier(array, element_address, constant);
1508 } else { 1508 } else {
(...skipping 4896 matching lines...) Expand 10 before | Expand all | Expand 10 after
6405 compiler->GenerateCall(token_pos(), 6405 compiler->GenerateCall(token_pos(),
6406 &label, 6406 &label,
6407 PcDescriptors::kOther, 6407 PcDescriptors::kOther,
6408 locs()); 6408 locs());
6409 __ Drop(ArgumentCount()); // Discard arguments. 6409 __ Drop(ArgumentCount()); // Discard arguments.
6410 } 6410 }
6411 6411
6412 } // namespace dart 6412 } // namespace dart
6413 6413
6414 #endif // defined TARGET_ARCH_ARM 6414 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698