From c7aa87e1666ac48ddf9149cfdfd64b026b3969e5 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 24 May 2018 15:19:52 +0100 Subject: Remove static_class_ from Method/VarHandle and CallSite. And add MethodHandle to the class roots to avoid extra indirection through MethodHandleImpl. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: Iaf172f3732677f2b4509e8297e6e9af5fb81a89f --- runtime/native/java_lang_Class.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/native/java_lang_Class.cc') diff --git a/runtime/native/java_lang_Class.cc b/runtime/native/java_lang_Class.cc index 9f595b1c29..b7dad89106 100644 --- a/runtime/native/java_lang_Class.cc +++ b/runtime/native/java_lang_Class.cc @@ -22,6 +22,7 @@ #include "art_method-inl.h" #include "base/enums.h" #include "class_linker-inl.h" +#include "class_root.h" #include "common_throws.h" #include "dex/descriptors_names.h" #include "dex/dex_file-inl.h" @@ -82,7 +83,7 @@ static bool IsCallerTrusted(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) // is subject to change so conservatively cover the entire package. // NB Static initializers within java.lang.invoke are permitted and do not // need further stack inspection. - ObjPtr lookup_class = mirror::MethodHandlesLookup::StaticClass(); + ObjPtr lookup_class = GetClassRoot(); if ((declaring_class == lookup_class || declaring_class->IsInSamePackage(lookup_class)) && !m->IsClassInitializer()) { return true; -- cgit v1.2.3-59-g8ed1b