From 864fe9910bf0a09dfe5b9e1d0072718d17920338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 8 Mar 2021 08:59:36 +0100 Subject: [PATCH] deps: make V8 9.1 abi-compatible with 9.0 Revert "[api] Avoid handles for const API functions" This reverts commit aee471b2ff5b1a9e622426454885b748d226535b. Revert "[api] Remove deprecated [Shared]ArrayBuffer API" This reverts commit 578f6be77fc5d8af975005c2baf918e7225abb62. Revert "[Jobs]: Cleanup in v8 platform." This reverts commit baf2b088dd9f585aa597459f30d71431171666e2. Revert "Skip global registration of [Shared]ArrayBuffer backing stores" This reverts commit fcdf35e6d70d51699ece063e25dc705e80673308. PR-URL: https://github.com/nodejs/node/pull/38991 Reviewed-By: Anna Henningsen --- common.gypi | 2 +- deps/v8/include/v8-platform.h | 18 +- deps/v8/include/v8.h | 276 +++++++++- deps/v8/src/api/api.cc | 529 +++++++++++++++---- deps/v8/src/objects/backing-store.cc | 37 +- deps/v8/src/objects/backing-store.h | 11 +- deps/v8/src/objects/string-inl.h | 78 ++- deps/v8/src/objects/string.cc | 11 +- deps/v8/src/objects/string.h | 92 ++-- deps/v8/src/wasm/module-compiler.cc | 2 - deps/v8/test/cctest/test-api-array-buffer.cc | 189 ++++++- deps/v8/test/cctest/test-typedarrays.cc | 24 + 12 files changed, 1030 insertions(+), 239 deletions(-) diff --git a/common.gypi b/common.gypi index b2ea540133f0af..aa42c69f96391b 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.13', + 'v8_embedder_string': '-node.14', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index fc9a357feb66cb..4c94d7fd392c0c 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -181,8 +181,9 @@ class JobDelegate { /** * Returns true if the current task is called from the thread currently * running JobHandle::Join(). + * TODO(etiennep): Make pure virtual once custom embedders implement it. */ - virtual bool IsJoiningThread() const = 0; + virtual bool IsJoiningThread() const { return false; } }; /** @@ -219,14 +220,19 @@ class JobHandle { * Forces all existing workers to yield ASAP but doesn’t wait for them. * Warning, this is dangerous if the Job's callback is bound to or has access * to state which may be deleted after this call. + * TODO(etiennep): Cleanup once implemented by all embedders. */ - virtual void CancelAndDetach() = 0; + virtual void CancelAndDetach() { Cancel(); } /** * Returns true if there's any work pending or any worker running. */ virtual bool IsActive() = 0; + // TODO(etiennep): Clean up once all overrides are removed. + V8_DEPRECATED("Use !IsActive() instead.") + virtual bool IsCompleted() { return !IsActive(); } + /** * Returns true if associated with a Job and other methods may be called. * Returns false after Join() or Cancel() was called. This may return true @@ -234,6 +240,10 @@ class JobHandle { */ virtual bool IsValid() = 0; + // TODO(etiennep): Clean up once all overrides are removed. + V8_DEPRECATED("Use IsValid() instead.") + virtual bool IsRunning() { return IsValid(); } + /** * Returns true if job priority can be changed. */ @@ -262,6 +272,10 @@ class JobTask { * it must not call back any JobHandle methods. */ virtual size_t GetMaxConcurrency(size_t worker_count) const = 0; + + // TODO(1114823): Clean up once all overrides are removed. + V8_DEPRECATED("Use the version that takes |worker_count|.") + virtual size_t GetMaxConcurrency() const { return 0; } }; /** diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index ba87e57a1e27ff..840dd2c2258b4f 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -1495,7 +1495,7 @@ class V8_EXPORT UnboundScript { */ Local