diff options
Diffstat (limited to 'deps/v8/test/unittests/heap/cppgc/write-barrier-unittest.cc')
-rw-r--r-- | deps/v8/test/unittests/heap/cppgc/write-barrier-unittest.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/deps/v8/test/unittests/heap/cppgc/write-barrier-unittest.cc b/deps/v8/test/unittests/heap/cppgc/write-barrier-unittest.cc index ba340743ea..605029dee3 100644 --- a/deps/v8/test/unittests/heap/cppgc/write-barrier-unittest.cc +++ b/deps/v8/test/unittests/heap/cppgc/write-barrier-unittest.cc @@ -54,7 +54,7 @@ class V8_NODISCARD ExpectWriteBarrierFires final EXPECT_TRUE(marking_worklist_.IsGlobalEmpty()); EXPECT_TRUE(write_barrier_worklist_.IsGlobalEmpty()); for (void* object : objects) { - headers_.push_back(&HeapObjectHeader::FromPayload(object)); + headers_.push_back(&HeapObjectHeader::FromObject(object)); EXPECT_FALSE(headers_.back()->IsMarked()); } } @@ -71,7 +71,8 @@ class V8_NODISCARD ExpectWriteBarrierFires final { HeapObjectHeader* item; while (write_barrier_worklist_.Pop(&item)) { - auto pos = std::find(objects_.begin(), objects_.end(), item->Payload()); + auto pos = + std::find(objects_.begin(), objects_.end(), item->ObjectStart()); if (pos != objects_.end()) objects_.erase(pos); } } @@ -104,7 +105,7 @@ class V8_NODISCARD ExpectNoWriteBarrierFires final EXPECT_TRUE(marking_worklist_.IsGlobalEmpty()); EXPECT_TRUE(write_barrier_worklist_.IsGlobalEmpty()); for (void* object : objects) { - auto* header = &HeapObjectHeader::FromPayload(object); + auto* header = &HeapObjectHeader::FromObject(object); headers_.emplace_back(header, header->IsMarked()); } } @@ -131,7 +132,7 @@ class GCed : public GarbageCollected<GCed> { void Trace(cppgc::Visitor* v) const { v->Trace(next_); } bool IsMarked() const { - return HeapObjectHeader::FromPayload(this).IsMarked(); + return HeapObjectHeader::FromObject(this).IsMarked(); } void set_next(GCed* next) { next_ = next; } @@ -201,7 +202,7 @@ TEST_F(NoWriteBarrierTest, BailoutWhenMarkingIsOff) { TEST_F(WriteBarrierTest, BailoutIfMarked) { auto* object1 = MakeGarbageCollected<GCed>(GetAllocationHandle()); auto* object2 = MakeGarbageCollected<GCed>(GetAllocationHandle()); - EXPECT_TRUE(HeapObjectHeader::FromPayload(object1).TryMarkAtomic()); + EXPECT_TRUE(HeapObjectHeader::FromObject(object1).TryMarkAtomic()); { ExpectNoWriteBarrierFires scope(marker(), {object1}); object2->set_next(object1); @@ -213,7 +214,7 @@ TEST_F(WriteBarrierTest, MemberInitializingStoreNoBarrier) { { ExpectNoWriteBarrierFires scope(marker(), {object1}); auto* object2 = MakeGarbageCollected<GCed>(GetAllocationHandle(), object1); - HeapObjectHeader& object2_header = HeapObjectHeader::FromPayload(object2); + HeapObjectHeader& object2_header = HeapObjectHeader::FromObject(object2); EXPECT_FALSE(object2_header.IsMarked()); } } @@ -313,7 +314,7 @@ TEST_F(WriteBarrierTest, NoWriteBarrierOnMarkedMixinApplication) { ParentWithMixinPointer* parent = MakeGarbageCollected<ParentWithMixinPointer>(GetAllocationHandle()); auto* child = MakeGarbageCollected<Child>(GetAllocationHandle()); - EXPECT_TRUE(HeapObjectHeader::FromPayload(child).TryMarkAtomic()); + EXPECT_TRUE(HeapObjectHeader::FromObject(child).TryMarkAtomic()); Mixin* mixin = static_cast<Mixin*>(child); EXPECT_NE(static_cast<void*>(child), static_cast<void*>(mixin)); { @@ -367,7 +368,7 @@ TEST_F(WriteBarrierTest, DijkstraWriteBarrierTriggersWhenMarkingIsOn) { TEST_F(WriteBarrierTest, DijkstraWriteBarrierBailoutIfMarked) { auto* object1 = MakeGarbageCollected<GCed>(GetAllocationHandle()); auto* object2 = MakeGarbageCollected<GCed>(GetAllocationHandle(), object1); - EXPECT_TRUE(HeapObjectHeader::FromPayload(object1).TryMarkAtomic()); + EXPECT_TRUE(HeapObjectHeader::FromObject(object1).TryMarkAtomic()); { ExpectNoWriteBarrierFires scope(marker(), {object1}); WriteBarrierParams params; @@ -387,7 +388,7 @@ struct InlinedObject { Member<GCed> ref; }; -class GCedWithInlinedArray : public GarbageCollected<GCed> { +class GCedWithInlinedArray : public GarbageCollected<GCedWithInlinedArray> { public: static constexpr size_t kNumReferences = 4; @@ -430,7 +431,7 @@ TEST_F(WriteBarrierTest, DijkstraWriteBarrierRangeBailoutIfMarked) { auto* object1 = MakeGarbageCollected<GCed>(GetAllocationHandle()); auto* object2 = MakeGarbageCollected<GCedWithInlinedArray>( GetAllocationHandle(), object1); - EXPECT_TRUE(HeapObjectHeader::FromPayload(object1).TryMarkAtomic()); + EXPECT_TRUE(HeapObjectHeader::FromObject(object1).TryMarkAtomic()); { ExpectNoWriteBarrierFires scope(marker(), {object1}); WriteBarrierParams params; @@ -450,7 +451,7 @@ TEST_F(WriteBarrierTest, SteeleWriteBarrierTriggersWhenMarkingIsOn) { auto* object2 = MakeGarbageCollected<GCed>(GetAllocationHandle(), object1); { ExpectWriteBarrierFires scope(marker(), {object1}); - EXPECT_TRUE(HeapObjectHeader::FromPayload(object1).TryMarkAtomic()); + EXPECT_TRUE(HeapObjectHeader::FromObject(object1).TryMarkAtomic()); WriteBarrierParams params; EXPECT_EQ(WriteBarrierType::kMarking, HeapConsistency::GetWriteBarrierType( |