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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 case kExternalTypedDataUint8ArrayCid: | 1049 case kExternalTypedDataUint8ArrayCid: |
1050 case kExternalTypedDataUint8ClampedArrayCid: | 1050 case kExternalTypedDataUint8ClampedArrayCid: |
1051 case kTypedDataInt16ArrayCid: | 1051 case kTypedDataInt16ArrayCid: |
1052 case kTypedDataUint16ArrayCid: | 1052 case kTypedDataUint16ArrayCid: |
1053 case kOneByteStringCid: | 1053 case kOneByteStringCid: |
1054 case kTwoByteStringCid: | 1054 case kTwoByteStringCid: |
1055 return CompileType::FromCid(kSmiCid); | 1055 return CompileType::FromCid(kSmiCid); |
1056 | 1056 |
1057 case kTypedDataInt32ArrayCid: | 1057 case kTypedDataInt32ArrayCid: |
1058 case kTypedDataUint32ArrayCid: | 1058 case kTypedDataUint32ArrayCid: |
1059 // Result can be Smi or Mint when boxed. | 1059 return Typed32BitIsSmi()() ? CompileType::FromCid(kSmiCid) |
1060 // Instruction can deoptimize if we optimistically assumed that the result | 1060 : CompileType::FromCid(kMintCid); |
1061 // fits into Smi. | |
1062 return CanDeoptimize() ? CompileType::FromCid(kSmiCid) | |
1063 : CompileType::Int(); | |
1064 | 1061 |
1065 default: | 1062 default: |
1066 UNIMPLEMENTED(); | 1063 UNIMPLEMENTED(); |
1067 return CompileType::Dynamic(); | 1064 return CompileType::Dynamic(); |
1068 } | 1065 } |
1069 } | 1066 } |
1070 | 1067 |
1071 | 1068 |
1072 Representation LoadIndexedInstr::representation() const { | 1069 Representation LoadIndexedInstr::representation() const { |
1073 switch (class_id_) { | 1070 switch (class_id_) { |
1074 case kArrayCid: | 1071 case kArrayCid: |
1075 case kImmutableArrayCid: | 1072 case kImmutableArrayCid: |
1076 case kTypedDataInt8ArrayCid: | 1073 case kTypedDataInt8ArrayCid: |
1077 case kTypedDataUint8ArrayCid: | 1074 case kTypedDataUint8ArrayCid: |
1078 case kTypedDataUint8ClampedArrayCid: | 1075 case kTypedDataUint8ClampedArrayCid: |
1079 case kExternalTypedDataUint8ArrayCid: | 1076 case kExternalTypedDataUint8ArrayCid: |
1080 case kExternalTypedDataUint8ClampedArrayCid: | 1077 case kExternalTypedDataUint8ClampedArrayCid: |
1081 case kTypedDataInt16ArrayCid: | 1078 case kTypedDataInt16ArrayCid: |
1082 case kTypedDataUint16ArrayCid: | 1079 case kTypedDataUint16ArrayCid: |
1083 case kOneByteStringCid: | 1080 case kOneByteStringCid: |
1084 case kTwoByteStringCid: | 1081 case kTwoByteStringCid: |
1085 return kTagged; | 1082 return kTagged; |
1086 case kTypedDataInt32ArrayCid: | 1083 case kTypedDataInt32ArrayCid: |
1087 case kTypedDataUint32ArrayCid: | 1084 case kTypedDataUint32ArrayCid: |
1088 // Instruction can deoptimize if we optimistically assumed that the result | 1085 return Typed32BitIsSmi() ? kTagged : kUnboxedMint; |
1089 // fits into Smi. | |
1090 return CanDeoptimize() ? kTagged : kUnboxedMint; | |
1091 case kTypedDataFloat32ArrayCid: | 1086 case kTypedDataFloat32ArrayCid: |
1092 case kTypedDataFloat64ArrayCid: | 1087 case kTypedDataFloat64ArrayCid: |
1093 return kUnboxedDouble; | 1088 return kUnboxedDouble; |
1094 case kTypedDataInt32x4ArrayCid: | 1089 case kTypedDataInt32x4ArrayCid: |
1095 return kUnboxedInt32x4; | 1090 return kUnboxedInt32x4; |
1096 case kTypedDataFloat32x4ArrayCid: | 1091 case kTypedDataFloat32x4ArrayCid: |
1097 return kUnboxedFloat32x4; | 1092 return kUnboxedFloat32x4; |
1098 default: | 1093 default: |
1099 UNIMPLEMENTED(); | 1094 UNIMPLEMENTED(); |
1100 return kTagged; | 1095 return kTagged; |
(...skipping 3679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4780 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 4775 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
4781 #if defined(DEBUG) | 4776 #if defined(DEBUG) |
4782 __ LoadImmediate(S4, kInvalidObjectPointer); | 4777 __ LoadImmediate(S4, kInvalidObjectPointer); |
4783 __ LoadImmediate(S5, kInvalidObjectPointer); | 4778 __ LoadImmediate(S5, kInvalidObjectPointer); |
4784 #endif | 4779 #endif |
4785 } | 4780 } |
4786 | 4781 |
4787 } // namespace dart | 4782 } // namespace dart |
4788 | 4783 |
4789 #endif // defined TARGET_ARCH_MIPS | 4784 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |