Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: src/compiler/simplified-operator.cc

Issue 2373983004: [turbofan] inline %StringIteratorPrototype%.next in JSBuiltinReducer. (Closed)
Patch Set: Reland "[turbofan] inline %StringIteratorPrototype%.next in JSBuiltinReducer" Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-operator.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) { \
« no previous file with comments | « src/compiler/simplified-operator.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698