Chromium Code Reviews| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1233 if (!Utils::IsInt(32, offset)) { | 1233 if (!Utils::IsInt(32, offset)) { |
| 1234 return false; | 1234 return false; |
| 1235 } | 1235 } |
| 1236 return Address::CanHoldOffset(static_cast<int32_t>(offset)); | 1236 return Address::CanHoldOffset(static_cast<int32_t>(offset)); |
| 1237 } | 1237 } |
| 1238 | 1238 |
| 1239 | 1239 |
| 1240 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone, | 1240 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone, |
| 1241 bool opt) const { | 1241 bool opt) const { |
| 1242 const intptr_t kNumInputs = 2; | 1242 const intptr_t kNumInputs = 2; |
| 1243 const intptr_t kNumTemps = 0; | 1243 const intptr_t kNumTemps = aligned() ? 0 : 1; |
| 1244 LocationSummary* locs = new(zone) LocationSummary( | 1244 LocationSummary* locs = new(zone) LocationSummary( |
| 1245 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1245 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1246 locs->set_in(0, Location::RequiresRegister()); | 1246 locs->set_in(0, Location::RequiresRegister()); |
| 1247 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1247 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
| 1248 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1248 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
| 1249 } else { | 1249 } else { |
| 1250 locs->set_in(1, Location::RequiresRegister()); | 1250 locs->set_in(1, Location::RequiresRegister()); |
| 1251 } | 1251 } |
| 1252 if ((representation() == kUnboxedDouble) || | 1252 if ((representation() == kUnboxedDouble) || |
| 1253 (representation() == kUnboxedFloat32x4) || | 1253 (representation() == kUnboxedFloat32x4) || |
| 1254 (representation() == kUnboxedInt32x4)) { | 1254 (representation() == kUnboxedInt32x4)) { |
| 1255 locs->set_out(0, Location::RequiresFpuRegister()); | 1255 locs->set_out(0, Location::RequiresFpuRegister()); |
| 1256 } else { | 1256 } else { |
| 1257 locs->set_out(0, Location::RequiresRegister()); | 1257 locs->set_out(0, Location::RequiresRegister()); |
| 1258 } | 1258 } |
| 1259 if (!aligned()) { | |
| 1260 locs->set_temp(0, Location::RequiresRegister()); | |
| 1261 } | |
| 1259 return locs; | 1262 return locs; |
| 1260 } | 1263 } |
| 1261 | 1264 |
| 1262 | 1265 |
| 1263 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1266 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1264 __ Comment("LoadIndexedInstr"); | 1267 __ Comment("LoadIndexedInstr"); |
| 1265 // The array register points to the backing store for external arrays. | 1268 // The array register points to the backing store for external arrays. |
| 1266 const Register array = locs()->in(0).reg(); | 1269 const Register array = locs()->in(0).reg(); |
| 1267 const Location index = locs()->in(1); | 1270 const Location index = locs()->in(1); |
| 1271 const Register address = aligned() ? kNoRegister : locs()->temp(0).reg(); | |
| 1268 | 1272 |
| 1269 Address element_address = index.IsRegister() | 1273 Address element_address(TMP); |
|
zra
2016/10/26 06:59:41
ditto
| |
| 1274 if (aligned()) { | |
| 1275 element_address = index.IsRegister() | |
| 1270 ? __ ElementAddressForRegIndex(true, // Load. | 1276 ? __ ElementAddressForRegIndex(true, // Load. |
| 1271 IsExternal(), class_id(), index_scale(), | 1277 IsExternal(), class_id(), index_scale(), |
| 1272 array, index.reg()) | 1278 array, index.reg()) |
| 1273 : __ ElementAddressForIntIndex( | 1279 : __ ElementAddressForIntIndex( |
| 1274 IsExternal(), class_id(), index_scale(), | 1280 IsExternal(), class_id(), index_scale(), |
| 1275 array, Smi::Cast(index.constant()).Value()); | 1281 array, Smi::Cast(index.constant()).Value()); |
| 1276 // Warning: element_address may use register TMP as base. | 1282 // Warning: element_address may use register TMP as base. |
| 1283 } else { | |
| 1284 if (index.IsRegister()) { | |
| 1285 __ LoadElementAddressForRegIndex(address, | |
| 1286 true, // Load. | |
| 1287 IsExternal(), class_id(), index_scale(), | |
| 1288 array, index.reg()); | |
| 1289 } else { | |
| 1290 __ LoadElementAddressForIntIndex(address, | |
| 1291 IsExternal(), class_id(), index_scale(), | |
| 1292 array, | |
| 1293 Smi::Cast(index.constant()).Value()); | |
| 1294 } | |
| 1295 } | |
| 1277 | 1296 |
| 1278 if ((representation() == kUnboxedDouble) || | 1297 if ((representation() == kUnboxedDouble) || |
| 1279 (representation() == kUnboxedFloat32x4) || | 1298 (representation() == kUnboxedFloat32x4) || |
| 1280 (representation() == kUnboxedInt32x4)) { | 1299 (representation() == kUnboxedInt32x4)) { |
| 1281 DRegister result = locs()->out(0).fpu_reg(); | 1300 DRegister result = locs()->out(0).fpu_reg(); |
| 1282 switch (class_id()) { | 1301 switch (class_id()) { |
| 1283 case kTypedDataFloat32ArrayCid: | 1302 case kTypedDataFloat32ArrayCid: |
| 1284 // Load single precision float. | 1303 // Load single precision float. |
| 1285 __ lwc1(EvenFRegisterOf(result), element_address); | 1304 __ lwc1(EvenFRegisterOf(result), element_address); |
| 1286 break; | 1305 break; |
| 1287 case kTypedDataFloat64ArrayCid: | 1306 case kTypedDataFloat64ArrayCid: |
| 1288 __ LoadDFromOffset(result, | 1307 __ LoadDFromOffset(result, |
| 1289 element_address.base(), element_address.offset()); | 1308 element_address.base(), element_address.offset()); |
| 1290 break; | 1309 break; |
| 1291 case kTypedDataInt32x4ArrayCid: | 1310 case kTypedDataInt32x4ArrayCid: |
| 1292 case kTypedDataFloat32x4ArrayCid: | 1311 case kTypedDataFloat32x4ArrayCid: |
| 1293 UNIMPLEMENTED(); | 1312 UNIMPLEMENTED(); |
| 1294 break; | 1313 break; |
| 1295 } | 1314 } |
| 1296 return; | 1315 return; |
| 1297 } | 1316 } |
| 1298 | 1317 |
| 1299 if ((representation() == kUnboxedUint32) || | 1318 if ((representation() == kUnboxedUint32) || |
| 1300 (representation() == kUnboxedInt32)) { | 1319 (representation() == kUnboxedInt32)) { |
| 1301 const Register result = locs()->out(0).reg(); | 1320 const Register result = locs()->out(0).reg(); |
| 1302 switch (class_id()) { | 1321 switch (class_id()) { |
| 1303 case kTypedDataInt32ArrayCid: | 1322 case kTypedDataInt32ArrayCid: |
| 1304 ASSERT(representation() == kUnboxedInt32); | 1323 ASSERT(representation() == kUnboxedInt32); |
| 1305 __ lw(result, element_address); | 1324 if (aligned()) { |
| 1325 __ lw(result, element_address); | |
| 1326 } else { | |
| 1327 __ LoadWordUnaligned(result, address, TMP); | |
| 1328 } | |
| 1306 break; | 1329 break; |
| 1307 case kTypedDataUint32ArrayCid: | 1330 case kTypedDataUint32ArrayCid: |
| 1308 ASSERT(representation() == kUnboxedUint32); | 1331 ASSERT(representation() == kUnboxedUint32); |
| 1309 __ lw(result, element_address); | 1332 if (aligned()) { |
| 1333 __ lw(result, element_address); | |
| 1334 } else { | |
| 1335 __ LoadWordUnaligned(result, address, TMP); | |
| 1336 } | |
| 1310 break; | 1337 break; |
| 1311 default: | 1338 default: |
| 1312 UNREACHABLE(); | 1339 UNREACHABLE(); |
| 1313 } | 1340 } |
| 1314 return; | 1341 return; |
| 1315 } | 1342 } |
| 1316 | 1343 |
| 1317 ASSERT(representation() == kTagged); | 1344 ASSERT(representation() == kTagged); |
| 1318 | 1345 |
| 1319 const Register result = locs()->out(0).reg(); | 1346 const Register result = locs()->out(0).reg(); |
| 1320 switch (class_id()) { | 1347 switch (class_id()) { |
| 1321 case kTypedDataInt8ArrayCid: | 1348 case kTypedDataInt8ArrayCid: |
| 1322 ASSERT(index_scale() == 1); | 1349 ASSERT(index_scale() == 1); |
| 1323 __ lb(result, element_address); | 1350 __ lb(result, element_address); |
| 1324 __ SmiTag(result); | 1351 __ SmiTag(result); |
| 1325 break; | 1352 break; |
| 1326 case kTypedDataUint8ArrayCid: | 1353 case kTypedDataUint8ArrayCid: |
| 1327 case kTypedDataUint8ClampedArrayCid: | 1354 case kTypedDataUint8ClampedArrayCid: |
| 1328 case kExternalTypedDataUint8ArrayCid: | 1355 case kExternalTypedDataUint8ArrayCid: |
| 1329 case kExternalTypedDataUint8ClampedArrayCid: | 1356 case kExternalTypedDataUint8ClampedArrayCid: |
| 1330 case kOneByteStringCid: | 1357 case kOneByteStringCid: |
| 1331 case kExternalOneByteStringCid: | 1358 case kExternalOneByteStringCid: |
| 1332 ASSERT(index_scale() == 1); | 1359 ASSERT(index_scale() == 1); |
| 1333 __ lbu(result, element_address); | 1360 __ lbu(result, element_address); |
| 1334 __ SmiTag(result); | 1361 __ SmiTag(result); |
| 1335 break; | 1362 break; |
| 1336 case kTypedDataInt16ArrayCid: | 1363 case kTypedDataInt16ArrayCid: |
| 1337 __ lh(result, element_address); | 1364 if (aligned()) { |
| 1365 __ lh(result, element_address); | |
| 1366 } else { | |
| 1367 __ LoadHalfWordUnaligned(result, address, TMP); | |
| 1368 } | |
| 1338 __ SmiTag(result); | 1369 __ SmiTag(result); |
| 1339 break; | 1370 break; |
| 1340 case kTypedDataUint16ArrayCid: | 1371 case kTypedDataUint16ArrayCid: |
| 1341 case kTwoByteStringCid: | 1372 case kTwoByteStringCid: |
| 1342 case kExternalTwoByteStringCid: | 1373 case kExternalTwoByteStringCid: |
| 1343 __ lhu(result, element_address); | 1374 if (aligned()) { |
| 1375 __ lhu(result, element_address); | |
| 1376 } else { | |
| 1377 __ LoadHalfWordUnsignedUnaligned(result, address, TMP); | |
| 1378 } | |
| 1344 __ SmiTag(result); | 1379 __ SmiTag(result); |
| 1345 break; | 1380 break; |
| 1346 default: | 1381 default: |
| 1347 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid)); | 1382 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid)); |
| 1383 ASSERT(aligned()); | |
| 1348 __ lw(result, element_address); | 1384 __ lw(result, element_address); |
| 1349 break; | 1385 break; |
| 1350 } | 1386 } |
| 1351 } | 1387 } |
| 1352 | 1388 |
| 1353 | 1389 |
| 1354 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone, | 1390 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone, |
| 1355 bool opt) const { | 1391 bool opt) const { |
| 1356 const intptr_t kNumInputs = 2; | 1392 const intptr_t kNumInputs = 2; |
| 1357 const intptr_t kNumTemps = 0; | 1393 const intptr_t kNumTemps = 0; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1437 default: | 1473 default: |
| 1438 UNIMPLEMENTED(); | 1474 UNIMPLEMENTED(); |
| 1439 return kTagged; | 1475 return kTagged; |
| 1440 } | 1476 } |
| 1441 } | 1477 } |
| 1442 | 1478 |
| 1443 | 1479 |
| 1444 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, | 1480 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, |
| 1445 bool opt) const { | 1481 bool opt) const { |
| 1446 const intptr_t kNumInputs = 3; | 1482 const intptr_t kNumInputs = 3; |
| 1447 const intptr_t kNumTemps = 0; | 1483 const intptr_t kNumTemps = aligned() ? 0 : 2; |
| 1448 LocationSummary* locs = new(zone) LocationSummary( | 1484 LocationSummary* locs = new(zone) LocationSummary( |
| 1449 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1485 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1450 locs->set_in(0, Location::RequiresRegister()); | 1486 locs->set_in(0, Location::RequiresRegister()); |
| 1451 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1487 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
| 1452 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1488 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
| 1453 } else { | 1489 } else { |
| 1454 locs->set_in(1, Location::WritableRegister()); | 1490 locs->set_in(1, Location::WritableRegister()); |
| 1455 } | 1491 } |
| 1456 switch (class_id()) { | 1492 switch (class_id()) { |
| 1457 case kArrayCid: | 1493 case kArrayCid: |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 1474 case kTypedDataFloat32ArrayCid: | 1510 case kTypedDataFloat32ArrayCid: |
| 1475 case kTypedDataFloat64ArrayCid: // TODO(srdjan): Support Float64 constants. | 1511 case kTypedDataFloat64ArrayCid: // TODO(srdjan): Support Float64 constants. |
| 1476 case kTypedDataInt32x4ArrayCid: | 1512 case kTypedDataInt32x4ArrayCid: |
| 1477 case kTypedDataFloat32x4ArrayCid: | 1513 case kTypedDataFloat32x4ArrayCid: |
| 1478 locs->set_in(2, Location::RequiresFpuRegister()); | 1514 locs->set_in(2, Location::RequiresFpuRegister()); |
| 1479 break; | 1515 break; |
| 1480 default: | 1516 default: |
| 1481 UNREACHABLE(); | 1517 UNREACHABLE(); |
| 1482 return NULL; | 1518 return NULL; |
| 1483 } | 1519 } |
| 1520 if (!aligned()) { | |
| 1521 locs->set_temp(0, Location::RequiresRegister()); | |
| 1522 locs->set_temp(1, Location::RequiresRegister()); | |
| 1523 } | |
| 1484 return locs; | 1524 return locs; |
| 1485 } | 1525 } |
| 1486 | 1526 |
| 1487 | 1527 |
| 1488 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1528 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1489 __ Comment("StoreIndexedInstr"); | 1529 __ Comment("StoreIndexedInstr"); |
| 1490 // The array register points to the backing store for external arrays. | 1530 // The array register points to the backing store for external arrays. |
| 1491 const Register array = locs()->in(0).reg(); | 1531 const Register array = locs()->in(0).reg(); |
| 1492 const Location index = locs()->in(1); | 1532 const Location index = locs()->in(1); |
| 1533 const Register address = aligned() ? kNoRegister : locs()->temp(0).reg(); | |
| 1534 const Register scratch = aligned() ? kNoRegister : locs()->temp(1).reg(); | |
| 1493 | 1535 |
| 1494 Address element_address = index.IsRegister() | 1536 Address element_address(TMP); |
|
zra
2016/10/26 06:59:41
ditto
| |
| 1537 if (aligned()) { | |
| 1538 element_address = index.IsRegister() | |
| 1495 ? __ ElementAddressForRegIndex(false, // Store. | 1539 ? __ ElementAddressForRegIndex(false, // Store. |
| 1496 IsExternal(), class_id(), index_scale(), | 1540 IsExternal(), class_id(), index_scale(), |
| 1497 array, index.reg()) | 1541 array, index.reg()) |
| 1498 : __ ElementAddressForIntIndex( | 1542 : __ ElementAddressForIntIndex( |
| 1499 IsExternal(), class_id(), index_scale(), | 1543 IsExternal(), class_id(), index_scale(), |
| 1500 array, Smi::Cast(index.constant()).Value()); | 1544 array, Smi::Cast(index.constant()).Value()); |
| 1501 ASSERT(element_address.base() != TMP); // Allowed for load only. | 1545 ASSERT(element_address.base() != TMP); // Allowed for load only. |
| 1546 } else { | |
| 1547 if (index.IsRegister()) { | |
| 1548 __ LoadElementAddressForRegIndex(address, | |
| 1549 false, // Store. | |
| 1550 IsExternal(), class_id(), index_scale(), | |
| 1551 array, index.reg()); | |
| 1552 } else { | |
| 1553 __ LoadElementAddressForIntIndex(address, | |
| 1554 IsExternal(), class_id(), index_scale(), | |
| 1555 array, | |
| 1556 Smi::Cast(index.constant()).Value()); | |
| 1557 } | |
| 1558 } | |
| 1502 | 1559 |
| 1503 switch (class_id()) { | 1560 switch (class_id()) { |
| 1504 case kArrayCid: | 1561 case kArrayCid: |
| 1562 ASSERT(aligned()); | |
| 1563 __ Comment("KArrayCid"); | |
|
zra
2016/10/26 06:59:41
Leftover debug print?
rmacnak
2016/10/31 22:57:26
Removed.
| |
| 1505 if (ShouldEmitStoreBarrier()) { | 1564 if (ShouldEmitStoreBarrier()) { |
| 1506 Register value = locs()->in(2).reg(); | 1565 Register value = locs()->in(2).reg(); |
| 1507 __ StoreIntoObject(array, element_address, value); | 1566 __ StoreIntoObject(array, element_address, value); |
| 1508 } else if (locs()->in(2).IsConstant()) { | 1567 } else if (locs()->in(2).IsConstant()) { |
| 1509 const Object& constant = locs()->in(2).constant(); | 1568 const Object& constant = locs()->in(2).constant(); |
| 1510 __ StoreIntoObjectNoBarrier(array, element_address, constant); | 1569 __ StoreIntoObjectNoBarrier(array, element_address, constant); |
| 1511 } else { | 1570 } else { |
| 1512 Register value = locs()->in(2).reg(); | 1571 Register value = locs()->in(2).reg(); |
| 1513 __ StoreIntoObjectNoBarrier(array, element_address, value); | 1572 __ StoreIntoObjectNoBarrier(array, element_address, value); |
| 1514 } | 1573 } |
| 1515 break; | 1574 break; |
| 1516 case kTypedDataInt8ArrayCid: | 1575 case kTypedDataInt8ArrayCid: |
| 1517 case kTypedDataUint8ArrayCid: | 1576 case kTypedDataUint8ArrayCid: |
| 1518 case kExternalTypedDataUint8ArrayCid: | 1577 case kExternalTypedDataUint8ArrayCid: |
| 1519 case kOneByteStringCid: { | 1578 case kOneByteStringCid: { |
| 1579 ASSERT(aligned()); | |
| 1520 if (locs()->in(2).IsConstant()) { | 1580 if (locs()->in(2).IsConstant()) { |
| 1521 const Smi& constant = Smi::Cast(locs()->in(2).constant()); | 1581 const Smi& constant = Smi::Cast(locs()->in(2).constant()); |
| 1522 __ LoadImmediate(TMP, static_cast<int8_t>(constant.Value())); | 1582 __ LoadImmediate(TMP, static_cast<int8_t>(constant.Value())); |
| 1523 __ sb(TMP, element_address); | 1583 __ sb(TMP, element_address); |
| 1524 } else { | 1584 } else { |
| 1525 Register value = locs()->in(2).reg(); | 1585 Register value = locs()->in(2).reg(); |
| 1526 __ SmiUntag(TMP, value); | 1586 __ SmiUntag(TMP, value); |
| 1527 __ sb(TMP, element_address); | 1587 __ sb(TMP, element_address); |
| 1528 } | 1588 } |
| 1529 break; | 1589 break; |
| 1530 } | 1590 } |
| 1531 case kTypedDataUint8ClampedArrayCid: | 1591 case kTypedDataUint8ClampedArrayCid: |
| 1532 case kExternalTypedDataUint8ClampedArrayCid: { | 1592 case kExternalTypedDataUint8ClampedArrayCid: { |
| 1593 ASSERT(aligned()); | |
| 1533 if (locs()->in(2).IsConstant()) { | 1594 if (locs()->in(2).IsConstant()) { |
| 1534 const Smi& constant = Smi::Cast(locs()->in(2).constant()); | 1595 const Smi& constant = Smi::Cast(locs()->in(2).constant()); |
| 1535 intptr_t value = constant.Value(); | 1596 intptr_t value = constant.Value(); |
| 1536 // Clamp to 0x0 or 0xFF respectively. | 1597 // Clamp to 0x0 or 0xFF respectively. |
| 1537 if (value > 0xFF) { | 1598 if (value > 0xFF) { |
| 1538 value = 0xFF; | 1599 value = 0xFF; |
| 1539 } else if (value < 0) { | 1600 } else if (value < 0) { |
| 1540 value = 0; | 1601 value = 0; |
| 1541 } | 1602 } |
| 1542 __ LoadImmediate(TMP, static_cast<int8_t>(value)); | 1603 __ LoadImmediate(TMP, static_cast<int8_t>(value)); |
| 1543 __ sb(TMP, element_address); | 1604 __ sb(TMP, element_address); |
| 1544 } else { | 1605 } else { |
| 1545 Register value = locs()->in(2).reg(); | 1606 Register value = locs()->in(2).reg(); |
| 1546 Label store_value, bigger, smaller; | 1607 Label store_value, bigger, smaller; |
| 1547 __ SmiUntag(TMP, value); | 1608 __ SmiUntag(TMP, value); |
| 1548 __ BranchUnsignedLess(TMP, Immediate(0xFF + 1), &store_value); | 1609 __ BranchUnsignedLess(TMP, Immediate(0xFF + 1), &store_value); |
| 1549 __ LoadImmediate(TMP, 0xFF); | 1610 __ LoadImmediate(TMP, 0xFF); |
| 1550 __ slti(CMPRES1, value, Immediate(1)); | 1611 __ slti(CMPRES1, value, Immediate(1)); |
| 1551 __ movn(TMP, ZR, CMPRES1); | 1612 __ movn(TMP, ZR, CMPRES1); |
| 1552 __ Bind(&store_value); | 1613 __ Bind(&store_value); |
| 1553 __ sb(TMP, element_address); | 1614 __ sb(TMP, element_address); |
| 1554 } | 1615 } |
| 1555 break; | 1616 break; |
| 1556 } | 1617 } |
| 1557 case kTypedDataInt16ArrayCid: | 1618 case kTypedDataInt16ArrayCid: |
| 1558 case kTypedDataUint16ArrayCid: { | 1619 case kTypedDataUint16ArrayCid: { |
| 1559 Register value = locs()->in(2).reg(); | 1620 Register value = locs()->in(2).reg(); |
| 1560 __ SmiUntag(TMP, value); | 1621 __ SmiUntag(TMP, value); |
| 1561 __ sh(TMP, element_address); | 1622 if (aligned()) { |
| 1623 __ sh(TMP, element_address); | |
| 1624 } else { | |
| 1625 __ StoreHalfWordUnaligned(TMP, address, scratch); | |
| 1626 } | |
| 1562 break; | 1627 break; |
| 1563 } | 1628 } |
| 1564 case kTypedDataInt32ArrayCid: | 1629 case kTypedDataInt32ArrayCid: |
| 1565 case kTypedDataUint32ArrayCid: { | 1630 case kTypedDataUint32ArrayCid: { |
| 1566 __ sw(locs()->in(2).reg(), element_address); | 1631 if (aligned()) { |
| 1632 __ sw(locs()->in(2).reg(), element_address); | |
| 1633 } else { | |
| 1634 __ StoreWordUnaligned(locs()->in(2).reg(), address, scratch); | |
| 1635 } | |
| 1567 break; | 1636 break; |
| 1568 } | 1637 } |
| 1569 case kTypedDataFloat32ArrayCid: { | 1638 case kTypedDataFloat32ArrayCid: { |
| 1639 ASSERT(aligned()); | |
| 1570 FRegister value = EvenFRegisterOf(locs()->in(2).fpu_reg()); | 1640 FRegister value = EvenFRegisterOf(locs()->in(2).fpu_reg()); |
| 1571 __ swc1(value, element_address); | 1641 __ swc1(value, element_address); |
| 1572 break; | 1642 break; |
| 1573 } | 1643 } |
| 1574 case kTypedDataFloat64ArrayCid: | 1644 case kTypedDataFloat64ArrayCid: |
| 1645 ASSERT(aligned()); | |
| 1575 __ StoreDToOffset(locs()->in(2).fpu_reg(), | 1646 __ StoreDToOffset(locs()->in(2).fpu_reg(), |
| 1576 element_address.base(), element_address.offset()); | 1647 element_address.base(), element_address.offset()); |
| 1577 break; | 1648 break; |
| 1578 case kTypedDataInt32x4ArrayCid: | 1649 case kTypedDataInt32x4ArrayCid: |
| 1579 case kTypedDataFloat32x4ArrayCid: | 1650 case kTypedDataFloat32x4ArrayCid: |
| 1580 UNIMPLEMENTED(); | 1651 UNIMPLEMENTED(); |
| 1581 break; | 1652 break; |
| 1582 default: | 1653 default: |
| 1583 UNREACHABLE(); | 1654 UNREACHABLE(); |
| 1584 } | 1655 } |
| (...skipping 4247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5832 1, | 5903 1, |
| 5833 locs()); | 5904 locs()); |
| 5834 __ lw(result, Address(SP, 1 * kWordSize)); | 5905 __ lw(result, Address(SP, 1 * kWordSize)); |
| 5835 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 5906 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 5836 } | 5907 } |
| 5837 | 5908 |
| 5838 | 5909 |
| 5839 } // namespace dart | 5910 } // namespace dart |
| 5840 | 5911 |
| 5841 #endif // defined TARGET_ARCH_MIPS | 5912 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |