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.
Bug: 28173563
Cherry-picked the "revert-revert"
(cherry picked from commit 456307a47336e3d6576ed6d8563b67573a4238d3)
and squashed two subsequent fixes
Fix RTP to hold mutator lock while using raw mirror pointers.
(cherry picked from commit 62977ff198deb673a6990202a2fb8b993217c57c)
Fix reference_type_propagation_test.
(cherry picked from commit 5eed0c5d27f091c952704f652cd77c4e3833ad88)
Change-Id: Ia944452d7ab26aed963832a9346df363743a419f
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index c9adcd4..10a51d6 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -170,7 +170,7 @@
return handle.GetReference() != nullptr;
}
- bool IsValid() const SHARED_REQUIRES(Locks::mutator_lock_) {
+ bool IsValid() const {
return IsValidHandle(type_handle_);
}
@@ -1831,7 +1831,7 @@
ReferenceTypeInfo GetReferenceTypeInfo() const {
DCHECK_EQ(GetType(), Primitive::kPrimNot);
return ReferenceTypeInfo::CreateUnchecked(reference_type_handle_,
- GetPackedFlag<kFlagReferenceTypeIsExact>());;
+ GetPackedFlag<kFlagReferenceTypeIsExact>());
}
void AddUseAt(HInstruction* user, size_t index) {