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/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 __ addu(index.reg(), array, index.reg()); | 1158 __ addu(index.reg(), array, index.reg()); |
1159 | 1159 |
1160 if (IsExternal()) { | 1160 if (IsExternal()) { |
1161 element_address = Address(index.reg(), 0); | 1161 element_address = Address(index.reg(), 0); |
1162 } else { | 1162 } else { |
1163 ASSERT(this->array()->definition()->representation() == kTagged); | 1163 ASSERT(this->array()->definition()->representation() == kTagged); |
1164 // If the data offset doesn't fit into the 18 bits we get for the addressing | 1164 // If the data offset doesn't fit into the 18 bits we get for the addressing |
1165 // mode, then we must load the offset into a register and add it to the | 1165 // mode, then we must load the offset into a register and add it to the |
1166 // index. | 1166 // index. |
1167 element_address = Address(index.reg(), | 1167 element_address = Address(index.reg(), |
1168 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); | 1168 Instance::DataOffsetFor(class_id()) - kHeapObjectTag); |
1169 } | 1169 } |
1170 | 1170 |
1171 if ((representation() == kUnboxedDouble) || | 1171 if ((representation() == kUnboxedDouble) || |
1172 (representation() == kUnboxedMint) || | 1172 (representation() == kUnboxedMint) || |
1173 (representation() == kUnboxedFloat32x4) || | 1173 (representation() == kUnboxedFloat32x4) || |
1174 (representation() == kUnboxedInt32x4)) { | 1174 (representation() == kUnboxedInt32x4)) { |
1175 DRegister result = locs()->out(0).fpu_reg(); | 1175 DRegister result = locs()->out(0).fpu_reg(); |
1176 switch (class_id()) { | 1176 switch (class_id()) { |
1177 case kTypedDataInt32ArrayCid: | 1177 case kTypedDataInt32ArrayCid: |
1178 UNIMPLEMENTED(); | 1178 UNIMPLEMENTED(); |
1179 break; | 1179 break; |
1180 case kTypedDataUint32ArrayCid: | 1180 case kTypedDataUint32ArrayCid: |
1181 UNIMPLEMENTED(); | 1181 UNIMPLEMENTED(); |
1182 break; | 1182 break; |
1183 case kTypedDataFloat32ArrayCid: | 1183 case kTypedDataFloat32ArrayCid: |
1184 // Load single precision float. | 1184 // Load single precision float. |
1185 __ lwc1(EvenFRegisterOf(result), element_address); | 1185 __ lwc1(EvenFRegisterOf(result), element_address); |
1186 break; | 1186 break; |
1187 case kTypedDataFloat64ArrayCid: | 1187 case kTypedDataFloat64ArrayCid: |
1188 __ LoadDFromOffset(result, index.reg(), | 1188 __ LoadDFromOffset(result, index.reg(), |
1189 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); | 1189 Instance::DataOffsetFor(class_id()) - kHeapObjectTag); |
1190 break; | 1190 break; |
1191 case kTypedDataInt32x4ArrayCid: | 1191 case kTypedDataInt32x4ArrayCid: |
1192 case kTypedDataFloat32x4ArrayCid: | 1192 case kTypedDataFloat32x4ArrayCid: |
1193 UNIMPLEMENTED(); | 1193 UNIMPLEMENTED(); |
1194 break; | 1194 break; |
1195 } | 1195 } |
1196 return; | 1196 return; |
1197 } | 1197 } |
1198 | 1198 |
1199 Register result = locs()->out(0).reg(); | 1199 Register result = locs()->out(0).reg(); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 default: | 1364 default: |
1365 UNREACHABLE(); | 1365 UNREACHABLE(); |
1366 } | 1366 } |
1367 __ addu(index.reg(), array, index.reg()); | 1367 __ addu(index.reg(), array, index.reg()); |
1368 | 1368 |
1369 if (IsExternal()) { | 1369 if (IsExternal()) { |
1370 element_address = Address(index.reg(), 0); | 1370 element_address = Address(index.reg(), 0); |
1371 } else { | 1371 } else { |
1372 ASSERT(this->array()->definition()->representation() == kTagged); | 1372 ASSERT(this->array()->definition()->representation() == kTagged); |
1373 element_address = Address(index.reg(), | 1373 element_address = Address(index.reg(), |
1374 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); | 1374 Instance::DataOffsetFor(class_id()) - kHeapObjectTag); |
1375 } | 1375 } |
1376 | 1376 |
1377 switch (class_id()) { | 1377 switch (class_id()) { |
1378 case kArrayCid: | 1378 case kArrayCid: |
1379 if (ShouldEmitStoreBarrier()) { | 1379 if (ShouldEmitStoreBarrier()) { |
1380 Register value = locs()->in(2).reg(); | 1380 Register value = locs()->in(2).reg(); |
1381 __ StoreIntoObject(array, element_address, value); | 1381 __ StoreIntoObject(array, element_address, value); |
1382 } else if (locs()->in(2).IsConstant()) { | 1382 } else if (locs()->in(2).IsConstant()) { |
1383 const Object& constant = locs()->in(2).constant(); | 1383 const Object& constant = locs()->in(2).constant(); |
1384 __ StoreIntoObjectNoBarrier(array, element_address, constant); | 1384 __ StoreIntoObjectNoBarrier(array, element_address, constant); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 } | 1448 } |
1449 break; | 1449 break; |
1450 } | 1450 } |
1451 case kTypedDataFloat32ArrayCid: { | 1451 case kTypedDataFloat32ArrayCid: { |
1452 FRegister value = EvenFRegisterOf(locs()->in(2).fpu_reg()); | 1452 FRegister value = EvenFRegisterOf(locs()->in(2).fpu_reg()); |
1453 __ swc1(value, element_address); | 1453 __ swc1(value, element_address); |
1454 break; | 1454 break; |
1455 } | 1455 } |
1456 case kTypedDataFloat64ArrayCid: | 1456 case kTypedDataFloat64ArrayCid: |
1457 __ StoreDToOffset(locs()->in(2).fpu_reg(), index.reg(), | 1457 __ StoreDToOffset(locs()->in(2).fpu_reg(), index.reg(), |
1458 FlowGraphCompiler::DataOffsetFor(class_id()) - kHeapObjectTag); | 1458 Instance::DataOffsetFor(class_id()) - kHeapObjectTag); |
1459 break; | 1459 break; |
1460 case kTypedDataInt32x4ArrayCid: | 1460 case kTypedDataInt32x4ArrayCid: |
1461 case kTypedDataFloat32x4ArrayCid: | 1461 case kTypedDataFloat32x4ArrayCid: |
1462 UNIMPLEMENTED(); | 1462 UNIMPLEMENTED(); |
1463 break; | 1463 break; |
1464 default: | 1464 default: |
1465 UNREACHABLE(); | 1465 UNREACHABLE(); |
1466 } | 1466 } |
1467 } | 1467 } |
1468 | 1468 |
(...skipping 3287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4756 compiler->GenerateCall(token_pos(), | 4756 compiler->GenerateCall(token_pos(), |
4757 &label, | 4757 &label, |
4758 PcDescriptors::kOther, | 4758 PcDescriptors::kOther, |
4759 locs()); | 4759 locs()); |
4760 __ Drop(ArgumentCount()); // Discard arguments. | 4760 __ Drop(ArgumentCount()); // Discard arguments. |
4761 } | 4761 } |
4762 | 4762 |
4763 } // namespace dart | 4763 } // namespace dart |
4764 | 4764 |
4765 #endif // defined TARGET_ARCH_MIPS | 4765 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |