From 41c5dde40d1c75d36a7f984c8d72ec65fbff3111 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Mon, 4 Dec 2023 12:05:00 +0000 Subject: Run optimizations with baseline compilation. And introduce inlined inline caches, which customize an inline cache for the top-level method being compiled. Reduces jank on compose view scrolling for 20 seconds: - For Go Mokey: - Before: ~525 frames drawn / ~14.64% janky frames - After: ~891 frames drawn / ~4.74% janky frames - For Pixel 8 pro: - Before: ~2443 frames drawn / ~0.91% janky frames - After: ~2447 frames drawn / ~0.65% janky frames Bug: 313040662 Test: test.py Change-Id: Ibaa746c6bd3c665b18ec9cd29cb477cf21023467 --- compiler/optimizing/profiling_info_builder.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/profiling_info_builder.h') diff --git a/compiler/optimizing/profiling_info_builder.h b/compiler/optimizing/profiling_info_builder.h index 2185b0eed3..c8dc59a03c 100644 --- a/compiler/optimizing/profiling_info_builder.h +++ b/compiler/optimizing/profiling_info_builder.h @@ -24,6 +24,7 @@ namespace art HIDDEN { class CodeGenerator; class CompilerOptions; +class HInliner; class InlineCache; class ProfilingInfo; @@ -42,8 +43,13 @@ class ProfilingInfoBuilder : public HGraphDelegateVisitor { static constexpr const char* kProfilingInfoBuilderPassName = "profiling_info_builder"; - static InlineCache* GetInlineCache(ProfilingInfo* info, HInvoke* invoke); + static InlineCache* GetInlineCache(ProfilingInfo* info, + const CompilerOptions& compiler_options, + HInvoke* invoke); static bool IsInlineCacheUseful(HInvoke* invoke, CodeGenerator* codegen); + static uint32_t EncodeInlinedDexPc( + const HInliner* inliner, const CompilerOptions& compiler_options, HInvoke* invoke) + REQUIRES_SHARED(Locks::mutator_lock_); private: void VisitInvokeVirtual(HInvokeVirtual* invoke) override; @@ -52,7 +58,7 @@ class ProfilingInfoBuilder : public HGraphDelegateVisitor { void HandleInvoke(HInvoke* invoke); CodeGenerator* codegen_; - [[maybe_unused]] const CompilerOptions& compiler_options_; + const CompilerOptions& compiler_options_; std::vector inline_caches_; DISALLOW_COPY_AND_ASSIGN(ProfilingInfoBuilder); -- cgit v1.2.3-59-g8ed1b