From 3645656b0543b2a73403dd04f75e4f7cadc5fc9c Mon Sep 17 00:00:00 2001 From: Steve Blackburn Date: Mon, 10 Feb 2020 17:22:35 +0100 Subject: [PATCH] [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 Commit-Queue: Steve Blackburn Cr-Commit-Position: refs/heads/master@{#66212} --- src/heap/heap-write-barrier-inl.h | 1 + src/heap/spaces.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/heap/heap-write-barrier-inl.h b/src/heap/heap-write-barrier-inl.h index 7b1438e6a3..8fec301fe7 100644 --- a/src/heap/heap-write-barrier-inl.h +++ b/src/heap/heap-write-barrier-inl.h @@ -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(object.ptr() & ~kPageAlignmentMask); } diff --git a/src/heap/spaces.h b/src/heap/spaces.h index 29a563afbc..f8b1cba5f8 100644 --- a/src/heap/spaces.h +++ b/src/heap/spaces.h @@ -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(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(BaseAddress(o.ptr())); }