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
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 2c6b249..a26d850 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -368,7 +368,7 @@
last_update_time_ns_.StoreRelease(NanoTime());
VLOG(jit)
<< "JIT added (osr=" << std::boolalpha << osr << std::noboolalpha << ") "
- << PrettyMethod(method) << "@" << method
+ << ArtMethod::PrettyMethod(method) << "@" << method
<< " ccache_size=" << PrettySize(CodeCacheSizeLocked()) << ": "
<< " dcache_size=" << PrettySize(DataCacheSizeLocked()) << ": "
<< reinterpret_cast<const void*>(method_header->GetEntryPoint()) << ","
@@ -378,7 +378,7 @@
LOG(INFO) << "JIT allocated "
<< PrettySize(code_size)
<< " for compiled code of "
- << PrettyMethod(method);
+ << ArtMethod::PrettyMethod(method);
}
}
@@ -434,7 +434,7 @@
LOG(INFO) << "JIT allocated "
<< PrettySize(size)
<< " for stack maps of "
- << PrettyMethod(method);
+ << ArtMethod::PrettyMethod(method);
}
return result;
}
@@ -806,7 +806,8 @@
}
if (kIsDebugBuild && method != nullptr) {
DCHECK_EQ(it->second, method)
- << PrettyMethod(method) << " " << PrettyMethod(it->second) << " " << std::hex << pc;
+ << ArtMethod::PrettyMethod(method) << " " << ArtMethod::PrettyMethod(it->second) << " "
+ << std::hex << pc;
}
return method_header;
}
@@ -927,7 +928,7 @@
ProfilingInfo* info = method->GetProfilingInfo(kRuntimePointerSize);
if (info == nullptr) {
- VLOG(jit) << PrettyMethod(method) << " needs a ProfilingInfo to be compiled";
+ VLOG(jit) << method->PrettyMethod() << " needs a ProfilingInfo to be compiled";
// Because the counter is not atomic, there are some rare cases where we may not
// hit the threshold for creating the ProfilingInfo. Reset the counter now to
// "correct" this.