Skip to content

Commit

Permalink
deps: V8: cherry-pick a5cea1bfc38c
Browse files Browse the repository at this point in the history
Original commit message:

    Mark Node::opcode() and Operator::opcode() as constexpr.

    Without the explicit constexpr keyword, Clang seems to be able to treat
    these methods as constexpr, whereas MSVC will not.

    Bug: v8:11760
    Change-Id: I9f6492f38fb50dcaf7a4f09da0bd79c0da6a50eb
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2912916
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Maya Lekova <mslekova@chromium.org>
    Commit-Queue: Lei Zhang <thestig@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74791}

Refs: v8/v8@a5cea1b

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 201da87 commit c3efc70
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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.10',
'v8_embedder_string': '-node.11',

##### V8 defaults for Node.js #####

Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/node.h
Expand Up @@ -50,7 +50,7 @@ class V8_EXPORT_PRIVATE Node final {

const Operator* op() const { return op_; }

IrOpcode::Value opcode() const {
constexpr IrOpcode::Value opcode() const {
DCHECK_GE(IrOpcode::kLast, op_->opcode());
return static_cast<IrOpcode::Value>(op_->opcode());
}
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/operator.h
Expand Up @@ -73,7 +73,7 @@ class V8_EXPORT_PRIVATE Operator : public NON_EXPORTED_BASE(ZoneObject) {
// A small integer unique to all instances of a particular kind of operator,
// useful for quick matching for specific kinds of operators. For fast access
// the opcode is stored directly in the operator object.
Opcode opcode() const { return opcode_; }
constexpr Opcode opcode() const { return opcode_; }

// Returns a constant string representing the mnemonic of the operator,
// without the static parameters. Useful for debugging.
Expand Down

0 comments on commit c3efc70

Please sign in to comment.