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

Side by Side Diff: src/builtins.cc

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: fix some nits Created 4 years, 7 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 | « src/builtins.h ('k') | src/code-stubs.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api-arguments.h" 7 #include "src/api-arguments.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 4205 matching lines...) Expand 10 before | Expand all | Expand 10 after
4216 4216
4217 // ES6 section 25.2.1.1 GeneratorFunction (p1, p2, ... , pn, body) 4217 // ES6 section 25.2.1.1 GeneratorFunction (p1, p2, ... , pn, body)
4218 BUILTIN(GeneratorFunctionConstructor) { 4218 BUILTIN(GeneratorFunctionConstructor) {
4219 HandleScope scope(isolate); 4219 HandleScope scope(isolate);
4220 Handle<JSFunction> result; 4220 Handle<JSFunction> result;
4221 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 4221 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
4222 isolate, result, CreateDynamicFunction(isolate, args, "function*")); 4222 isolate, result, CreateDynamicFunction(isolate, args, "function*"));
4223 return *result; 4223 return *result;
4224 } 4224 }
4225 4225
4226 BUILTIN(AsyncFunctionConstructor) {
4227 HandleScope scope(isolate);
4228 Handle<JSFunction> result;
4229 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
4230 isolate, result, CreateDynamicFunction(isolate, args, "async function"));
4231 return *result;
4232 }
4226 4233
4227 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case. 4234 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case.
4228 BUILTIN(SymbolConstructor) { 4235 BUILTIN(SymbolConstructor) {
4229 HandleScope scope(isolate); 4236 HandleScope scope(isolate);
4230 Handle<Symbol> result = isolate->factory()->NewSymbol(); 4237 Handle<Symbol> result = isolate->factory()->NewSymbol();
4231 Handle<Object> description = args.atOrUndefined(isolate, 1); 4238 Handle<Object> description = args.atOrUndefined(isolate, 1);
4232 if (!description->IsUndefined()) { 4239 if (!description->IsUndefined()) {
4233 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, description, 4240 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, description,
4234 Object::ToString(isolate, description)); 4241 Object::ToString(isolate, description));
4235 result->set_name(*description); 4242 result->set_name(*description);
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
5478 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) 5485 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T)
5479 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 5486 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
5480 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 5487 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
5481 #undef DEFINE_BUILTIN_ACCESSOR_C 5488 #undef DEFINE_BUILTIN_ACCESSOR_C
5482 #undef DEFINE_BUILTIN_ACCESSOR_A 5489 #undef DEFINE_BUILTIN_ACCESSOR_A
5483 #undef DEFINE_BUILTIN_ACCESSOR_T 5490 #undef DEFINE_BUILTIN_ACCESSOR_T
5484 #undef DEFINE_BUILTIN_ACCESSOR_H 5491 #undef DEFINE_BUILTIN_ACCESSOR_H
5485 5492
5486 } // namespace internal 5493 } // namespace internal
5487 } // namespace v8 5494 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698