diff options
author | 2018-05-31 11:11:32 +0100 | |
---|---|---|
committer | 2018-05-31 13:56:49 +0100 | |
commit | 317892b756cd2a87c01928b09e99e020c86dea10 (patch) | |
tree | bb337ff8cd81c049e781afbd8c68b72ca30907fc | |
parent | 1539a11150ca9c28fec353b38508267c41d7814b (diff) |
Remove static GcRoot<>s from Class and ClassExt.
And clean up gc_root includes in runtime/mirror/.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: Ib5c42a3a892ced4440720350a63a94bcf3a1ca75
25 files changed, 24 insertions, 109 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index cd03401cf9..e46b980682 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -435,7 +435,7 @@ bool ClassLinker::InitWithoutImage(std::vector<std::unique_ptr<const DexFile>> b Handle<mirror::Class> java_lang_Class(hs.NewHandle(down_cast<mirror::Class*>( heap->AllocNonMovableObject<true>(self, nullptr, class_class_size, VoidFunctor())))); CHECK(java_lang_Class != nullptr); - mirror::Class::SetClassClass(java_lang_Class.Get()); + java_lang_Class->SetClassFlags(mirror::kClassFlagClass); java_lang_Class->SetClass(java_lang_Class.Get()); if (kUseBakerReadBarrier) { java_lang_Class->AssertReadBarrierState(); @@ -553,7 +553,6 @@ bool ClassLinker::InitWithoutImage(std::vector<std::unique_ptr<const DexFile>> b Handle<mirror::Class> dalvik_system_ClassExt(hs.NewHandle( AllocClass(self, java_lang_Class.Get(), mirror::ClassExt::ClassSize(image_pointer_size_)))); SetClassRoot(ClassRoot::kDalvikSystemClassExt, dalvik_system_ClassExt.Get()); - mirror::ClassExt::SetClass(dalvik_system_ClassExt.Get()); mirror::Class::SetStatus(dalvik_system_ClassExt, ClassStatus::kResolved, self); // Set up array classes for string, field, method @@ -991,7 +990,8 @@ bool ClassLinker::InitFromBootImage(std::string* error_msg) { class_roots_ = GcRoot<mirror::ObjectArray<mirror::Class>>( down_cast<mirror::ObjectArray<mirror::Class>*>( spaces[0]->GetImageHeader().GetImageRoot(ImageHeader::kClassRoots))); - mirror::Class::SetClassClass(GetClassRoot(ClassRoot::kJavaLangClass, this)); + DCHECK_EQ(GetClassRoot(ClassRoot::kJavaLangClass, this)->GetClassFlags(), + mirror::kClassFlagClass); ObjPtr<mirror::Class> java_lang_Object = GetClassRoot<mirror::Object>(this); java_lang_Object->SetObjectSize(sizeof(mirror::Object)); @@ -1004,8 +1004,6 @@ bool ClassLinker::InitFromBootImage(std::string* error_msg) { array_iftable_ = GcRoot<mirror::IfTable>(GetClassRoot(ClassRoot::kObjectArrayClass, this)->GetIfTable()); DCHECK_EQ(array_iftable_.Read(), GetClassRoot(ClassRoot::kBooleanArrayClass, this)->GetIfTable()); - // String class root was set above - mirror::ClassExt::SetClass(GetClassRoot(ClassRoot::kDalvikSystemClassExt, this)); for (gc::space::ImageSpace* image_space : spaces) { // Boot class loader, use a null handle. @@ -2082,7 +2080,6 @@ void ClassLinker::VisitClassesWithoutClassesLock(ClassVisitor* visitor) { } ClassLinker::~ClassLinker() { - mirror::Class::ResetClass(); Thread* const self = Thread::Current(); for (const ClassLoaderData& data : class_loaders_) { // CHA unloading analysis is not needed. No negative consequences are expected because diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index b004566ed1..25ed652b41 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -3913,9 +3913,9 @@ void Heap::BroadcastForNewAllocationRecords() const { } void Heap::CheckGcStressMode(Thread* self, ObjPtr<mirror::Object>* obj) { + DCHECK(gc_stress_mode_); auto* const runtime = Runtime::Current(); - if (gc_stress_mode_ && runtime->GetClassLinker()->IsInitialized() && - !runtime->IsActiveTransaction() && mirror::Class::HasJavaLangClass()) { + if (runtime->GetClassLinker()->IsInitialized() && !runtime->IsActiveTransaction()) { // Check if we should GC. bool new_backtrace = false; { diff --git a/runtime/interpreter/unstarted_runtime_test.cc b/runtime/interpreter/unstarted_runtime_test.cc index fee837572b..449458ce6f 100644 --- a/runtime/interpreter/unstarted_runtime_test.cc +++ b/runtime/interpreter/unstarted_runtime_test.cc @@ -448,8 +448,7 @@ TEST_F(UnstartedRuntimeTest, SystemArrayCopyObjectArrayTestExceptions) { // Note: all tests are not GC safe. Assume there's no GC running here with the few objects we // allocate. StackHandleScope<3> hs_misc(self); - Handle<mirror::Class> object_class( - hs_misc.NewHandle(mirror::Class::GetJavaLangClass()->GetSuperClass())); + Handle<mirror::Class> object_class(hs_misc.NewHandle(GetClassRoot<mirror::Object>())); StackHandleScope<3> hs_data(self); hs_data.NewHandle(mirror::String::AllocFromModifiedUtf8(self, "1")); @@ -481,8 +480,7 @@ TEST_F(UnstartedRuntimeTest, SystemArrayCopyObjectArrayTest) { ShadowFrame* tmp = ShadowFrame::CreateDeoptimizedFrame(10, nullptr, nullptr, 0); StackHandleScope<1> hs_object(self); - Handle<mirror::Class> object_class( - hs_object.NewHandle(mirror::Class::GetJavaLangClass()->GetSuperClass())); + Handle<mirror::Class> object_class(hs_object.NewHandle(GetClassRoot<mirror::Object>())); // Simple test: // [1,2,3]{1 @ 2} into [4,5,6] = [4,2,6] @@ -902,7 +900,7 @@ TEST_F(UnstartedRuntimeTest, IsAnonymousClass) { JValue result; ShadowFrame* shadow_frame = ShadowFrame::CreateDeoptimizedFrame(10, nullptr, nullptr, 0); - ObjPtr<mirror::Class> class_klass = mirror::Class::GetJavaLangClass(); + ObjPtr<mirror::Class> class_klass = GetClassRoot<mirror::Class>(); shadow_frame->SetVRegReference(0, class_klass); UnstartedClassIsAnonymousClass(self, shadow_frame, &result, 0); EXPECT_EQ(result.GetZ(), 0); @@ -996,7 +994,7 @@ TEST_F(UnstartedRuntimeTest, ThreadLocalGet) { { // Just use a method in Class. - ObjPtr<mirror::Class> class_class = mirror::Class::GetJavaLangClass(); + ObjPtr<mirror::Class> class_class = GetClassRoot<mirror::Class>(); ArtMethod* caller_method = &*class_class->GetDeclaredMethods(class_linker->GetImagePointerSize()).begin(); ShadowFrame* caller_frame = ShadowFrame::CreateDeoptimizedFrame(10, nullptr, caller_method, 0); @@ -1111,7 +1109,7 @@ class UnstartedClassForNameTest : public UnstartedRuntimeTest { { ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); StackHandleScope<1> hs(self); - Handle<mirror::Class> h_class = hs.NewHandle(mirror::Class::GetJavaLangClass()); + Handle<mirror::Class> h_class = hs.NewHandle(GetClassRoot<mirror::Class>()); CHECK(class_linker->EnsureInitialized(self, h_class, true, true)); } diff --git a/runtime/mirror/call_site.cc b/runtime/mirror/call_site.cc index 808f77cde1..738106c0e4 100644 --- a/runtime/mirror/call_site.cc +++ b/runtime/mirror/call_site.cc @@ -18,18 +18,17 @@ #include "class-inl.h" #include "class_root.h" -#include "gc_root-inl.h" +#include "obj_ptr-inl.h" namespace art { namespace mirror { mirror::CallSite* CallSite::Create(Thread* const self, Handle<MethodHandle> target) { - StackHandleScope<1> hs(self); - Handle<mirror::CallSite> cs( - hs.NewHandle(ObjPtr<CallSite>::DownCast(GetClassRoot<CallSite>()->AllocObject(self)))); + ObjPtr<mirror::CallSite> cs = + ObjPtr<CallSite>::DownCast(GetClassRoot<CallSite>()->AllocObject(self)); CHECK(!Runtime::Current()->IsActiveTransaction()); cs->SetFieldObject<false>(TargetOffset(), target.Get()); - return cs.Get(); + return cs.Ptr(); } } // namespace mirror diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc index cb2708d0cb..996461b3b2 100644 --- a/runtime/mirror/class.cc +++ b/runtime/mirror/class.cc @@ -55,26 +55,6 @@ namespace mirror { using android::base::StringPrintf; -GcRoot<Class> Class::java_lang_Class_; - -void Class::SetClassClass(ObjPtr<Class> java_lang_Class) { - CHECK(java_lang_Class_.IsNull()) - << java_lang_Class_.Read() - << " " << java_lang_Class; - CHECK(java_lang_Class != nullptr); - java_lang_Class->SetClassFlags(kClassFlagClass); - java_lang_Class_ = GcRoot<Class>(java_lang_Class); -} - -void Class::ResetClass() { - CHECK(!java_lang_Class_.IsNull()); - java_lang_Class_ = GcRoot<Class>(nullptr); -} - -void Class::VisitRoots(RootVisitor* visitor) { - java_lang_Class_.VisitRootIfNonNull(visitor, RootInfo(kRootStickyClass)); -} - ObjPtr<mirror::Class> Class::GetPrimitiveClass(ObjPtr<mirror::String> name) { const char* expected_name = nullptr; ClassRoot class_root = ClassRoot::kJavaLangObject; // Invalid. @@ -1211,13 +1191,15 @@ Class* Class::CopyOf(Thread* self, int32_t new_length, ImTable* imt, PointerSize // We may get copied by a compacting GC. StackHandleScope<1> hs(self); Handle<Class> h_this(hs.NewHandle(this)); - gc::Heap* heap = Runtime::Current()->GetHeap(); + Runtime* runtime = Runtime::Current(); + gc::Heap* heap = runtime->GetHeap(); // The num_bytes (3rd param) is sizeof(Class) as opposed to SizeOf() // to skip copying the tail part that we will overwrite here. CopyClassVisitor visitor(self, &h_this, new_length, sizeof(Class), imt, pointer_size); + ObjPtr<mirror::Class> java_lang_Class = GetClassRoot<mirror::Class>(runtime->GetClassLinker()); ObjPtr<Object> new_class = kMovingClasses ? - heap->AllocObject<true>(self, java_lang_Class_.Read(), new_length, visitor) : - heap->AllocNonMovableObject<true>(self, java_lang_Class_.Read(), new_length, visitor); + heap->AllocObject<true>(self, java_lang_Class, new_length, visitor) : + heap->AllocNonMovableObject<true>(self, java_lang_Class, new_length, visitor); if (UNLIKELY(new_class == nullptr)) { self->AssertPendingOOMException(); return nullptr; diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 7d5f539576..a637c86823 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -30,7 +30,6 @@ #include "dex/modifiers.h" #include "dex/primitive.h" #include "gc/allocator_type.h" -#include "gc_root.h" #include "imtable.h" #include "object.h" #include "object_array.h" @@ -1130,21 +1129,6 @@ class MANAGED Class FINAL : public Object { dex::TypeIndex FindTypeIndexInOtherDexFile(const DexFile& dex_file) REQUIRES_SHARED(Locks::mutator_lock_); - static Class* GetJavaLangClass() REQUIRES_SHARED(Locks::mutator_lock_) { - DCHECK(HasJavaLangClass()); - return java_lang_Class_.Read(); - } - - static bool HasJavaLangClass() REQUIRES_SHARED(Locks::mutator_lock_) { - return !java_lang_Class_.IsNull(); - } - - // Can't call this SetClass or else gets called instead of Object::SetClass in places. - static void SetClassClass(ObjPtr<Class> java_lang_Class) REQUIRES_SHARED(Locks::mutator_lock_); - static void ResetClass(); - static void VisitRoots(RootVisitor* visitor) - REQUIRES_SHARED(Locks::mutator_lock_); - // Visit native roots visits roots which are keyed off the native pointers such as ArtFields and // ArtMethods. template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier, class Visitor> @@ -1504,9 +1488,6 @@ class MANAGED Class FINAL : public Object { // Static fields, variable size. // uint32_t fields_[0]; - // java.lang.Class - static GcRoot<Class> java_lang_Class_; - ART_FRIEND_TEST(DexCacheTest, TestResolvedFieldAccess); // For ResolvedFieldAccessTest friend struct art::ClassOffsets; // for verifying offset information friend class Object; // For VisitReferences diff --git a/runtime/mirror/class_ext.cc b/runtime/mirror/class_ext.cc index 081957964c..7214620c93 100644 --- a/runtime/mirror/class_ext.cc +++ b/runtime/mirror/class_ext.cc @@ -21,6 +21,7 @@ #include "base/enums.h" #include "base/utils.h" #include "class-inl.h" +#include "class_root.h" #include "dex/dex_file-inl.h" #include "gc/accounting/card_table-inl.h" #include "object-inl.h" @@ -31,8 +32,6 @@ namespace art { namespace mirror { -GcRoot<Class> ClassExt::dalvik_system_ClassExt_; - uint32_t ClassExt::ClassSize(PointerSize pointer_size) { uint32_t vtable_entries = Object::kVTableLength; return Class::ComputeClassSize(true, vtable_entries, 0, 0, 0, 0, 0, pointer_size); @@ -102,8 +101,7 @@ bool ClassExt::ExtendObsoleteArrays(Thread* self, uint32_t increase) { } ClassExt* ClassExt::Alloc(Thread* self) { - DCHECK(dalvik_system_ClassExt_.Read() != nullptr); - return down_cast<ClassExt*>(dalvik_system_ClassExt_.Read()->AllocObject(self).Ptr()); + return down_cast<ClassExt*>(GetClassRoot<ClassExt>()->AllocObject(self).Ptr()); } void ClassExt::SetVerifyError(ObjPtr<Object> err) { @@ -119,19 +117,5 @@ void ClassExt::SetOriginalDexFile(ObjPtr<Object> bytes) { SetFieldObject<false>(OFFSET_OF_OBJECT_MEMBER(ClassExt, original_dex_file_), bytes); } -void ClassExt::SetClass(ObjPtr<Class> dalvik_system_ClassExt) { - CHECK(dalvik_system_ClassExt != nullptr); - dalvik_system_ClassExt_ = GcRoot<Class>(dalvik_system_ClassExt); -} - -void ClassExt::ResetClass() { - CHECK(!dalvik_system_ClassExt_.IsNull()); - dalvik_system_ClassExt_ = GcRoot<Class>(nullptr); -} - -void ClassExt::VisitRoots(RootVisitor* visitor) { - dalvik_system_ClassExt_.VisitRootIfNonNull(visitor, RootInfo(kRootStickyClass)); -} - } // namespace mirror } // namespace art diff --git a/runtime/mirror/class_ext.h b/runtime/mirror/class_ext.h index 75a3800989..612fd0f256 100644 --- a/runtime/mirror/class_ext.h +++ b/runtime/mirror/class_ext.h @@ -20,7 +20,6 @@ #include "array.h" #include "class.h" #include "dex_cache.h" -#include "gc_root.h" #include "object.h" #include "object_array.h" #include "string.h" @@ -72,10 +71,6 @@ class MANAGED ClassExt : public Object { bool ExtendObsoleteArrays(Thread* self, uint32_t increase) REQUIRES_SHARED(Locks::mutator_lock_); - static void SetClass(ObjPtr<Class> dalvik_system_ClassExt); - static void ResetClass(); - static void VisitRoots(RootVisitor* visitor) REQUIRES_SHARED(Locks::mutator_lock_); - template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier, class Visitor> inline void VisitNativeRoots(Visitor& visitor, PointerSize pointer_size) REQUIRES_SHARED(Locks::mutator_lock_); @@ -93,8 +88,6 @@ class MANAGED ClassExt : public Object { // The saved verification error of this class. HeapReference<Object> verify_error_; - static GcRoot<Class> dalvik_system_ClassExt_; - friend struct art::ClassExtOffsets; // for verifying offset information DISALLOW_IMPLICIT_CONSTRUCTORS(ClassExt); }; diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h index 72f1443dfa..96778aa98d 100644 --- a/runtime/mirror/dex_cache-inl.h +++ b/runtime/mirror/dex_cache-inl.h @@ -28,7 +28,7 @@ #include "class_linker.h" #include "dex/dex_file.h" #include "gc/heap-inl.h" -#include "gc_root.h" +#include "gc_root-inl.h" #include "mirror/call_site.h" #include "mirror/class.h" #include "mirror/method_type.h" diff --git a/runtime/mirror/emulated_stack_frame.cc b/runtime/mirror/emulated_stack_frame.cc index 5595102866..ce39049e11 100644 --- a/runtime/mirror/emulated_stack_frame.cc +++ b/runtime/mirror/emulated_stack_frame.cc @@ -18,7 +18,6 @@ #include "class-inl.h" #include "class_root.h" -#include "gc_root-inl.h" #include "jvalue-inl.h" #include "method_handles-inl.h" #include "method_handles.h" diff --git a/runtime/mirror/executable.h b/runtime/mirror/executable.h index 8a28f66868..23dd787c80 100644 --- a/runtime/mirror/executable.h +++ b/runtime/mirror/executable.h @@ -18,7 +18,6 @@ #define ART_RUNTIME_MIRROR_EXECUTABLE_H_ #include "accessible_object.h" -#include "gc_root.h" #include "object.h" #include "read_barrier_option.h" diff --git a/runtime/mirror/method.cc b/runtime/mirror/method.cc index e5d3403107..cf03b95d5e 100644 --- a/runtime/mirror/method.cc +++ b/runtime/mirror/method.cc @@ -18,7 +18,6 @@ #include "art_method.h" #include "class_root.h" -#include "gc_root-inl.h" #include "mirror/class-inl.h" #include "mirror/object-inl.h" diff --git a/runtime/mirror/method_handle_impl.cc b/runtime/mirror/method_handle_impl.cc index a6c1609d01..88ccbc947d 100644 --- a/runtime/mirror/method_handle_impl.cc +++ b/runtime/mirror/method_handle_impl.cc @@ -18,7 +18,6 @@ #include "class-inl.h" #include "class_root.h" -#include "gc_root-inl.h" namespace art { namespace mirror { diff --git a/runtime/mirror/method_handles_lookup.cc b/runtime/mirror/method_handles_lookup.cc index 1ac38dad24..d1e7a6dbfa 100644 --- a/runtime/mirror/method_handles_lookup.cc +++ b/runtime/mirror/method_handles_lookup.cc @@ -19,7 +19,6 @@ #include "class-inl.h" #include "class_root.h" #include "dex/modifiers.h" -#include "gc_root-inl.h" #include "handle_scope.h" #include "jni/jni_internal.h" #include "mirror/method_handle_impl.h" diff --git a/runtime/mirror/method_handles_lookup.h b/runtime/mirror/method_handles_lookup.h index aa94f95ae0..56261eca67 100644 --- a/runtime/mirror/method_handles_lookup.h +++ b/runtime/mirror/method_handles_lookup.h @@ -18,7 +18,6 @@ #define ART_RUNTIME_MIRROR_METHOD_HANDLES_LOOKUP_H_ #include "base/utils.h" -#include "gc_root.h" #include "handle.h" #include "obj_ptr.h" #include "object.h" diff --git a/runtime/mirror/method_type.cc b/runtime/mirror/method_type.cc index 483fff5b26..bc62ebdc8b 100644 --- a/runtime/mirror/method_type.cc +++ b/runtime/mirror/method_type.cc @@ -18,7 +18,6 @@ #include "class-inl.h" #include "class_root.h" -#include "gc_root-inl.h" #include "method_handles.h" namespace art { diff --git a/runtime/mirror/reference-inl.h b/runtime/mirror/reference-inl.h index c65f740a78..f8de6e6d90 100644 --- a/runtime/mirror/reference-inl.h +++ b/runtime/mirror/reference-inl.h @@ -19,7 +19,6 @@ #include "reference.h" -#include "gc_root-inl.h" #include "obj_ptr-inl.h" #include "runtime.h" diff --git a/runtime/mirror/stack_trace_element.cc b/runtime/mirror/stack_trace_element.cc index ff353d8939..5a7575a027 100644 --- a/runtime/mirror/stack_trace_element.cc +++ b/runtime/mirror/stack_trace_element.cc @@ -20,7 +20,6 @@ #include "class.h" #include "class_root.h" #include "gc/accounting/card_table-inl.h" -#include "gc_root-inl.h" #include "handle_scope-inl.h" #include "object-inl.h" #include "string.h" diff --git a/runtime/mirror/stack_trace_element.h b/runtime/mirror/stack_trace_element.h index f25211c397..55a2ef0b49 100644 --- a/runtime/mirror/stack_trace_element.h +++ b/runtime/mirror/stack_trace_element.h @@ -17,7 +17,6 @@ #ifndef ART_RUNTIME_MIRROR_STACK_TRACE_ELEMENT_H_ #define ART_RUNTIME_MIRROR_STACK_TRACE_ELEMENT_H_ -#include "gc_root.h" #include "object.h" namespace art { diff --git a/runtime/mirror/string.cc b/runtime/mirror/string.cc index b76ca1968a..d5ef039273 100644 --- a/runtime/mirror/string.cc +++ b/runtime/mirror/string.cc @@ -24,7 +24,6 @@ #include "dex/descriptors_names.h" #include "dex/utf-inl.h" #include "gc/accounting/card_table-inl.h" -#include "gc_root-inl.h" #include "handle_scope-inl.h" #include "intern_table.h" #include "object-inl.h" diff --git a/runtime/mirror/string.h b/runtime/mirror/string.h index 598175b749..0e2fc903b5 100644 --- a/runtime/mirror/string.h +++ b/runtime/mirror/string.h @@ -20,7 +20,6 @@ #include "base/bit_utils.h" #include "base/globals.h" #include "gc/allocator_type.h" -#include "gc_root-inl.h" #include "class.h" #include "object.h" diff --git a/runtime/mirror/throwable.h b/runtime/mirror/throwable.h index 42c612f8b6..a9e5d1a30b 100644 --- a/runtime/mirror/throwable.h +++ b/runtime/mirror/throwable.h @@ -17,7 +17,6 @@ #ifndef ART_RUNTIME_MIRROR_THROWABLE_H_ #define ART_RUNTIME_MIRROR_THROWABLE_H_ -#include "gc_root.h" #include "object.h" namespace art { diff --git a/runtime/mirror/var_handle.cc b/runtime/mirror/var_handle.cc index 71f41b9d12..4319c5df25 100644 --- a/runtime/mirror/var_handle.cc +++ b/runtime/mirror/var_handle.cc @@ -21,7 +21,6 @@ #include "class-inl.h" #include "class_linker.h" #include "class_root.h" -#include "gc_root-inl.h" #include "intrinsics_enum.h" #include "jni/jni_internal.h" #include "jvalue-inl.h" diff --git a/runtime/proxy_test.h b/runtime/proxy_test.h index 860d96c116..411dc7af82 100644 --- a/runtime/proxy_test.h +++ b/runtime/proxy_test.h @@ -40,11 +40,10 @@ ObjPtr<mirror::Class> GenerateProxyClass(ScopedObjectAccess& soa, const std::vector<Handle<mirror::Class>>& interfaces) REQUIRES_SHARED(Locks::mutator_lock_) { StackHandleScope<1> hs(soa.Self()); - Handle<mirror::Class> javaLangObject = hs.NewHandle( - class_linker->FindSystemClass(soa.Self(), "Ljava/lang/Object;")); + Handle<mirror::Class> javaLangObject = hs.NewHandle(GetClassRoot<mirror::Object>()); CHECK(javaLangObject != nullptr); - jclass javaLangClass = soa.AddLocalReference<jclass>(mirror::Class::GetJavaLangClass()); + jclass javaLangClass = soa.AddLocalReference<jclass>(GetClassRoot<mirror::Class>()); // Builds the interfaces array. jobjectArray proxyClassInterfaces = diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 6384d01aaf..0d9d16cd01 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1976,10 +1976,6 @@ mirror::Throwable* Runtime::GetPreAllocatedNoClassDefFoundError() { } void Runtime::VisitConstantRoots(RootVisitor* visitor) { - // Visit the classes held as static in mirror classes, these can be visited concurrently and only - // need to be visited once per GC since they never change. - mirror::Class::VisitRoots(visitor); - mirror::ClassExt::VisitRoots(visitor); // Visiting the roots of these ArtMethods is not currently required since all the GcRoots are // null. BufferedRootVisitor<16> buffered_visitor(visitor, RootInfo(kRootVMInternal)); |