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

Unified Diff: src/runtime/runtime-strings.cc

Issue 2539093002: [runtime] Port simple String.prototype.indexOf cases to TF Builtin (Closed)
Patch Set: call runtime for large strings Created 4 years 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
Index: src/runtime/runtime-strings.cc
diff --git a/src/runtime/runtime-strings.cc b/src/runtime/runtime-strings.cc
index 328bdceb376c469e90c103c9464732415ba527e4..e6f21e1341af450a2f140332173698185341d05e 100644
--- a/src/runtime/runtime-strings.cc
+++ b/src/runtime/runtime-strings.cc
@@ -90,13 +90,12 @@ RUNTIME_FUNCTION(Runtime_StringReplaceOneCharWithString) {
RUNTIME_FUNCTION(Runtime_StringIndexOf) {
HandleScope scope(isolate);
DCHECK(args.length() == 3);
- return String::IndexOf(isolate, args.at<Object>(0), args.at<Object>(1),
- args.at<Object>(2));
+ return String::IndexOf(isolate, args.at(0), args.at(1), args.at(2));
}
RUNTIME_FUNCTION(Runtime_StringLastIndexOf) {
HandleScope handle_scope(isolate);
- return String::LastIndexOf(isolate, args.at<Object>(0), args.at<Object>(1),
+ return String::LastIndexOf(isolate, args.at(0), args.at(1),
isolate->factory()->undefined_value());
}
@@ -989,5 +988,13 @@ RUNTIME_FUNCTION(Runtime_StringCharCodeAt) {
return __RT_impl_Runtime_StringCharCodeAtRT(args, isolate);
}
+// ES6 #sec-string.prototype.indexof
+// String.prototype.indexOf(searchString [, position])
+RUNTIME_FUNCTION(Runtime_StringPrototypeIndexOf) {
+ HandleScope handle_scope(isolate);
+ DCHECK(args.length() == 3);
+ return String::IndexOf(isolate, args.at(0), args.at(1), args.at(2));
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698