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

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

Issue 14917020: Inline _OneByteString._setAt. The key knowledge is that _setAt is an internal method that has to be… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.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_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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1338 1338
1339 1339
1340 Representation StoreIndexedInstr::RequiredInputRepresentation( 1340 Representation StoreIndexedInstr::RequiredInputRepresentation(
1341 intptr_t idx) const { 1341 intptr_t idx) const {
1342 // Array can be a Dart object or a pointer to external data. 1342 // Array can be a Dart object or a pointer to external data.
1343 if (idx == 0) return kNoRepresentation; // Flexible input representation. 1343 if (idx == 0) return kNoRepresentation; // Flexible input representation.
1344 if (idx == 1) return kTagged; // Index is a smi. 1344 if (idx == 1) return kTagged; // Index is a smi.
1345 ASSERT(idx == 2); 1345 ASSERT(idx == 2);
1346 switch (class_id_) { 1346 switch (class_id_) {
1347 case kArrayCid: 1347 case kArrayCid:
1348 case kOneByteStringCid:
1348 case kTypedDataInt8ArrayCid: 1349 case kTypedDataInt8ArrayCid:
1349 case kTypedDataUint8ArrayCid: 1350 case kTypedDataUint8ArrayCid:
1350 case kExternalTypedDataUint8ArrayCid: 1351 case kExternalTypedDataUint8ArrayCid:
1351 case kTypedDataUint8ClampedArrayCid: 1352 case kTypedDataUint8ClampedArrayCid:
1352 case kExternalTypedDataUint8ClampedArrayCid: 1353 case kExternalTypedDataUint8ClampedArrayCid:
1353 case kTypedDataInt16ArrayCid: 1354 case kTypedDataInt16ArrayCid:
1354 case kTypedDataUint16ArrayCid: 1355 case kTypedDataUint16ArrayCid:
1355 return kTagged; 1356 return kTagged;
1356 case kTypedDataInt32ArrayCid: 1357 case kTypedDataInt32ArrayCid:
1357 case kTypedDataUint32ArrayCid: 1358 case kTypedDataUint32ArrayCid:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 case kArrayCid: 1392 case kArrayCid:
1392 locs->set_in(2, ShouldEmitStoreBarrier() 1393 locs->set_in(2, ShouldEmitStoreBarrier()
1393 ? Location::WritableRegister() 1394 ? Location::WritableRegister()
1394 : Location::RegisterOrConstant(value())); 1395 : Location::RegisterOrConstant(value()));
1395 break; 1396 break;
1396 case kExternalTypedDataUint8ArrayCid: 1397 case kExternalTypedDataUint8ArrayCid:
1397 case kExternalTypedDataUint8ClampedArrayCid: 1398 case kExternalTypedDataUint8ClampedArrayCid:
1398 case kTypedDataInt8ArrayCid: 1399 case kTypedDataInt8ArrayCid:
1399 case kTypedDataUint8ArrayCid: 1400 case kTypedDataUint8ArrayCid:
1400 case kTypedDataUint8ClampedArrayCid: 1401 case kTypedDataUint8ClampedArrayCid:
1402 case kOneByteStringCid:
1401 // TODO(fschneider): Add location constraint for byte registers (EAX, 1403 // TODO(fschneider): Add location constraint for byte registers (EAX,
1402 // EBX, ECX, EDX) instead of using a fixed register. 1404 // EBX, ECX, EDX) instead of using a fixed register.
1403 locs->set_in(2, Location::FixedRegisterOrSmiConstant(value(), EAX)); 1405 locs->set_in(2, Location::FixedRegisterOrSmiConstant(value(), EAX));
1404 break; 1406 break;
1405 case kTypedDataInt16ArrayCid: 1407 case kTypedDataInt16ArrayCid:
1406 case kTypedDataUint16ArrayCid: 1408 case kTypedDataUint16ArrayCid:
1407 // Writable register because the value must be untagged before storing. 1409 // Writable register because the value must be untagged before storing.
1408 locs->set_in(2, Location::WritableRegister()); 1410 locs->set_in(2, Location::WritableRegister());
1409 break; 1411 break;
1410 case kTypedDataInt32ArrayCid: 1412 case kTypedDataInt32ArrayCid:
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 const Object& constant = locs()->in(2).constant(); 1469 const Object& constant = locs()->in(2).constant();
1468 __ StoreIntoObjectNoBarrier(array, element_address, constant); 1470 __ StoreIntoObjectNoBarrier(array, element_address, constant);
1469 } else { 1471 } else {
1470 Register value = locs()->in(2).reg(); 1472 Register value = locs()->in(2).reg();
1471 __ StoreIntoObjectNoBarrier(array, element_address, value); 1473 __ StoreIntoObjectNoBarrier(array, element_address, value);
1472 } 1474 }
1473 break; 1475 break;
1474 case kTypedDataInt8ArrayCid: 1476 case kTypedDataInt8ArrayCid:
1475 case kTypedDataUint8ArrayCid: 1477 case kTypedDataUint8ArrayCid:
1476 case kExternalTypedDataUint8ArrayCid: 1478 case kExternalTypedDataUint8ArrayCid:
1479 case kOneByteStringCid:
1477 if (locs()->in(2).IsConstant()) { 1480 if (locs()->in(2).IsConstant()) {
1478 const Smi& constant = Smi::Cast(locs()->in(2).constant()); 1481 const Smi& constant = Smi::Cast(locs()->in(2).constant());
1479 __ movb(element_address, 1482 __ movb(element_address,
1480 Immediate(static_cast<int8_t>(constant.Value()))); 1483 Immediate(static_cast<int8_t>(constant.Value())));
1481 } else { 1484 } else {
1482 ASSERT(locs()->in(2).reg() == EAX); 1485 ASSERT(locs()->in(2).reg() == EAX);
1483 __ SmiUntag(EAX); 1486 __ SmiUntag(EAX);
1484 __ movb(element_address, AL); 1487 __ movb(element_address, AL);
1485 } 1488 }
1486 break; 1489 break;
(...skipping 2936 matching lines...) Expand 10 before | Expand all | Expand 10 after
4423 PcDescriptors::kOther, 4426 PcDescriptors::kOther,
4424 locs()); 4427 locs());
4425 __ Drop(2); // Discard type arguments and receiver. 4428 __ Drop(2); // Discard type arguments and receiver.
4426 } 4429 }
4427 4430
4428 } // namespace dart 4431 } // namespace dart
4429 4432
4430 #undef __ 4433 #undef __
4431 4434
4432 #endif // defined TARGET_ARCH_IA32 4435 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698