Commit 5e3f37a8 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[oilpan] Fix incremental marking tests

This fixes tests when run with enable_blink_heap_verification which
checks that all marked objects on the heap have their children marked
too. This is not the case for these kind of unittests.

Bug: chromium:757440
Change-Id: Ie92761b7619dcf2f16fba7c2a3d3e6b0b10b0afd
Reviewed-on: https://chromium-review.googlesource.com/966401Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543692}
parent 1e620f31
......@@ -79,6 +79,7 @@ class ExpectWriteBarrierFires : public IncrementalMarkingScope {
// All headers of objects watched should be marked.
for (HeapObjectHeader* header : headers_) {
EXPECT_TRUE(header->IsMarked());
header->Unmark();
}
// All objects watched should be on the marking stack.
while (!marking_stack_->IsEmpty()) {
......@@ -86,8 +87,10 @@ class ExpectWriteBarrierFires : public IncrementalMarkingScope {
T* obj = reinterpret_cast<T*>(item->Object());
// Ignore the backing object.
if (!ThreadHeap::IsNormalArenaIndex(
PageFromObject(obj)->Arena()->ArenaIndex()))
PageFromObject(obj)->Arena()->ArenaIndex())) {
HeapObjectHeader::FromPayload(obj)->Unmark();
continue;
}
auto pos = std::find(objects_.begin(), objects_.end(), obj);
// The following check makes sure that there are no unexpected objects on
// the marking stack. If it fails then the write barrier fired for an
......@@ -126,6 +129,7 @@ class ExpectNoWriteBarrierFires : public IncrementalMarkingScope {
EXPECT_TRUE(marking_stack_->IsEmpty());
for (size_t i = 0; i < headers_.size(); i++) {
EXPECT_EQ(was_marked_[i], headers_[i]->IsMarked());
headers_[i]->Unmark();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment