| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 return AttributesEqual(other); | 55 return AttributesEqual(other); |
| 56 } | 56 } |
| 57 | 57 |
| 58 | 58 |
| 59 bool Value::Equals(Value* other) const { | 59 bool Value::Equals(Value* other) const { |
| 60 return definition() == other->definition(); | 60 return definition() == other->definition(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 |
| 65 CheckClassInstr::CheckClassInstr(Value* value, |
| 66 intptr_t deopt_id, |
| 67 const ICData& unary_checks) |
| 68 : unary_checks_(unary_checks) { |
| 69 ASSERT(value != NULL); |
| 70 ASSERT(unary_checks.IsZoneHandle()); |
| 71 // Expected useful check data. |
| 72 ASSERT(!unary_checks_.IsNull() && |
| 73 (unary_checks_.NumberOfChecks() > 0) && |
| 74 (unary_checks_.num_args_tested() == 1)); |
| 75 inputs_[0] = value; |
| 76 deopt_id_ = deopt_id; |
| 77 // Otherwise use CheckSmiInstr. |
| 78 ASSERT((unary_checks_.NumberOfChecks() != 1) || |
| 79 (unary_checks_.GetReceiverClassIdAt(0) != kSmiCid)); |
| 80 } |
| 81 |
| 82 |
| 64 bool CheckClassInstr::AttributesEqual(Instruction* other) const { | 83 bool CheckClassInstr::AttributesEqual(Instruction* other) const { |
| 65 CheckClassInstr* other_check = other->AsCheckClass(); | 84 CheckClassInstr* other_check = other->AsCheckClass(); |
| 66 ASSERT(other_check != NULL); | 85 ASSERT(other_check != NULL); |
| 67 if (unary_checks().NumberOfChecks() != | 86 if (unary_checks().NumberOfChecks() != |
| 68 other_check->unary_checks().NumberOfChecks()) { | 87 other_check->unary_checks().NumberOfChecks()) { |
| 69 return false; | 88 return false; |
| 70 } | 89 } |
| 71 for (intptr_t i = 0; i < unary_checks().NumberOfChecks(); ++i) { | 90 for (intptr_t i = 0; i < unary_checks().NumberOfChecks(); ++i) { |
| 72 // TODO(fschneider): Make sure ic_data are sorted to hit more cases. | 91 // TODO(fschneider): Make sure ic_data are sorted to hit more cases. |
| 73 if (unary_checks().GetReceiverClassIdAt(i) != | 92 if (unary_checks().GetReceiverClassIdAt(i) != |
| (...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2198 ASSERT(!new_min.IsUnknown() && !new_max.IsUnknown()); | 2217 ASSERT(!new_min.IsUnknown() && !new_max.IsUnknown()); |
| 2199 set_overflow(new_min.Overflowed() || new_max.Overflowed()); | 2218 set_overflow(new_min.Overflowed() || new_max.Overflowed()); |
| 2200 | 2219 |
| 2201 range_ = new Range(new_min.Clamp(), new_max.Clamp()); | 2220 range_ = new Range(new_min.Clamp(), new_max.Clamp()); |
| 2202 } | 2221 } |
| 2203 | 2222 |
| 2204 | 2223 |
| 2205 #undef __ | 2224 #undef __ |
| 2206 | 2225 |
| 2207 } // namespace dart | 2226 } // namespace dart |
| OLD | NEW |