| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 | 1055 |
| 1056 RawAbstractType* NativeCallInstr::CompileType() const { | 1056 RawAbstractType* NativeCallInstr::CompileType() const { |
| 1057 // The result type of the native function is identical to the result type of | 1057 // The result type of the native function is identical to the result type of |
| 1058 // the enclosing native Dart function. However, we prefer to check the type | 1058 // the enclosing native Dart function. However, we prefer to check the type |
| 1059 // of the value returned from the native call. | 1059 // of the value returned from the native call. |
| 1060 return Type::DynamicType(); | 1060 return Type::DynamicType(); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 | 1063 |
| 1064 RawAbstractType* LoadIndexedInstr::CompileType() const { | 1064 RawAbstractType* LoadIndexedInstr::CompileType() const { |
| 1065 return Type::DynamicType(); | 1065 switch (class_id_) { |
| 1066 case kArrayCid: |
| 1067 case kGrowableObjectArrayCid: |
| 1068 case kImmutableArrayCid: |
| 1069 return Type::DynamicType(); |
| 1070 case kFloat32ArrayCid : |
| 1071 case kFloat64ArrayCid : |
| 1072 return Type::Double(); |
| 1073 default: |
| 1074 UNIMPLEMENTED(); |
| 1075 return Type::IntType(); |
| 1076 } |
| 1077 } |
| 1078 |
| 1079 |
| 1080 intptr_t LoadIndexedInstr::ResultCid() const { |
| 1081 switch (class_id_) { |
| 1082 case kArrayCid: |
| 1083 case kGrowableObjectArrayCid: |
| 1084 case kImmutableArrayCid: |
| 1085 return kDynamicCid; |
| 1086 case kFloat32ArrayCid : |
| 1087 case kFloat64ArrayCid : |
| 1088 return kDoubleCid; |
| 1089 default: |
| 1090 UNIMPLEMENTED(); |
| 1091 return kSmiCid; |
| 1092 } |
| 1093 } |
| 1094 |
| 1095 |
| 1096 Representation LoadIndexedInstr::representation() const { |
| 1097 switch (class_id_) { |
| 1098 case kArrayCid: |
| 1099 case kGrowableObjectArrayCid: |
| 1100 case kImmutableArrayCid: |
| 1101 return kTagged; |
| 1102 case kFloat32ArrayCid : |
| 1103 case kFloat64ArrayCid : |
| 1104 return kUnboxedDouble; |
| 1105 default: |
| 1106 UNIMPLEMENTED(); |
| 1107 return kTagged; |
| 1108 } |
| 1066 } | 1109 } |
| 1067 | 1110 |
| 1068 | 1111 |
| 1069 RawAbstractType* StoreIndexedInstr::CompileType() const { | 1112 RawAbstractType* StoreIndexedInstr::CompileType() const { |
| 1070 return AbstractType::null(); | 1113 return AbstractType::null(); |
| 1071 } | 1114 } |
| 1072 | 1115 |
| 1073 | 1116 |
| 1117 Representation StoreIndexedInstr::RequiredInputRepresentation( |
| 1118 intptr_t idx) const { |
| 1119 if ((idx == 0) || (idx == 1)) return kTagged; |
| 1120 ASSERT(idx == 2); |
| 1121 switch (class_id_) { |
| 1122 case kArrayCid: |
| 1123 case kGrowableObjectArrayCid: |
| 1124 case kImmutableArrayCid: |
| 1125 return kTagged; |
| 1126 case kFloat32ArrayCid : |
| 1127 case kFloat64ArrayCid : |
| 1128 return kUnboxedDouble; |
| 1129 default: |
| 1130 UNIMPLEMENTED(); |
| 1131 return kTagged; |
| 1132 } |
| 1133 } |
| 1134 |
| 1135 |
| 1074 RawAbstractType* StoreInstanceFieldInstr::CompileType() const { | 1136 RawAbstractType* StoreInstanceFieldInstr::CompileType() const { |
| 1075 return value()->CompileType(); | 1137 return value()->CompileType(); |
| 1076 } | 1138 } |
| 1077 | 1139 |
| 1078 | 1140 |
| 1079 RawAbstractType* LoadStaticFieldInstr::CompileType() const { | 1141 RawAbstractType* LoadStaticFieldInstr::CompileType() const { |
| 1080 if (FLAG_enable_type_checks) { | 1142 if (FLAG_enable_type_checks) { |
| 1081 return field().type(); | 1143 return field().type(); |
| 1082 } | 1144 } |
| 1083 return Type::DynamicType(); | 1145 return Type::DynamicType(); |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2086 new_max = new_max.Clamp(); | 2148 new_max = new_max.Clamp(); |
| 2087 } | 2149 } |
| 2088 | 2150 |
| 2089 return Range::Update(&range_, new_min, new_max); | 2151 return Range::Update(&range_, new_min, new_max); |
| 2090 } | 2152 } |
| 2091 | 2153 |
| 2092 | 2154 |
| 2093 #undef __ | 2155 #undef __ |
| 2094 | 2156 |
| 2095 } // namespace dart | 2157 } // namespace dart |
| OLD | NEW |