summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/heap-write-barrier-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap/heap-write-barrier-inl.h')
-rw-r--r--deps/v8/src/heap/heap-write-barrier-inl.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/deps/v8/src/heap/heap-write-barrier-inl.h b/deps/v8/src/heap/heap-write-barrier-inl.h
index a1b03256af..4d48679dfa 100644
--- a/deps/v8/src/heap/heap-write-barrier-inl.h
+++ b/deps/v8/src/heap/heap-write-barrier-inl.h
@@ -45,10 +45,10 @@ struct MemoryChunk {
static constexpr uintptr_t kFlagsOffset = kSizetSize;
static constexpr uintptr_t kHeapOffset = kSizetSize + kUIntptrSize;
static constexpr uintptr_t kIsExecutableBit = uintptr_t{1} << 0;
- static constexpr uintptr_t kMarkingBit = uintptr_t{1} << 18;
+ static constexpr uintptr_t kMarkingBit = uintptr_t{1} << 17;
static constexpr uintptr_t kFromPageBit = uintptr_t{1} << 3;
static constexpr uintptr_t kToPageBit = uintptr_t{1} << 4;
- static constexpr uintptr_t kReadOnlySpaceBit = uintptr_t{1} << 21;
+ static constexpr uintptr_t kReadOnlySpaceBit = uintptr_t{1} << 20;
V8_INLINE static heap_internals::MemoryChunk* FromHeapObject(
HeapObject object) {
@@ -283,6 +283,19 @@ void WriteBarrier::MarkingFromInternalFields(JSObject host) {
MarkingSlowFromInternalFields(*heap, host);
}
+#ifdef ENABLE_SLOW_DCHECKS
+// static
+template <typename T>
+bool WriteBarrier::IsRequired(HeapObject host, T value) {
+ if (BasicMemoryChunk::FromHeapObject(host)->InYoungGeneration()) return false;
+ if (value.IsSmi()) return false;
+ if (value.IsCleared()) return false;
+ HeapObject target = value.GetHeapObject();
+ if (ReadOnlyHeap::Contains(target)) return false;
+ return !IsImmortalImmovableHeapObject(target);
+}
+#endif
+
} // namespace internal
} // namespace v8