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 2709773002: [builtins] (Re-)implement Array.prototype.every/some with the CSA (Closed)
Patch Set: Rebase 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') | 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 966f227457c7b6886080ecdf4a97f5eeff635310..fa679cd144cb9b90533ad6392905a2f19bf27c86 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3708,6 +3708,26 @@ void Genesis::InitializeGlobal_enable_fast_array_builtins() {
Handle<JSFunction>::cast(for_each_function)
->shared()
->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach));
+
+ LookupIterator it4(array_prototype,
+ factory->NewStringFromAsciiChecked("every"),
+ LookupIterator::OWN_SKIP_INTERCEPTOR);
+ Handle<Object> every_function = Object::GetProperty(&it4).ToHandleChecked();
+ Handle<JSFunction>::cast(every_function)
+ ->set_code(isolate->builtins()->builtin(Builtins::kArrayEvery));
+ Handle<JSFunction>::cast(every_function)
+ ->shared()
+ ->set_code(isolate->builtins()->builtin(Builtins::kArrayEvery));
+
+ LookupIterator it5(array_prototype,
+ factory->NewStringFromAsciiChecked("some"),
+ LookupIterator::OWN_SKIP_INTERCEPTOR);
+ Handle<Object> some_function = Object::GetProperty(&it5).ToHandleChecked();
+ Handle<JSFunction>::cast(some_function)
+ ->set_code(isolate->builtins()->builtin(Builtins::kArraySome));
+ Handle<JSFunction>::cast(some_function)
+ ->shared()
+ ->set_code(isolate->builtins()->builtin(Builtins::kArraySome));
}
void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698