From c3efc70df7e22d7eb1b24a311f3b2135eb0ccab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sun, 20 Jun 2021 11:04:18 +0200 Subject: [PATCH] deps: V8: cherry-pick a5cea1bfc38c 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 Reviewed-by: Maya Lekova Commit-Queue: Lei Zhang Cr-Commit-Position: refs/heads/master@{#74791} Refs: https://github.com/v8/v8/commit/a5cea1bfc38ceafc74f4baddd6ab94ea13757ef8 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/node.h | 2 +- deps/v8/src/compiler/operator.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index e721566fecddc1..4c584060e66852 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.10', + 'v8_embedder_string': '-node.11', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/compiler/node.h b/deps/v8/src/compiler/node.h index 37b45c403f1e9f..57d49fe1ac0009 100644 --- a/deps/v8/src/compiler/node.h +++ b/deps/v8/src/compiler/node.h @@ -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(op_->opcode()); } diff --git a/deps/v8/src/compiler/operator.h b/deps/v8/src/compiler/operator.h index 4206e753f1e634..f641394eb1f0fa 100644 --- a/deps/v8/src/compiler/operator.h +++ b/deps/v8/src/compiler/operator.h @@ -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.