| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const { | 146 bool LoadStaticFieldInstr::AttributesEqual(Instruction* other) const { |
| 147 LoadStaticFieldInstr* other_load = other->AsLoadStaticField(); | 147 LoadStaticFieldInstr* other_load = other->AsLoadStaticField(); |
| 148 ASSERT(other_load != NULL); | 148 ASSERT(other_load != NULL); |
| 149 // Assert that the field is initialized. | 149 // Assert that the field is initialized. |
| 150 ASSERT(field().value() != Object::sentinel()); | 150 ASSERT(field().value() != Object::sentinel()); |
| 151 ASSERT(field().value() != Object::transition_sentinel()); | 151 ASSERT(field().value() != Object::transition_sentinel()); |
| 152 return field().raw() == other_load->field().raw(); | 152 return field().raw() == other_load->field().raw(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 | 155 |
| 156 bool StringCharCodeAtInstr::AttributesEqual(Instruction* other) const { |
| 157 StringCharCodeAtInstr* other_load = other->AsStringCharCodeAt(); |
| 158 ASSERT(other_load != NULL); |
| 159 return class_id() == other_load->class_id(); |
| 160 } |
| 161 |
| 162 |
| 156 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const { | 163 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const { |
| 157 LoadIndexedInstr* other_load = other->AsLoadIndexed(); | 164 LoadIndexedInstr* other_load = other->AsLoadIndexed(); |
| 158 ASSERT(other_load != NULL); | 165 ASSERT(other_load != NULL); |
| 159 return class_id() == other_load->class_id(); | 166 return class_id() == other_load->class_id(); |
| 160 } | 167 } |
| 161 | 168 |
| 162 | 169 |
| 163 bool ConstantInstr::AttributesEqual(Instruction* other) const { | 170 bool ConstantInstr::AttributesEqual(Instruction* other) const { |
| 164 ConstantInstr* other_constant = other->AsConstant(); | 171 ConstantInstr* other_constant = other->AsConstant(); |
| 165 ASSERT(other_constant != NULL); | 172 ASSERT(other_constant != NULL); |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 | 1113 |
| 1107 | 1114 |
| 1108 RawAbstractType* NativeCallInstr::CompileType() const { | 1115 RawAbstractType* NativeCallInstr::CompileType() const { |
| 1109 // The result type of the native function is identical to the result type of | 1116 // The result type of the native function is identical to the result type of |
| 1110 // the enclosing native Dart function. However, we prefer to check the type | 1117 // the enclosing native Dart function. However, we prefer to check the type |
| 1111 // of the value returned from the native call. | 1118 // of the value returned from the native call. |
| 1112 return Type::DynamicType(); | 1119 return Type::DynamicType(); |
| 1113 } | 1120 } |
| 1114 | 1121 |
| 1115 | 1122 |
| 1123 RawAbstractType* StringCharCodeAtInstr::CompileType() const { |
| 1124 return Type::IntType(); |
| 1125 } |
| 1126 |
| 1127 |
| 1128 intptr_t StringCharCodeAtInstr::ResultCid() const { |
| 1129 return kSmiCid; |
| 1130 } |
| 1131 |
| 1132 |
| 1116 RawAbstractType* LoadIndexedInstr::CompileType() const { | 1133 RawAbstractType* LoadIndexedInstr::CompileType() const { |
| 1117 switch (class_id_) { | 1134 switch (class_id_) { |
| 1118 case kArrayCid: | 1135 case kArrayCid: |
| 1119 case kGrowableObjectArrayCid: | 1136 case kGrowableObjectArrayCid: |
| 1120 case kImmutableArrayCid: | 1137 case kImmutableArrayCid: |
| 1121 return Type::DynamicType(); | 1138 return Type::DynamicType(); |
| 1122 case kFloat32ArrayCid : | 1139 case kFloat32ArrayCid : |
| 1123 case kFloat64ArrayCid : | 1140 case kFloat64ArrayCid : |
| 1124 return Type::Double(); | 1141 return Type::Double(); |
| 1125 default: | 1142 default: |
| (...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2598 // Try symbolic comparison. | 2615 // Try symbolic comparison. |
| 2599 do { | 2616 do { |
| 2600 if (DependOnSameSymbol(max, length)) return max.offset() < length.offset(); | 2617 if (DependOnSameSymbol(max, length)) return max.offset() < length.offset(); |
| 2601 } while (CanonicalizeMaxBoundary(&max) || CanonicalizeMinBoundary(&length)); | 2618 } while (CanonicalizeMaxBoundary(&max) || CanonicalizeMinBoundary(&length)); |
| 2602 | 2619 |
| 2603 // Failed to prove that maximum is bounded with array length. | 2620 // Failed to prove that maximum is bounded with array length. |
| 2604 return false; | 2621 return false; |
| 2605 } | 2622 } |
| 2606 | 2623 |
| 2607 | 2624 |
| 2625 intptr_t CheckArrayBoundInstr::LengthOffsetFor(intptr_t class_id) { |
| 2626 switch (class_id) { |
| 2627 case kGrowableObjectArrayCid: |
| 2628 return GrowableObjectArray::length_offset(); |
| 2629 case kFloat64ArrayCid: |
| 2630 return Float64Array::length_offset(); |
| 2631 case kFloat32ArrayCid: |
| 2632 return Float32Array::length_offset(); |
| 2633 case kOneByteStringCid: |
| 2634 case kTwoByteStringCid: |
| 2635 return String::length_offset(); |
| 2636 case kArrayCid: |
| 2637 case kImmutableArrayCid: |
| 2638 return Array::length_offset(); |
| 2639 default: |
| 2640 UNREACHABLE(); |
| 2641 return -1; |
| 2642 } |
| 2643 } |
| 2644 |
| 2608 #undef __ | 2645 #undef __ |
| 2609 | 2646 |
| 2610 } // namespace dart | 2647 } // namespace dart |
| OLD | NEW |