Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: runtime/vm/intermediate_language_ia32.cc

Issue 414163003: Fix issue 20190: Mark Uint32/Int32 typed data load to produce a Mint always (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 case kExternalTypedDataUint8ArrayCid: 983 case kExternalTypedDataUint8ArrayCid:
984 case kExternalTypedDataUint8ClampedArrayCid: 984 case kExternalTypedDataUint8ClampedArrayCid:
985 case kTypedDataInt16ArrayCid: 985 case kTypedDataInt16ArrayCid:
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 return Typed32BitIsSmi() ? CompileType::FromCid(kSmiCid)
994 // Instruction can deoptimize if we optimistically assumed that the result 994 : CompileType::FromCid(kMintCid);
995 // fits into Smi.
996 return CanDeoptimize() ? CompileType::FromCid(kSmiCid)
997 : CompileType::Int();
998 995
999 default: 996 default:
1000 UNIMPLEMENTED(); 997 UNIMPLEMENTED();
1001 return CompileType::Dynamic(); 998 return CompileType::Dynamic();
1002 } 999 }
1003 } 1000 }
1004 1001
1005 1002
1006 Representation LoadIndexedInstr::representation() const { 1003 Representation LoadIndexedInstr::representation() const {
1007 switch (class_id_) { 1004 switch (class_id_) {
1008 case kArrayCid: 1005 case kArrayCid:
1009 case kImmutableArrayCid: 1006 case kImmutableArrayCid:
1010 case kTypedDataInt8ArrayCid: 1007 case kTypedDataInt8ArrayCid:
1011 case kTypedDataUint8ArrayCid: 1008 case kTypedDataUint8ArrayCid:
1012 case kTypedDataUint8ClampedArrayCid: 1009 case kTypedDataUint8ClampedArrayCid:
1013 case kExternalTypedDataUint8ArrayCid: 1010 case kExternalTypedDataUint8ArrayCid:
1014 case kExternalTypedDataUint8ClampedArrayCid: 1011 case kExternalTypedDataUint8ClampedArrayCid:
1015 case kTypedDataInt16ArrayCid: 1012 case kTypedDataInt16ArrayCid:
1016 case kTypedDataUint16ArrayCid: 1013 case kTypedDataUint16ArrayCid:
1017 case kOneByteStringCid: 1014 case kOneByteStringCid:
1018 case kTwoByteStringCid: 1015 case kTwoByteStringCid:
1019 return kTagged; 1016 return kTagged;
1020 case kTypedDataInt32ArrayCid: 1017 case kTypedDataInt32ArrayCid:
1021 case kTypedDataUint32ArrayCid: 1018 case kTypedDataUint32ArrayCid:
1022 // Instruction can deoptimize if we optimistically assumed that the result 1019 return Typed32BitIsSmi() ? kTagged : kUnboxedMint;
1023 // fits into Smi.
1024 return CanDeoptimize() ? kTagged : kUnboxedMint;
1025 case kTypedDataFloat32ArrayCid: 1020 case kTypedDataFloat32ArrayCid:
1026 case kTypedDataFloat64ArrayCid: 1021 case kTypedDataFloat64ArrayCid:
1027 return kUnboxedDouble; 1022 return kUnboxedDouble;
1028 case kTypedDataFloat32x4ArrayCid: 1023 case kTypedDataFloat32x4ArrayCid:
1029 return kUnboxedFloat32x4; 1024 return kUnboxedFloat32x4;
1030 case kTypedDataInt32x4ArrayCid: 1025 case kTypedDataInt32x4ArrayCid:
1031 return kUnboxedInt32x4; 1026 return kUnboxedInt32x4;
1032 case kTypedDataFloat64x2ArrayCid: 1027 case kTypedDataFloat64x2ArrayCid:
1033 return kUnboxedFloat64x2; 1028 return kUnboxedFloat64x2;
1034 default: 1029 default:
(...skipping 5526 matching lines...) Expand 10 before | Expand all | Expand 10 after
6561 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6556 __ movl(EDX, Immediate(kInvalidObjectPointer));
6562 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6557 __ movl(EDX, Immediate(kInvalidObjectPointer));
6563 #endif 6558 #endif
6564 } 6559 }
6565 6560
6566 } // namespace dart 6561 } // namespace dart
6567 6562
6568 #undef __ 6563 #undef __
6569 6564
6570 #endif // defined TARGET_ARCH_IA32 6565 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698