diff options
author | 2016-10-13 09:12:37 -0700 | |
---|---|---|
committer | 2016-10-18 14:10:04 -0700 | |
commit | 709b070044354d9f47641f273edacaeeb0240ab7 (patch) | |
tree | 3a8ac051d7c35076303984d0d892cdd396b60427 /runtime/quick_exception_handler.cc | |
parent | 1a4de6a2453a3ad0310aca1a44e7e2d3b6f53bc1 (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/quick_exception_handler.cc')
-rw-r--r-- | runtime/quick_exception_handler.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index 9056d96f79..a81458fded 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -145,7 +145,7 @@ void QuickExceptionHandler::FindCatch(mirror::Throwable* exception) { if (kDebugExceptionDelivery) { mirror::String* msg = exception->GetDetailMessage(); std::string str_msg(msg != nullptr ? msg->ToModifiedUtf8() : ""); - self_->DumpStack(LOG_STREAM(INFO) << "Delivering exception: " << PrettyTypeOf(exception) + self_->DumpStack(LOG_STREAM(INFO) << "Delivering exception: " << exception->PrettyTypeOf() << ": " << str_msg << "\n"); } StackHandleScope<1> hs(self_); @@ -162,7 +162,8 @@ void QuickExceptionHandler::FindCatch(mirror::Throwable* exception) { if (handler_method_ != nullptr) { const DexFile* dex_file = handler_method_->GetDeclaringClass()->GetDexCache()->GetDexFile(); int line_number = annotations::GetLineNumFromPC(dex_file, handler_method_, handler_dex_pc_); - LOG(INFO) << "Handler: " << PrettyMethod(handler_method_) << " (line: " << line_number << ")"; + LOG(INFO) << "Handler: " << handler_method_->PrettyMethod() << " (line: " + << line_number << ")"; } } if (clear_exception_) { @@ -262,8 +263,8 @@ void QuickExceptionHandler::SetCatchEnvironmentForOptimizedHandler(StackVisitor* vreg_kind, &vreg_value); CHECK(get_vreg_success) << "VReg " << vreg << " was optimized out (" - << "method=" << PrettyMethod(stack_visitor->GetMethod()) << ", " - << "dex_pc=" << stack_visitor->GetDexPc() << ", " + << "method=" << ArtMethod::PrettyMethod(stack_visitor->GetMethod()) + << ", dex_pc=" << stack_visitor->GetDexPc() << ", " << "native_pc_offset=" << stack_visitor->GetNativePcOffset() << ")"; // Copy value to the catch phi's stack slot. @@ -323,7 +324,7 @@ class DeoptimizeStackVisitor FINAL : public StackVisitor { if (GetMethod() == nullptr) { exception_handler_->SetFullFragmentDone(true); } else { - CHECK(callee_method_ != nullptr) << art::PrettyMethod(GetMethod(), false); + CHECK(callee_method_ != nullptr) << GetMethod()->PrettyMethod(false); exception_handler_->SetHandlerQuickArg0(reinterpret_cast<uintptr_t>(callee_method_)); } } @@ -669,7 +670,7 @@ class DumpFramesWithTypeStackVisitor FINAL : public StackVisitor { return true; } else if (method->IsRuntimeMethod()) { if (show_details_) { - LOG(INFO) << "R " << PrettyMethod(method, true); + LOG(INFO) << "R " << method->PrettyMethod(true); } return true; } else { @@ -677,7 +678,7 @@ class DumpFramesWithTypeStackVisitor FINAL : public StackVisitor { LOG(INFO) << (is_shadow ? "S" : "Q") << ((!is_shadow && IsInInlinedFrame()) ? "i" : " ") << " " - << PrettyMethod(method, true); + << method->PrettyMethod(true); return true; // Go on. } } |