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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | test/js-perf-test/JSTests.json » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/ieee754.h" 9 #include "src/base/ieee754.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3658 matching lines...) Expand 10 before | Expand all | Expand 10 after
3669 Isolate* isolate = global->GetIsolate(); 3669 Isolate* isolate = global->GetIsolate();
3670 Factory* factory = isolate->factory(); 3670 Factory* factory = isolate->factory();
3671 3671
3672 LookupIterator it1(global, factory->NewStringFromAsciiChecked("Array"), 3672 LookupIterator it1(global, factory->NewStringFromAsciiChecked("Array"),
3673 LookupIterator::OWN_SKIP_INTERCEPTOR); 3673 LookupIterator::OWN_SKIP_INTERCEPTOR);
3674 Handle<Object> array_object = Object::GetProperty(&it1).ToHandleChecked(); 3674 Handle<Object> array_object = Object::GetProperty(&it1).ToHandleChecked();
3675 LookupIterator it2(array_object, 3675 LookupIterator it2(array_object,
3676 factory->NewStringFromAsciiChecked("prototype"), 3676 factory->NewStringFromAsciiChecked("prototype"),
3677 LookupIterator::OWN_SKIP_INTERCEPTOR); 3677 LookupIterator::OWN_SKIP_INTERCEPTOR);
3678 Handle<Object> array_prototype = Object::GetProperty(&it2).ToHandleChecked(); 3678 Handle<Object> array_prototype = Object::GetProperty(&it2).ToHandleChecked();
3679
3679 LookupIterator it3(array_prototype, 3680 LookupIterator it3(array_prototype,
3680 factory->NewStringFromAsciiChecked("forEach"), 3681 factory->NewStringFromAsciiChecked("forEach"),
3681 LookupIterator::OWN_SKIP_INTERCEPTOR); 3682 LookupIterator::OWN_SKIP_INTERCEPTOR);
3682 Handle<Object> for_each_function = 3683 Handle<Object> for_each_function =
3683 Object::GetProperty(&it3).ToHandleChecked(); 3684 Object::GetProperty(&it3).ToHandleChecked();
3684 Handle<JSFunction>::cast(for_each_function) 3685 Handle<JSFunction>::cast(for_each_function)
3685 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach)); 3686 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach));
3686 Handle<JSFunction>::cast(for_each_function) 3687 Handle<JSFunction>::cast(for_each_function)
3687 ->shared() 3688 ->shared()
3688 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach)); 3689 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach));
(...skipping 10 matching lines...) Expand all
3699 3700
3700 LookupIterator it5(array_prototype, 3701 LookupIterator it5(array_prototype,
3701 factory->NewStringFromAsciiChecked("some"), 3702 factory->NewStringFromAsciiChecked("some"),
3702 LookupIterator::OWN_SKIP_INTERCEPTOR); 3703 LookupIterator::OWN_SKIP_INTERCEPTOR);
3703 Handle<Object> some_function = Object::GetProperty(&it5).ToHandleChecked(); 3704 Handle<Object> some_function = Object::GetProperty(&it5).ToHandleChecked();
3704 Handle<JSFunction>::cast(some_function) 3705 Handle<JSFunction>::cast(some_function)
3705 ->set_code(isolate->builtins()->builtin(Builtins::kArraySome)); 3706 ->set_code(isolate->builtins()->builtin(Builtins::kArraySome));
3706 Handle<JSFunction>::cast(some_function) 3707 Handle<JSFunction>::cast(some_function)
3707 ->shared() 3708 ->shared()
3708 ->set_code(isolate->builtins()->builtin(Builtins::kArraySome)); 3709 ->set_code(isolate->builtins()->builtin(Builtins::kArraySome));
3710
3711 if (FLAG_experimental_array_builtins) {
3712 LookupIterator it6(array_prototype,
3713 factory->NewStringFromAsciiChecked("filter"),
3714 LookupIterator::OWN_SKIP_INTERCEPTOR);
3715 Handle<Object> filter_function =
3716 Object::GetProperty(&it6).ToHandleChecked();
3717 Handle<JSFunction>::cast(filter_function)
3718 ->set_code(isolate->builtins()->builtin(Builtins::kArrayFilter));
3719 Handle<JSFunction>::cast(filter_function)
3720 ->shared()
3721 ->set_code(isolate->builtins()->builtin(Builtins::kArrayFilter));
3722 }
3709 } 3723 }
3710 3724
3711 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { 3725 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
3712 if (!FLAG_harmony_sharedarraybuffer) return; 3726 if (!FLAG_harmony_sharedarraybuffer) return;
3713 3727
3714 Handle<JSGlobalObject> global(native_context()->global_object()); 3728 Handle<JSGlobalObject> global(native_context()->global_object());
3715 Isolate* isolate = global->GetIsolate(); 3729 Isolate* isolate = global->GetIsolate();
3716 Factory* factory = isolate->factory(); 3730 Factory* factory = isolate->factory();
3717 3731
3718 Handle<JSFunction> shared_array_buffer_fun = 3732 Handle<JSFunction> shared_array_buffer_fun =
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
5063 } 5077 }
5064 5078
5065 5079
5066 // Called when the top-level V8 mutex is destroyed. 5080 // Called when the top-level V8 mutex is destroyed.
5067 void Bootstrapper::FreeThreadResources() { 5081 void Bootstrapper::FreeThreadResources() {
5068 DCHECK(!IsActive()); 5082 DCHECK(!IsActive());
5069 } 5083 }
5070 5084
5071 } // namespace internal 5085 } // namespace internal
5072 } // namespace v8 5086 } // namespace v8
OLDNEW
« 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