From 07f2e9f3b63ada1a4cd3205a5b13f2ba25cd2ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 25 Apr 2023 22:17:27 +0200 Subject: [PATCH] chore: disable V8 pointer compression (#1214) --- .gn | 6 ++++++ src/binding.cc | 8 -------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.gn b/.gn index 78704bff..d81db032 100644 --- a/.gn +++ b/.gn @@ -50,4 +50,10 @@ default_args = { # This is problematic for Deno, which has separate "runtime" and "typescript # compiler" snapshots, and sometimes uses them both at the same time. v8_enable_shared_ro_heap = false + + # V8 introduced a bug in 11.1 that causes the External Pointer Table to never + # be cleaned which causes resource exhaustion. Disabling pointer compression + # makes sure that the EPT is not used. + # https://bugs.chromium.org/p/v8/issues/detail?id=13640&q=garbage%20collection&can=2 + v8_enable_pointer_compression = false } diff --git a/src/binding.cc b/src/binding.cc index e790c6b6..6f7f5695 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -2913,14 +2913,6 @@ void v8__HeapProfiler__TakeHeapSnapshot(v8::Isolate* isolate, const_cast(snapshot)->Delete(); } -// This is necessary for v8__internal__GetIsolateFromHeapObject() to be -// reliable enough for our purposes. -#if UINTPTR_MAX == 0xffffffffffffffff && \ - !(defined V8_SHARED_RO_HEAP or defined V8_COMPRESS_POINTERS) -#error V8 must be built with either the 'v8_enable_pointer_compression' or \ -'v8_enable_shared_ro_heap' feature enabled. -#endif - v8::Isolate* v8__internal__GetIsolateFromHeapObject(const v8::Data& data) { namespace i = v8::internal; i::Object object(reinterpret_cast(data));