From 27bb86edf60e2f9ca2c1075c0c86b9e79374f1d0 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 14 Apr 2016 18:07:55 +0100 Subject: Use dex cache from compilation unit in RTP. Avoid calling the costly ClassLinker::FindDexCache() from reference type propagation when the dex cache from the compilation unit will do, i.e. almost always. Compiling the Nexus 5 boot image on host under perf(1) shows that the FindDexCache() hits drop from about 0.2% to almost nothing, though enabling inlining for the boot image will increase it a bit to 0.03% due to unavoidable calls from the inliner. Also clean up the ScopedObjectAccess usage a bit. Change-Id: I426a5f9f5da9e64fad2ea57654240789a48d3871 --- compiler/optimizing/ssa_builder.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/ssa_builder.h') diff --git a/compiler/optimizing/ssa_builder.h b/compiler/optimizing/ssa_builder.h index c37c28c801..d7360adef8 100644 --- a/compiler/optimizing/ssa_builder.h +++ b/compiler/optimizing/ssa_builder.h @@ -47,8 +47,11 @@ namespace art { */ class SsaBuilder : public ValueObject { public: - SsaBuilder(HGraph* graph, StackHandleScopeCollection* handles) + SsaBuilder(HGraph* graph, + Handle dex_cache, + StackHandleScopeCollection* handles) : graph_(graph), + dex_cache_(dex_cache), handles_(handles), agets_fixed_(false), ambiguous_agets_(graph->GetArena()->Adapter(kArenaAllocGraphBuilder)), @@ -112,6 +115,7 @@ class SsaBuilder : public ValueObject { void RemoveRedundantUninitializedStrings(); HGraph* graph_; + Handle dex_cache_; StackHandleScopeCollection* const handles_; // True if types of ambiguous ArrayGets have been resolved. -- cgit v1.2.3-59-g8ed1b