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/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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 prev_instr->set_next(next_instr); | 135 prev_instr->set_next(next_instr); |
| 136 next_instr->set_previous(prev_instr); | 136 next_instr->set_previous(prev_instr); |
| 137 // Reset successor and previous instruction to indicate | 137 // Reset successor and previous instruction to indicate |
| 138 // that the instruction is removed from the graph. | 138 // that the instruction is removed from the graph. |
| 139 set_previous(NULL); | 139 set_previous(NULL); |
| 140 set_next(NULL); | 140 set_next(NULL); |
| 141 return return_previous ? prev_instr : next_instr; | 141 return return_previous ? prev_instr : next_instr; |
| 142 } | 142 } |
| 143 | 143 |
| 144 | 144 |
| 145 Instruction* Definition::RemoveFromGraph(bool return_previous) { | |
| 146 ASSERT(use_list() == NULL); | |
|
Florian Schneider
2012/08/13 08:37:37
Alternatively, you could put the assert in Instruc
| |
| 147 return Instruction::RemoveFromGraph(return_previous); | |
| 148 } | |
| 149 | |
| 150 | |
| 145 void ForwardInstructionIterator::RemoveCurrentFromGraph() { | 151 void ForwardInstructionIterator::RemoveCurrentFromGraph() { |
| 146 current_ = current_->RemoveFromGraph(true); // Set current_ to previous. | 152 current_ = current_->RemoveFromGraph(true); // Set current_ to previous. |
| 147 } | 153 } |
| 148 | 154 |
| 149 | 155 |
| 150 // Default implementation of visiting basic blocks. Can be overridden. | 156 // Default implementation of visiting basic blocks. Can be overridden. |
| 151 void FlowGraphVisitor::VisitBlocks() { | 157 void FlowGraphVisitor::VisitBlocks() { |
| 152 for (intptr_t i = 0; i < block_order_.length(); ++i) { | 158 for (intptr_t i = 0; i < block_order_.length(); ++i) { |
| 153 BlockEntryInstr* entry = block_order_[i]; | 159 BlockEntryInstr* entry = block_order_[i]; |
| 154 entry->Accept(this); | 160 entry->Accept(this); |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1247 if (compiler->is_ssa()) { | 1253 if (compiler->is_ssa()) { |
| 1248 ASSERT(locs()->in(0).IsRegister()); | 1254 ASSERT(locs()->in(0).IsRegister()); |
| 1249 __ PushRegister(locs()->in(0).reg()); | 1255 __ PushRegister(locs()->in(0).reg()); |
| 1250 } | 1256 } |
| 1251 } | 1257 } |
| 1252 | 1258 |
| 1253 | 1259 |
| 1254 #undef __ | 1260 #undef __ |
| 1255 | 1261 |
| 1256 } // namespace dart | 1262 } // namespace dart |
| OLD | NEW |