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

Unified Diff: src/bootstrapper.cc

Issue 2775503006: [builtins] Improve performance of array.prototype.filter and map (Closed)
Patch Set: Code comments Created 3 years, 8 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-array-gen.cc » ('j') | no next file with comments »
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 8653ce9b97997701d9dc959339d74018bebd2bc2..97da2d1df5ae35ee0d51d59ab04733891ef891c8 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3860,14 +3860,6 @@ void Genesis::InstallOneBuiltinFunction(Handle<Object> prototype,
void Genesis::InitializeGlobal_experimental_fast_array_builtins() {
if (!FLAG_experimental_fast_array_builtins) return;
{
- Handle<JSFunction> array_constructor(native_context()->array_function());
- Handle<Object> array_prototype(array_constructor->prototype(), isolate());
- // Insert experimental fast Array builtins here.
- InstallOneBuiltinFunction(array_prototype, "filter",
- Builtins::kArrayFilter);
- InstallOneBuiltinFunction(array_prototype, "map", Builtins::kArrayMap);
- }
- {
Handle<Object> typed_array_prototype(
native_context()->typed_array_prototype(), isolate());
// Insert experimental fast TypedArray builtins here.
@@ -4355,6 +4347,12 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
// Add forEach to the context.
native_context()->set_array_for_each_iterator(*forEach);
+ // Install Array.prototype.filter
+ InstallArrayBuiltinFunction(proto, "filter", Builtins::kArrayFilter, 2);
+
+ // Install Array.prototype.map
+ InstallArrayBuiltinFunction(proto, "map", Builtins::kArrayMap, 2);
+
// Install Array.prototype.every
InstallArrayBuiltinFunction(proto, "every", Builtins::kArrayEvery, 2);
« no previous file with comments | « no previous file | src/builtins/builtins-array-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698