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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1085 case kExternalTypedDataUint8ArrayCid: | 1085 case kExternalTypedDataUint8ArrayCid: |
1086 case kExternalTypedDataUint8ClampedArrayCid: | 1086 case kExternalTypedDataUint8ClampedArrayCid: |
1087 case kTypedDataInt16ArrayCid: | 1087 case kTypedDataInt16ArrayCid: |
1088 case kTypedDataUint16ArrayCid: | 1088 case kTypedDataUint16ArrayCid: |
1089 case kOneByteStringCid: | 1089 case kOneByteStringCid: |
1090 case kTwoByteStringCid: | 1090 case kTwoByteStringCid: |
1091 return CompileType::FromCid(kSmiCid); | 1091 return CompileType::FromCid(kSmiCid); |
1092 | 1092 |
1093 case kTypedDataInt32ArrayCid: | 1093 case kTypedDataInt32ArrayCid: |
1094 case kTypedDataUint32ArrayCid: | 1094 case kTypedDataUint32ArrayCid: |
1095 // Result can be Smi or Mint when boxed. | 1095 return Typed32BitIsSmi() ? CompileType::FromCid(kSmiCid) |
1096 // Instruction can deoptimize if we optimistically assumed that the result | 1096 : CompileType::FromCid(kMintCid); |
1097 // fits into Smi. | |
1098 return CanDeoptimize() ? CompileType::FromCid(kSmiCid) | |
1099 : CompileType::Int(); | |
1100 | 1097 |
1101 default: | 1098 default: |
1102 UNREACHABLE(); | 1099 UNREACHABLE(); |
1103 return CompileType::Dynamic(); | 1100 return CompileType::Dynamic(); |
1104 } | 1101 } |
1105 } | 1102 } |
1106 | 1103 |
1107 | 1104 |
1108 Representation LoadIndexedInstr::representation() const { | 1105 Representation LoadIndexedInstr::representation() const { |
1109 switch (class_id_) { | 1106 switch (class_id_) { |
1110 case kArrayCid: | 1107 case kArrayCid: |
1111 case kImmutableArrayCid: | 1108 case kImmutableArrayCid: |
1112 case kTypedDataInt8ArrayCid: | 1109 case kTypedDataInt8ArrayCid: |
1113 case kTypedDataUint8ArrayCid: | 1110 case kTypedDataUint8ArrayCid: |
1114 case kTypedDataUint8ClampedArrayCid: | 1111 case kTypedDataUint8ClampedArrayCid: |
1115 case kExternalTypedDataUint8ArrayCid: | 1112 case kExternalTypedDataUint8ArrayCid: |
1116 case kExternalTypedDataUint8ClampedArrayCid: | 1113 case kExternalTypedDataUint8ClampedArrayCid: |
1117 case kTypedDataInt16ArrayCid: | 1114 case kTypedDataInt16ArrayCid: |
1118 case kTypedDataUint16ArrayCid: | 1115 case kTypedDataUint16ArrayCid: |
1119 case kOneByteStringCid: | 1116 case kOneByteStringCid: |
1120 case kTwoByteStringCid: | 1117 case kTwoByteStringCid: |
1121 return kTagged; | 1118 return kTagged; |
1122 case kTypedDataInt32ArrayCid: | 1119 case kTypedDataInt32ArrayCid: |
1123 case kTypedDataUint32ArrayCid: | 1120 case kTypedDataUint32ArrayCid: |
1124 // Instruction can deoptimize if we optimistically assumed that the result | 1121 return Typed32BitIsSmi() ? kTagged : kUnboxedMint; |
1125 // fits into Smi. | |
1126 return CanDeoptimize() ? kTagged : kUnboxedMint; | |
1127 case kTypedDataFloat32ArrayCid: | 1122 case kTypedDataFloat32ArrayCid: |
1128 case kTypedDataFloat64ArrayCid: | 1123 case kTypedDataFloat64ArrayCid: |
1129 return kUnboxedDouble; | 1124 return kUnboxedDouble; |
1130 case kTypedDataInt32x4ArrayCid: | 1125 case kTypedDataInt32x4ArrayCid: |
1131 return kUnboxedInt32x4; | 1126 return kUnboxedInt32x4; |
1132 case kTypedDataFloat32x4ArrayCid: | 1127 case kTypedDataFloat32x4ArrayCid: |
1133 return kUnboxedFloat32x4; | 1128 return kUnboxedFloat32x4; |
1134 case kTypedDataFloat64x2ArrayCid: | 1129 case kTypedDataFloat64x2ArrayCid: |
1135 return kUnboxedFloat64x2; | 1130 return kUnboxedFloat64x2; |
1136 default: | 1131 default: |
(...skipping 5479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6616 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6611 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
6617 #if defined(DEBUG) | 6612 #if defined(DEBUG) |
6618 __ LoadImmediate(R4, kInvalidObjectPointer); | 6613 __ LoadImmediate(R4, kInvalidObjectPointer); |
6619 __ LoadImmediate(R5, kInvalidObjectPointer); | 6614 __ LoadImmediate(R5, kInvalidObjectPointer); |
6620 #endif | 6615 #endif |
6621 } | 6616 } |
6622 | 6617 |
6623 } // namespace dart | 6618 } // namespace dart |
6624 | 6619 |
6625 #endif // defined TARGET_ARCH_ARM | 6620 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |