summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.h
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2016-04-13 19:29:26 +0100
committerVladimir Marko <vmarko@google.com>2016-04-14 10:16:28 +0100
commit3cd50df11b3076b801954018236c366fd9b97948 (patch)
tree8f442c981f5e0edfd5f2c4fc4fe8439a4eb001e6 /compiler/optimizing/instruction_builder.h
parent8d4b37ed048487561358e13e2a18ad9ca0dab3c0 (diff)
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
Diffstat (limited to 'compiler/optimizing/instruction_builder.h')
-rw-r--r--compiler/optimizing/instruction_builder.h4
1 files changed, 4 insertions, 0 deletions
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<mirror::DexCache> dex_cache,
+ /*out*/bool* finalizable) const
+ SHARED_REQUIRES(Locks::mutator_lock_);
bool NeedsAccessCheck(uint32_t type_index, /*out*/bool* finalizable) const;
template<typename T>