Flutter Engine
The Flutter Engine
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 3016 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 3018 of file flow_graph.cc.

3021 : block_num_(num_blocks),
3022 ssa_num_(num_ssa_vars),
3023 detached_defs_(detached_defs) {
3024 block_num_.EnsureLength(num_blocks, -1);
3025 ssa_num_.EnsureLength(num_ssa_vars, -1);
3026 }
void EnsureLength(intptr_t new_length, const T &default_value)

Member Function Documentation

◆ RenumberGraph()

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

Definition at line 3028 of file flow_graph.cc.

3028 {
3029 for (auto block : graph->reverse_postorder()) {
3030 block_num_[block->block_id()] = 1;
3031 CollectDetachedMaterializations(block->env());
3032
3033 if (auto* block_with_idefs = block->AsBlockEntryWithInitialDefs()) {
3034 for (Definition* def : *block_with_idefs->initial_definitions()) {
3035 RenumberDefinition(def);
3036 CollectDetachedMaterializations(def->env());
3037 }
3038 }
3039 if (auto* join = block->AsJoinEntry()) {
3040 for (PhiIterator it(join); !it.Done(); it.Advance()) {
3041 RenumberDefinition(it.Current());
3042 }
3043 }
3044 for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
3045 Instruction* instr = it.Current();
3046 if (Definition* def = instr->AsDefinition()) {
3047 RenumberDefinition(def);
3048 }
3049 CollectDetachedMaterializations(instr->env());
3050 }
3051 }
3052 for (auto* def : (*detached_defs_)) {
3053 RenumberDefinition(def);
3054 }
3055 graph->set_current_ssa_temp_index(current_ssa_index_);
3056
3057 // Preserve order between block ids to as predecessors are sorted
3058 // by block ids.
3059 intptr_t current_block_index = 0;
3060 for (intptr_t i = 0, n = block_num_.length(); i < n; ++i) {
3061 if (block_num_[i] >= 0) {
3062 block_num_[i] = current_block_index++;
3063 }
3064 }
3065 for (auto block : graph->reverse_postorder()) {
3066 block->set_block_id(block_num_[block->block_id()]);
3067 }
3068 graph->set_max_block_id(current_block_index - 1);
3069 }
intptr_t length() const
static SkString join(const CommandLineFlags::StringArray &)
Definition: skpbench.cpp:741

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