Index: src/compiler/simplified-operator.cc |
diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc |
index b7b230fc7b25ce02595684639a0bae1fc08aea49..a7bbae3493ce70fc555291f8a4c8f7a3e0f11282 100644 |
--- a/src/compiler/simplified-operator.cc |
+++ b/src/compiler/simplified-operator.cc |
@@ -336,6 +336,11 @@ PretenureFlag PretenureFlagOf(const Operator* op) { |
return OpParameter<PretenureFlag>(op); |
} |
+UnicodeEncoding UnicodeEncodingOf(const Operator* op) { |
+ DCHECK(op->opcode() == IrOpcode::kStringFromCodePoint); |
+ return OpParameter<UnicodeEncoding>(op); |
+} |
+ |
#define PURE_OP_LIST(V) \ |
V(BooleanNot, Operator::kNoProperties, 1, 0) \ |
V(NumberEqual, Operator::kCommutative, 2, 0) \ |
@@ -468,6 +473,17 @@ struct SimplifiedOperatorGlobalCache final { |
CHECKED_OP_LIST(CHECKED) |
#undef CHECKED |
+ template <UnicodeEncoding kEncoding> |
+ struct StringFromCodePointOperator final : public Operator { |
+ StringFromCodePointOperator() |
+ : Operator(IrOpcode::kStringFromCodePoint, Operator::kPure, |
+ "StringFromCodePoint", 1, 0, 0, 1, 0, 0) {} |
+ }; |
+ StringFromCodePointOperator<UnicodeEncoding::UTF16> |
+ kStringFromCodePointOperatorUTF16; |
+ StringFromCodePointOperator<UnicodeEncoding::UTF32> |
+ kStringFromCodePointOperatorUTF32; |
+ |
struct ArrayBufferWasNeuteredOperator final : public Operator { |
ArrayBufferWasNeuteredOperator() |
: Operator(IrOpcode::kArrayBufferWasNeutered, Operator::kEliminatable, |
@@ -754,6 +770,18 @@ const Operator* SimplifiedOperatorBuilder::StoreBuffer(BufferAccess access) { |
return nullptr; |
} |
+const Operator* SimplifiedOperatorBuilder::StringFromCodePoint( |
+ UnicodeEncoding encoding) { |
+ switch (encoding) { |
+ case UnicodeEncoding::UTF16: |
+ return &cache_.kStringFromCodePointOperatorUTF16; |
+ case UnicodeEncoding::UTF32: |
+ return &cache_.kStringFromCodePointOperatorUTF32; |
+ } |
+ UNREACHABLE(); |
+ return nullptr; |
+} |
+ |
#define SPECULATIVE_NUMBER_BINOP(Name) \ |
const Operator* SimplifiedOperatorBuilder::Name(NumberOperationHint hint) { \ |
switch (hint) { \ |