Commit 1511a19d authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[heap] Verify skipping of write barriers for maps

We recently landed write barrier verification in
https://crrev.com/c/3386803. This CL adds verification to
set_map_no_write_barrier and similar methods as well.

Bug: v8:12544
Change-Id: I54844b0323731281b4f41fd1502acdd44557a2c9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3395561Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78675}
parent 261ad0d5
......@@ -831,6 +831,7 @@ void HeapObject::set_map_no_write_barrier(Map value, RelaxedStoreTag tag) {
}
#endif
set_map_word(MapWord::FromMap(value), tag);
SLOW_DCHECK(!WriteBarrier::IsRequired(*this, value));
}
void HeapObject::set_map_no_write_barrier(Map value, ReleaseStoreTag tag) {
......@@ -840,6 +841,7 @@ void HeapObject::set_map_no_write_barrier(Map value, ReleaseStoreTag tag) {
}
#endif
set_map_word(MapWord::FromMap(value), tag);
SLOW_DCHECK(!WriteBarrier::IsRequired(*this, value));
}
void HeapObject::set_map_after_allocation(Map value, WriteBarrierMode mode) {
......@@ -851,6 +853,8 @@ void HeapObject::set_map_after_allocation(Map value, WriteBarrierMode mode) {
// TODO(1600) We are passing kNullAddress as a slot because maps can never
// be on an evacuation candidate.
WriteBarrier::Marking(*this, ObjectSlot(kNullAddress), value);
} else {
SLOW_DCHECK(!WriteBarrier::IsRequired(*this, value));
}
#endif
}
......
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