Index: src/compiler/common-operator.cc |
diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc |
index e57160a3f8553411ee0722e1c9a7e3b6255de15a..8ed4bae950b46da040773044055b79ba84dae162 100644 |
--- a/src/compiler/common-operator.cc |
+++ b/src/compiler/common-operator.cc |
@@ -210,6 +210,31 @@ std::ostream& operator<<(std::ostream& os, |
return os; |
} |
+int OsrValueIndexOf(Operator const* op) { |
+ DCHECK_EQ(IrOpcode::kOsrValue, op->opcode()); |
+ return OpParameter<int>(op); |
+} |
+ |
+size_t hash_value(OsrGuardType type) { return static_cast<size_t>(type); } |
+ |
+std::ostream& operator<<(std::ostream& os, OsrGuardType type) { |
+ switch (type) { |
+ case OsrGuardType::kUninitialized: |
+ return os << "Uninitialized"; |
+ case OsrGuardType::kSignedSmall: |
+ return os << "SignedSmall"; |
+ case OsrGuardType::kAny: |
+ return os << "Any"; |
+ } |
+ UNREACHABLE(); |
+ return os; |
+} |
+ |
+OsrGuardType OsrGuardTypeOf(Operator const* op) { |
+ DCHECK_EQ(IrOpcode::kOsrGuard, op->opcode()); |
+ return OpParameter<OsrGuardType>(op); |
+} |
+ |
#define CACHED_OP_LIST(V) \ |
V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \ |
V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ |
@@ -780,7 +805,6 @@ const Operator* CommonOperatorBuilder::Parameter(int index, |
ParameterInfo(index, debug_name)); // parameter info |
} |
- |
const Operator* CommonOperatorBuilder::OsrValue(int index) { |
return new (zone()) Operator1<int>( // -- |
IrOpcode::kOsrValue, Operator::kNoProperties, // opcode |
@@ -789,6 +813,13 @@ const Operator* CommonOperatorBuilder::OsrValue(int index) { |
index); // parameter |
} |
+const Operator* CommonOperatorBuilder::OsrGuard(OsrGuardType type) { |
+ return new (zone()) Operator1<OsrGuardType>( // -- |
+ IrOpcode::kOsrGuard, Operator::kNoThrow, // opcode |
+ "OsrGuard", // name |
+ 1, 1, 1, 1, 1, 0, // counts |
+ type); // parameter |
+} |
const Operator* CommonOperatorBuilder::Int32Constant(int32_t value) { |
return new (zone()) Operator1<int32_t>( // -- |