| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 } | 1038 } |
| 1039 return Address::CanHoldOffset(static_cast<int32_t>(offset), | 1039 return Address::CanHoldOffset(static_cast<int32_t>(offset), |
| 1040 Address::Offset, | 1040 Address::Offset, |
| 1041 Address::OperandSizeFor(cid)); | 1041 Address::OperandSizeFor(cid)); |
| 1042 } | 1042 } |
| 1043 | 1043 |
| 1044 | 1044 |
| 1045 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone, | 1045 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone, |
| 1046 bool opt) const { | 1046 bool opt) const { |
| 1047 const intptr_t kNumInputs = 2; | 1047 const intptr_t kNumInputs = 2; |
| 1048 const intptr_t kNumTemps = 0; | 1048 const intptr_t kNumTemps = aligned() ? 0 : 1; |
| 1049 LocationSummary* locs = new(zone) LocationSummary( | 1049 LocationSummary* locs = new(zone) LocationSummary( |
| 1050 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1050 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1051 locs->set_in(0, Location::RequiresRegister()); | 1051 locs->set_in(0, Location::RequiresRegister()); |
| 1052 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1052 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
| 1053 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1053 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
| 1054 } else { | 1054 } else { |
| 1055 locs->set_in(1, Location::RequiresRegister()); | 1055 locs->set_in(1, Location::RequiresRegister()); |
| 1056 } | 1056 } |
| 1057 if ((representation() == kUnboxedDouble) || | 1057 if ((representation() == kUnboxedDouble) || |
| 1058 (representation() == kUnboxedFloat32x4) || | 1058 (representation() == kUnboxedFloat32x4) || |
| 1059 (representation() == kUnboxedInt32x4) || | 1059 (representation() == kUnboxedInt32x4) || |
| 1060 (representation() == kUnboxedFloat64x2)) { | 1060 (representation() == kUnboxedFloat64x2)) { |
| 1061 locs->set_out(0, Location::RequiresFpuRegister()); | 1061 locs->set_out(0, Location::RequiresFpuRegister()); |
| 1062 } else { | 1062 } else { |
| 1063 locs->set_out(0, Location::RequiresRegister()); | 1063 locs->set_out(0, Location::RequiresRegister()); |
| 1064 } | 1064 } |
| 1065 if (!aligned()) { |
| 1066 locs->set_temp(0, Location::RequiresRegister()); |
| 1067 } |
| 1065 return locs; | 1068 return locs; |
| 1066 } | 1069 } |
| 1067 | 1070 |
| 1068 | 1071 |
| 1069 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1072 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1070 // The array register points to the backing store for external arrays. | 1073 // The array register points to the backing store for external arrays. |
| 1071 const Register array = locs()->in(0).reg(); | 1074 const Register array = locs()->in(0).reg(); |
| 1072 const Location index = locs()->in(1); | 1075 const Location index = locs()->in(1); |
| 1076 const Register address = aligned() ? kNoRegister : locs()->temp(0).reg(); |
| 1073 | 1077 |
| 1074 Address element_address = index.IsRegister() | 1078 Address element_address(TMP); // Bad address. |
| 1075 ? __ ElementAddressForRegIndex(true, // Load. | 1079 if (aligned()) { |
| 1076 IsExternal(), class_id(), index_scale(), | 1080 element_address = index.IsRegister() |
| 1077 array, index.reg()) | 1081 ? __ ElementAddressForRegIndex(true, // Load. |
| 1078 : __ ElementAddressForIntIndex( | 1082 IsExternal(), class_id(), index_scale(), |
| 1079 IsExternal(), class_id(), index_scale(), | 1083 array, index.reg()) |
| 1080 array, Smi::Cast(index.constant()).Value()); | 1084 : __ ElementAddressForIntIndex( |
| 1081 // Warning: element_address may use register TMP as base. | 1085 IsExternal(), class_id(), index_scale(), |
| 1086 array, Smi::Cast(index.constant()).Value()); |
| 1087 // Warning: element_address may use register TMP as base. |
| 1088 } else { |
| 1089 if (index.IsRegister()) { |
| 1090 __ LoadElementAddressForRegIndex(address, |
| 1091 true, // Load. |
| 1092 IsExternal(), class_id(), index_scale(), |
| 1093 array, index.reg()); |
| 1094 } else { |
| 1095 __ LoadElementAddressForIntIndex(address, |
| 1096 IsExternal(), class_id(), index_scale(), |
| 1097 array, |
| 1098 Smi::Cast(index.constant()).Value()); |
| 1099 } |
| 1100 } |
| 1082 | 1101 |
| 1083 if ((representation() == kUnboxedDouble) || | 1102 if ((representation() == kUnboxedDouble) || |
| 1084 (representation() == kUnboxedFloat32x4) || | 1103 (representation() == kUnboxedFloat32x4) || |
| 1085 (representation() == kUnboxedInt32x4) || | 1104 (representation() == kUnboxedInt32x4) || |
| 1086 (representation() == kUnboxedFloat64x2)) { | 1105 (representation() == kUnboxedFloat64x2)) { |
| 1087 const VRegister result = locs()->out(0).fpu_reg(); | 1106 const VRegister result = locs()->out(0).fpu_reg(); |
| 1088 switch (class_id()) { | 1107 switch (class_id()) { |
| 1108 ASSERT(aligned()); |
| 1089 case kTypedDataFloat32ArrayCid: | 1109 case kTypedDataFloat32ArrayCid: |
| 1090 // Load single precision float. | 1110 // Load single precision float. |
| 1091 __ fldrs(result, element_address); | 1111 __ fldrs(result, element_address); |
| 1092 break; | 1112 break; |
| 1093 case kTypedDataFloat64ArrayCid: | 1113 case kTypedDataFloat64ArrayCid: |
| 1094 // Load double precision float. | 1114 // Load double precision float. |
| 1095 __ fldrd(result, element_address); | 1115 __ fldrd(result, element_address); |
| 1096 break; | 1116 break; |
| 1097 case kTypedDataFloat64x2ArrayCid: | 1117 case kTypedDataFloat64x2ArrayCid: |
| 1098 case kTypedDataInt32x4ArrayCid: | 1118 case kTypedDataInt32x4ArrayCid: |
| 1099 case kTypedDataFloat32x4ArrayCid: | 1119 case kTypedDataFloat32x4ArrayCid: |
| 1100 __ fldrq(result, element_address); | 1120 __ fldrq(result, element_address); |
| 1101 break; | 1121 break; |
| 1102 default: | 1122 default: |
| 1103 UNREACHABLE(); | 1123 UNREACHABLE(); |
| 1104 } | 1124 } |
| 1105 return; | 1125 return; |
| 1106 } | 1126 } |
| 1107 | 1127 |
| 1108 if ((representation() == kUnboxedInt32) || | 1128 if ((representation() == kUnboxedInt32) || |
| 1109 (representation() == kUnboxedUint32)) { | 1129 (representation() == kUnboxedUint32)) { |
| 1110 const Register result = locs()->out(0).reg(); | 1130 const Register result = locs()->out(0).reg(); |
| 1111 switch (class_id()) { | 1131 switch (class_id()) { |
| 1112 case kTypedDataInt32ArrayCid: | 1132 case kTypedDataInt32ArrayCid: |
| 1113 ASSERT(representation() == kUnboxedInt32); | 1133 ASSERT(representation() == kUnboxedInt32); |
| 1114 __ ldr(result, element_address, kWord); | 1134 if (aligned()) { |
| 1135 __ ldr(result, element_address, kWord); |
| 1136 } else { |
| 1137 __ LoadUnaligned(result, address, TMP, kWord); |
| 1138 } |
| 1115 break; | 1139 break; |
| 1116 case kTypedDataUint32ArrayCid: | 1140 case kTypedDataUint32ArrayCid: |
| 1117 ASSERT(representation() == kUnboxedUint32); | 1141 ASSERT(representation() == kUnboxedUint32); |
| 1118 __ ldr(result, element_address, kUnsignedWord); | 1142 if (aligned()) { |
| 1143 __ ldr(result, element_address, kUnsignedWord); |
| 1144 } else { |
| 1145 __ LoadUnaligned(result, address, TMP, kUnsignedWord); |
| 1146 } |
| 1119 break; | 1147 break; |
| 1120 default: | 1148 default: |
| 1121 UNREACHABLE(); | 1149 UNREACHABLE(); |
| 1122 } | 1150 } |
| 1123 return; | 1151 return; |
| 1124 } | 1152 } |
| 1125 | 1153 |
| 1126 ASSERT(representation() == kTagged); | 1154 ASSERT(representation() == kTagged); |
| 1127 const Register result = locs()->out(0).reg(); | 1155 const Register result = locs()->out(0).reg(); |
| 1128 switch (class_id()) { | 1156 switch (class_id()) { |
| 1129 case kTypedDataInt8ArrayCid: | 1157 case kTypedDataInt8ArrayCid: |
| 1130 ASSERT(index_scale() == 1); | 1158 ASSERT(index_scale() == 1); |
| 1131 __ ldr(result, element_address, kByte); | 1159 __ ldr(result, element_address, kByte); |
| 1132 __ SmiTag(result); | 1160 __ SmiTag(result); |
| 1133 break; | 1161 break; |
| 1134 case kTypedDataUint8ArrayCid: | 1162 case kTypedDataUint8ArrayCid: |
| 1135 case kTypedDataUint8ClampedArrayCid: | 1163 case kTypedDataUint8ClampedArrayCid: |
| 1136 case kExternalTypedDataUint8ArrayCid: | 1164 case kExternalTypedDataUint8ArrayCid: |
| 1137 case kExternalTypedDataUint8ClampedArrayCid: | 1165 case kExternalTypedDataUint8ClampedArrayCid: |
| 1138 case kOneByteStringCid: | 1166 case kOneByteStringCid: |
| 1139 case kExternalOneByteStringCid: | 1167 case kExternalOneByteStringCid: |
| 1140 ASSERT(index_scale() == 1); | 1168 ASSERT(index_scale() == 1); |
| 1141 __ ldr(result, element_address, kUnsignedByte); | 1169 __ ldr(result, element_address, kUnsignedByte); |
| 1142 __ SmiTag(result); | 1170 __ SmiTag(result); |
| 1143 break; | 1171 break; |
| 1144 case kTypedDataInt16ArrayCid: | 1172 case kTypedDataInt16ArrayCid: |
| 1145 __ ldr(result, element_address, kHalfword); | 1173 if (aligned()) { |
| 1174 __ ldr(result, element_address, kHalfword); |
| 1175 } else { |
| 1176 __ LoadUnaligned(result, address, TMP, kHalfword); |
| 1177 } |
| 1146 __ SmiTag(result); | 1178 __ SmiTag(result); |
| 1147 break; | 1179 break; |
| 1148 case kTypedDataUint16ArrayCid: | 1180 case kTypedDataUint16ArrayCid: |
| 1149 case kTwoByteStringCid: | 1181 case kTwoByteStringCid: |
| 1150 case kExternalTwoByteStringCid: | 1182 case kExternalTwoByteStringCid: |
| 1151 __ ldr(result, element_address, kUnsignedHalfword); | 1183 if (aligned()) { |
| 1184 __ ldr(result, element_address, kUnsignedHalfword); |
| 1185 } else { |
| 1186 __ LoadUnaligned(result, address, TMP, kUnsignedHalfword); |
| 1187 } |
| 1152 __ SmiTag(result); | 1188 __ SmiTag(result); |
| 1153 break; | 1189 break; |
| 1154 default: | 1190 default: |
| 1155 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid)); | 1191 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid)); |
| 1192 ASSERT(aligned()); |
| 1156 __ ldr(result, element_address); | 1193 __ ldr(result, element_address); |
| 1157 break; | 1194 break; |
| 1158 } | 1195 } |
| 1159 } | 1196 } |
| 1160 | 1197 |
| 1161 | 1198 |
| 1162 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone, | 1199 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone, |
| 1163 bool opt) const { | 1200 bool opt) const { |
| 1164 const intptr_t kNumInputs = 2; | 1201 const intptr_t kNumInputs = 2; |
| 1165 const intptr_t kNumTemps = 0; | 1202 const intptr_t kNumTemps = 0; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1242 default: | 1279 default: |
| 1243 UNREACHABLE(); | 1280 UNREACHABLE(); |
| 1244 return kTagged; | 1281 return kTagged; |
| 1245 } | 1282 } |
| 1246 } | 1283 } |
| 1247 | 1284 |
| 1248 | 1285 |
| 1249 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, | 1286 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, |
| 1250 bool opt) const { | 1287 bool opt) const { |
| 1251 const intptr_t kNumInputs = 3; | 1288 const intptr_t kNumInputs = 3; |
| 1252 const intptr_t kNumTemps = 0; | 1289 const intptr_t kNumTemps = aligned() ? 0 : 2; |
| 1253 LocationSummary* locs = new(zone) LocationSummary( | 1290 LocationSummary* locs = new(zone) LocationSummary( |
| 1254 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1291 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1255 locs->set_in(0, Location::RequiresRegister()); | 1292 locs->set_in(0, Location::RequiresRegister()); |
| 1256 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1293 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
| 1257 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1294 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
| 1258 } else { | 1295 } else { |
| 1259 locs->set_in(1, Location::WritableRegister()); | 1296 locs->set_in(1, Location::WritableRegister()); |
| 1260 } | 1297 } |
| 1261 switch (class_id()) { | 1298 switch (class_id()) { |
| 1262 case kArrayCid: | 1299 case kArrayCid: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1282 break; | 1319 break; |
| 1283 case kTypedDataInt32x4ArrayCid: | 1320 case kTypedDataInt32x4ArrayCid: |
| 1284 case kTypedDataFloat32x4ArrayCid: | 1321 case kTypedDataFloat32x4ArrayCid: |
| 1285 case kTypedDataFloat64x2ArrayCid: | 1322 case kTypedDataFloat64x2ArrayCid: |
| 1286 locs->set_in(2, Location::RequiresFpuRegister()); | 1323 locs->set_in(2, Location::RequiresFpuRegister()); |
| 1287 break; | 1324 break; |
| 1288 default: | 1325 default: |
| 1289 UNREACHABLE(); | 1326 UNREACHABLE(); |
| 1290 return NULL; | 1327 return NULL; |
| 1291 } | 1328 } |
| 1329 if (!aligned()) { |
| 1330 locs->set_temp(0, Location::RequiresRegister()); |
| 1331 locs->set_temp(1, Location::RequiresRegister()); |
| 1332 } |
| 1292 return locs; | 1333 return locs; |
| 1293 } | 1334 } |
| 1294 | 1335 |
| 1295 | 1336 |
| 1296 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1337 void StoreIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1297 // The array register points to the backing store for external arrays. | 1338 // The array register points to the backing store for external arrays. |
| 1298 const Register array = locs()->in(0).reg(); | 1339 const Register array = locs()->in(0).reg(); |
| 1299 const Location index = locs()->in(1); | 1340 const Location index = locs()->in(1); |
| 1341 const Register address = aligned() ? kNoRegister : locs()->temp(0).reg(); |
| 1342 const Register scratch = aligned() ? kNoRegister : locs()->temp(1).reg(); |
| 1300 | 1343 |
| 1301 Address element_address = index.IsRegister() | 1344 Address element_address(TMP); // Bad address. |
| 1345 if (aligned()) { |
| 1346 element_address = index.IsRegister() |
| 1302 ? __ ElementAddressForRegIndex(false, // Store. | 1347 ? __ ElementAddressForRegIndex(false, // Store. |
| 1303 IsExternal(), class_id(), index_scale(), | 1348 IsExternal(), class_id(), index_scale(), |
| 1304 array, index.reg()) | 1349 array, index.reg()) |
| 1305 : __ ElementAddressForIntIndex( | 1350 : __ ElementAddressForIntIndex( |
| 1306 IsExternal(), class_id(), index_scale(), | 1351 IsExternal(), class_id(), index_scale(), |
| 1307 array, Smi::Cast(index.constant()).Value()); | 1352 array, Smi::Cast(index.constant()).Value()); |
| 1353 } else { |
| 1354 if (index.IsRegister()) { |
| 1355 __ LoadElementAddressForRegIndex(address, |
| 1356 false, // Store. |
| 1357 IsExternal(), class_id(), index_scale(), |
| 1358 array, index.reg()); |
| 1359 } else { |
| 1360 __ LoadElementAddressForIntIndex(address, |
| 1361 IsExternal(), class_id(), index_scale(), |
| 1362 array, |
| 1363 Smi::Cast(index.constant()).Value()); |
| 1364 } |
| 1365 } |
| 1308 | 1366 |
| 1309 switch (class_id()) { | 1367 switch (class_id()) { |
| 1310 case kArrayCid: | 1368 case kArrayCid: |
| 1369 ASSERT(aligned()); |
| 1311 if (ShouldEmitStoreBarrier()) { | 1370 if (ShouldEmitStoreBarrier()) { |
| 1312 const Register value = locs()->in(2).reg(); | 1371 const Register value = locs()->in(2).reg(); |
| 1313 __ StoreIntoObject(array, element_address, value); | 1372 __ StoreIntoObject(array, element_address, value); |
| 1314 } else if (locs()->in(2).IsConstant()) { | 1373 } else if (locs()->in(2).IsConstant()) { |
| 1315 const Object& constant = locs()->in(2).constant(); | 1374 const Object& constant = locs()->in(2).constant(); |
| 1316 __ StoreIntoObjectNoBarrier(array, element_address, constant); | 1375 __ StoreIntoObjectNoBarrier(array, element_address, constant); |
| 1317 } else { | 1376 } else { |
| 1318 const Register value = locs()->in(2).reg(); | 1377 const Register value = locs()->in(2).reg(); |
| 1319 __ StoreIntoObjectNoBarrier(array, element_address, value); | 1378 __ StoreIntoObjectNoBarrier(array, element_address, value); |
| 1320 } | 1379 } |
| 1321 break; | 1380 break; |
| 1322 case kTypedDataInt8ArrayCid: | 1381 case kTypedDataInt8ArrayCid: |
| 1323 case kTypedDataUint8ArrayCid: | 1382 case kTypedDataUint8ArrayCid: |
| 1324 case kExternalTypedDataUint8ArrayCid: | 1383 case kExternalTypedDataUint8ArrayCid: |
| 1325 case kOneByteStringCid: { | 1384 case kOneByteStringCid: { |
| 1385 ASSERT(aligned()); |
| 1326 if (locs()->in(2).IsConstant()) { | 1386 if (locs()->in(2).IsConstant()) { |
| 1327 const Smi& constant = Smi::Cast(locs()->in(2).constant()); | 1387 const Smi& constant = Smi::Cast(locs()->in(2).constant()); |
| 1328 __ LoadImmediate(TMP, static_cast<int8_t>(constant.Value())); | 1388 __ LoadImmediate(TMP, static_cast<int8_t>(constant.Value())); |
| 1329 __ str(TMP, element_address, kUnsignedByte); | 1389 __ str(TMP, element_address, kUnsignedByte); |
| 1330 } else { | 1390 } else { |
| 1331 const Register value = locs()->in(2).reg(); | 1391 const Register value = locs()->in(2).reg(); |
| 1332 __ SmiUntag(TMP, value); | 1392 __ SmiUntag(TMP, value); |
| 1333 __ str(TMP, element_address, kUnsignedByte); | 1393 __ str(TMP, element_address, kUnsignedByte); |
| 1334 } | 1394 } |
| 1335 break; | 1395 break; |
| 1336 } | 1396 } |
| 1337 case kTypedDataUint8ClampedArrayCid: | 1397 case kTypedDataUint8ClampedArrayCid: |
| 1338 case kExternalTypedDataUint8ClampedArrayCid: { | 1398 case kExternalTypedDataUint8ClampedArrayCid: { |
| 1399 ASSERT(aligned()); |
| 1339 if (locs()->in(2).IsConstant()) { | 1400 if (locs()->in(2).IsConstant()) { |
| 1340 const Smi& constant = Smi::Cast(locs()->in(2).constant()); | 1401 const Smi& constant = Smi::Cast(locs()->in(2).constant()); |
| 1341 intptr_t value = constant.Value(); | 1402 intptr_t value = constant.Value(); |
| 1342 // Clamp to 0x0 or 0xFF respectively. | 1403 // Clamp to 0x0 or 0xFF respectively. |
| 1343 if (value > 0xFF) { | 1404 if (value > 0xFF) { |
| 1344 value = 0xFF; | 1405 value = 0xFF; |
| 1345 } else if (value < 0) { | 1406 } else if (value < 0) { |
| 1346 value = 0; | 1407 value = 0; |
| 1347 } | 1408 } |
| 1348 __ LoadImmediate(TMP, static_cast<int8_t>(value)); | 1409 __ LoadImmediate(TMP, static_cast<int8_t>(value)); |
| 1349 __ str(TMP, element_address, kUnsignedByte); | 1410 __ str(TMP, element_address, kUnsignedByte); |
| 1350 } else { | 1411 } else { |
| 1351 const Register value = locs()->in(2).reg(); | 1412 const Register value = locs()->in(2).reg(); |
| 1352 __ CompareImmediate(value, 0x1FE); // Smi value and smi 0xFF. | 1413 __ CompareImmediate(value, 0x1FE); // Smi value and smi 0xFF. |
| 1353 // Clamp to 0x00 or 0xFF respectively. | 1414 // Clamp to 0x00 or 0xFF respectively. |
| 1354 __ csetm(TMP, GT); // TMP = value > 0x1FE ? -1 : 0. | 1415 __ csetm(TMP, GT); // TMP = value > 0x1FE ? -1 : 0. |
| 1355 __ csel(TMP, value, TMP, LS); // TMP = value in range ? value : TMP. | 1416 __ csel(TMP, value, TMP, LS); // TMP = value in range ? value : TMP. |
| 1356 __ SmiUntag(TMP); | 1417 __ SmiUntag(TMP); |
| 1357 __ str(TMP, element_address, kUnsignedByte); | 1418 __ str(TMP, element_address, kUnsignedByte); |
| 1358 } | 1419 } |
| 1359 break; | 1420 break; |
| 1360 } | 1421 } |
| 1361 case kTypedDataInt16ArrayCid: | 1422 case kTypedDataInt16ArrayCid: |
| 1362 case kTypedDataUint16ArrayCid: { | 1423 case kTypedDataUint16ArrayCid: { |
| 1363 const Register value = locs()->in(2).reg(); | 1424 const Register value = locs()->in(2).reg(); |
| 1364 __ SmiUntag(TMP, value); | 1425 __ SmiUntag(TMP, value); |
| 1365 __ str(TMP, element_address, kUnsignedHalfword); | 1426 if (aligned()) { |
| 1427 __ str(TMP, element_address, kUnsignedHalfword); |
| 1428 } else { |
| 1429 __ StoreUnaligned(TMP, address, scratch, kUnsignedHalfword); |
| 1430 } |
| 1366 break; | 1431 break; |
| 1367 } | 1432 } |
| 1368 case kTypedDataInt32ArrayCid: | 1433 case kTypedDataInt32ArrayCid: |
| 1369 case kTypedDataUint32ArrayCid: { | 1434 case kTypedDataUint32ArrayCid: { |
| 1370 const Register value = locs()->in(2).reg(); | 1435 const Register value = locs()->in(2).reg(); |
| 1371 __ str(value, element_address, kUnsignedWord); | 1436 if (aligned()) { |
| 1437 __ str(value, element_address, kUnsignedWord); |
| 1438 } else { |
| 1439 __ StoreUnaligned(value, address, scratch, kUnsignedWord); |
| 1440 } |
| 1372 break; | 1441 break; |
| 1373 } | 1442 } |
| 1374 case kTypedDataFloat32ArrayCid: { | 1443 case kTypedDataFloat32ArrayCid: { |
| 1444 ASSERT(aligned()); |
| 1375 const VRegister value_reg = locs()->in(2).fpu_reg(); | 1445 const VRegister value_reg = locs()->in(2).fpu_reg(); |
| 1376 __ fstrs(value_reg, element_address); | 1446 __ fstrs(value_reg, element_address); |
| 1377 break; | 1447 break; |
| 1378 } | 1448 } |
| 1379 case kTypedDataFloat64ArrayCid: { | 1449 case kTypedDataFloat64ArrayCid: { |
| 1450 ASSERT(aligned()); |
| 1380 const VRegister value_reg = locs()->in(2).fpu_reg(); | 1451 const VRegister value_reg = locs()->in(2).fpu_reg(); |
| 1381 __ fstrd(value_reg, element_address); | 1452 __ fstrd(value_reg, element_address); |
| 1382 break; | 1453 break; |
| 1383 } | 1454 } |
| 1384 case kTypedDataFloat64x2ArrayCid: | 1455 case kTypedDataFloat64x2ArrayCid: |
| 1385 case kTypedDataInt32x4ArrayCid: | 1456 case kTypedDataInt32x4ArrayCid: |
| 1386 case kTypedDataFloat32x4ArrayCid: { | 1457 case kTypedDataFloat32x4ArrayCid: { |
| 1458 ASSERT(aligned()); |
| 1387 const VRegister value_reg = locs()->in(2).fpu_reg(); | 1459 const VRegister value_reg = locs()->in(2).fpu_reg(); |
| 1388 __ fstrq(value_reg, element_address); | 1460 __ fstrq(value_reg, element_address); |
| 1389 break; | 1461 break; |
| 1390 } | 1462 } |
| 1391 default: | 1463 default: |
| 1392 UNREACHABLE(); | 1464 UNREACHABLE(); |
| 1393 } | 1465 } |
| 1394 } | 1466 } |
| 1395 | 1467 |
| 1396 | 1468 |
| (...skipping 4449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5846 1, | 5918 1, |
| 5847 locs()); | 5919 locs()); |
| 5848 __ Drop(1); | 5920 __ Drop(1); |
| 5849 __ Pop(result); | 5921 __ Pop(result); |
| 5850 } | 5922 } |
| 5851 | 5923 |
| 5852 | 5924 |
| 5853 } // namespace dart | 5925 } // namespace dart |
| 5854 | 5926 |
| 5855 #endif // defined TARGET_ARCH_ARM64 | 5927 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |