diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-02-22 13:50:42 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2023-02-23 14:07:46 +0000 |
commit | 588986e4d3589bc8ae950de5fca94bd60066c3da (patch) | |
tree | cd6056c49141ddbaf61b4a8f3bf1bf040e834b61 | |
parent | f7860adb852a797ad68ce9f5f0d1622633775a2f (diff) | |
download | qtwebengine-chromium-588986e4d3589bc8ae950de5fca94bd60066c3da.tar.gz |
[Backport] 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
Review-URL: https://chromium-review.googlesource.com/c/v8/v8/+/2912916
Cr-Commit-Position: refs/heads/master@{#74791}
Change-Id: I75a9bdf0fa455940f8703988438e99ffc6b3be8b
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/462017
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/v8/src/compiler/node.h | 2 | ||||
-rw-r--r-- | chromium/v8/src/compiler/operator.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/chromium/v8/src/compiler/node.h b/chromium/v8/src/compiler/node.h index 1936f06457e..83ff9e256ce 100644 --- a/chromium/v8/src/compiler/node.h +++ b/chromium/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<IrOpcode::Value>(op_->opcode()); } diff --git a/chromium/v8/src/compiler/operator.h b/chromium/v8/src/compiler/operator.h index 7227c92cd86..94d70588672 100644 --- a/chromium/v8/src/compiler/operator.h +++ b/chromium/v8/src/compiler/operator.h @@ -69,7 +69,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. |