Add root verification when we try to mark an invalid object.
Now when we try to mark an object not contained by any spaces, We call verify
roots. This prints the root's vreg and method when it finds an invalid root.
Fixed a error in the total paused time statistic.
Change-Id: Id10e4097cce56bc54ee488de32183c18ba3f3780
diff --git a/src/stack.h b/src/stack.h
index 70d6f9d..bceadc3 100644
--- a/src/stack.h
+++ b/src/stack.h
@@ -90,12 +90,13 @@
(shadow_frame_entry <= (&references_[number_of_references_ - 1])));
}
- void VisitRoots(Heap::RootVisitor* visitor, void* arg) {
+ template <typename Visitor>
+ void VisitRoots(const Visitor& visitor) {
size_t num_refs = NumberOfReferences();
for (size_t j = 0; j < num_refs; j++) {
Object* object = GetReference(j);
if (object != NULL) {
- visitor(object, arg);
+ visitor(object, j);
}
}
}