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

Unified Diff: src/bootstrapper.cc

Issue 2775503006: [builtins] Improve performance of array.prototype.filter and map (Closed)
Patch Set: fixes 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') | src/code-stub-assembler.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 eb06ff17a3e38b139019522152360d478422e55d..e8a82c5650929be0d340f06739308b51fe8c60c7 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3864,14 +3864,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.
@@ -4370,6 +4362,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/code-stub-assembler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698