summaryrefslogtreecommitdiffstats
path: root/runtime/gc/collector
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-04-14 09:35:18 -0700
committerMathieu Chartier <mathieuc@google.com>2015-04-14 11:06:34 -0700
commit9086b65b2ad35dd39a8afc62d535be8217208d08 (patch)
tree3abc6e3297b840289bc240e3a9bc7e61b7a99cbc /runtime/gc/collector
parent8d20011a9de7cd94bee59db3ae8c0cbbf55911d9 (diff)
downloadart-9086b65b2ad35dd39a8afc62d535be8217208d08.zip
art-9086b65b2ad35dd39a8afc62d535be8217208d08.tar.gz
art-9086b65b2ad35dd39a8afc62d535be8217208d08.tar.bz2
Fix valgrind tests
Delete large objects in space destructor. Also some cleanup. Change-Id: I4c4e90149841a156b7a3236201b37683e14890fb
Diffstat (limited to 'runtime/gc/collector')
-rw-r--r--runtime/gc/collector/mark_sweep.cc26
-rw-r--r--runtime/gc/collector/mark_sweep.h3
2 files changed, 9 insertions, 20 deletions
diff --git a/runtime/gc/collector/mark_sweep.cc b/runtime/gc/collector/mark_sweep.cc
index ed2e295..bb8d876 100644
--- a/runtime/gc/collector/mark_sweep.cc
+++ b/runtime/gc/collector/mark_sweep.cc
@@ -490,29 +490,21 @@ void MarkSweep::VisitRoots(mirror::CompressedReference<mirror::Object>** roots,
class VerifyRootVisitor : public SingleRootVisitor {
public:
- explicit VerifyRootVisitor(MarkSweep* collector) : collector_(collector) { }
-
void VisitRoot(mirror::Object* root, const RootInfo& info) OVERRIDE
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_, Locks::heap_bitmap_lock_) {
- collector_->VerifyRoot(root, info);
- }
-
- private:
- MarkSweep* const collector_;
-};
-
-void MarkSweep::VerifyRoot(const Object* root, const RootInfo& root_info) {
- // See if the root is on any space bitmap.
- if (heap_->GetLiveBitmap()->GetContinuousSpaceBitmap(root) == nullptr) {
- space::LargeObjectSpace* large_object_space = GetHeap()->GetLargeObjectsSpace();
- if (large_object_space != nullptr && !large_object_space->Contains(root)) {
- LOG(ERROR) << "Found invalid root: " << root << " " << root_info;
+ // See if the root is on any space bitmap.
+ auto* heap = Runtime::Current()->GetHeap();
+ if (heap->GetLiveBitmap()->GetContinuousSpaceBitmap(root) == nullptr) {
+ space::LargeObjectSpace* large_object_space = heap->GetLargeObjectsSpace();
+ if (large_object_space != nullptr && !large_object_space->Contains(root)) {
+ LOG(ERROR) << "Found invalid root: " << root << " " << info;
+ }
}
}
-}
+};
void MarkSweep::VerifyRoots() {
- VerifyRootVisitor visitor(this);
+ VerifyRootVisitor visitor;
Runtime::Current()->GetThreadList()->VisitRoots(&visitor);
}
diff --git a/runtime/gc/collector/mark_sweep.h b/runtime/gc/collector/mark_sweep.h
index 31cea17..fad3403 100644
--- a/runtime/gc/collector/mark_sweep.h
+++ b/runtime/gc/collector/mark_sweep.h
@@ -248,9 +248,6 @@ class MarkSweep : public GarbageCollector {
// whether or not we care about pauses.
size_t GetThreadCount(bool paused) const;
- void VerifyRoot(const mirror::Object* root, const RootInfo& root_info)
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_, Locks::heap_bitmap_lock_);
-
// Push a single reference on a mark stack.
void PushOnMarkStack(mirror::Object* obj) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);