Skip to content

Commit

Permalink
deps: V8: cherry-pick 7ff6609a5385
Browse files Browse the repository at this point in the history
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: v8/v8@7ff6609

Backport-PR-URL: #39470
PR-URL: #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>
  • Loading branch information
targos authored and BethGriggs committed Jul 29, 2021
1 parent c3efc70 commit 65062b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Expand Up @@ -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 #####

Expand Down
25 changes: 15 additions & 10 deletions deps/v8/src/compiler/js-operator.h
Expand Up @@ -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) \
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 65062b3

Please sign in to comment.