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

Unified Diff: src/bootstrapper.cc

Issue 2775503006: [builtins] Improve performance of array.prototype.filter and map (Closed)
Patch Set: Remove old impl. Created 3 years, 9 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') | src/builtins/builtins-array-gen.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 a1ffe77db635a8364deb7f1f96754eeba4348d5e..88491c9ac62827d4a768f34bb7999218e4e88c91 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3848,14 +3848,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.
@@ -4354,6 +4346,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') | src/builtins/builtins-array-gen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698