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

Unified Diff: src/bootstrapper.cc

Issue 2358263002: [builtins] migrate C++ String Iterator builtins to baseline TurboFan (Closed)
Patch Set: add "break;" statement to switch case Created 4 years, 3 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 | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-string.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 9d67e627e5e69f151dea840e172d4179dab79cef..991af0954799c3151021042c41f3d870711910fe 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1440,9 +1440,17 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
factory->NewStringFromAsciiChecked("String Iterator"),
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
- InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE,
- JSObject::kHeaderSize, MaybeHandle<JSObject>(),
- Builtins::kStringIteratorPrototypeNext);
+ Handle<JSFunction> next =
+ InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE,
+ JSObject::kHeaderSize, MaybeHandle<JSObject>(),
+ Builtins::kStringIteratorPrototypeNext);
+
+ // Set the expected parameters for %StringIteratorPrototype%.next to 0 (not
+ // including the receiver), as required by the builtin.
+ next->shared()->set_internal_formal_parameter_count(0);
+
+ // Set the length for the function to satisfy ECMA-262.
+ next->shared()->set_length(0);
Handle<JSFunction> string_iterator_function = CreateFunction(
isolate, factory->NewStringFromAsciiChecked("StringIterator"),
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-string.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698