Commit 00868103 authored by Maciej Goszczycki's avatar Maciej Goszczycki Committed by Commit Bot

[roheap] Switch to ReadOnlyHeap::Contains everywhere

ReadOnlySpace::Contains uses owner() which will eventually be set to
nullptr. Use ReadOnlyHeap::Contains instead.

Bug: v8:7464
Change-Id: I2b33c40b937768ff06536fb17be8d57727a8dd22
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1635695Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Maciej Goszczycki <goszczycki@google.com>
Cr-Commit-Position: refs/heads/master@{#61940}
parent c354fb9c
......@@ -3736,7 +3736,7 @@ bool Heap::InSpace(HeapObject value, AllocationSpace space) {
case NEW_LO_SPACE:
return new_lo_space_->Contains(value);
case RO_SPACE:
return read_only_space_->Contains(value);
return ReadOnlyHeap::Contains(value);
}
UNREACHABLE();
}
......
......@@ -105,7 +105,7 @@ void ReadOnlyHeap::ClearSharedHeapForTest() {
// static
bool ReadOnlyHeap::Contains(HeapObject object) {
return Page::FromAddress(object.ptr())->owner()->identity() == RO_SPACE;
return Page::FromHeapObject(object)->owner()->identity() == RO_SPACE;
}
// static
......
......@@ -2560,8 +2560,7 @@ void NewSpace::Verify(Isolate* isolate) {
// be in map space or read-only space.
Map map = object.map();
CHECK(map.IsMap());
CHECK(heap()->map_space()->Contains(map) ||
heap()->read_only_space()->Contains(map));
CHECK(heap()->map_space()->Contains(map) || ReadOnlyHeap::Contains(map));
// The object should not be code or a map.
CHECK(!object.IsMap());
......@@ -3722,8 +3721,7 @@ void LargeObjectSpace::Verify(Isolate* isolate) {
// in map space or read-only space.
Map map = object.map();
CHECK(map.IsMap());
CHECK(heap()->map_space()->Contains(map) ||
heap()->read_only_space()->Contains(map));
CHECK(heap()->map_space()->Contains(map) || ReadOnlyHeap::Contains(map));
// We have only the following types in the large object space:
if (!(object.IsAbstractCode() || object.IsSeqString() ||
......
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