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

Unified Diff: src/bootstrapper.cc

Issue 2680153005: [builtins] Array.prototype.filter implemented as a TurboFan code stub. (Closed)
Patch Set: Code comments. 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.h » ('j') | test/js-perf-test/JSTests.json » ('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 65208d7f3241b01d084c4f3ed6b8dc48c390da4c..aab6dd708d31b25f208d003a3d2906342ef6cbe4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3676,6 +3676,7 @@ void Genesis::InitializeGlobal_enable_fast_array_builtins() {
factory->NewStringFromAsciiChecked("prototype"),
LookupIterator::OWN_SKIP_INTERCEPTOR);
Handle<Object> array_prototype = Object::GetProperty(&it2).ToHandleChecked();
+
LookupIterator it3(array_prototype,
factory->NewStringFromAsciiChecked("forEach"),
LookupIterator::OWN_SKIP_INTERCEPTOR);
@@ -3706,6 +3707,19 @@ void Genesis::InitializeGlobal_enable_fast_array_builtins() {
Handle<JSFunction>::cast(some_function)
->shared()
->set_code(isolate->builtins()->builtin(Builtins::kArraySome));
+
+ if (FLAG_experimental_array_builtins) {
+ LookupIterator it6(array_prototype,
+ factory->NewStringFromAsciiChecked("filter"),
+ LookupIterator::OWN_SKIP_INTERCEPTOR);
+ Handle<Object> filter_function =
+ Object::GetProperty(&it6).ToHandleChecked();
+ Handle<JSFunction>::cast(filter_function)
+ ->set_code(isolate->builtins()->builtin(Builtins::kArrayFilter));
+ Handle<JSFunction>::cast(filter_function)
+ ->shared()
+ ->set_code(isolate->builtins()->builtin(Builtins::kArrayFilter));
+ }
}
void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | test/js-perf-test/JSTests.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698