diff --git a/src/compiler/backend/arm/instruction-selector-arm.cc b/src/compiler/backend/arm/instruction-selector-arm.cc index 04f46a1d6b..78175209e1 100644 --- a/src/compiler/backend/arm/instruction-selector-arm.cc +++ b/src/compiler/backend/arm/instruction-selector-arm.cc @@ -1125,11 +1125,6 @@ void InstructionSelector::VisitWord32ReverseBytes(Node* node) { void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); } -void InstructionSelector::VisitSpeculationFence(Node* node) { - ArmOperandGenerator g(this); - Emit(kArmDsbIsb, g.NoOutput()); -} - void InstructionSelector::VisitInt32Add(Node* node) { ArmOperandGenerator g(this); Int32BinopMatcher m(node); @@ -2694,8 +2689,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { // static MachineOperatorBuilder::Flags InstructionSelector::SupportedMachineOperatorFlags() { - MachineOperatorBuilder::Flags flags = - MachineOperatorBuilder::kSpeculationFence; + MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; if (CpuFeatures::IsSupported(SUDIV)) { // The sdiv and udiv instructions correctly return 0 if the divisor is 0, // but the fall-back implementation does not. diff --git a/src/compiler/backend/arm64/instruction-selector-arm64.cc b/src/compiler/backend/arm64/instruction-selector-arm64.cc index e4312de895..520a64cc39 100644 --- a/src/compiler/backend/arm64/instruction-selector-arm64.cc +++ b/src/compiler/backend/arm64/instruction-selector-arm64.cc @@ -1283,11 +1283,6 @@ void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); } void InstructionSelector::VisitWord64Popcnt(Node* node) { UNREACHABLE(); } -void InstructionSelector::VisitSpeculationFence(Node* node) { - Arm64OperandGenerator g(this); - Emit(kArm64DsbIsb, g.NoOutput()); -} - void InstructionSelector::VisitInt32Add(Node* node) { Arm64OperandGenerator g(this); Int32BinopMatcher m(node); @@ -3272,8 +3267,7 @@ InstructionSelector::SupportedMachineOperatorFlags() { MachineOperatorBuilder::kInt32DivIsSafe | MachineOperatorBuilder::kUint32DivIsSafe | MachineOperatorBuilder::kWord32ReverseBits | - MachineOperatorBuilder::kWord64ReverseBits | - MachineOperatorBuilder::kSpeculationFence; + MachineOperatorBuilder::kWord64ReverseBits; } // static diff --git a/src/compiler/backend/ia32/instruction-selector-ia32.cc b/src/compiler/backend/ia32/instruction-selector-ia32.cc index 2740412383..a6e6f26e2f 100644 --- a/src/compiler/backend/ia32/instruction-selector-ia32.cc +++ b/src/compiler/backend/ia32/instruction-selector-ia32.cc @@ -277,11 +277,6 @@ void InstructionSelector::VisitDebugAbort(Node* node) { Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), edx)); } -void InstructionSelector::VisitSpeculationFence(Node* node) { - IA32OperandGenerator g(this); - Emit(kLFence, g.NoOutput()); -} - void InstructionSelector::VisitLoad(Node* node) { LoadRepresentation load_rep = LoadRepresentationOf(node->op()); @@ -2441,8 +2436,7 @@ MachineOperatorBuilder::Flags InstructionSelector::SupportedMachineOperatorFlags() { MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kWord32ShiftIsSafe | - MachineOperatorBuilder::kWord32Ctz | - MachineOperatorBuilder::kSpeculationFence; + MachineOperatorBuilder::kWord32Ctz; if (CpuFeatures::IsSupported(POPCNT)) { flags |= MachineOperatorBuilder::kWord32Popcnt; } diff --git a/src/compiler/backend/instruction-selector.cc b/src/compiler/backend/instruction-selector.cc index bbf13e49b7..2398ed5c40 100644 --- a/src/compiler/backend/instruction-selector.cc +++ b/src/compiler/backend/instruction-selector.cc @@ -1764,8 +1764,6 @@ void InstructionSelector::VisitNode(Node* node) { ATOMIC_CASE(Exchange) ATOMIC_CASE(CompareExchange) #undef ATOMIC_CASE - case IrOpcode::kSpeculationFence: - return VisitSpeculationFence(node); case IrOpcode::kProtectedLoad: { LoadRepresentation type = LoadRepresentationOf(node->op()); MarkAsRepresentation(type.representation(), node); diff --git a/src/compiler/backend/mips/instruction-selector-mips.cc b/src/compiler/backend/mips/instruction-selector-mips.cc index 44cadd2505..7f882a067b 100644 --- a/src/compiler/backend/mips/instruction-selector-mips.cc +++ b/src/compiler/backend/mips/instruction-selector-mips.cc @@ -1994,8 +1994,6 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { UNREACHABLE(); } -void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); } - #define SIMD_TYPE_LIST(V) \ V(F32x4) \ V(I32x4) \ diff --git a/src/compiler/backend/mips64/instruction-selector-mips64.cc b/src/compiler/backend/mips64/instruction-selector-mips64.cc index eec5d955ff..81933eb149 100644 --- a/src/compiler/backend/mips64/instruction-selector-mips64.cc +++ b/src/compiler/backend/mips64/instruction-selector-mips64.cc @@ -2649,8 +2649,6 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { UNREACHABLE(); } -void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); } - #define SIMD_TYPE_LIST(V) \ V(F32x4) \ V(I32x4) \ diff --git a/src/compiler/backend/ppc/instruction-selector-ppc.cc b/src/compiler/backend/ppc/instruction-selector-ppc.cc index d5b93e86d0..67111f83a5 100644 --- a/src/compiler/backend/ppc/instruction-selector-ppc.cc +++ b/src/compiler/backend/ppc/instruction-selector-ppc.cc @@ -935,8 +935,6 @@ void InstructionSelector::VisitWord32ReverseBytes(Node* node) { g.UseRegister(node->InputAt(0))); } -void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); } - void InstructionSelector::VisitInt32Add(Node* node) { VisitBinop(this, node, kPPC_Add32, kInt16Imm); } diff --git a/src/compiler/backend/s390/instruction-selector-s390.cc b/src/compiler/backend/s390/instruction-selector-s390.cc index 7b121e0c58..feabc1a88f 100644 --- a/src/compiler/backend/s390/instruction-selector-s390.cc +++ b/src/compiler/backend/s390/instruction-selector-s390.cc @@ -1143,8 +1143,6 @@ void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); } void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); } #endif -void InstructionSelector::VisitSpeculationFence(Node* node) { UNREACHABLE(); } - void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) { VisitWord32UnaryOp(this, node, kS390_Abs32, OperandMode::kNone); } diff --git a/src/compiler/backend/x64/instruction-selector-x64.cc b/src/compiler/backend/x64/instruction-selector-x64.cc index 098b35f1b5..f5524ef662 100644 --- a/src/compiler/backend/x64/instruction-selector-x64.cc +++ b/src/compiler/backend/x64/instruction-selector-x64.cc @@ -317,11 +317,6 @@ void InstructionSelector::VisitDebugAbort(Node* node) { Emit(kArchDebugAbort, g.NoOutput(), g.UseFixed(node->InputAt(0), rdx)); } -void InstructionSelector::VisitSpeculationFence(Node* node) { - X64OperandGenerator g(this); - Emit(kLFence, g.NoOutput()); -} - void InstructionSelector::VisitLoad(Node* node) { LoadRepresentation load_rep = LoadRepresentationOf(node->op()); X64OperandGenerator g(this); @@ -3066,8 +3061,7 @@ MachineOperatorBuilder::Flags InstructionSelector::SupportedMachineOperatorFlags() { MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kWord32ShiftIsSafe | - MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz | - MachineOperatorBuilder::kSpeculationFence; + MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz; if (CpuFeatures::IsSupported(POPCNT)) { flags |= MachineOperatorBuilder::kWord32Popcnt | MachineOperatorBuilder::kWord64Popcnt; diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc index e16f2588d5..c539efcc04 100644 --- a/src/compiler/machine-operator.cc +++ b/src/compiler/machine-operator.cc @@ -781,13 +781,6 @@ struct MachineOperatorGlobalCache { }; Word64PoisonOnSpeculation kWord64PoisonOnSpeculation; - struct SpeculationFenceOperator : public Operator { - SpeculationFenceOperator() - : Operator(IrOpcode::kSpeculationFence, Operator::kNoThrow, - "SpeculationFence", 0, 1, 1, 0, 1, 0) {} - }; - SpeculationFenceOperator kSpeculationFence; - struct DebugAbortOperator : public Operator { DebugAbortOperator() : Operator(IrOpcode::kDebugAbort, Operator::kNoThrow, "DebugAbort", 1, @@ -1228,11 +1221,6 @@ const Operator* MachineOperatorBuilder::Word64PoisonOnSpeculation() { return &cache_.kWord64PoisonOnSpeculation; } -const OptionalOperator MachineOperatorBuilder::SpeculationFence() { - return OptionalOperator(flags_ & kSpeculationFence, - &cache_.kSpeculationFence); -} - #define SIMD_LANE_OPS(Type, lane_count) \ const Operator* MachineOperatorBuilder::Type##ExtractLane( \ int32_t lane_index) { \ diff --git a/src/compiler/machine-operator.h b/src/compiler/machine-operator.h index 25b053ea66..1eb3e219eb 100644 --- a/src/compiler/machine-operator.h +++ b/src/compiler/machine-operator.h @@ -142,14 +142,13 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final kWord64ReverseBits = 1u << 17, kInt32AbsWithOverflow = 1u << 20, kInt64AbsWithOverflow = 1u << 21, - kSpeculationFence = 1u << 22, - kAllOptionalOps = - kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | - kFloat64RoundUp | kFloat32RoundTruncate | kFloat64RoundTruncate | - kFloat64RoundTiesAway | kFloat32RoundTiesEven | kFloat64RoundTiesEven | - kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | - kWord32ReverseBits | kWord64ReverseBits | kInt32AbsWithOverflow | - kInt64AbsWithOverflow | kSpeculationFence + kAllOptionalOps = kFloat32RoundDown | kFloat64RoundDown | kFloat32RoundUp | + kFloat64RoundUp | kFloat32RoundTruncate | + kFloat64RoundTruncate | kFloat64RoundTiesAway | + kFloat32RoundTiesEven | kFloat64RoundTiesEven | + kWord32Ctz | kWord64Ctz | kWord32Popcnt | kWord64Popcnt | + kWord32ReverseBits | kWord64ReverseBits | + kInt32AbsWithOverflow | kInt64AbsWithOverflow }; typedef base::Flags Flags; @@ -671,8 +670,6 @@ class V8_EXPORT_PRIVATE MachineOperatorBuilder final // new_value_high, new_value_low const Operator* Word32AtomicPairCompareExchange(); - const OptionalOperator SpeculationFence(); - // Target machine word-size assumed by this builder. bool Is32() const { return word() == MachineRepresentation::kWord32; } bool Is64() const { return word() == MachineRepresentation::kWord64; } diff --git a/src/compiler/opcodes.h b/src/compiler/opcodes.h index ee2773fdc8..7728220dee 100644 --- a/src/compiler/opcodes.h +++ b/src/compiler/opcodes.h @@ -696,7 +696,6 @@ V(Word32AtomicPairXor) \ V(Word32AtomicPairExchange) \ V(Word32AtomicPairCompareExchange) \ - V(SpeculationFence) \ V(SignExtendWord8ToInt32) \ V(SignExtendWord16ToInt32) \ V(SignExtendWord8ToInt64) \ diff --git a/src/compiler/raw-machine-assembler.h b/src/compiler/raw-machine-assembler.h index 1c7ba465ee..a8da8cd954 100644 --- a/src/compiler/raw-machine-assembler.h +++ b/src/compiler/raw-machine-assembler.h @@ -266,10 +266,6 @@ class V8_EXPORT_PRIVATE RawMachineAssembler { old_value, new_value); } - Node* SpeculationFence() { - return AddNode(machine()->SpeculationFence().op()); - } - // Arithmetic Operations. Node* WordAnd(Node* a, Node* b) { return AddNode(machine()->WordAnd(), a, b); diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc index 75ca566330..5dc4720d0f 100644 --- a/src/compiler/verifier.cc +++ b/src/compiler/verifier.cc @@ -1807,7 +1807,6 @@ void Verifier::Visitor::Check(Node* node, const AllNodes& all) { case IrOpcode::kWord32AtomicPairXor: case IrOpcode::kWord32AtomicPairExchange: case IrOpcode::kWord32AtomicPairCompareExchange: - case IrOpcode::kSpeculationFence: case IrOpcode::kSignExtendWord8ToInt32: case IrOpcode::kSignExtendWord16ToInt32: case IrOpcode::kSignExtendWord8ToInt64: diff --git a/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc index 95be442f0e..af2e6c68ca 100644 --- a/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc +++ b/test/unittests/compiler/arm/instruction-selector-arm-unittest.cc @@ -3240,15 +3240,6 @@ TEST_F(InstructionSelectorTest, Float64Neg) { EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); } -TEST_F(InstructionSelectorTest, SpeculationFence) { - StreamBuilder m(this, MachineType::Int32()); - m.SpeculationFence(); - m.Return(m.Int32Constant(0)); - Stream s = m.Build(); - ASSERT_EQ(1U, s.size()); - EXPECT_EQ(kArmDsbIsb, s[0]->arch_opcode()); -} - TEST_F(InstructionSelectorTest, StackCheck0) { StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer()); Node* const sp = m.LoadStackPointer(); diff --git a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc index c5f9645766..aa14a81d7b 100644 --- a/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc +++ b/test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc @@ -4461,15 +4461,6 @@ TEST_F(InstructionSelectorTest, CompareFloat64HighGreaterThanOrEqualZero64) { EXPECT_EQ(63, s.ToInt32(s[1]->InputAt(1))); } -TEST_F(InstructionSelectorTest, SpeculationFence) { - StreamBuilder m(this, MachineType::Int32()); - m.SpeculationFence(); - m.Return(m.Int32Constant(0)); - Stream s = m.Build(); - ASSERT_EQ(1U, s.size()); - EXPECT_EQ(kArm64DsbIsb, s[0]->arch_opcode()); -} - TEST_F(InstructionSelectorTest, StackCheck0) { StreamBuilder m(this, MachineType::Int32(), MachineType::Pointer()); Node* const sp = m.LoadStackPointer(); diff --git a/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc b/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc index 72c82da09e..7b2c2c27f0 100644 --- a/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc +++ b/test/unittests/compiler/ia32/instruction-selector-ia32-unittest.cc @@ -840,15 +840,6 @@ TEST_F(InstructionSelectorTest, Word32Clz) { EXPECT_EQ(s.ToVreg(n), s.ToVreg(s[0]->Output())); } -TEST_F(InstructionSelectorTest, SpeculationFence) { - StreamBuilder m(this, MachineType::Int32()); - m.SpeculationFence(); - m.Return(m.Int32Constant(0)); - Stream s = m.Build(); - ASSERT_EQ(1U, s.size()); - EXPECT_EQ(kLFence, s[0]->arch_opcode()); -} - TEST_F(InstructionSelectorTest, StackCheck0) { ExternalReference js_stack_limit = ExternalReference::Create(isolate()->stack_guard()->address_of_jslimit()); diff --git a/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc b/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc index 7ba4c5ae4b..0aa5c389bf 100644 --- a/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc +++ b/test/unittests/compiler/x64/instruction-selector-x64-unittest.cc @@ -1723,15 +1723,6 @@ TEST_F(InstructionSelectorTest, LoadAndWord64ShiftRight32) { } } -TEST_F(InstructionSelectorTest, SpeculationFence) { - StreamBuilder m(this, MachineType::Int32()); - m.SpeculationFence(); - m.Return(m.Int32Constant(0)); - Stream s = m.Build(); - ASSERT_EQ(1U, s.size()); - EXPECT_EQ(kLFence, s[0]->arch_opcode()); -} - TEST_F(InstructionSelectorTest, StackCheck0) { ExternalReference js_stack_limit = ExternalReference::Create(isolate()->stack_guard()->address_of_jslimit());