| 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/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 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 // Try symbolic comparison. | 2332 // Try symbolic comparison. |
| 2333 do { | 2333 do { |
| 2334 if (DependOnSameSymbol(max, length)) return max.offset() < length.offset(); | 2334 if (DependOnSameSymbol(max, length)) return max.offset() < length.offset(); |
| 2335 } while (CanonicalizeMaxBoundary(&max) || CanonicalizeMinBoundary(&length)); | 2335 } while (CanonicalizeMaxBoundary(&max) || CanonicalizeMinBoundary(&length)); |
| 2336 | 2336 |
| 2337 // Failed to prove that maximum is bounded with array length. | 2337 // Failed to prove that maximum is bounded with array length. |
| 2338 return false; | 2338 return false; |
| 2339 } | 2339 } |
| 2340 | 2340 |
| 2341 | 2341 |
| 2342 Instruction* CheckArrayBoundInstr::Canonicalize(FlowGraph* flow_graph) { |
| 2343 return IsRedundant(RangeBoundary::FromDefinition(length()->definition())) ? |
| 2344 NULL : this; |
| 2345 } |
| 2346 |
| 2347 |
| 2342 intptr_t CheckArrayBoundInstr::LengthOffsetFor(intptr_t class_id) { | 2348 intptr_t CheckArrayBoundInstr::LengthOffsetFor(intptr_t class_id) { |
| 2343 if (RawObject::IsExternalTypedDataClassId(class_id)) { | 2349 if (RawObject::IsExternalTypedDataClassId(class_id)) { |
| 2344 return ExternalTypedData::length_offset(); | 2350 return ExternalTypedData::length_offset(); |
| 2345 } | 2351 } |
| 2346 if (RawObject::IsTypedDataClassId(class_id)) { | 2352 if (RawObject::IsTypedDataClassId(class_id)) { |
| 2347 return TypedData::length_offset(); | 2353 return TypedData::length_offset(); |
| 2348 } | 2354 } |
| 2349 switch (class_id) { | 2355 switch (class_id) { |
| 2350 case kGrowableObjectArrayCid: | 2356 case kGrowableObjectArrayCid: |
| 2351 return GrowableObjectArray::length_offset(); | 2357 return GrowableObjectArray::length_offset(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2445 default: | 2451 default: |
| 2446 UNREACHABLE(); | 2452 UNREACHABLE(); |
| 2447 } | 2453 } |
| 2448 return kPowRuntimeEntry; | 2454 return kPowRuntimeEntry; |
| 2449 } | 2455 } |
| 2450 | 2456 |
| 2451 | 2457 |
| 2452 #undef __ | 2458 #undef __ |
| 2453 | 2459 |
| 2454 } // namespace dart | 2460 } // namespace dart |
| OLD | NEW |