Commit 190fda57 authored by Peter Kasting's avatar Peter Kasting Committed by V8 LUCI CQ

Remove "volatile" on arguments where deprecated in C++20.

Many uses of "volatile" are deprecated in C++20 because they don't
actually do anything.  Remove "volatile" in these cases.

Bug: chromium:1284275
Change-Id: I64a3989d73f25e0cd933375dd6fa0b3f2b3acb54
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3630343
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80428}
parent d60d36a8
......@@ -1174,7 +1174,7 @@ const Operator* CommonOperatorBuilder::TaggedIndexConstant(int32_t value) {
value); // parameter
}
const Operator* CommonOperatorBuilder::Float32Constant(volatile float value) {
const Operator* CommonOperatorBuilder::Float32Constant(float value) {
return zone()->New<Operator1<float>>( // --
IrOpcode::kFloat32Constant, Operator::kPure, // opcode
"Float32Constant", // name
......@@ -1183,7 +1183,7 @@ const Operator* CommonOperatorBuilder::Float32Constant(volatile float value) {
}
const Operator* CommonOperatorBuilder::Float64Constant(volatile double value) {
const Operator* CommonOperatorBuilder::Float64Constant(double value) {
return zone()->New<Operator1<double>>( // --
IrOpcode::kFloat64Constant, Operator::kPure, // opcode
"Float64Constant", // name
......@@ -1202,7 +1202,7 @@ const Operator* CommonOperatorBuilder::ExternalConstant(
}
const Operator* CommonOperatorBuilder::NumberConstant(volatile double value) {
const Operator* CommonOperatorBuilder::NumberConstant(double value) {
return zone()->New<Operator1<double>>( // --
IrOpcode::kNumberConstant, Operator::kPure, // opcode
"NumberConstant", // name
......
......@@ -502,10 +502,10 @@ class V8_EXPORT_PRIVATE CommonOperatorBuilder final
const Operator* Int32Constant(int32_t);
const Operator* Int64Constant(int64_t);
const Operator* TaggedIndexConstant(int32_t value);
const Operator* Float32Constant(volatile float);
const Operator* Float64Constant(volatile double);
const Operator* Float32Constant(float);
const Operator* Float64Constant(double);
const Operator* ExternalConstant(const ExternalReference&);
const Operator* NumberConstant(volatile double);
const Operator* NumberConstant(double);
const Operator* PointerConstant(intptr_t);
const Operator* HeapConstant(const Handle<HeapObject>&);
const Operator* CompressedHeapConstant(const Handle<HeapObject>&);
......
......@@ -172,11 +172,11 @@ MachineOperatorReducer::MachineOperatorReducer(Editor* editor,
MachineOperatorReducer::~MachineOperatorReducer() = default;
Node* MachineOperatorReducer::Float32Constant(volatile float value) {
Node* MachineOperatorReducer::Float32Constant(float value) {
return graph()->NewNode(common()->Float32Constant(value));
}
Node* MachineOperatorReducer::Float64Constant(volatile double value) {
Node* MachineOperatorReducer::Float64Constant(double value) {
return mcgraph()->Float64Constant(value);
}
......
......@@ -37,8 +37,8 @@ class V8_EXPORT_PRIVATE MachineOperatorReducer final
friend class Word32Adapter;
friend class Word64Adapter;
Node* Float32Constant(volatile float value);
Node* Float64Constant(volatile double value);
Node* Float32Constant(float value);
Node* Float64Constant(double value);
Node* Int32Constant(int32_t value);
Node* Int64Constant(int64_t value);
Node* Uint32Constant(uint32_t value) {
......@@ -65,10 +65,10 @@ class V8_EXPORT_PRIVATE MachineOperatorReducer final
Node* TruncateInt64ToInt32(Node* value);
Reduction ReplaceBool(bool value) { return ReplaceInt32(value ? 1 : 0); }
Reduction ReplaceFloat32(volatile float value) {
Reduction ReplaceFloat32(float value) {
return Replace(Float32Constant(value));
}
Reduction ReplaceFloat64(volatile double value) {
Reduction ReplaceFloat64(double value) {
return Replace(Float64Constant(value));
}
Reduction ReplaceInt32(int32_t value) {
......
......@@ -232,7 +232,7 @@ class WasmGraphAssembler : public GraphAssembler {
return branch;
}
Node* NumberConstant(volatile double value) {
Node* NumberConstant(double value) {
return graph()->NewNode(mcgraph()->common()->NumberConstant(value));
}
......
......@@ -19,29 +19,29 @@ namespace compiler {
template <typename T>
const Operator* NewConstantOperator(CommonOperatorBuilder* common,
volatile T value);
T value);
template <>
const Operator* NewConstantOperator<int32_t>(CommonOperatorBuilder* common,
volatile int32_t value) {
int32_t value) {
return common->Int32Constant(value);
}
template <>
const Operator* NewConstantOperator<int64_t>(CommonOperatorBuilder* common,
volatile int64_t value) {
int64_t value) {
return common->Int64Constant(value);
}
template <>
const Operator* NewConstantOperator<double>(CommonOperatorBuilder* common,
volatile double value) {
double value) {
return common->Float64Constant(value);
}
template <>
const Operator* NewConstantOperator<float>(CommonOperatorBuilder* common,
volatile float value) {
float value) {
return common->Float32Constant(value);
}
......@@ -107,7 +107,7 @@ class ReducerTester : public HandleAndZoneScope {
GraphReducer graph_reducer;
template <typename T>
Node* Constant(volatile T value) {
Node* Constant(T value) {
return graph.NewNode(NewConstantOperator<T>(&common, value));
}
......@@ -119,14 +119,14 @@ class ReducerTester : public HandleAndZoneScope {
// Check that the reduction of this binop applied to constants {a} and {b}
// yields the {expect} value.
template <typename T>
void CheckFoldBinop(volatile T expect, volatile T a, volatile T b) {
void CheckFoldBinop(T expect, T a, T b) {
CheckFoldBinop<T>(expect, Constant<T>(a), Constant<T>(b));
}
// Check that the reduction of this binop applied to {a} and {b} yields
// the {expect} value.
template <typename T>
void CheckFoldBinop(volatile T expect, Node* a, Node* b) {
void CheckFoldBinop(T expect, Node* a, Node* b) {
CHECK(binop);
Node* n = CreateBinopNode(a, b);
MachineOperatorReducer reducer(&graph_reducer, &jsgraph);
......@@ -172,7 +172,7 @@ class ReducerTester : public HandleAndZoneScope {
// Check that the reduction of this binop applied to {left} and {right} yields
// the {op_expect} applied to {left_expect} and {right_expect}.
template <typename T>
void CheckFoldBinop(volatile T left_expect, const Operator* op_expect,
void CheckFoldBinop(T left_expect, const Operator* op_expect,
Node* right_expect, Node* left, Node* right) {
CHECK(binop);
Node* n = CreateBinopNode(left, right);
......@@ -188,7 +188,7 @@ class ReducerTester : public HandleAndZoneScope {
// the {op_expect} applied to {left_expect} and {right_expect}.
template <typename T>
void CheckFoldBinop(Node* left_expect, const Operator* op_expect,
volatile T right_expect, Node* left, Node* right) {
T right_expect, Node* left, Node* right) {
CHECK(binop);
Node* n = CreateBinopNode(left, right);
MachineOperatorReducer reducer(&graph_reducer, &jsgraph);
......@@ -204,7 +204,7 @@ class ReducerTester : public HandleAndZoneScope {
// Check that if the given constant appears on the left, the reducer will
// swap it to be on the right.
template <typename T>
void CheckPutConstantOnRight(volatile T constant) {
void CheckPutConstantOnRight(T constant) {
// TODO(titzer): CHECK(binop->HasProperty(Operator::kCommutative));
Node* p = Parameter();
Node* k = Constant<T>(constant);
......@@ -229,7 +229,7 @@ class ReducerTester : public HandleAndZoneScope {
// Check that if the given constant appears on the left, the reducer will
// *NOT* swap it to be on the right.
template <typename T>
void CheckDontPutConstantOnRight(volatile T constant) {
void CheckDontPutConstantOnRight(T constant) {
CHECK(!binop->HasProperty(Operator::kCommutative));
Node* p = Parameter();
Node* k = Constant<T>(constant);
......
......@@ -39,12 +39,12 @@ Node* GraphTest::Parameter(Type type, int32_t index) {
return node;
}
Node* GraphTest::Float32Constant(volatile float value) {
Node* GraphTest::Float32Constant(float value) {
return graph()->NewNode(common()->Float32Constant(value));
}
Node* GraphTest::Float64Constant(volatile double value) {
Node* GraphTest::Float64Constant(double value) {
return graph()->NewNode(common()->Float64Constant(value));
}
......@@ -59,7 +59,7 @@ Node* GraphTest::Int64Constant(int64_t value) {
}
Node* GraphTest::NumberConstant(volatile double value) {
Node* GraphTest::NumberConstant(double value) {
return graph()->NewNode(common()->NumberConstant(value));
}
......
......@@ -36,14 +36,14 @@ class GraphTest : public TestWithNativeContextAndZone {
Node* Parameter(int32_t index = 0);
Node* Parameter(Type type, int32_t index = 0);
Node* Float32Constant(volatile float value);
Node* Float64Constant(volatile double value);
Node* Float32Constant(float value);
Node* Float64Constant(double value);
Node* Int32Constant(int32_t value);
Node* Uint32Constant(uint32_t value) {
return Int32Constant(base::bit_cast<int32_t>(value));
}
Node* Int64Constant(int64_t value);
Node* NumberConstant(volatile double value);
Node* NumberConstant(double value);
Node* HeapConstant(const Handle<HeapObject>& value);
Node* FalseConstant();
Node* TrueConstant();
......
......@@ -72,7 +72,7 @@ TEST_F(GCHeapTest, PreciseGCReclaimsObjectOnStack) {
namespace {
const void* ConservativeGCReturningObject(cppgc::Heap* heap,
const void* volatile object) {
const void* object) {
internal::Heap::From(heap)->CollectGarbage(
Heap::Config::ConservativeAtomicConfig());
return object;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment