summaryrefslogtreecommitdiff
path: root/runtime/java_vm_ext.cc
diff options
context:
space:
mode:
author David Sehr <sehr@google.com> 2016-10-13 09:12:37 -0700
committer David Sehr <sehr@google.com> 2016-10-18 14:10:04 -0700
commit709b070044354d9f47641f273edacaeeb0240ab7 (patch)
tree3a8ac051d7c35076303984d0d892cdd396b60427 /runtime/java_vm_ext.cc
parent1a4de6a2453a3ad0310aca1a44e7e2d3b6f53bc1 (diff)
Remove mirror:: and ArtMethod deps in utils.{h,cc}
The latest chapter in the ongoing saga of attempting to dump a DEX file without having to start a whole runtime instance. This episode finds us removing references to ArtMethod/ArtField/mirror. One aspect of this change that I would like to call out specfically is that the utils versions of the "Pretty*" functions all were written to accept nullptr as an argument. I have split these functions up as follows: 1) an instance method, such as PrettyClass that obviously requires this != nullptr. 2) a static method, that behaves the same way as the util method, but calls the instance method if p != nullptr. This requires using a full class qualifier for the static methods, which isn't exactly beautiful. I have tried to remove as many cases as possible where it was clear p != nullptr. Bug: 22322814 Test: test-art-host Change-Id: I21adee3614aa697aa580cd1b86b72d9206e1cb24
Diffstat (limited to 'runtime/java_vm_ext.cc')
-rw-r--r--runtime/java_vm_ext.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc
index f2bda05b94..29dda888e6 100644
--- a/runtime/java_vm_ext.cc
+++ b/runtime/java_vm_ext.cc
@@ -235,8 +235,8 @@ class Libraries {
void* FindNativeMethod(ArtMethod* m, std::string& detail)
REQUIRES(Locks::jni_libraries_lock_)
REQUIRES_SHARED(Locks::mutator_lock_) {
- std::string jni_short_name(JniShortName(m));
- std::string jni_long_name(JniLongName(m));
+ std::string jni_short_name(m->JniShortName());
+ std::string jni_long_name(m->JniLongName());
mirror::ClassLoader* const declaring_class_loader = m->GetDeclaringClass()->GetClassLoader();
ScopedObjectAccessUnchecked soa(Thread::Current());
void* const declaring_class_loader_allocator =
@@ -258,13 +258,13 @@ class Libraries {
fn = library->FindSymbol(jni_long_name, shorty);
}
if (fn != nullptr) {
- VLOG(jni) << "[Found native code for " << PrettyMethod(m)
+ VLOG(jni) << "[Found native code for " << m->PrettyMethod()
<< " in \"" << library->GetPath() << "\"]";
return fn;
}
}
detail += "No implementation found for ";
- detail += PrettyMethod(m);
+ detail += m->PrettyMethod();
detail += " (tried " + jni_short_name + " and " + jni_long_name + ")";
LOG(ERROR) << detail;
return nullptr;
@@ -471,7 +471,7 @@ void JavaVMExt::JniAbort(const char* jni_function_name, const char* msg) {
}
// TODO: is this useful given that we're about to dump the calling thread's stack?
if (current_method != nullptr) {
- os << "\n from " << PrettyMethod(current_method);
+ os << "\n from " << current_method->PrettyMethod();
}
os << "\n";
self->Dump(os);
@@ -904,7 +904,7 @@ void* JavaVMExt::FindCodeForNativeMethod(ArtMethod* m) {
CHECK(m->IsNative());
mirror::Class* c = m->GetDeclaringClass();
// If this is a static method, it could be called before the class has been initialized.
- CHECK(c->IsInitializing()) << c->GetStatus() << " " << PrettyMethod(m);
+ CHECK(c->IsInitializing()) << c->GetStatus() << " " << m->PrettyMethod();
std::string detail;
void* native_method;
Thread* self = Thread::Current();