From 3cd50df11b3076b801954018236c366fd9b97948 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 13 Apr 2016 19:29:26 +0100 Subject: Use dex cache from compilation unit in HInstructionBuilder. Avoid calling costly ClassLinker::FindDexCache() from HInstructionBuilder, the dex cache is already available in the compilation unit. Compiling Nexus 5 boot image on host under perf(1) shows that the time spent in FindDexCache() is reduced from about 2% to well under 0.2%, 90% of the remaining hits coming from ReferenceTypePropagation which doesn't have access to the compilation unit. Change-Id: Id9df61c79db9a67e3f12c857f32a4ca80e5420c3 --- compiler/optimizing/instruction_builder.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/optimizing/instruction_builder.h') diff --git a/compiler/optimizing/instruction_builder.h b/compiler/optimizing/instruction_builder.h index f480b70062..070f7da80e 100644 --- a/compiler/optimizing/instruction_builder.h +++ b/compiler/optimizing/instruction_builder.h @@ -97,6 +97,10 @@ class HInstructionBuilder : public ValueObject { // Returns whether the current method needs access check for the type. // Output parameter finalizable is set to whether the type is finalizable. + bool NeedsAccessCheck(uint32_t type_index, + Handle dex_cache, + /*out*/bool* finalizable) const + SHARED_REQUIRES(Locks::mutator_lock_); bool NeedsAccessCheck(uint32_t type_index, /*out*/bool* finalizable) const; template -- cgit v1.2.3-59-g8ed1b