[heap] TPH cannot assume chunks

Bug: v8:9533
Change-Id: Ia47af94bd24b3f9a8a3d39f79a8ed61f4f2d53ab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2047048
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Cr-Commit-Position: refs/heads/master@{#66212}
This commit is contained in:
Steve Blackburn 2020-02-10 17:22:35 +01:00 committed by Commit Bot
parent e6e42ec108
commit 3645656b05
2 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,7 @@ struct MemoryChunk {
V8_INLINE static heap_internals::MemoryChunk* FromHeapObject(
HeapObject object) {
DCHECK(!V8_ENABLE_THIRD_PARTY_HEAP_BOOL);
return reinterpret_cast<MemoryChunk*>(object.ptr() & ~kPageAlignmentMask);
}

View File

@ -641,10 +641,12 @@ class MemoryChunk : public BasicMemoryChunk {
// Only works if the pointer is in the first kPageSize of the MemoryChunk.
static MemoryChunk* FromAddress(Address a) {
DCHECK(!V8_ENABLE_THIRD_PARTY_HEAP_BOOL);
return reinterpret_cast<MemoryChunk*>(BaseAddress(a));
}
// Only works if the object is in the first kPageSize of the MemoryChunk.
static MemoryChunk* FromHeapObject(HeapObject o) {
DCHECK(!V8_ENABLE_THIRD_PARTY_HEAP_BOOL);
return reinterpret_cast<MemoryChunk*>(BaseAddress(o.ptr()));
}