Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::WriteBarrierElimination Class Reference
Inheritance diagram for dart::WriteBarrierElimination:
dart::ValueObject

Public Member Functions

 WriteBarrierElimination (Zone *zone, FlowGraph *flow_graph)
 
void Analyze ()
 
void SaveResults ()
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 73 of file write_barrier_elimination.cc.

Constructor & Destructor Documentation

◆ 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}

Member Function Documentation

◆ 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();
175 ++i) {
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,...)
Definition: log.h:20
#define Pd
Definition: globals.h:408

◆ 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) {
187 vector_->CopyFrom(usable_allocs_in_[i]);
188 UpdateVectorForBlock(block_order_->At(i), /*finalize=*/true);
189 }
190}
void CopyFrom(const BitVector *other)
Definition: bit_vector.h:54

The documentation for this class was generated from the following file: