| 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 3063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3074 // IR follows the following pattern: loads, materializations, deoptimizing | 3074 // IR follows the following pattern: loads, materializations, deoptimizing |
| 3075 // instruction. | 3075 // instruction. |
| 3076 Instruction* load_point = FirstMaterializationAt(exit); | 3076 Instruction* load_point = FirstMaterializationAt(exit); |
| 3077 | 3077 |
| 3078 // Insert load instruction for every field. | 3078 // Insert load instruction for every field. |
| 3079 for (intptr_t i = 0; i < slots.length(); i++) { | 3079 for (intptr_t i = 0; i < slots.length(); i++) { |
| 3080 LoadFieldInstr* load = | 3080 LoadFieldInstr* load = |
| 3081 slots[i]->IsField() | 3081 slots[i]->IsField() |
| 3082 ? new (Z) LoadFieldInstr( | 3082 ? new (Z) LoadFieldInstr( |
| 3083 new (Z) Value(alloc), &Field::Cast(*slots[i]), | 3083 new (Z) Value(alloc), &Field::Cast(*slots[i]), |
| 3084 AbstractType::ZoneHandle(Z), alloc->token_pos()) | 3084 AbstractType::ZoneHandle(Z), alloc->token_pos(), NULL) |
| 3085 : new (Z) LoadFieldInstr( | 3085 : new (Z) LoadFieldInstr( |
| 3086 new (Z) Value(alloc), Smi::Cast(*slots[i]).Value(), | 3086 new (Z) Value(alloc), Smi::Cast(*slots[i]).Value(), |
| 3087 AbstractType::ZoneHandle(Z), alloc->token_pos()); | 3087 AbstractType::ZoneHandle(Z), alloc->token_pos()); |
| 3088 flow_graph_->InsertBefore(load_point, load, NULL, FlowGraph::kValue); | 3088 flow_graph_->InsertBefore(load_point, load, NULL, FlowGraph::kValue); |
| 3089 values->Add(new (Z) Value(load)); | 3089 values->Add(new (Z) Value(load)); |
| 3090 } | 3090 } |
| 3091 | 3091 |
| 3092 MaterializeObjectInstr* mat = NULL; | 3092 MaterializeObjectInstr* mat = NULL; |
| 3093 if (alloc->IsAllocateObject()) { | 3093 if (alloc->IsAllocateObject()) { |
| 3094 mat = new (Z) | 3094 mat = new (Z) |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3374 join->phis_ = NULL; | 3374 join->phis_ = NULL; |
| 3375 } else { | 3375 } else { |
| 3376 join->phis_->TruncateTo(to_index); | 3376 join->phis_->TruncateTo(to_index); |
| 3377 } | 3377 } |
| 3378 } | 3378 } |
| 3379 } | 3379 } |
| 3380 } | 3380 } |
| 3381 | 3381 |
| 3382 | 3382 |
| 3383 } // namespace dart | 3383 } // namespace dart |
| OLD | NEW |