Fix and reenable lock dumping in stack dumps.
This patch adds a flag to tell the method verifier not to load
classes when resolving types, so that when we ask the method verifier
to find monitor-enter instructions for stack dumping it doesn't try
to allocate (since the most common cause of stack dumping is SIGQUIT).
We believe that all the classes we care about will be loaded already
anyway, since we're only interested in _held_ locks, and you can only
hold a lock if you've executed the code that leads to the monitor-enter,
and you can't execute the code without loading the relevant classes.
Any not-yet-loaded classes shouldn't be relevant for our purposes.
Also clarify the stack dumps when a thread is starting up; although
strictly speaking a thread might be in the kNative state, it's more
helpful if we also explicitly say that it's still starting up.
Also a few GC log output fixes.
Change-Id: Ibf8519e9bde27838c511eafa5c13734c5bebeab6
diff --git a/src/verifier/method_verifier.h b/src/verifier/method_verifier.h
index b676269..a02cc25 100644
--- a/src/verifier/method_verifier.h
+++ b/src/verifier/method_verifier.h
@@ -227,7 +227,7 @@
private:
explicit MethodVerifier(const DexFile* dex_file, DexCache* dex_cache,
ClassLoader* class_loader, uint32_t class_def_idx, const DexFile::CodeItem* code_item,
- uint32_t method_idx, AbstractMethod* method, uint32_t access_flags)
+ uint32_t method_idx, AbstractMethod* method, uint32_t access_flags, bool can_load_classes)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
// Adds the given string to the beginning of the last failure message.
@@ -670,6 +670,8 @@
// The number of occurrences of specific opcodes.
size_t new_instance_count_;
size_t monitor_enter_count_;
+
+ const bool can_load_classes_;
};
std::ostream& operator<<(std::ostream& os, const MethodVerifier::FailureKind& rhs);