Dump GC maps/verification for methods with bad roots.
Change-Id: Iec32ea30420a6fac318f947108248bf4207f279c
diff --git a/src/gc/mark_sweep.cc b/src/gc/mark_sweep.cc
index 8637370..0869e26 100644
--- a/src/gc/mark_sweep.cc
+++ b/src/gc/mark_sweep.cc
@@ -37,6 +37,7 @@
#include "timing_logger.h"
#include "thread.h"
#include "thread_list.h"
+#include "verifier/method_verifier.h"
namespace art {
@@ -185,9 +186,10 @@
LargeObjectSpace* large_object_space = GetHeap()->GetLargeObjectsSpace();
if (!large_object_space->Contains(root)) {
LOG(ERROR) << "Found invalid root: " << root;
- LOG(ERROR) << "VReg / Shadow frame offset: " << vreg;
+ LOG(ERROR) << "VReg: " << vreg;
if (method != NULL) {
- LOG(ERROR) << "In method " << PrettyMethod(method, true);
+ LOG(ERROR) << "In method " << PrettyMethod(method, true) << "\nVerifier output:\n";
+ verifier::MethodVerifier::VerifyMethodAndDump(const_cast<AbstractMethod*>(method));
}
}
}
diff --git a/src/verifier/method_verifier.h b/src/verifier/method_verifier.h
index 8951b13..6765c10 100644
--- a/src/verifier/method_verifier.h
+++ b/src/verifier/method_verifier.h
@@ -162,6 +162,9 @@
std::string& error)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ static void VerifyMethodAndDump(AbstractMethod* method)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
uint8_t EncodePcToReferenceMapData() const;
uint32_t DexFileVersion() const {
@@ -235,8 +238,6 @@
ClassLoader* class_loader, uint32_t class_def_idx, const DexFile::CodeItem* code_item,
AbstractMethod* method, uint32_t method_access_flags)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- static void VerifyMethodAndDump(AbstractMethod* method)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// Run verification on the method. Returns true if verification completes and false if the input
// has an irrecoverable corruption.
@@ -653,8 +654,6 @@
// The number of occurrences of specific opcodes.
size_t new_instance_count_;
size_t monitor_enter_count_;
-
- friend struct art::ReferenceMap2Visitor; // for VerifyMethodAndDump
};
std::ostream& operator<<(std::ostream& os, const MethodVerifier::FailureKind& rhs);