summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/common-operator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/common-operator.cc')
-rw-r--r--deps/v8/src/compiler/common-operator.cc44
1 files changed, 37 insertions, 7 deletions
diff --git a/deps/v8/src/compiler/common-operator.cc b/deps/v8/src/compiler/common-operator.cc
index 36b1caffa6..7488e36305 100644
--- a/deps/v8/src/compiler/common-operator.cc
+++ b/deps/v8/src/compiler/common-operator.cc
@@ -391,6 +391,26 @@ ZoneVector<MachineType> const* MachineTypesOf(Operator const* op) {
return OpParameter<TypedObjectStateInfo>(op).machine_types();
}
+V8_EXPORT_PRIVATE bool operator==(IfValueParameters const& l,
+ IfValueParameters const& r) {
+ return l.value() == r.value() && r.comparison_order() == r.comparison_order();
+}
+
+size_t hash_value(IfValueParameters const& p) {
+ return base::hash_combine(p.value(), p.comparison_order());
+}
+
+V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out,
+ IfValueParameters const& p) {
+ out << p.value() << " (order " << p.comparison_order() << ")";
+ return out;
+}
+
+IfValueParameters const& IfValueParametersOf(const Operator* op) {
+ DCHECK(op->opcode() == IrOpcode::kIfValue);
+ return OpParameter<IfValueParameters>(op);
+}
+
#define COMMON_CACHED_OP_LIST(V) \
V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \
V(Unreachable, Operator::kFoldable, 0, 1, 1, 1, 1, 0) \
@@ -994,13 +1014,13 @@ const Operator* CommonOperatorBuilder::Switch(size_t control_output_count) {
1, 0, 1, 0, 0, control_output_count); // counts
}
-
-const Operator* CommonOperatorBuilder::IfValue(int32_t index) {
- return new (zone()) Operator1<int32_t>( // --
- IrOpcode::kIfValue, Operator::kKontrol, // opcode
- "IfValue", // name
- 0, 0, 1, 0, 0, 1, // counts
- index); // parameter
+const Operator* CommonOperatorBuilder::IfValue(int32_t index,
+ int32_t comparison_order) {
+ return new (zone()) Operator1<IfValueParameters>( // --
+ IrOpcode::kIfValue, Operator::kKontrol, // opcode
+ "IfValue", // name
+ 0, 0, 1, 0, 0, 1, // counts
+ IfValueParameters(index, comparison_order)); // parameter
}
@@ -1148,6 +1168,11 @@ const Operator* CommonOperatorBuilder::HeapConstant(
value); // parameter
}
+Handle<HeapObject> HeapConstantOf(const Operator* op) {
+ DCHECK_EQ(IrOpcode::kHeapConstant, op->opcode());
+ return OpParameter<Handle<HeapObject>>(op);
+}
+
const Operator* CommonOperatorBuilder::RelocatableInt32Constant(
int32_t value, RelocInfo::Mode rmode) {
return new (zone()) Operator1<RelocatablePtrConstantInfo>( // --
@@ -1486,6 +1511,11 @@ const Operator* CommonOperatorBuilder::DeadValue(MachineRepresentation rep) {
rep); // parameter
}
+const FrameStateInfo& FrameStateInfoOf(const Operator* op) {
+ DCHECK_EQ(IrOpcode::kFrameState, op->opcode());
+ return OpParameter<FrameStateInfo>(op);
+}
+
#undef COMMON_CACHED_OP_LIST
#undef CACHED_BRANCH_LIST
#undef CACHED_RETURN_LIST