Commit 9c6c8d99 authored by Steve Blackburn's avatar Steve Blackburn Committed by Commit Bot

Fix TPH heap code

1. Fix typo introduced in prior commit.
2. Guard code so TPH does not attempt to use OffThreadSpace.

Bug: v8:9533
Change-Id: I37eeff6a9c6ec4a7c479161a01345aa82c884e54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2047046Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Steve Blackburn <steveblackburn@google.com>
Cr-Commit-Position: refs/heads/master@{#66214}
parent 5a5976fc
...@@ -27,7 +27,7 @@ V8_INLINE Heap* GetHeapFromWritableObject(HeapObject object) { ...@@ -27,7 +27,7 @@ V8_INLINE Heap* GetHeapFromWritableObject(HeapObject object) {
// able to get the heap, but not the isolate, for off-thread objects. // able to get the heap, but not the isolate, for off-thread objects.
#if defined V8_ENABLE_THIRD_PARTY_HEAP #if defined V8_ENABLE_THIRD_PARTY_HEAP
return Heap::GetIsolateFromWritableObject(obj)->heap(); return Heap::GetIsolateFromWritableObject(object)->heap();
#elif defined V8_COMPRESS_POINTERS #elif defined V8_COMPRESS_POINTERS
Isolate* isolate = Isolate::FromRoot(GetIsolateRoot(object.ptr())); Isolate* isolate = Isolate::FromRoot(GetIsolateRoot(object.ptr()));
DCHECK_NOT_NULL(isolate); DCHECK_NOT_NULL(isolate);
......
...@@ -2958,6 +2958,9 @@ bool Heap::CanMoveObjectStart(HeapObject object) { ...@@ -2958,6 +2958,9 @@ bool Heap::CanMoveObjectStart(HeapObject object) {
// static // static
bool Heap::InOffThreadSpace(HeapObject heap_object) { bool Heap::InOffThreadSpace(HeapObject heap_object) {
#ifdef V8_ENABLE_THIRD_PARTY_HEAP
return false; // currently unsupported
#else
Space* owner = MemoryChunk::FromHeapObject(heap_object)->owner(); Space* owner = MemoryChunk::FromHeapObject(heap_object)->owner();
if (owner->identity() == OLD_SPACE) { if (owner->identity() == OLD_SPACE) {
// TODO(leszeks): Should we exclude compaction spaces here? // TODO(leszeks): Should we exclude compaction spaces here?
...@@ -2967,6 +2970,7 @@ bool Heap::InOffThreadSpace(HeapObject heap_object) { ...@@ -2967,6 +2970,7 @@ bool Heap::InOffThreadSpace(HeapObject heap_object) {
return static_cast<LargeObjectSpace*>(owner)->is_off_thread(); return static_cast<LargeObjectSpace*>(owner)->is_off_thread();
} }
return false; return false;
#endif
} }
bool Heap::IsImmovable(HeapObject object) { bool Heap::IsImmovable(HeapObject object) {
......
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