summaryrefslogtreecommitdiffstats
path: root/runtime/gc_root.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-04-10 14:23:35 -0700
committerMathieu Chartier <mathieuc@google.com>2015-04-13 16:15:22 -0700
commitd3ed9a320a89cb9b91b2361892c043ab7e112717 (patch)
tree94d2b646e8ff9b28e0bef735804ce17a6a8be729 /runtime/gc_root.h
parent4b5673b7387804947a1605a906deee132ab28f14 (diff)
downloadart-d3ed9a320a89cb9b91b2361892c043ab7e112717.tar.gz
art-d3ed9a320a89cb9b91b2361892c043ab7e112717.tar.bz2
art-d3ed9a320a89cb9b91b2361892c043ab7e112717.zip
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
Diffstat (limited to 'runtime/gc_root.h')
-rw-r--r--runtime/gc_root.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/gc_root.h b/runtime/gc_root.h
index 0d3c93b83d..bdc7d5c8e6 100644
--- a/runtime/gc_root.h
+++ b/runtime/gc_root.h
@@ -50,7 +50,7 @@ enum RootType {
};
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 @@ class RootVisitor {
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) {