Chromium Code Reviews| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 618 return true; | 618 return true; |
| 619 } | 619 } |
| 620 | 620 |
| 621 | 621 |
| 622 | 622 |
| 623 bool FlowGraphOptimizer::TryReplaceWithLoadIndexed(InstanceCallInstr* call) { | 623 bool FlowGraphOptimizer::TryReplaceWithLoadIndexed(InstanceCallInstr* call) { |
| 624 const intptr_t class_id = ReceiverClassId(call); | 624 const intptr_t class_id = ReceiverClassId(call); |
| 625 switch (class_id) { | 625 switch (class_id) { |
| 626 case kArrayCid: | 626 case kArrayCid: |
| 627 case kImmutableArrayCid: | 627 case kImmutableArrayCid: |
| 628 case kGrowableObjectArrayCid: | 628 case kGrowableObjectArrayCid: |
|
srdjan
2012/11/22 18:18:19
Remove kGrowableObjectArrayCid?
Florian Schneider
2012/11/23 14:49:39
Here we still need GrowableObjectArray. Only the o
| |
| 629 case kFloat32ArrayCid: | 629 case kFloat32ArrayCid: |
| 630 case kFloat64ArrayCid: | 630 case kFloat64ArrayCid: |
| 631 case kUint8ArrayCid: | |
| 632 case kExternalUint8ArrayCid: | |
| 631 // Acceptable load index classes. | 633 // Acceptable load index classes. |
| 632 break; | 634 break; |
| 633 default: | 635 default: |
| 634 return false; | 636 return false; |
| 635 } | 637 } |
| 636 Value* array = NULL; | 638 Value* array = NULL; |
| 637 Value* index = NULL; | 639 Value* index = NULL; |
| 638 intptr_t array_cid = PrepareIndexedOp(call, class_id, &array, &index); | 640 intptr_t array_cid = PrepareIndexedOp(call, class_id, &array, &index); |
| 639 Definition* array_op = new LoadIndexedInstr(array, index, array_cid); | 641 Definition* array_op = new LoadIndexedInstr(array, index, array_cid); |
| 640 call->ReplaceWith(array_op, current_iterator()); | 642 call->ReplaceWith(array_op, current_iterator()); |
| (...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3757 | 3759 |
| 3758 if (FLAG_trace_constant_propagation) { | 3760 if (FLAG_trace_constant_propagation) { |
| 3759 OS::Print("\n==== After constant propagation ====\n"); | 3761 OS::Print("\n==== After constant propagation ====\n"); |
| 3760 FlowGraphPrinter printer(*graph_); | 3762 FlowGraphPrinter printer(*graph_); |
| 3761 printer.PrintBlocks(); | 3763 printer.PrintBlocks(); |
| 3762 } | 3764 } |
| 3763 } | 3765 } |
| 3764 | 3766 |
| 3765 | 3767 |
| 3766 } // namespace dart | 3768 } // namespace dart |
| OLD | NEW |