// Use ScopedArenaAllocator for all local allocations.
ScopedArenaAllocator local_allocator(graph_->GetArenaStack());
HBasicBlockBuilder block_builder(graph_, dex_file_, code_item_accessor_, &local_allocator);
SsaBuilder ssa_builder(graph_,
dex_compilation_unit_->GetClassLoader(),
dex_compilation_unit_->GetDexCache(),
&local_allocator);
HInstructionBuilder instruction_builder(graph_,
&block_builder,
&ssa_builder,
dex_file_,
code_item_accessor_,
return_type_,
dex_compilation_unit_,
outer_compilation_unit_,
code_generator_,
compilation_stats_,
&local_allocator);
// 1) Create basic blocks and link them together. Basic blocks are left // unpopulated with the exception of synthetic blocks, e.g. HTryBoundaries. if (!block_builder.Build()) { return kAnalysisInvalidBytecode;
}
// 2) Decide whether to skip compiling this method based on e.g. the compiler filter and method's // code size. if (SkipCompilation()) { return kAnalysisSkipped;
}
// 3) Build the dominator tree and fill in loop and try/catch metadata.
GraphAnalysisResult result = graph_->BuildDominatorTree(); if (result != kAnalysisSuccess) { return result;
}
// 4) Populate basic blocks with instructions. if (!instruction_builder.Build()) { return kAnalysisInvalidBytecode;
}
// 5) Type the graph and eliminate dead/redundant phis. return ssa_builder.BuildSsa();
}
// For simplicity, reserve 2 vregs (the maximum) for return value regardless of the return type.
size_t return_vregs = 2u;
graph_->SetNumberOfVRegs(return_vregs + num_arg_vregs);
graph_->SetNumberOfInVRegs(num_arg_vregs);
// Use ScopedArenaAllocator for all local allocations.
ScopedArenaAllocator local_allocator(graph_->GetArenaStack());
HBasicBlockBuilder block_builder(graph_,
dex_file_,
CodeItemDebugInfoAccessor(),
&local_allocator);
SsaBuilder ssa_builder(graph_,
dex_compilation_unit_->GetClassLoader(),
dex_compilation_unit_->GetDexCache(),
&local_allocator);
HInstructionBuilder instruction_builder(graph_,
&block_builder,
&ssa_builder,
dex_file_,
CodeItemDebugInfoAccessor(),
return_type_,
dex_compilation_unit_,
outer_compilation_unit_,
code_generator_,
compilation_stats_,
&local_allocator);
// 1) Create basic blocks for the intrinsic and link them together.
block_builder.BuildIntrinsic();
// 3) Populate basic blocks with instructions for the intrinsic.
instruction_builder.BuildIntrinsic(method);
// 4) Type the graph (no dead/redundant phis to eliminate).
GraphAnalysisResult build_ssa_result = ssa_builder.BuildSsa();
DCHECK_EQ(build_ssa_result, kAnalysisSuccess);
}
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.