Flutter Engine
The Flutter Engine
Namespaces | Macros | Functions | Variables
compiler_pass.cc File Reference
#include "vm/compiler/compiler_pass.h"
#include "vm/compiler/backend/block_scheduler.h"
#include "vm/compiler/backend/branch_optimizer.h"
#include "vm/compiler/backend/constant_propagator.h"
#include "vm/compiler/backend/flow_graph_checker.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/compiler/backend/il_printer.h"
#include "vm/compiler/backend/inliner.h"
#include "vm/compiler/backend/linearscan.h"
#include "vm/compiler/backend/range_analysis.h"
#include "vm/compiler/backend/redundancy_elimination.h"
#include "vm/compiler/backend/type_propagator.h"
#include "vm/compiler/call_specializer.h"
#include "vm/compiler/compiler_timings.h"
#include "vm/compiler/write_barrier_elimination.h"
#include "vm/thread.h"
#include "vm/timeline.h"

Go to the source code of this file.

Namespaces

namespace  dart
 

Macros

#define COMPILER_PASS_REPEAT(Name, Body)
 
#define COMPILER_PASS(Name, Body)
 
#define INVOKE_PASS(Name)    CompilerPass::Get(CompilerPass::k##Name)->Run(pass_state);
 
#define INVOKE_PASS_AOT(Name)
 

Functions

 dart::DEFINE_OPTION_HANDLER (CompilerPass::ParseFiltersFromFlag, compiler_passes, "List of comma separated compilation passes flags. " "Use -Name to disable a pass, Name to print IL after it. " "Do --compiler-passes=help for more information.")
 
 dart::DECLARE_FLAG (bool, print_flow_graph)
 
 dart::DECLARE_FLAG (bool, print_flow_graph_optimized)
 
 dart::DEFINE_FLAG (bool, test_il_serialization, false, "Test IL serialization.")
 
 dart::COMPILER_PASS (ComputeSSA, { flow_graph->ComputeSSA(nullptr);})
 
 dart::COMPILER_PASS (ApplyICData, { state->call_specializer->ApplyICData();})
 
 dart::COMPILER_PASS (TryOptimizePatterns, { flow_graph->TryOptimizePatterns();})
 
 dart::COMPILER_PASS (SetOuterInliningId, { FlowGraphInliner::SetInliningId(flow_graph, 0);})
 
 dart::COMPILER_PASS (Inlining, { FlowGraphInliner inliner(flow_graph, &state->inline_id_to_function, &state->inline_id_to_token_pos, &state->caller_inline_id, state->speculative_policy, state->precompiler);state->inlining_depth=inliner.Inline();})
 
 dart::COMPILER_PASS (TypePropagation, { FlowGraphTypePropagator::Propagate(flow_graph);})
 
 dart::COMPILER_PASS (ApplyClassIds, { state->call_specializer->ApplyClassIds();})
 
 dart::COMPILER_PASS (EliminateStackOverflowChecks, { if(!flow_graph->IsCompiledForOsr()) { CheckStackOverflowElimination::EliminateStackOverflow(flow_graph);} })
 
 dart::COMPILER_PASS (Canonicalize, { if(flow_graph->Canonicalize()) { flow_graph->Canonicalize();} })
 
 dart::COMPILER_PASS (BranchSimplify, { BranchSimplifier::Simplify(flow_graph);})
 
 dart::COMPILER_PASS (IfConvert, { IfConverter::Simplify(flow_graph);})
 
 dart::COMPILER_PASS_REPEAT (ConstantPropagation, { ConstantPropagator::Optimize(flow_graph);return true;})
 
 dart::COMPILER_PASS (OptimisticallySpecializeSmiPhis, { LICM licm(flow_graph);licm.OptimisticallySpecializeSmiPhis();})
 
 dart::COMPILER_PASS (SelectRepresentations, { flow_graph->SelectRepresentations();})
 
 dart::COMPILER_PASS (SelectRepresentations_Final, { flow_graph->SelectRepresentations();flow_graph->disallow_unmatched_representations();})
 
 dart::COMPILER_PASS (UseTableDispatch, { state->call_specializer->ReplaceInstanceCallsWithDispatchTableCalls();})
 
 dart::COMPILER_PASS_REPEAT (CSE, { return DominatorBasedCSE::Optimize(flow_graph);})
 
 dart::COMPILER_PASS (LICM, { flow_graph->RenameUsesDominatedByRedefinitions();DEBUG_ASSERT(flow_graph->VerifyRedefinitions());LICM licm(flow_graph);licm.Optimize();flow_graph->RemoveRedefinitions(true);})
 
 dart::COMPILER_PASS (DSE, { DeadStoreElimination::Optimize(flow_graph);})
 
 dart::COMPILER_PASS (RangeAnalysis, { RangeAnalysis range_analysis(flow_graph);range_analysis.Analyze();})
 
 dart::COMPILER_PASS (OptimizeBranches, { ConstantPropagator::OptimizeBranches(flow_graph);})
 
 dart::COMPILER_PASS (OptimizeTypedDataAccesses, { TypedDataSpecializer::Optimize(flow_graph);})
 
 dart::COMPILER_PASS (TryCatchOptimization, { OptimizeCatchEntryStates(flow_graph, CompilerState::Current().is_aot());})
 
 dart::COMPILER_PASS (EliminateEnvironments, { flow_graph->EliminateEnvironments();})
 
 dart::COMPILER_PASS (EliminateDeadPhis, { DeadCodeElimination::EliminateDeadPhis(flow_graph);})
 
 dart::COMPILER_PASS (DCE, { DeadCodeElimination::EliminateDeadCode(flow_graph);})
 
 dart::COMPILER_PASS (DelayAllocations, { DelayAllocations::Optimize(flow_graph);})
 
 dart::COMPILER_PASS (AllocationSinking_Sink, { if(flow_graph->graph_entry() ->catch_entries().is_empty()) { state->sinking=new AllocationSinking(flow_graph);state->sinking->Optimize();} })
 
 dart::COMPILER_PASS (AllocationSinking_DetachMaterializations, { if(state->sinking !=nullptr) { state->sinking->DetachMaterializations();} })
 
 dart::COMPILER_PASS (AllocateRegisters, { flow_graph->InsertMoveArguments();flow_graph->GetLoopHierarchy();FlowGraphAllocator allocator(*flow_graph);allocator.AllocateRegisters();})
 
 dart::COMPILER_PASS (AllocateRegistersForGraphIntrinsic, { flow_graph->set_max_argument_slot_count(0);flow_graph->GetLoopHierarchy();FlowGraphAllocator allocator(*flow_graph, true);allocator.AllocateRegisters();})
 
 dart::COMPILER_PASS (ReorderBlocks, { BlockScheduler::ReorderBlocks(flow_graph);})
 
 dart::COMPILER_PASS (EliminateWriteBarriers, { EliminateWriteBarriers(flow_graph);})
 
 dart::COMPILER_PASS (FinalizeGraph, { intptr_t instruction_count=0;intptr_t call_site_count=0;FlowGraphInliner::CollectGraphInfo(flow_graph, 0, true, &instruction_count, &call_site_count);flow_graph->function().set_inlining_depth(state->inlining_depth);flow_graph->RemoveRedefinitions();})
 
 dart::COMPILER_PASS (TestILSerialization, { if(FLAG_test_il_serialization &&CompilerState::Current().is_aot()) { Zone *zone=flow_graph->zone();auto *detached_defs=new(zone) ZoneGrowableArray< Definition * >(zone, 0);flow_graph->CompactSSA(detached_defs);ZoneWriteStream write_stream(flow_graph->zone(), 1024);FlowGraphSerializer serializer(&write_stream);serializer.WriteFlowGraph(*flow_graph, *detached_defs);ReadStream read_stream(write_stream.buffer(), write_stream.bytes_written());FlowGraphDeserializer deserializer(flow_graph->parsed_function(), &read_stream);state->set_flow_graph(deserializer.ReadFlowGraph());} })
 
 dart::COMPILER_PASS (LoweringAfterCodeMotionDisabled, { flow_graph->ExtractNonInternalTypedDataPayloads();})
 
 dart::COMPILER_PASS (GenerateCode, { state->graph_compiler->CompileGraph();})
 

Variables

static const char * dart::kCompilerPassesUsage
 

Macro Definition Documentation

◆ COMPILER_PASS

#define COMPILER_PASS (   Name,
  Body 
)
Value:
Body; \
return false; \
})
#define COMPILER_PASS_REPEAT(Name, Body)
ImplicitString Name
Definition: DMSrcSink.h:38

Definition at line 46 of file compiler_pass.cc.

◆ COMPILER_PASS_REPEAT

#define COMPILER_PASS_REPEAT (   Name,
  Body 
)
Value:
class CompilerPass_##Name : public CompilerPass { \
public: \
CompilerPass_##Name() : CompilerPass(k##Name, #Name) {} \
\
static bool Register() { \
return true; \
} \
\
protected: \
virtual bool DoBody(CompilerPassState* state) const { \
FlowGraph* flow_graph = state->flow_graph(); \
USE(flow_graph); \
Body; \
} \
}; \
static CompilerPass_##Name compiler_pass_##Name;
AtkStateType state

Definition at line 28 of file compiler_pass.cc.

◆ INVOKE_PASS

#define INVOKE_PASS (   Name)     CompilerPass::Get(CompilerPass::k##Name)->Run(pass_state);

Definition at line 267 of file compiler_pass.cc.

◆ INVOKE_PASS_AOT

#define INVOKE_PASS_AOT (   Name)

Definition at line 276 of file compiler_pass.cc.