summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/js-operator.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2021-06-20 11:04:57 +0200
committerMichaël Zasso <targos@protonmail.com>2021-07-20 15:28:03 +0200
commitbc6a101ecda74464e1614a88bb9abe7b16d8b2a2 (patch)
treedee0c9b0d0c42e3f4bbb855c3a4772dd0ad02a16 /deps/v8/src/compiler/js-operator.h
parent0479bcf59316efeb7298915b5a293748e1623e84 (diff)
downloadnode-new-bc6a101ecda74464e1614a88bb9abe7b16d8b2a2.tar.gz
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 <mslekova@chromium.org> Reviewed-by: Clemens Backes <clemensb@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/master@{#74807} Refs: https://github.com/v8/v8/commit/7ff6609a53854f859b12ba4b76606f397e074a70 PR-URL: https://github.com/nodejs/node/pull/38990 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/js-operator.h')
-rw-r--r--deps/v8/src/compiler/js-operator.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/deps/v8/src/compiler/js-operator.h b/deps/v8/src/compiler/js-operator.h
index 8080d4caef..b136adc573 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<HeapObject>::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 <int kOpcode>