From 02ca05a5a6e3f5028c6c2987a81be481d07bc617 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Tue, 12 May 2020 13:58:51 +0100 Subject: Move HandleCache to HGraph. This avoids passing the `VariableSizedHandleScope*` argument around and eliminates HGraph::inexact_object_rti_ and its initialization. The latter shall allow running Optimizing gtests that do not require type information without creating a Runtime in future. (To be implemented in a separate CL.) Test: m test-art-host-gtest Test: testrunner.py --host --optmizing Test: aosp_taimen-userdebug boots. Change-Id: I36fe9bc556c6d610d644c8c14cc74c9985a14d64 --- compiler/optimizing/nodes.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index a5e0991578..3ea13b66f7 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -39,12 +39,11 @@ namespace art { // double). static constexpr bool kEnableFloatingPointStaticEvaluation = (FLT_EVAL_METHOD == 0); -void HGraph::InitializeInexactObjectRTI(VariableSizedHandleScope* handles) { +ReferenceTypeInfo::TypeHandle HandleCache::CreateRootHandle(VariableSizedHandleScope* handles, + ClassRoot class_root) { + // Mutator lock is required for NewHandle and GetClassRoot(). ScopedObjectAccess soa(Thread::Current()); - // Create the inexact Object reference type and store it in the HGraph. - inexact_object_rti_ = ReferenceTypeInfo::Create( - handles->NewHandle(GetClassRoot()), - /* is_exact= */ false); + return handles->NewHandle(GetClassRoot(class_root)); } void HGraph::AddBlock(HBasicBlock* block) { @@ -662,7 +661,7 @@ HNullConstant* HGraph::GetNullConstant(uint32_t dex_pc) { // id and/or any invariants the graph is assuming when adding new instructions. if ((cached_null_constant_ == nullptr) || (cached_null_constant_->GetBlock() == nullptr)) { cached_null_constant_ = new (allocator_) HNullConstant(dex_pc); - cached_null_constant_->SetReferenceTypeInfo(inexact_object_rti_); + cached_null_constant_->SetReferenceTypeInfo(GetInexactObjectRti()); InsertConstant(cached_null_constant_); } if (kIsDebugBuild) { -- cgit v1.2.3-59-g8ed1b