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

Side by Side Diff: src/bootstrapper.cc

Issue 2118653004: [builtins] make AsyncFunction constructor a subclass of Function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't redundantly call set_prototype_or_initial_map() Created 4 years, 5 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 | test/mjsunit/harmony/async-await-basic.js » ('j') | no next file with comments »
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 2619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 2630
2631 { 2631 {
2632 PrototypeIterator iter(native_context->sloppy_async_function_map()); 2632 PrototypeIterator iter(native_context->sloppy_async_function_map());
2633 Handle<JSObject> async_function_prototype(iter.GetCurrent<JSObject>()); 2633 Handle<JSObject> async_function_prototype(iter.GetCurrent<JSObject>());
2634 2634
2635 static const bool kUseStrictFunctionMap = true; 2635 static const bool kUseStrictFunctionMap = true;
2636 Handle<JSFunction> async_function_constructor = InstallFunction( 2636 Handle<JSFunction> async_function_constructor = InstallFunction(
2637 container, "AsyncFunction", JS_FUNCTION_TYPE, JSFunction::kSize, 2637 container, "AsyncFunction", JS_FUNCTION_TYPE, JSFunction::kSize,
2638 async_function_prototype, Builtins::kAsyncFunctionConstructor, 2638 async_function_prototype, Builtins::kAsyncFunctionConstructor,
2639 kUseStrictFunctionMap); 2639 kUseStrictFunctionMap);
2640 async_function_constructor->set_prototype_or_initial_map(
2641 native_context->sloppy_async_function_map());
2642 async_function_constructor->shared()->DontAdaptArguments(); 2640 async_function_constructor->shared()->DontAdaptArguments();
2643 async_function_constructor->shared()->set_construct_stub( 2641 async_function_constructor->shared()->set_construct_stub(
2644 *isolate->builtins()->AsyncFunctionConstructor()); 2642 *isolate->builtins()->AsyncFunctionConstructor());
2645 async_function_constructor->shared()->set_length(1); 2643 async_function_constructor->shared()->set_length(1);
2646 InstallWithIntrinsicDefaultProto(isolate, async_function_constructor, 2644 InstallWithIntrinsicDefaultProto(isolate, async_function_constructor,
2647 Context::ASYNC_FUNCTION_FUNCTION_INDEX); 2645 Context::ASYNC_FUNCTION_FUNCTION_INDEX);
2646 SetObjectPrototype(async_function_constructor,
2647 isolate->function_function());
2648 2648
2649 JSObject::AddProperty( 2649 JSObject::AddProperty(
2650 async_function_prototype, factory->constructor_string(), 2650 async_function_prototype, factory->constructor_string(),
2651 async_function_constructor, 2651 async_function_constructor,
2652 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); 2652 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
2653 2653
2654 JSFunction::SetPrototype(async_function_constructor, 2654 JSFunction::SetPrototype(async_function_constructor,
2655 async_function_prototype); 2655 async_function_prototype);
2656 2656
2657 Handle<JSFunction> async_function_next = 2657 Handle<JSFunction> async_function_next =
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
3955 } 3955 }
3956 3956
3957 3957
3958 // Called when the top-level V8 mutex is destroyed. 3958 // Called when the top-level V8 mutex is destroyed.
3959 void Bootstrapper::FreeThreadResources() { 3959 void Bootstrapper::FreeThreadResources() {
3960 DCHECK(!IsActive()); 3960 DCHECK(!IsActive());
3961 } 3961 }
3962 3962
3963 } // namespace internal 3963 } // namespace internal
3964 } // namespace v8 3964 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/harmony/async-await-basic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698