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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 case kTypedDataUint16ArrayCid: | 986 case kTypedDataUint16ArrayCid: |
987 case kOneByteStringCid: | 987 case kOneByteStringCid: |
988 case kTwoByteStringCid: | 988 case kTwoByteStringCid: |
989 return CompileType::FromCid(kSmiCid); | 989 return CompileType::FromCid(kSmiCid); |
990 | 990 |
991 case kTypedDataInt32ArrayCid: | 991 case kTypedDataInt32ArrayCid: |
992 case kTypedDataUint32ArrayCid: | 992 case kTypedDataUint32ArrayCid: |
993 // Result can be Smi or Mint when boxed. | 993 // Result can be Smi or Mint when boxed. |
994 // Instruction can deoptimize if we optimistically assumed that the result | 994 // Instruction can deoptimize if we optimistically assumed that the result |
995 // fits into Smi. | 995 // fits into Smi. |
996 return CanDeoptimize() ? CompileType::FromCid(kSmiCid) | 996 return Typed32BitIsSmi() ? CompileType::FromCid(kSmiCid) |
997 : CompileType::Int(); | 997 : CompileType::FromCid(kMintCid); |
998 | 998 |
999 default: | 999 default: |
1000 UNIMPLEMENTED(); | 1000 UNIMPLEMENTED(); |
1001 return CompileType::Dynamic(); | 1001 return CompileType::Dynamic(); |
1002 } | 1002 } |
1003 } | 1003 } |
1004 | 1004 |
1005 | 1005 |
| 1006 // TODO(srdjan): Implement this as a flag so that it can be optimized. |
| 1007 bool LoadIndexedInstr::Typed32BitIsSmi() const { return false; } |
| 1008 |
| 1009 |
1006 Representation LoadIndexedInstr::representation() const { | 1010 Representation LoadIndexedInstr::representation() const { |
1007 switch (class_id_) { | 1011 switch (class_id_) { |
1008 case kArrayCid: | 1012 case kArrayCid: |
1009 case kImmutableArrayCid: | 1013 case kImmutableArrayCid: |
1010 case kTypedDataInt8ArrayCid: | 1014 case kTypedDataInt8ArrayCid: |
1011 case kTypedDataUint8ArrayCid: | 1015 case kTypedDataUint8ArrayCid: |
1012 case kTypedDataUint8ClampedArrayCid: | 1016 case kTypedDataUint8ClampedArrayCid: |
1013 case kExternalTypedDataUint8ArrayCid: | 1017 case kExternalTypedDataUint8ArrayCid: |
1014 case kExternalTypedDataUint8ClampedArrayCid: | 1018 case kExternalTypedDataUint8ClampedArrayCid: |
1015 case kTypedDataInt16ArrayCid: | 1019 case kTypedDataInt16ArrayCid: |
1016 case kTypedDataUint16ArrayCid: | 1020 case kTypedDataUint16ArrayCid: |
1017 case kOneByteStringCid: | 1021 case kOneByteStringCid: |
1018 case kTwoByteStringCid: | 1022 case kTwoByteStringCid: |
1019 return kTagged; | 1023 return kTagged; |
1020 case kTypedDataInt32ArrayCid: | 1024 case kTypedDataInt32ArrayCid: |
1021 case kTypedDataUint32ArrayCid: | 1025 case kTypedDataUint32ArrayCid: |
1022 // Instruction can deoptimize if we optimistically assumed that the result | 1026 return Typed32BitIsSmi() ? kTagged : kUnboxedMint; |
1023 // fits into Smi. | |
1024 return CanDeoptimize() ? kTagged : kUnboxedMint; | |
1025 case kTypedDataFloat32ArrayCid: | 1027 case kTypedDataFloat32ArrayCid: |
1026 case kTypedDataFloat64ArrayCid: | 1028 case kTypedDataFloat64ArrayCid: |
1027 return kUnboxedDouble; | 1029 return kUnboxedDouble; |
1028 case kTypedDataFloat32x4ArrayCid: | 1030 case kTypedDataFloat32x4ArrayCid: |
1029 return kUnboxedFloat32x4; | 1031 return kUnboxedFloat32x4; |
1030 case kTypedDataInt32x4ArrayCid: | 1032 case kTypedDataInt32x4ArrayCid: |
1031 return kUnboxedInt32x4; | 1033 return kUnboxedInt32x4; |
1032 case kTypedDataFloat64x2ArrayCid: | 1034 case kTypedDataFloat64x2ArrayCid: |
1033 return kUnboxedFloat64x2; | 1035 return kUnboxedFloat64x2; |
1034 default: | 1036 default: |
(...skipping 5526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6561 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6563 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
6562 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6564 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
6563 #endif | 6565 #endif |
6564 } | 6566 } |
6565 | 6567 |
6566 } // namespace dart | 6568 } // namespace dart |
6567 | 6569 |
6568 #undef __ | 6570 #undef __ |
6569 | 6571 |
6570 #endif // defined TARGET_ARCH_IA32 | 6572 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |