OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 M(ExtractNthOutput) \ | 101 M(ExtractNthOutput) \ |
102 M(BinaryUint32Op) \ | 102 M(BinaryUint32Op) \ |
103 M(ShiftUint32Op) \ | 103 M(ShiftUint32Op) \ |
104 M(UnaryUint32Op) \ | 104 M(UnaryUint32Op) \ |
105 M(UnboxedIntConverter) \ | 105 M(UnboxedIntConverter) \ |
106 M(GrowRegExpStack) \ | 106 M(GrowRegExpStack) \ |
107 M(BoxInteger32) \ | 107 M(BoxInteger32) \ |
108 M(UnboxInteger32) \ | 108 M(UnboxInteger32) \ |
109 M(CheckedSmiOp) \ | 109 M(CheckedSmiOp) \ |
110 M(CheckArrayBound) \ | 110 M(CheckArrayBound) \ |
111 M(CheckSmi) \ | |
112 M(CheckClassId) \ | 111 M(CheckClassId) \ |
113 M(CheckClass) \ | 112 M(CheckClass) \ |
114 M(BinarySmiOp) \ | 113 M(BinarySmiOp) \ |
115 M(TestSmi) \ | 114 M(TestSmi) \ |
116 M(RelationalOp) \ | 115 M(RelationalOp) \ |
117 M(EqualityCompare) \ | 116 M(EqualityCompare) \ |
118 M(LoadIndexed) | 117 M(LoadIndexed) |
119 | 118 |
120 // Location summaries actually are not used by the unoptimizing DBC compiler | 119 // Location summaries actually are not used by the unoptimizing DBC compiler |
121 // because we don't allocate any registers. | 120 // because we don't allocate any registers. |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
843 default: | 842 default: |
844 UNREACHABLE(); | 843 UNREACHABLE(); |
845 return kTagged; | 844 return kTagged; |
846 } | 845 } |
847 } | 846 } |
848 | 847 |
849 | 848 |
850 Representation StoreIndexedInstr::RequiredInputRepresentation( | 849 Representation StoreIndexedInstr::RequiredInputRepresentation( |
851 intptr_t idx) const { | 850 intptr_t idx) const { |
852 // Array can be a Dart object or a pointer to external data. | 851 // Array can be a Dart object or a pointer to external data. |
853 if (idx == 0) return kNoRepresentation; // Flexible input representation. | 852 if (idx == 0) { |
854 if (idx == 1) return kTagged; // Index is a smi. | 853 return kNoRepresentation; // Flexible input representation. |
854 } | |
855 if (idx == 1) { | |
856 return kTagged; // Index is a smi. | |
857 } | |
855 ASSERT(idx == 2); | 858 ASSERT(idx == 2); |
856 switch (class_id_) { | 859 switch (class_id_) { |
857 case kArrayCid: | 860 case kArrayCid: |
858 case kOneByteStringCid: | 861 case kOneByteStringCid: |
859 case kTwoByteStringCid: | 862 case kTwoByteStringCid: |
860 case kExternalOneByteStringCid: | 863 case kExternalOneByteStringCid: |
861 case kExternalTwoByteStringCid: | 864 case kExternalTwoByteStringCid: |
862 case kTypedDataInt8ArrayCid: | 865 case kTypedDataInt8ArrayCid: |
863 case kTypedDataUint8ArrayCid: | 866 case kTypedDataUint8ArrayCid: |
864 case kExternalTypedDataUint8ArrayCid: | 867 case kExternalTypedDataUint8ArrayCid: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
896 // environment. | 899 // environment. |
897 ASSERT(argc <= values_.length()); | 900 ASSERT(argc <= values_.length()); |
898 for (intptr_t i = 0; i < argc; i++) { | 901 for (intptr_t i = 0; i < argc; i++) { |
899 ASSERT(values_[values_.length() - i - 1]->definition()->IsPushArgument()); | 902 ASSERT(values_[values_.length() - i - 1]->definition()->IsPushArgument()); |
900 } | 903 } |
901 #endif | 904 #endif |
902 values_.TruncateTo(values_.length() - argc); | 905 values_.TruncateTo(values_.length() - argc); |
903 } | 906 } |
904 | 907 |
905 | 908 |
909 EMIT_NATIVE_CODE(CheckSmi, 1) { | |
910 __ CheckSmi(locs()->in(0).reg()); | |
911 compiler->AddDeoptWithoutStub(deopt_id(), | |
912 ICData::kDeoptCheckSmi, | |
913 licm_hoisted_ ? ICData::kHoisted : 0); | |
914 __ Deopt(0, deopt_id()); | |
Vyacheslav Egorov (Google)
2016/06/09 15:09:06
I would prefer to write this as
compiler->EmitDe
zra
2016/06/09 16:42:23
Done.
| |
915 } | |
916 | |
906 } // namespace dart | 917 } // namespace dart |
907 | 918 |
908 #endif // defined TARGET_ARCH_DBC | 919 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |