diff options
author | Ian Rogers <irogers@google.com> | 2014-02-24 16:53:16 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-02-24 18:47:23 -0800 |
commit | 9837939678bb5dcba178e5fb00ed59b5d14c8d9b (patch) | |
tree | 00f0e6b54d7c4cac78a02752e268724157e50b6e /runtime/jni_internal_test.cc | |
parent | 3fcf18e25241253f23efbeebe77b2a4c4a7c54d3 (diff) | |
download | art-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/jni_internal_test.cc')
-rw-r--r-- | runtime/jni_internal_test.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/jni_internal_test.cc b/runtime/jni_internal_test.cc index 2dd7d96..63bc45c 100644 --- a/runtime/jni_internal_test.cc +++ b/runtime/jni_internal_test.cc @@ -107,7 +107,8 @@ class JniInternalTest : public CommonTest { class_name); } - mirror::Class* c = class_linker_->FindClass(DotToDescriptor(class_name).c_str(), class_loader); + mirror::Class* c = class_linker_->FindClass(self, DotToDescriptor(class_name).c_str(), + class_loader); CHECK(c != NULL); *method = is_static ? c->FindDirectMethod(method_name, method_signature) @@ -1778,7 +1779,7 @@ TEST_F(JniInternalTest, StaticMainMethod) { class_loader(soa.Self(), soa.Decode<mirror::ClassLoader*>(jclass_loader)); CompileDirectMethod(class_loader, "Main", "main", "([Ljava/lang/String;)V"); - mirror::Class* klass = class_linker_->FindClass("LMain;", class_loader); + mirror::Class* klass = class_linker_->FindClass(soa.Self(), "LMain;", class_loader); ASSERT_TRUE(klass != NULL); mirror::ArtMethod* method = klass->FindDirectMethod("main", "([Ljava/lang/String;)V"); |