| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 | 1046 |
| 1047 | 1047 |
| 1048 Representation StoreIndexedInstr::RequiredInputRepresentation( | 1048 Representation StoreIndexedInstr::RequiredInputRepresentation( |
| 1049 intptr_t idx) const { | 1049 intptr_t idx) const { |
| 1050 // Array can be a Dart object or a pointer to external data. | 1050 // Array can be a Dart object or a pointer to external data. |
| 1051 if (idx == 0) return kNoRepresentation; // Flexible input representation. | 1051 if (idx == 0) return kNoRepresentation; // Flexible input representation. |
| 1052 if (idx == 1) return kTagged; // Index is a smi. | 1052 if (idx == 1) return kTagged; // Index is a smi. |
| 1053 ASSERT(idx == 2); | 1053 ASSERT(idx == 2); |
| 1054 switch (class_id_) { | 1054 switch (class_id_) { |
| 1055 case kArrayCid: | 1055 case kArrayCid: |
| 1056 case kOneByteStringCid: |
| 1056 case kTypedDataInt8ArrayCid: | 1057 case kTypedDataInt8ArrayCid: |
| 1057 case kTypedDataUint8ArrayCid: | 1058 case kTypedDataUint8ArrayCid: |
| 1058 case kExternalTypedDataUint8ArrayCid: | 1059 case kExternalTypedDataUint8ArrayCid: |
| 1059 case kTypedDataUint8ClampedArrayCid: | 1060 case kTypedDataUint8ClampedArrayCid: |
| 1060 case kExternalTypedDataUint8ClampedArrayCid: | 1061 case kExternalTypedDataUint8ClampedArrayCid: |
| 1061 case kTypedDataInt16ArrayCid: | 1062 case kTypedDataInt16ArrayCid: |
| 1062 case kTypedDataUint16ArrayCid: | 1063 case kTypedDataUint16ArrayCid: |
| 1063 return kTagged; | 1064 return kTagged; |
| 1064 case kTypedDataInt32ArrayCid: | 1065 case kTypedDataInt32ArrayCid: |
| 1065 case kTypedDataUint32ArrayCid: | 1066 case kTypedDataUint32ArrayCid: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1090 case kArrayCid: | 1091 case kArrayCid: |
| 1091 locs->set_in(2, ShouldEmitStoreBarrier() | 1092 locs->set_in(2, ShouldEmitStoreBarrier() |
| 1092 ? Location::WritableRegister() | 1093 ? Location::WritableRegister() |
| 1093 : Location::RegisterOrConstant(value())); | 1094 : Location::RegisterOrConstant(value())); |
| 1094 break; | 1095 break; |
| 1095 case kExternalTypedDataUint8ArrayCid: | 1096 case kExternalTypedDataUint8ArrayCid: |
| 1096 case kExternalTypedDataUint8ClampedArrayCid: | 1097 case kExternalTypedDataUint8ClampedArrayCid: |
| 1097 case kTypedDataInt8ArrayCid: | 1098 case kTypedDataInt8ArrayCid: |
| 1098 case kTypedDataUint8ArrayCid: | 1099 case kTypedDataUint8ArrayCid: |
| 1099 case kTypedDataUint8ClampedArrayCid: | 1100 case kTypedDataUint8ClampedArrayCid: |
| 1101 case kOneByteStringCid: |
| 1100 locs->set_in(2, Location::RegisterOrSmiConstant(value())); | 1102 locs->set_in(2, Location::RegisterOrSmiConstant(value())); |
| 1101 break; | 1103 break; |
| 1102 case kTypedDataInt16ArrayCid: | 1104 case kTypedDataInt16ArrayCid: |
| 1103 case kTypedDataUint16ArrayCid: | 1105 case kTypedDataUint16ArrayCid: |
| 1104 case kTypedDataInt32ArrayCid: | 1106 case kTypedDataInt32ArrayCid: |
| 1105 case kTypedDataUint32ArrayCid: | 1107 case kTypedDataUint32ArrayCid: |
| 1106 locs->set_in(2, Location::RequiresRegister()); | 1108 locs->set_in(2, Location::RequiresRegister()); |
| 1107 break; | 1109 break; |
| 1108 case kTypedDataFloat32ArrayCid: | 1110 case kTypedDataFloat32ArrayCid: |
| 1109 // TODO(regis): Verify. | 1111 // TODO(regis): Verify. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 } else if (locs()->in(2).IsConstant()) { | 1174 } else if (locs()->in(2).IsConstant()) { |
| 1173 const Object& constant = locs()->in(2).constant(); | 1175 const Object& constant = locs()->in(2).constant(); |
| 1174 __ StoreIntoObjectNoBarrier(array, element_address, constant); | 1176 __ StoreIntoObjectNoBarrier(array, element_address, constant); |
| 1175 } else { | 1177 } else { |
| 1176 Register value = locs()->in(2).reg(); | 1178 Register value = locs()->in(2).reg(); |
| 1177 __ StoreIntoObjectNoBarrier(array, element_address, value); | 1179 __ StoreIntoObjectNoBarrier(array, element_address, value); |
| 1178 } | 1180 } |
| 1179 break; | 1181 break; |
| 1180 case kTypedDataInt8ArrayCid: | 1182 case kTypedDataInt8ArrayCid: |
| 1181 case kTypedDataUint8ArrayCid: | 1183 case kTypedDataUint8ArrayCid: |
| 1182 case kExternalTypedDataUint8ArrayCid: { | 1184 case kExternalTypedDataUint8ArrayCid: |
| 1185 case kOneByteStringCid: { |
| 1183 if (locs()->in(2).IsConstant()) { | 1186 if (locs()->in(2).IsConstant()) { |
| 1184 const Smi& constant = Smi::Cast(locs()->in(2).constant()); | 1187 const Smi& constant = Smi::Cast(locs()->in(2).constant()); |
| 1185 __ LoadImmediate(IP, static_cast<int8_t>(constant.Value())); | 1188 __ LoadImmediate(IP, static_cast<int8_t>(constant.Value())); |
| 1186 __ strb(IP, element_address); | 1189 __ strb(IP, element_address); |
| 1187 } else { | 1190 } else { |
| 1188 Register value = locs()->in(2).reg(); | 1191 Register value = locs()->in(2).reg(); |
| 1189 __ SmiUntag(value); | 1192 __ SmiUntag(value); |
| 1190 __ strb(value, element_address); | 1193 __ strb(value, element_address); |
| 1191 } | 1194 } |
| 1192 break; | 1195 break; |
| (...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2793 compiler->GenerateCall(token_pos(), | 2796 compiler->GenerateCall(token_pos(), |
| 2794 &label, | 2797 &label, |
| 2795 PcDescriptors::kOther, | 2798 PcDescriptors::kOther, |
| 2796 locs()); | 2799 locs()); |
| 2797 __ Drop(2); // Discard type arguments and receiver. | 2800 __ Drop(2); // Discard type arguments and receiver. |
| 2798 } | 2801 } |
| 2799 | 2802 |
| 2800 } // namespace dart | 2803 } // namespace dart |
| 2801 | 2804 |
| 2802 #endif // defined TARGET_ARCH_ARM | 2805 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |