Fix DCHECK failures from Class::VisitFieldRoots
We now use GetDeclaringClassUnchecked when marking roots to fix
flaky test failures. Fixed a race condition in root marking where
we could have non zero field array length with a null pointer.
Fixed a race condition where we could be marking roots before
FixupTemporaryDeclaringClass had finished. The solution is to
only do the declaring class CHECK if we are at least resolved.
Fixed JDWP tests by changing FieldId / MethodId to be 64 bits.
Also some cleanup.
Change-Id: Ibac09519860d93c3f68a5cc964bbc91dc10a279a
diff --git a/runtime/gc_root.h b/runtime/gc_root.h
index 0d3c93b..bdc7d5c 100644
--- a/runtime/gc_root.h
+++ b/runtime/gc_root.h
@@ -50,7 +50,7 @@
};
std::ostream& operator<<(std::ostream& os, const RootType& root_type);
-// Only used by hprof. tid and root_type are only used by hprof.
+// Only used by hprof. thread_id_ and type_ are only used by hprof.
class RootInfo {
public:
// Thread id 0 is for non thread roots.
@@ -85,12 +85,13 @@
public:
virtual ~RootVisitor() { }
- // Single root versions, not overridable.
+ // Single root version, not overridable.
ALWAYS_INLINE void VisitRoot(mirror::Object** roots, const RootInfo& info)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
VisitRoots(&roots, 1, info);
}
+ // Single root version, not overridable.
ALWAYS_INLINE void VisitRootIfNonNull(mirror::Object** roots, const RootInfo& info)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (*roots != nullptr) {