Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::SSACompactor Class Reference
Inheritance diagram for dart::SSACompactor:
dart::ValueObject

Public Member Functions

 SSACompactor (intptr_t num_blocks, intptr_t num_ssa_vars, ZoneGrowableArray< Definition * > *detached_defs)
 
void RenumberGraph (FlowGraph *graph)
 
- Public Member Functions inherited from dart::ValueObject
 ValueObject ()
 
 ~ValueObject ()
 

Detailed Description

Definition at line 3248 of file flow_graph.cc.

Constructor & Destructor Documentation

◆ SSACompactor()

dart::SSACompactor::SSACompactor ( intptr_t  num_blocks,
intptr_t  num_ssa_vars,
ZoneGrowableArray< Definition * > *  detached_defs 
)
inline

Definition at line 3250 of file flow_graph.cc.

3253 : block_num_(num_blocks),
3254 ssa_num_(num_ssa_vars),
3255 detached_defs_(detached_defs) {
3256 block_num_.EnsureLength(num_blocks, -1);
3257 ssa_num_.EnsureLength(num_ssa_vars, -1);
3258 }
void EnsureLength(intptr_t new_length, const T &default_value)

Member Function Documentation

◆ RenumberGraph()

void dart::SSACompactor::RenumberGraph ( FlowGraph graph)
inline

Definition at line 3260 of file flow_graph.cc.

3260 {
3261 for (auto block : graph->reverse_postorder()) {
3262 block_num_[block->block_id()] = 1;
3263 CollectDetachedMaterializations(block->env());
3264
3265 if (auto* block_with_idefs = block->AsBlockEntryWithInitialDefs()) {
3266 for (Definition* def : *block_with_idefs->initial_definitions()) {
3267 RenumberDefinition(def);
3268 CollectDetachedMaterializations(def->env());
3269 }
3270 }
3271 if (auto* join = block->AsJoinEntry()) {
3272 for (PhiIterator it(join); !it.Done(); it.Advance()) {
3273 RenumberDefinition(it.Current());
3274 }
3275 }
3276 for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
3277 Instruction* instr = it.Current();
3278 if (Definition* def = instr->AsDefinition()) {
3279 RenumberDefinition(def);
3280 }
3281 CollectDetachedMaterializations(instr->env());
3282 }
3283 }
3284 for (auto* def : (*detached_defs_)) {
3285 RenumberDefinition(def);
3286 }
3287 graph->set_current_ssa_temp_index(current_ssa_index_);
3288
3289 // Preserve order between block ids to as predecessors are sorted
3290 // by block ids.
3291 intptr_t current_block_index = 0;
3292 for (intptr_t i = 0, n = block_num_.length(); i < n; ++i) {
3293 if (block_num_[i] >= 0) {
3294 block_num_[i] = current_block_index++;
3295 }
3296 }
3297 for (auto block : graph->reverse_postorder()) {
3298 block->set_block_id(block_num_[block->block_id()]);
3299 }
3300 graph->set_max_block_id(current_block_index - 1);
3301 }
intptr_t length() const

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