From 65062b3e0de6e1ad5b81f7166eefde4f0ece4c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 20 Jun 2021 11:04:57 +0200 Subject: [PATCH] deps: V8: cherry-pick 7ff6609a5385 Original commit message: Move DCHECK() in JSCallOrConstructNode ctor into a helper function. As is, the DCHECK() has a #if inside, and MSVC has trouble pre-processing that. Fix this by moving the conditional inside the DCHECK() into a separate helper function. Bug: v8:11760 Change-Id: Ib4ae0fe263029bb426da378afa5b6881557ce652 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2919421 Reviewed-by: Maya Lekova Reviewed-by: Clemens Backes Commit-Queue: Lei Zhang Cr-Commit-Position: refs/heads/master@{#74807} Refs: https://github.com/v8/v8/commit/7ff6609a53854f859b12ba4b76606f397e074a70 Backport-PR-URL: https://github.com/nodejs/node/pull/39470 PR-URL: https://github.com/nodejs/node/pull/38990 Reviewed-By: Jiawen Geng Reviewed-By: Matteo Collina Reviewed-By: Robert Nagy Reviewed-By: Colin Ihrig --- common.gypi | 2 +- deps/v8/src/compiler/js-operator.h | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/common.gypi b/common.gypi index 4c584060e66852..b5c0a18c594af4 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.11', + 'v8_embedder_string': '-node.12', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/compiler/js-operator.h b/deps/v8/src/compiler/js-operator.h index 8080d4caefefc5..b136adc5735efa 100644 --- a/deps/v8/src/compiler/js-operator.h +++ b/deps/v8/src/compiler/js-operator.h @@ -1284,16 +1284,7 @@ class JSCallOrConstructNode : public JSNodeWrapperBase { public: explicit constexpr JSCallOrConstructNode(Node* node) : JSNodeWrapperBase(node) { - DCHECK(node->opcode() == IrOpcode::kJSCall || - node->opcode() == IrOpcode::kJSCallWithArrayLike || - node->opcode() == IrOpcode::kJSCallWithSpread || - node->opcode() == IrOpcode::kJSConstruct || - node->opcode() == IrOpcode::kJSConstructWithArrayLike || - node->opcode() == IrOpcode::kJSConstructWithSpread -#if V8_ENABLE_WEBASSEMBLY - || node->opcode() == IrOpcode::kJSWasmCall -#endif // V8_ENABLE_WEBASSEMBLY - ); // NOLINT(whitespace/parens) + DCHECK(IsValidNode(node)); } #define INPUTS(V) \ @@ -1367,6 +1358,20 @@ class JSCallOrConstructNode : public JSNodeWrapperBase { return TNode::UncheckedCast( NodeProperties::GetValueInput(node(), FeedbackVectorIndex())); } + + private: + static constexpr bool IsValidNode(Node* node) { + return node->opcode() == IrOpcode::kJSCall || + node->opcode() == IrOpcode::kJSCallWithArrayLike || + node->opcode() == IrOpcode::kJSCallWithSpread || + node->opcode() == IrOpcode::kJSConstruct || + node->opcode() == IrOpcode::kJSConstructWithArrayLike || + node->opcode() == IrOpcode::kJSConstructWithSpread +#if V8_ENABLE_WEBASSEMBLY + || node->opcode() == IrOpcode::kJSWasmCall +#endif // V8_ENABLE_WEBASSEMBLY + ; // NOLINT(whitespace/semicolon) + } }; template