From 9837939678bb5dcba178e5fb00ed59b5d14c8d9b Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Mon, 24 Feb 2014 16:53:16 -0800 Subject: Avoid std::string allocations for finding an array class. Introduce ClassLinker::FindArrayClass which performs an array class lookup given the element/component class. This has a 16 element cache of recently looked up arrays. Pass the current thread to ClassLinker Find .. Class routines to avoid calls to Thread::Current(). Avoid some uses of FindClass in the debugger where WellKnownClasses is a faster and more compacting GC friendly alternative. Change-Id: I60e231820b349543a7edb3ceb9cf1ce92db3c843 --- runtime/gc/heap_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/gc/heap_test.cc') diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc index b02b8bb022..4b863397c4 100644 --- a/runtime/gc/heap_test.cc +++ b/runtime/gc/heap_test.cc @@ -43,7 +43,8 @@ TEST_F(HeapTest, GarbageCollectClassLinkerInit) { ScopedObjectAccess soa(Thread::Current()); // garbage is created during ClassLinker::Init - SirtRef c(soa.Self(), class_linker_->FindSystemClass("[Ljava/lang/Object;")); + SirtRef c(soa.Self(), class_linker_->FindSystemClass(soa.Self(), + "[Ljava/lang/Object;")); for (size_t i = 0; i < 1024; ++i) { SirtRef > array(soa.Self(), mirror::ObjectArray::Alloc(soa.Self(), c.get(), 2048)); -- cgit v1.2.3-59-g8ed1b