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

Unified Diff: src/compiler/effect-control-linearizer.cc

Issue 2657243002: [turbofan] Introduce dedicated StringIndexOf operator. (Closed)
Patch Set: Created 3 years, 11 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/effect-control-linearizer.h ('k') | src/compiler/escape-analysis.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/effect-control-linearizer.cc
diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc
index 1c882517970b89d03d8bf4a4e2fd978b2dc8705b..bc24a30968f5671c31d38fb928a128e77153c93d 100644
--- a/src/compiler/effect-control-linearizer.cc
+++ b/src/compiler/effect-control-linearizer.cc
@@ -750,6 +750,9 @@ bool EffectControlLinearizer::TryWireInStateEffect(Node* node,
case IrOpcode::kStringFromCodePoint:
result = LowerStringFromCodePoint(node);
break;
+ case IrOpcode::kStringIndexOf:
+ result = LowerStringIndexOf(node);
+ break;
case IrOpcode::kStringCharAt:
result = LowerStringCharAt(node);
break;
@@ -2056,6 +2059,20 @@ Node* EffectControlLinearizer::LowerStringFromCodePoint(Node* node) {
return done.PhiAt(0);
}
+Node* EffectControlLinearizer::LowerStringIndexOf(Node* node) {
+ Node* subject = node->InputAt(0);
+ Node* search_string = node->InputAt(1);
+ Node* position = node->InputAt(2);
+
+ Callable callable = CodeFactory::StringIndexOf(isolate());
+ Operator::Properties properties = Operator::kEliminatable;
+ CallDescriptor::Flags flags = CallDescriptor::kNoFlags;
+ CallDescriptor* desc = Linkage::GetStubCallDescriptor(
+ isolate(), graph()->zone(), callable.descriptor(), 0, flags, properties);
+ return __ Call(desc, __ HeapConstant(callable.code()), subject, search_string,
+ position, __ NoContextConstant());
+}
+
Node* EffectControlLinearizer::LowerStringComparison(Callable const& callable,
Node* node) {
Node* lhs = node->InputAt(0);
« no previous file with comments | « src/compiler/effect-control-linearizer.h ('k') | src/compiler/escape-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698