OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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/redundancy_elimination.h" | 5 #include "vm/redundancy_elimination.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/flow_graph.h" | 8 #include "vm/flow_graph.h" |
9 #include "vm/hash_map.h" | 9 #include "vm/hash_map.h" |
10 #include "vm/il_printer.h" | 10 #include "vm/il_printer.h" |
(...skipping 2521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 if (FLAG_trace_load_optimization) { | 2532 if (FLAG_trace_load_optimization) { |
2533 FlowGraphPrinter::PrintGraph("After StoreOptimizer", graph_); | 2533 FlowGraphPrinter::PrintGraph("After StoreOptimizer", graph_); |
2534 } | 2534 } |
2535 } | 2535 } |
2536 | 2536 |
2537 bool CanEliminateStore(Instruction* instr) { | 2537 bool CanEliminateStore(Instruction* instr) { |
2538 switch (instr->tag()) { | 2538 switch (instr->tag()) { |
2539 case Instruction::kStoreInstanceField: { | 2539 case Instruction::kStoreInstanceField: { |
2540 StoreInstanceFieldInstr* store_instance = instr->AsStoreInstanceField(); | 2540 StoreInstanceFieldInstr* store_instance = instr->AsStoreInstanceField(); |
2541 // Can't eliminate stores that initialize fields. | 2541 // Can't eliminate stores that initialize fields. |
2542 return !(store_instance->is_potential_unboxed_initialization() || | 2542 return !store_instance->is_initialization(); |
2543 store_instance->is_object_reference_initialization()); | |
2544 } | 2543 } |
2545 case Instruction::kStoreIndexed: | 2544 case Instruction::kStoreIndexed: |
2546 case Instruction::kStoreStaticField: | 2545 case Instruction::kStoreStaticField: |
2547 return true; | 2546 return true; |
2548 default: | 2547 default: |
2549 UNREACHABLE(); | 2548 UNREACHABLE(); |
2550 return false; | 2549 return false; |
2551 } | 2550 } |
2552 } | 2551 } |
2553 | 2552 |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3465 join->phis_ = NULL; | 3464 join->phis_ = NULL; |
3466 } else { | 3465 } else { |
3467 join->phis_->TruncateTo(to_index); | 3466 join->phis_->TruncateTo(to_index); |
3468 } | 3467 } |
3469 } | 3468 } |
3470 } | 3469 } |
3471 } | 3470 } |
3472 | 3471 |
3473 | 3472 |
3474 } // namespace dart | 3473 } // namespace dart |
OLD | NEW |