From 6a91400de42b44aea1531d7642461e9c9b10e877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Fri, 6 Nov 2020 02:46:17 +0100 Subject: [PATCH] deps: v8: backport 1337a343 to v14 Original commit message: deps: V8: cherry-pick 086eecbd96b6 Original commit message: [platform] Add Permission::kNoAccessWillJitLater enum value This value is unused for now. This CL is part 1 of a 3-step dance. Part 2 will be teaching Chrome's Platform implementation to accept the new value. Part 3 will then actually use it in V8. Bug: chromium:1117591 Change-Id: Ie3aed20d4cc58f3def3be2a3a03bba4c3a37bf44 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2450056 Commit-Queue: Jakob Kummerow Reviewed-by: Michael Lippautz Cr-Commit-Position: refs/heads/master@{#70335} PR-URL: https://github.com/nodejs/node/pull/35986 Reviewed-By: Anna Henningsen Reviewed-By: Richard Lau Reviewed-By: Michael Dawson Reviewed-By: Rich Trott Reviewed-By: Beth Griggs Reviewed-By: Jiawen Geng --- common.gypi | 2 +- deps/v8/include/v8-platform.h | 8 +++++++- deps/v8/test/unittests/heap/unmapper-unittest.cc | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index a3f155fde2861a..fc74558f2cbffe 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.21', + 'v8_embedder_string': '-node.22', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index bf474f26803c48..dfb9442f5798b4 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -338,7 +338,13 @@ class PageAllocator { kReadWrite, // TODO(hpayer): Remove this flag. Memory should never be rwx. kReadWriteExecute, - kReadExecute + kReadExecute, + // Set this when reserving memory that will later require kReadWriteExecute + // permissions. The resulting behavior is platform-specific, currently + // this is used to set the MAP_JIT flag on Apple Silicon. + // TODO(jkummerow): Remove this when Wasm has a platform-independent + // w^x implementation. + kNoAccessWillJitLater }; /** diff --git a/deps/v8/test/unittests/heap/unmapper-unittest.cc b/deps/v8/test/unittests/heap/unmapper-unittest.cc index cd1344f8098629..ffcd94a2154e12 100644 --- a/deps/v8/test/unittests/heap/unmapper-unittest.cc +++ b/deps/v8/test/unittests/heap/unmapper-unittest.cc @@ -169,6 +169,7 @@ class TrackingPageAllocator : public ::v8::PageAllocator { os << " page: [" << start << ", " << end << "), access: "; switch (access) { case PageAllocator::kNoAccess: + case PageAllocator::kNoAccessWillJitLater: os << "--"; break; case PageAllocator::kRead: