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

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

Issue 12295017: Use compile type to improve stores to Int32List and Uint32List on ia32. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « no previous file | no next file » | 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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1307 case kInt8ArrayCid: 1307 case kInt8ArrayCid:
1308 case kUint8ArrayCid: 1308 case kUint8ArrayCid:
1309 case kExternalUint8ArrayCid: 1309 case kExternalUint8ArrayCid:
1310 case kUint8ClampedArrayCid: 1310 case kUint8ClampedArrayCid:
1311 case kExternalUint8ClampedArrayCid: 1311 case kExternalUint8ClampedArrayCid:
1312 case kInt16ArrayCid: 1312 case kInt16ArrayCid:
1313 case kUint16ArrayCid: 1313 case kUint16ArrayCid:
1314 return kTagged; 1314 return kTagged;
1315 case kInt32ArrayCid: 1315 case kInt32ArrayCid:
1316 case kUint32ArrayCid: 1316 case kUint32ArrayCid:
1317 return kUnboxedMint; 1317 return (value()->Type()->ToCid() == kSmiCid) ? kTagged : kUnboxedMint;
1318 case kFloat32ArrayCid : 1318 case kFloat32ArrayCid :
1319 case kFloat64ArrayCid : 1319 case kFloat64ArrayCid :
1320 return kUnboxedDouble; 1320 return kUnboxedDouble;
1321 default: 1321 default:
1322 UNIMPLEMENTED(); 1322 UNIMPLEMENTED();
1323 return kTagged; 1323 return kTagged;
1324 } 1324 }
1325 } 1325 }
1326 1326
1327 1327
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 case kUint8ClampedArrayCid: 1361 case kUint8ClampedArrayCid:
1362 // TODO(fschneider): Add location constraint for byte registers (EAX, 1362 // TODO(fschneider): Add location constraint for byte registers (EAX,
1363 // EBX, ECX, EDX) instead of using a fixed register. 1363 // EBX, ECX, EDX) instead of using a fixed register.
1364 locs->set_in(2, Location::FixedRegisterOrSmiConstant(value(), EAX)); 1364 locs->set_in(2, Location::FixedRegisterOrSmiConstant(value(), EAX));
1365 break; 1365 break;
1366 case kInt16ArrayCid: 1366 case kInt16ArrayCid:
1367 case kUint16ArrayCid: 1367 case kUint16ArrayCid:
1368 // Writable register because the value must be untagged before storing. 1368 // Writable register because the value must be untagged before storing.
1369 locs->set_in(2, Location::WritableRegister()); 1369 locs->set_in(2, Location::WritableRegister());
1370 break; 1370 break;
1371 case kInt32ArrayCid:
1372 case kUint32ArrayCid:
1373 // Mints are stored in XMM registers. For smis, use a writable register
1374 // because the value must be untagged before storing.
1375 locs->set_in(2, (RequiredInputRepresentation(2) == kUnboxedMint)
1376 ? Location::RequiresFpuRegister()
1377 : Location::WritableRegister());
1378 break;
1371 case kFloat32ArrayCid: 1379 case kFloat32ArrayCid:
1372 // Need temp register for float-to-double conversion. 1380 // Need temp register for float-to-double conversion.
1373 locs->AddTemp(Location::RequiresFpuRegister()); 1381 locs->AddTemp(Location::RequiresFpuRegister());
1374 // Fall through. 1382 // Fall through.
1375 case kInt32ArrayCid:
1376 case kUint32ArrayCid:
1377 case kFloat64ArrayCid: 1383 case kFloat64ArrayCid:
1378 // TODO(srdjan): Support Float64 constants. 1384 // TODO(srdjan): Support Float64 constants.
1379 locs->set_in(2, Location::RequiresFpuRegister()); 1385 locs->set_in(2, Location::RequiresFpuRegister());
1380 break; 1386 break;
1381 default: 1387 default:
1382 UNREACHABLE(); 1388 UNREACHABLE();
1383 return NULL; 1389 return NULL;
1384 } 1390 }
1385 return locs; 1391 return locs;
1386 } 1392 }
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 } 1482 }
1477 case kInt16ArrayCid: 1483 case kInt16ArrayCid:
1478 case kUint16ArrayCid: { 1484 case kUint16ArrayCid: {
1479 Register value = locs()->in(2).reg(); 1485 Register value = locs()->in(2).reg();
1480 __ SmiUntag(value); 1486 __ SmiUntag(value);
1481 __ movw(element_address, value); 1487 __ movw(element_address, value);
1482 break; 1488 break;
1483 } 1489 }
1484 case kInt32ArrayCid: 1490 case kInt32ArrayCid:
1485 case kUint32ArrayCid: 1491 case kUint32ArrayCid:
1492 if (RequiredInputRepresentation(2) == kTagged) {
Vyacheslav Egorov (Google) 2013/02/18 16:21:44 I suggest you encapsulate this check (and two abov
Florian Schneider 2013/02/18 16:33:31 Done.
1493 Register value = locs()->in(2).reg();
1494 __ SmiUntag(value);
1495 __ movl(element_address, value);
1496 } else {
1497 ASSERT(RequiredInputRepresentation(2) == kUnboxedMint);
1486 __ movss(element_address, locs()->in(2).fpu_reg()); 1498 __ movss(element_address, locs()->in(2).fpu_reg());
1499 }
1487 break; 1500 break;
1488 case kFloat32ArrayCid: 1501 case kFloat32ArrayCid:
1489 // Convert to single precision. 1502 // Convert to single precision.
1490 __ cvtsd2ss(locs()->temp(0).fpu_reg(), locs()->in(2).fpu_reg()); 1503 __ cvtsd2ss(locs()->temp(0).fpu_reg(), locs()->in(2).fpu_reg());
1491 // Store. 1504 // Store.
1492 __ movss(element_address, locs()->temp(0).fpu_reg()); 1505 __ movss(element_address, locs()->temp(0).fpu_reg());
1493 break; 1506 break;
1494 case kFloat64ArrayCid: 1507 case kFloat64ArrayCid:
1495 __ movsd(element_address, locs()->in(2).fpu_reg()); 1508 __ movsd(element_address, locs()->in(2).fpu_reg());
1496 break; 1509 break;
(...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after
3480 PcDescriptors::kOther, 3493 PcDescriptors::kOther,
3481 locs()); 3494 locs());
3482 __ Drop(2); // Discard type arguments and receiver. 3495 __ Drop(2); // Discard type arguments and receiver.
3483 } 3496 }
3484 3497
3485 } // namespace dart 3498 } // namespace dart
3486 3499
3487 #undef __ 3500 #undef __
3488 3501
3489 #endif // defined TARGET_ARCH_IA32 3502 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698