| 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/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| (...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 } | 1347 } |
| 1348 } | 1348 } |
| 1349 | 1349 |
| 1350 | 1350 |
| 1351 Definition* ConstantInstr::Canonicalize(FlowGraph* flow_graph) { | 1351 Definition* ConstantInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1352 return HasUses() ? this : NULL; | 1352 return HasUses() ? this : NULL; |
| 1353 } | 1353 } |
| 1354 | 1354 |
| 1355 | 1355 |
| 1356 Definition* LoadFieldInstr::Canonicalize(FlowGraph* flow_graph) { | 1356 Definition* LoadFieldInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1357 if (!HasUses()) return NULL; |
| 1357 if (!IsImmutableLengthLoad()) return this; | 1358 if (!IsImmutableLengthLoad()) return this; |
| 1358 | 1359 |
| 1359 // For fixed length arrays if the array is the result of a known constructor | 1360 // For fixed length arrays if the array is the result of a known constructor |
| 1360 // call we can replace the length load with the length argument passed to | 1361 // call we can replace the length load with the length argument passed to |
| 1361 // the constructor. | 1362 // the constructor. |
| 1362 StaticCallInstr* call = instance()->definition()->AsStaticCall(); | 1363 StaticCallInstr* call = instance()->definition()->AsStaticCall(); |
| 1363 if ((call != NULL) && | 1364 if ((call != NULL) && |
| 1364 call->is_known_list_constructor() && | 1365 call->is_known_list_constructor() && |
| 1365 IsFixedLengthArrayCid(call->Type()->ToCid())) { | 1366 IsFixedLengthArrayCid(call->Type()->ToCid())) { |
| 1366 return call->ArgumentAt(1); | 1367 return call->ArgumentAt(1); |
| (...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2650 default: | 2651 default: |
| 2651 UNREACHABLE(); | 2652 UNREACHABLE(); |
| 2652 } | 2653 } |
| 2653 return kPowRuntimeEntry; | 2654 return kPowRuntimeEntry; |
| 2654 } | 2655 } |
| 2655 | 2656 |
| 2656 | 2657 |
| 2657 #undef __ | 2658 #undef __ |
| 2658 | 2659 |
| 2659 } // namespace dart | 2660 } // namespace dart |
| OLD | NEW |