summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/machine-operator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/machine-operator.cc')
-rw-r--r--deps/v8/src/compiler/machine-operator.cc109
1 files changed, 105 insertions, 4 deletions
diff --git a/deps/v8/src/compiler/machine-operator.cc b/deps/v8/src/compiler/machine-operator.cc
index 5a7ccfe3dc..a5a27418f8 100644
--- a/deps/v8/src/compiler/machine-operator.cc
+++ b/deps/v8/src/compiler/machine-operator.cc
@@ -126,6 +126,11 @@ std::ostream& operator<<(std::ostream& os, LoadTransformation rep) {
return os << "kS128Load32Zero";
case LoadTransformation::kS128Load64Zero:
return os << "kS128Load64Zero";
+ // Simd256
+ case LoadTransformation::kS256Load32Splat:
+ return os << "kS256Load32Splat";
+ case LoadTransformation::kS256Load64Splat:
+ return os << "kS256Load64Splat";
}
UNREACHABLE();
}
@@ -173,6 +178,7 @@ bool operator==(LoadLaneParameters lhs, LoadLaneParameters rhs) {
LoadRepresentation LoadRepresentationOf(Operator const* op) {
DCHECK(IrOpcode::kLoad == op->opcode() ||
IrOpcode::kProtectedLoad == op->opcode() ||
+ IrOpcode::kLoadTrapOnNull == op->opcode() ||
IrOpcode::kUnalignedLoad == op->opcode() ||
IrOpcode::kLoadImmutable == op->opcode());
return OpParameter<LoadRepresentation>(op);
@@ -191,7 +197,8 @@ AtomicOpParameters AtomicOpParametersOf(Operator const* op) {
StoreRepresentation const& StoreRepresentationOf(Operator const* op) {
DCHECK(IrOpcode::kStore == op->opcode() ||
- IrOpcode::kProtectedStore == op->opcode());
+ IrOpcode::kProtectedStore == op->opcode() ||
+ IrOpcode::kStoreTrapOnNull == op->opcode());
return OpParameter<StoreRepresentation>(op);
}
@@ -431,6 +438,7 @@ std::ostream& operator<<(std::ostream& os, TruncateKind kind) {
V(Float64InsertHighWord32, Operator::kNoProperties, 2, 0, 1) \
V(LoadStackCheckOffset, Operator::kNoProperties, 0, 0, 1) \
V(LoadFramePointer, Operator::kNoProperties, 0, 0, 1) \
+ V(LoadRootRegister, Operator::kNoProperties, 0, 0, 1) \
V(LoadParentFramePointer, Operator::kNoProperties, 0, 0, 1) \
V(Int32PairAdd, Operator::kNoProperties, 4, 0, 2) \
V(Int32PairSub, Operator::kNoProperties, 4, 0, 2) \
@@ -637,7 +645,18 @@ std::ostream& operator<<(std::ostream& os, TruncateKind kind) {
V(I32x4RelaxedTruncF64x2UZero, Operator::kNoProperties, 1, 0, 1) \
V(I16x8RelaxedQ15MulRS, Operator::kCommutative, 2, 0, 1) \
V(I16x8DotI8x16I7x16S, Operator::kCommutative, 2, 0, 1) \
- V(I32x4DotI8x16I7x16AddS, Operator::kNoProperties, 3, 0, 1)
+ V(I32x4DotI8x16I7x16AddS, Operator::kNoProperties, 3, 0, 1) \
+ V(F32x8Add, Operator::kCommutative, 2, 0, 1) \
+ V(F32x8Sub, Operator::kNoProperties, 2, 0, 1) \
+ V(F32x8Mul, Operator::kCommutative, 2, 0, 1) \
+ V(F32x8Div, Operator::kNoProperties, 2, 0, 1) \
+ V(F32x8Pmin, Operator::kNoProperties, 2, 0, 1) \
+ V(F32x8Pmax, Operator::kNoProperties, 2, 0, 1) \
+ V(F32x8Eq, Operator::kCommutative, 2, 0, 1) \
+ V(F32x8Ne, Operator::kCommutative, 2, 0, 1) \
+ V(F32x8Lt, Operator::kNoProperties, 2, 0, 1) \
+ V(F32x8Le, Operator::kNoProperties, 2, 0, 1) \
+ V(S256Select, Operator::kNoProperties, 3, 0, 1)
// The format is:
// V(Name, properties, value_input_count, control_input_count, output_count)
@@ -729,7 +748,9 @@ std::ostream& operator<<(std::ostream& os, TruncateKind kind) {
V(S128Load32x2S) \
V(S128Load32x2U) \
V(S128Load32Zero) \
- V(S128Load64Zero)
+ V(S128Load64Zero) \
+ V(S256Load32Splat) \
+ V(S256Load64Splat)
#if TAGGED_SIZE_8_BYTES
@@ -951,6 +972,8 @@ struct MachineOperatorGlobalCache {
OVERFLOW_OP_LIST(OVERFLOW_OP)
#undef OVERFLOW_OP
+// ProtectedLoad and LoadTrapOnNull are not marked kNoWrite, so potentially
+// trapping loads are not eliminated if their result is unused.
#define LOAD(Type) \
struct Load##Type##Operator final : public Operator1<LoadRepresentation> { \
Load##Type##Operator() \
@@ -973,6 +996,14 @@ struct MachineOperatorGlobalCache {
Operator::kNoDeopt | Operator::kNoThrow, "ProtectedLoad", 2, 1, \
1, 1, 1, 0, MachineType::Type()) {} \
}; \
+ struct LoadTrapOnNull##Type##Operator final \
+ : public Operator1<LoadRepresentation> { \
+ LoadTrapOnNull##Type##Operator() \
+ : Operator1<LoadRepresentation>( \
+ IrOpcode::kLoadTrapOnNull, \
+ Operator::kNoDeopt | Operator::kNoThrow, "LoadTrapOnNull", 2, 1, \
+ 1, 1, 1, 0, MachineType::Type()) {} \
+ }; \
struct LoadImmutable##Type##Operator final \
: public Operator1<LoadRepresentation> { \
LoadImmutable##Type##Operator() \
@@ -983,6 +1014,7 @@ struct MachineOperatorGlobalCache {
Load##Type##Operator kLoad##Type; \
UnalignedLoad##Type##Operator kUnalignedLoad##Type; \
ProtectedLoad##Type##Operator kProtectedLoad##Type; \
+ LoadTrapOnNull##Type##Operator kLoadTrapOnNull##Type; \
LoadImmutable##Type##Operator kLoadImmutable##Type;
MACHINE_TYPE_LIST(LOAD)
#undef LOAD
@@ -1081,6 +1113,26 @@ struct MachineOperatorGlobalCache {
StoreRepresentation(MachineRepresentation::Type, \
kNoWriteBarrier)) {} \
}; \
+ struct StoreTrapOnNull##Type##FullWriteBarrier##Operator \
+ : public Operator1<StoreRepresentation> { \
+ explicit StoreTrapOnNull##Type##FullWriteBarrier##Operator() \
+ : Operator1<StoreRepresentation>( \
+ IrOpcode::kStoreTrapOnNull, \
+ Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow, \
+ "StoreTrapOnNull", 3, 1, 1, 0, 1, 0, \
+ StoreRepresentation(MachineRepresentation::Type, \
+ kFullWriteBarrier)) {} \
+ }; \
+ struct StoreTrapOnNull##Type##NoWriteBarrier##Operator \
+ : public Operator1<StoreRepresentation> { \
+ explicit StoreTrapOnNull##Type##NoWriteBarrier##Operator() \
+ : Operator1<StoreRepresentation>( \
+ IrOpcode::kStoreTrapOnNull, \
+ Operator::kNoDeopt | Operator::kNoRead | Operator::kNoThrow, \
+ "StoreTrapOnNull", 3, 1, 1, 0, 1, 0, \
+ StoreRepresentation(MachineRepresentation::Type, \
+ kNoWriteBarrier)) {} \
+ }; \
Store##Type##NoWriteBarrier##Operator kStore##Type##NoWriteBarrier; \
Store##Type##AssertNoWriteBarrier##Operator \
kStore##Type##AssertNoWriteBarrier; \
@@ -1091,7 +1143,11 @@ struct MachineOperatorGlobalCache {
kStore##Type##EphemeronKeyWriteBarrier; \
Store##Type##FullWriteBarrier##Operator kStore##Type##FullWriteBarrier; \
UnalignedStore##Type##Operator kUnalignedStore##Type; \
- ProtectedStore##Type##Operator kProtectedStore##Type;
+ ProtectedStore##Type##Operator kProtectedStore##Type; \
+ StoreTrapOnNull##Type##FullWriteBarrier##Operator \
+ kStoreTrapOnNull##Type##FullWriteBarrier; \
+ StoreTrapOnNull##Type##NoWriteBarrier##Operator \
+ kStoreTrapOnNull##Type##NoWriteBarrier;
MACHINE_REPRESENTATION_LIST(STORE)
#undef STORE
@@ -1542,6 +1598,16 @@ const Operator* MachineOperatorBuilder::ProtectedLoad(LoadRepresentation rep) {
UNREACHABLE();
}
+const Operator* MachineOperatorBuilder::LoadTrapOnNull(LoadRepresentation rep) {
+#define LOAD(Type) \
+ if (rep == MachineType::Type()) { \
+ return &cache_.kLoadTrapOnNull##Type; \
+ }
+ MACHINE_TYPE_LIST(LOAD)
+#undef LOAD
+ UNREACHABLE();
+}
+
const Operator* MachineOperatorBuilder::LoadTransform(
MemoryAccessKind kind, LoadTransformation transform) {
#define LOAD_TRANSFORM_KIND(TYPE, KIND) \
@@ -1700,6 +1766,26 @@ const Operator* MachineOperatorBuilder::ProtectedStore(
UNREACHABLE();
}
+const Operator* MachineOperatorBuilder::StoreTrapOnNull(
+ StoreRepresentation rep) {
+ switch (rep.representation()) {
+#define STORE(kRep) \
+ case MachineRepresentation::kRep: \
+ if (rep.write_barrier_kind() == kNoWriteBarrier) { \
+ return &cache_.kStoreTrapOnNull##kRep##NoWriteBarrier; \
+ } else if (rep.write_barrier_kind() == kFullWriteBarrier) { \
+ return &cache_.kStoreTrapOnNull##kRep##FullWriteBarrier; \
+ } \
+ break;
+ MACHINE_REPRESENTATION_LIST(STORE)
+#undef STORE
+ case MachineRepresentation::kBit:
+ case MachineRepresentation::kNone:
+ break;
+ }
+ UNREACHABLE();
+}
+
const Operator* MachineOperatorBuilder::StackPointerGreaterThan(
StackCheckKind kind) {
switch (kind) {
@@ -2226,6 +2312,21 @@ StackCheckKind StackCheckKindOf(Operator const* op) {
return OpParameter<StackCheckKind>(op);
}
+const Operator* MachineOperatorBuilder::ExtractF128(int32_t lane_index) {
+ DCHECK(0 <= lane_index && lane_index < 2);
+ class ExtractF128Operator final : public Operator1<int32_t> {
+ public:
+ explicit ExtractF128Operator(int32_t lane_index)
+ : Operator1<int32_t>(IrOpcode::kExtractF128, Operator::kPure,
+ "ExtractF128", 1, 0, 0, 1, 0, 0, lane_index) {
+ lane_index_ = lane_index;
+ }
+
+ int32_t lane_index_;
+ };
+ return zone_->New<ExtractF128Operator>(lane_index);
+}
+
#undef PURE_BINARY_OP_LIST_32
#undef PURE_BINARY_OP_LIST_64
#undef MACHINE_PURE_OP_LIST