| OLD | NEW |
| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" |
| 7 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 11 #include "vm/flow_graph_builder.h" |
| 11 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
| 12 #include "vm/flow_graph_optimizer.h" | 13 #include "vm/flow_graph_optimizer.h" |
| 13 #include "vm/locations.h" | 14 #include "vm/locations.h" |
| 14 #include "vm/object.h" | 15 #include "vm/object.h" |
| 15 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
| 16 #include "vm/os.h" | 17 #include "vm/os.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 198 } |
| 198 | 199 |
| 199 | 200 |
| 200 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const { | 201 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const { |
| 201 LoadIndexedInstr* other_load = other->AsLoadIndexed(); | 202 LoadIndexedInstr* other_load = other->AsLoadIndexed(); |
| 202 ASSERT(other_load != NULL); | 203 ASSERT(other_load != NULL); |
| 203 return class_id() == other_load->class_id(); | 204 return class_id() == other_load->class_id(); |
| 204 } | 205 } |
| 205 | 206 |
| 206 | 207 |
| 208 ConstantInstr::ConstantInstr(const Object& value) : value_(value) { |
| 209 // Check that the value is not an incorrect Integer representation. |
| 210 ASSERT(!value.IsBigint() || |
| 211 !BigintOperations::FitsIntoSmi(Bigint::Cast(value))); |
| 212 ASSERT(!value.IsBigint() || |
| 213 !BigintOperations::FitsIntoInt64(Bigint::Cast(value))); |
| 214 ASSERT(!value.IsMint() || !Smi::IsValid64(Mint::Cast(value).AsInt64Value())); |
| 215 } |
| 216 |
| 217 |
| 207 bool ConstantInstr::AttributesEqual(Instruction* other) const { | 218 bool ConstantInstr::AttributesEqual(Instruction* other) const { |
| 208 ConstantInstr* other_constant = other->AsConstant(); | 219 ConstantInstr* other_constant = other->AsConstant(); |
| 209 ASSERT(other_constant != NULL); | 220 ASSERT(other_constant != NULL); |
| 210 return (value().raw() == other_constant->value().raw()); | 221 return (value().raw() == other_constant->value().raw()); |
| 211 } | 222 } |
| 212 | 223 |
| 213 | 224 |
| 214 // Returns true if the value represents a constant. | 225 // Returns true if the value represents a constant. |
| 215 bool Value::BindsToConstant() const { | 226 bool Value::BindsToConstant() const { |
| 216 return definition()->IsConstant(); | 227 return definition()->IsConstant(); |
| (...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2450 default: | 2461 default: |
| 2451 UNREACHABLE(); | 2462 UNREACHABLE(); |
| 2452 } | 2463 } |
| 2453 return kPowRuntimeEntry; | 2464 return kPowRuntimeEntry; |
| 2454 } | 2465 } |
| 2455 | 2466 |
| 2456 | 2467 |
| 2457 #undef __ | 2468 #undef __ |
| 2458 | 2469 |
| 2459 } // namespace dart | 2470 } // namespace dart |
| OLD | NEW |