◆ WriteBarrierElimination()
dart::WriteBarrierElimination::WriteBarrierElimination |
( |
Zone * |
zone, |
|
|
FlowGraph * |
flow_graph |
|
) |
| |
Definition at line 144 of file write_barrier_elimination.cc.
146 : flow_graph_(flow_graph), block_order_(&flow_graph->postorder()) {
147#if defined(DEBUG)
148 if (flow_graph->should_print() && FLAG_trace_write_barrier_elimination) {
149 tracing_ = true;
150 }
151#endif
152
153 IndexDefinitions(zone);
154
155 for (intptr_t
i = 0;
i < block_order_->length(); ++
i) {
156 usable_allocs_in_.Add(new (zone) BitVector(zone, definition_count_));
157 usable_allocs_in_[
i]->CopyFrom(vector_);
158
159 usable_allocs_out_.Add(new (zone) BitVector(zone, definition_count_));
160 usable_allocs_out_[
i]->CopyFrom(vector_);
161 }
162
163 processed_blocks_ = new (zone) BitVector(zone, block_order_->length());
164}
◆ Analyze()
void dart::WriteBarrierElimination::Analyze |
( |
| ) |
|
Definition at line 166 of file write_barrier_elimination.cc.
166 {
167 for (intptr_t
i = 0;
i < block_order_->length(); ++
i) {
168 worklist_.Add(block_order_->At(
i));
169 }
170
171 while (!worklist_.is_empty()) {
172 auto* const entry = worklist_.RemoveLast();
173 if (AnalyzeBlock(entry)) {
174 for (intptr_t
i = 0;
i < entry->last_instruction()->SuccessorCount();
176 if (tracing_) {
177 THR_Print(
"Enqueueing block %" Pd "\n", entry->block_id());
178 }
179 worklist_.Add(entry->last_instruction()->SuccessorAt(
i));
180 }
181 }
182 }
183}
#define THR_Print(format,...)
◆ SaveResults()
void dart::WriteBarrierElimination::SaveResults |
( |
| ) |
|
Definition at line 185 of file write_barrier_elimination.cc.
185 {
186 for (intptr_t
i = 0;
i < block_order_->length(); ++
i) {
188 UpdateVectorForBlock(block_order_->At(
i),
true);
189 }
190}
void CopyFrom(const BitVector *other)
The documentation for this class was generated from the following file: