summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter/interpreter_common.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-02-24 16:53:16 -0800
committerIan Rogers <irogers@google.com>2014-02-24 18:47:23 -0800
commit9837939678bb5dcba178e5fb00ed59b5d14c8d9b (patch)
tree00f0e6b54d7c4cac78a02752e268724157e50b6e /runtime/interpreter/interpreter_common.cc
parent3fcf18e25241253f23efbeebe77b2a4c4a7c54d3 (diff)
downloadart-9837939678bb5dcba178e5fb00ed59b5d14c8d9b.zip
art-9837939678bb5dcba178e5fb00ed59b5d14c8d9b.tar.gz
art-9837939678bb5dcba178e5fb00ed59b5d14c8d9b.tar.bz2
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
Diffstat (limited to 'runtime/interpreter/interpreter_common.cc')
-rw-r--r--runtime/interpreter/interpreter_common.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc
index 9e1d915..83a1fbc 100644
--- a/runtime/interpreter/interpreter_common.cc
+++ b/runtime/interpreter/interpreter_common.cc
@@ -280,7 +280,7 @@ static void UnstartedRuntimeInvoke(Thread* self, MethodHelper& mh,
std::string descriptor(DotToDescriptor(shadow_frame->GetVRegReference(arg_offset)->AsString()->ToModifiedUtf8().c_str()));
SirtRef<ClassLoader> class_loader(self, nullptr); // shadow_frame.GetMethod()->GetDeclaringClass()->GetClassLoader();
- Class* found = Runtime::Current()->GetClassLinker()->FindClass(descriptor.c_str(),
+ Class* found = Runtime::Current()->GetClassLinker()->FindClass(self, descriptor.c_str(),
class_loader);
CHECK(found != NULL) << "Class.forName failed in un-started runtime for class: "
<< PrettyDescriptor(descriptor);
@@ -289,7 +289,7 @@ static void UnstartedRuntimeInvoke(Thread* self, MethodHelper& mh,
SirtRef<ClassLoader> class_loader(self, down_cast<mirror::ClassLoader*>(shadow_frame->GetVRegReference(arg_offset)));
std::string descriptor(DotToDescriptor(shadow_frame->GetVRegReference(arg_offset + 1)->AsString()->ToModifiedUtf8().c_str()));
- Class* found = Runtime::Current()->GetClassLinker()->FindClass(descriptor.c_str(),
+ Class* found = Runtime::Current()->GetClassLinker()->FindClass(self, descriptor.c_str(),
class_loader);
result->SetL(found);
} else if (name == "java.lang.Object java.lang.Class.newInstance()") {