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 2709773002: [builtins] (Re-)implement Array.prototype.every/some with the CSA (Closed)
Patch Set: Add some Created 3 years, 10 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') | src/builtins/builtins-array.cc » ('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 3546 matching lines...) Expand 10 before | Expand all | Expand 10 after
3557 LookupIterator it3(array_prototype, 3557 LookupIterator it3(array_prototype,
3558 factory->NewStringFromAsciiChecked("forEach"), 3558 factory->NewStringFromAsciiChecked("forEach"),
3559 LookupIterator::OWN_SKIP_INTERCEPTOR); 3559 LookupIterator::OWN_SKIP_INTERCEPTOR);
3560 Handle<Object> for_each_function = 3560 Handle<Object> for_each_function =
3561 Object::GetProperty(&it3).ToHandleChecked(); 3561 Object::GetProperty(&it3).ToHandleChecked();
3562 Handle<JSFunction>::cast(for_each_function) 3562 Handle<JSFunction>::cast(for_each_function)
3563 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach)); 3563 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach));
3564 Handle<JSFunction>::cast(for_each_function) 3564 Handle<JSFunction>::cast(for_each_function)
3565 ->shared() 3565 ->shared()
3566 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach)); 3566 ->set_code(isolate->builtins()->builtin(Builtins::kArrayForEach));
3567
3568 LookupIterator it4(array_prototype,
3569 factory->NewStringFromAsciiChecked("every"),
3570 LookupIterator::OWN_SKIP_INTERCEPTOR);
3571 Handle<Object> every_function = Object::GetProperty(&it4).ToHandleChecked();
3572 Handle<JSFunction>::cast(every_function)
3573 ->set_code(isolate->builtins()->builtin(Builtins::kArrayEvery));
3574 Handle<JSFunction>::cast(every_function)
3575 ->shared()
3576 ->set_code(isolate->builtins()->builtin(Builtins::kArrayEvery));
3577
3578 LookupIterator it5(array_prototype,
3579 factory->NewStringFromAsciiChecked("some"),
3580 LookupIterator::OWN_SKIP_INTERCEPTOR);
3581 Handle<Object> some_function = Object::GetProperty(&it5).ToHandleChecked();
3582 Handle<JSFunction>::cast(some_function)
3583 ->set_code(isolate->builtins()->builtin(Builtins::kArraySome));
3584 Handle<JSFunction>::cast(some_function)
3585 ->shared()
3586 ->set_code(isolate->builtins()->builtin(Builtins::kArraySome));
3567 } 3587 }
3568 3588
3569 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { 3589 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
3570 if (!FLAG_harmony_sharedarraybuffer) return; 3590 if (!FLAG_harmony_sharedarraybuffer) return;
3571 3591
3572 Handle<JSGlobalObject> global(native_context()->global_object()); 3592 Handle<JSGlobalObject> global(native_context()->global_object());
3573 Isolate* isolate = global->GetIsolate(); 3593 Isolate* isolate = global->GetIsolate();
3574 Factory* factory = isolate->factory(); 3594 Factory* factory = isolate->factory();
3575 3595
3576 Handle<JSFunction> shared_array_buffer_fun = 3596 Handle<JSFunction> shared_array_buffer_fun =
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
5001 } 5021 }
5002 5022
5003 5023
5004 // Called when the top-level V8 mutex is destroyed. 5024 // Called when the top-level V8 mutex is destroyed.
5005 void Bootstrapper::FreeThreadResources() { 5025 void Bootstrapper::FreeThreadResources() {
5006 DCHECK(!IsActive()); 5026 DCHECK(!IsActive());
5007 } 5027 }
5008 5028
5009 } // namespace internal 5029 } // namespace internal
5010 } // namespace v8 5030 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | src/builtins/builtins-array.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698