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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1109 case kTypedDataUint8ClampedArrayCid: | 1109 case kTypedDataUint8ClampedArrayCid: |
| 1110 case kExternalTypedDataUint8ArrayCid: | 1110 case kExternalTypedDataUint8ArrayCid: |
| 1111 case kExternalTypedDataUint8ClampedArrayCid: | 1111 case kExternalTypedDataUint8ClampedArrayCid: |
| 1112 case kTypedDataInt16ArrayCid: | 1112 case kTypedDataInt16ArrayCid: |
| 1113 case kTypedDataUint16ArrayCid: | 1113 case kTypedDataUint16ArrayCid: |
| 1114 case kOneByteStringCid: | 1114 case kOneByteStringCid: |
| 1115 case kTwoByteStringCid: | 1115 case kTwoByteStringCid: |
| 1116 return CompileType::FromCid(kSmiCid); | 1116 return CompileType::FromCid(kSmiCid); |
| 1117 | 1117 |
| 1118 case kTypedDataInt32ArrayCid: | 1118 case kTypedDataInt32ArrayCid: |
| 1119 return Typed32BitIsSmi() ? CompileType::FromCid(kSmiCid) | |
|
Vyacheslav Egorov (Google)
2014/09/30 15:06:01
Any reason you don't want to support Int32List too
Cutch
2014/09/30 15:39:12
Done.
| |
| 1120 : CompileType::FromCid(kMintCid); | |
| 1121 | |
| 1119 case kTypedDataUint32ArrayCid: | 1122 case kTypedDataUint32ArrayCid: |
| 1120 return Typed32BitIsSmi() ? CompileType::FromCid(kSmiCid) | 1123 return CompileType::FromCid(kMintCid); |
|
Vyacheslav Egorov (Google)
2014/09/30 15:06:02
This is not correct actually: boxing can result in
Cutch
2014/09/30 15:39:12
Done. Here and above.
| |
| 1121 : CompileType::FromCid(kMintCid); | |
| 1122 | 1124 |
| 1123 default: | 1125 default: |
| 1124 UNREACHABLE(); | 1126 UNREACHABLE(); |
| 1125 return CompileType::Dynamic(); | 1127 return CompileType::Dynamic(); |
| 1126 } | 1128 } |
| 1127 } | 1129 } |
| 1128 | 1130 |
| 1129 | 1131 |
| 1130 Representation LoadIndexedInstr::representation() const { | 1132 Representation LoadIndexedInstr::representation() const { |
| 1131 switch (class_id_) { | 1133 switch (class_id_) { |
| 1132 case kArrayCid: | 1134 case kArrayCid: |
| 1133 case kImmutableArrayCid: | 1135 case kImmutableArrayCid: |
| 1134 case kTypedDataInt8ArrayCid: | 1136 case kTypedDataInt8ArrayCid: |
| 1135 case kTypedDataUint8ArrayCid: | 1137 case kTypedDataUint8ArrayCid: |
| 1136 case kTypedDataUint8ClampedArrayCid: | 1138 case kTypedDataUint8ClampedArrayCid: |
| 1137 case kExternalTypedDataUint8ArrayCid: | 1139 case kExternalTypedDataUint8ArrayCid: |
| 1138 case kExternalTypedDataUint8ClampedArrayCid: | 1140 case kExternalTypedDataUint8ClampedArrayCid: |
| 1139 case kTypedDataInt16ArrayCid: | 1141 case kTypedDataInt16ArrayCid: |
| 1140 case kTypedDataUint16ArrayCid: | 1142 case kTypedDataUint16ArrayCid: |
| 1141 case kOneByteStringCid: | 1143 case kOneByteStringCid: |
| 1142 case kTwoByteStringCid: | 1144 case kTwoByteStringCid: |
| 1143 return kTagged; | 1145 return kTagged; |
| 1144 case kTypedDataInt32ArrayCid: | 1146 case kTypedDataInt32ArrayCid: |
| 1147 return Typed32BitIsSmi() ? kTagged : kUnboxedMint; | |
| 1145 case kTypedDataUint32ArrayCid: | 1148 case kTypedDataUint32ArrayCid: |
| 1146 return Typed32BitIsSmi() ? kTagged : kUnboxedMint; | 1149 return kUnboxedUint32; |
| 1147 case kTypedDataFloat32ArrayCid: | 1150 case kTypedDataFloat32ArrayCid: |
| 1148 case kTypedDataFloat64ArrayCid: | 1151 case kTypedDataFloat64ArrayCid: |
| 1149 return kUnboxedDouble; | 1152 return kUnboxedDouble; |
| 1150 case kTypedDataInt32x4ArrayCid: | 1153 case kTypedDataInt32x4ArrayCid: |
| 1151 return kUnboxedInt32x4; | 1154 return kUnboxedInt32x4; |
| 1152 case kTypedDataFloat32x4ArrayCid: | 1155 case kTypedDataFloat32x4ArrayCid: |
| 1153 return kUnboxedFloat32x4; | 1156 return kUnboxedFloat32x4; |
| 1154 case kTypedDataFloat64x2ArrayCid: | 1157 case kTypedDataFloat64x2ArrayCid: |
| 1155 return kUnboxedFloat64x2; | 1158 return kUnboxedFloat64x2; |
| 1156 default: | 1159 default: |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1222 // Need register <= Q7 for float operations. | 1225 // Need register <= Q7 for float operations. |
| 1223 // TODO(fschneider): Add a register policy to specify a subset of | 1226 // TODO(fschneider): Add a register policy to specify a subset of |
| 1224 // registers. | 1227 // registers. |
| 1225 locs->set_out(0, Location::FpuRegisterLocation(Q7)); | 1228 locs->set_out(0, Location::FpuRegisterLocation(Q7)); |
| 1226 } else { | 1229 } else { |
| 1227 locs->set_out(0, Location::RequiresFpuRegister()); | 1230 locs->set_out(0, Location::RequiresFpuRegister()); |
| 1228 } | 1231 } |
| 1229 } else if (representation() == kUnboxedMint) { | 1232 } else if (representation() == kUnboxedMint) { |
| 1230 locs->set_out(0, Location::Pair(Location::RequiresRegister(), | 1233 locs->set_out(0, Location::Pair(Location::RequiresRegister(), |
| 1231 Location::RequiresRegister())); | 1234 Location::RequiresRegister())); |
| 1235 } else if (representation() == kUnboxedUint32) { | |
| 1236 locs->set_out(0, Location::RequiresRegister()); | |
| 1232 } else { | 1237 } else { |
| 1233 ASSERT(representation() == kTagged); | 1238 ASSERT(representation() == kTagged); |
| 1234 locs->set_out(0, Location::RequiresRegister()); | 1239 locs->set_out(0, Location::RequiresRegister()); |
| 1235 } | 1240 } |
| 1236 return locs; | 1241 return locs; |
| 1237 } | 1242 } |
| 1238 | 1243 |
| 1239 | 1244 |
| 1240 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1245 void LoadIndexedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1241 // The array register points to the backing store for external arrays. | 1246 // The array register points to the backing store for external arrays. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1286 PairLocation* result_pair = locs()->out(0).AsPairLocation(); | 1291 PairLocation* result_pair = locs()->out(0).AsPairLocation(); |
| 1287 const Register result1 = result_pair->At(0).reg(); | 1292 const Register result1 = result_pair->At(0).reg(); |
| 1288 const Register result2 = result_pair->At(1).reg(); | 1293 const Register result2 = result_pair->At(1).reg(); |
| 1289 switch (class_id()) { | 1294 switch (class_id()) { |
| 1290 case kTypedDataInt32ArrayCid: | 1295 case kTypedDataInt32ArrayCid: |
| 1291 // Load low word. | 1296 // Load low word. |
| 1292 __ ldr(result1, element_address); | 1297 __ ldr(result1, element_address); |
| 1293 // Sign extend into high word. | 1298 // Sign extend into high word. |
| 1294 __ SignFill(result2, result1); | 1299 __ SignFill(result2, result1); |
| 1295 break; | 1300 break; |
| 1296 case kTypedDataUint32ArrayCid: | |
| 1297 // Load low word. | |
| 1298 __ ldr(result1, element_address); | |
| 1299 // Zero high word. | |
| 1300 __ eor(result2, result2, Operand(result2)); | |
| 1301 break; | |
| 1302 default: | 1301 default: |
| 1303 UNREACHABLE(); | 1302 UNREACHABLE(); |
| 1304 break; | 1303 break; |
| 1305 } | 1304 } |
| 1306 return; | 1305 return; |
| 1307 } | 1306 } |
| 1308 | 1307 |
| 1308 if (representation() == kUnboxedUint32) { | |
| 1309 ASSERT(class_id() == kTypedDataUint32ArrayCid); | |
| 1310 const Register result = locs()->out(0).reg(); | |
| 1311 __ ldr(result, element_address); | |
| 1312 return; | |
| 1313 } | |
| 1314 | |
| 1309 ASSERT(representation() == kTagged); | 1315 ASSERT(representation() == kTagged); |
| 1310 | 1316 |
| 1311 const Register result = locs()->out(0).reg(); | 1317 const Register result = locs()->out(0).reg(); |
| 1312 switch (class_id()) { | 1318 switch (class_id()) { |
| 1313 case kTypedDataInt8ArrayCid: | 1319 case kTypedDataInt8ArrayCid: |
| 1314 ASSERT(index_scale() == 1); | 1320 ASSERT(index_scale() == 1); |
| 1315 __ ldrsb(result, element_address); | 1321 __ ldrsb(result, element_address); |
| 1316 __ SmiTag(result); | 1322 __ SmiTag(result); |
| 1317 break; | 1323 break; |
| 1318 case kTypedDataUint8ArrayCid: | 1324 case kTypedDataUint8ArrayCid: |
| (...skipping 5700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7019 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 7025 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 7020 #if defined(DEBUG) | 7026 #if defined(DEBUG) |
| 7021 __ LoadImmediate(R4, kInvalidObjectPointer); | 7027 __ LoadImmediate(R4, kInvalidObjectPointer); |
| 7022 __ LoadImmediate(R5, kInvalidObjectPointer); | 7028 __ LoadImmediate(R5, kInvalidObjectPointer); |
| 7023 #endif | 7029 #endif |
| 7024 } | 7030 } |
| 7025 | 7031 |
| 7026 } // namespace dart | 7032 } // namespace dart |
| 7027 | 7033 |
| 7028 #endif // defined TARGET_ARCH_ARM | 7034 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |