| 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" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1321 } | 1321 } |
| 1322 | 1322 |
| 1323 | 1323 |
| 1324 Representation StoreIndexedInstr::RequiredInputRepresentation( | 1324 Representation StoreIndexedInstr::RequiredInputRepresentation( |
| 1325 intptr_t idx) const { | 1325 intptr_t idx) const { |
| 1326 if (idx == 0) return kNoRepresentation; | 1326 if (idx == 0) return kNoRepresentation; |
| 1327 if (idx == 1) return kTagged; | 1327 if (idx == 1) return kTagged; |
| 1328 ASSERT(idx == 2); | 1328 ASSERT(idx == 2); |
| 1329 switch (class_id_) { | 1329 switch (class_id_) { |
| 1330 case kArrayCid: | 1330 case kArrayCid: |
| 1331 case kOneByteStringCid: |
| 1331 case kTypedDataInt8ArrayCid: | 1332 case kTypedDataInt8ArrayCid: |
| 1332 case kTypedDataUint8ArrayCid: | 1333 case kTypedDataUint8ArrayCid: |
| 1333 case kExternalTypedDataUint8ArrayCid: | 1334 case kExternalTypedDataUint8ArrayCid: |
| 1334 case kTypedDataUint8ClampedArrayCid: | 1335 case kTypedDataUint8ClampedArrayCid: |
| 1335 case kExternalTypedDataUint8ClampedArrayCid: | 1336 case kExternalTypedDataUint8ClampedArrayCid: |
| 1336 case kTypedDataInt16ArrayCid: | 1337 case kTypedDataInt16ArrayCid: |
| 1337 case kTypedDataUint16ArrayCid: | 1338 case kTypedDataUint16ArrayCid: |
| 1338 case kTypedDataInt32ArrayCid: | 1339 case kTypedDataInt32ArrayCid: |
| 1339 case kTypedDataUint32ArrayCid: | 1340 case kTypedDataUint32ArrayCid: |
| 1340 return kTagged; | 1341 return kTagged; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 case kArrayCid: | 1374 case kArrayCid: |
| 1374 locs->set_in(2, ShouldEmitStoreBarrier() | 1375 locs->set_in(2, ShouldEmitStoreBarrier() |
| 1375 ? Location::WritableRegister() | 1376 ? Location::WritableRegister() |
| 1376 : Location::RegisterOrConstant(value())); | 1377 : Location::RegisterOrConstant(value())); |
| 1377 break; | 1378 break; |
| 1378 case kExternalTypedDataUint8ArrayCid: | 1379 case kExternalTypedDataUint8ArrayCid: |
| 1379 case kExternalTypedDataUint8ClampedArrayCid: | 1380 case kExternalTypedDataUint8ClampedArrayCid: |
| 1380 case kTypedDataInt8ArrayCid: | 1381 case kTypedDataInt8ArrayCid: |
| 1381 case kTypedDataUint8ArrayCid: | 1382 case kTypedDataUint8ArrayCid: |
| 1382 case kTypedDataUint8ClampedArrayCid: | 1383 case kTypedDataUint8ClampedArrayCid: |
| 1384 case kOneByteStringCid: |
| 1383 // TODO(fschneider): Add location constraint for byte registers (RAX, | 1385 // TODO(fschneider): Add location constraint for byte registers (RAX, |
| 1384 // RBX, RCX, RDX) instead of using a fixed register. | 1386 // RBX, RCX, RDX) instead of using a fixed register. |
| 1385 locs->set_in(2, Location::FixedRegisterOrSmiConstant(value(), RAX)); | 1387 locs->set_in(2, Location::FixedRegisterOrSmiConstant(value(), RAX)); |
| 1386 break; | 1388 break; |
| 1387 case kTypedDataInt16ArrayCid: | 1389 case kTypedDataInt16ArrayCid: |
| 1388 case kTypedDataUint16ArrayCid: | 1390 case kTypedDataUint16ArrayCid: |
| 1389 case kTypedDataInt32ArrayCid: | 1391 case kTypedDataInt32ArrayCid: |
| 1390 case kTypedDataUint32ArrayCid: | 1392 case kTypedDataUint32ArrayCid: |
| 1391 // Writable register because the value must be untagged before storing. | 1393 // Writable register because the value must be untagged before storing. |
| 1392 locs->set_in(2, Location::WritableRegister()); | 1394 locs->set_in(2, Location::WritableRegister()); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1445 const Object& constant = locs()->in(2).constant(); | 1447 const Object& constant = locs()->in(2).constant(); |
| 1446 __ StoreObject(element_address, constant); | 1448 __ StoreObject(element_address, constant); |
| 1447 } else { | 1449 } else { |
| 1448 Register value = locs()->in(2).reg(); | 1450 Register value = locs()->in(2).reg(); |
| 1449 __ StoreIntoObjectNoBarrier(array, element_address, value); | 1451 __ StoreIntoObjectNoBarrier(array, element_address, value); |
| 1450 } | 1452 } |
| 1451 break; | 1453 break; |
| 1452 case kTypedDataInt8ArrayCid: | 1454 case kTypedDataInt8ArrayCid: |
| 1453 case kTypedDataUint8ArrayCid: | 1455 case kTypedDataUint8ArrayCid: |
| 1454 case kExternalTypedDataUint8ArrayCid: | 1456 case kExternalTypedDataUint8ArrayCid: |
| 1457 case kOneByteStringCid: |
| 1455 if (locs()->in(2).IsConstant()) { | 1458 if (locs()->in(2).IsConstant()) { |
| 1456 const Smi& constant = Smi::Cast(locs()->in(2).constant()); | 1459 const Smi& constant = Smi::Cast(locs()->in(2).constant()); |
| 1457 __ movb(element_address, | 1460 __ movb(element_address, |
| 1458 Immediate(static_cast<int8_t>(constant.Value()))); | 1461 Immediate(static_cast<int8_t>(constant.Value()))); |
| 1459 } else { | 1462 } else { |
| 1460 ASSERT(locs()->in(2).reg() == RAX); | 1463 ASSERT(locs()->in(2).reg() == RAX); |
| 1461 __ SmiUntag(RAX); | 1464 __ SmiUntag(RAX); |
| 1462 __ movb(element_address, RAX); | 1465 __ movb(element_address, RAX); |
| 1463 } | 1466 } |
| 1464 break; | 1467 break; |
| (...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4049 PcDescriptors::kOther, | 4052 PcDescriptors::kOther, |
| 4050 locs()); | 4053 locs()); |
| 4051 __ Drop(2); // Discard type arguments and receiver. | 4054 __ Drop(2); // Discard type arguments and receiver. |
| 4052 } | 4055 } |
| 4053 | 4056 |
| 4054 } // namespace dart | 4057 } // namespace dart |
| 4055 | 4058 |
| 4056 #undef __ | 4059 #undef __ |
| 4057 | 4060 |
| 4058 #endif // defined TARGET_ARCH_X64 | 4061 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |