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

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: remove weird arrow-generator thing 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') | src/compiler.cc » ('J')
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 2460 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 Generate_GeneratorPrototypeResume(assembler, JSGeneratorObject::kReturn, 2471 Generate_GeneratorPrototypeResume(assembler, JSGeneratorObject::kReturn,
2472 "[Generator].prototype.return"); 2472 "[Generator].prototype.return");
2473 } 2473 }
2474 2474
2475 // ES6 section 25.3.1.4 Generator.prototype.throw ( exception ) 2475 // ES6 section 25.3.1.4 Generator.prototype.throw ( exception )
2476 void Builtins::Generate_GeneratorPrototypeThrow(CodeStubAssembler* assembler) { 2476 void Builtins::Generate_GeneratorPrototypeThrow(CodeStubAssembler* assembler) {
2477 Generate_GeneratorPrototypeResume(assembler, JSGeneratorObject::kThrow, 2477 Generate_GeneratorPrototypeResume(assembler, JSGeneratorObject::kThrow,
2478 "[Generator].prototype.throw"); 2478 "[Generator].prototype.throw");
2479 } 2479 }
2480 2480
2481 void Builtins::Generate_AsyncFunctionNext(CodeStubAssembler* assembler) {
2482 Generate_GeneratorPrototypeResume(assembler, JSGeneratorObject::kNext,
2483 "AsyncFunctionNext");
2484 }
2485
2486 // ES6 section 25.3.1.4 Generator.prototype.throw ( exception )
2487 void Builtins::Generate_AsyncFunctionThrow(CodeStubAssembler* assembler) {
2488 Generate_GeneratorPrototypeResume(assembler, JSGeneratorObject::kThrow,
2489 "AsyncFunctionThrow");
2490 }
2491
2481 // ----------------------------------------------------------------------------- 2492 // -----------------------------------------------------------------------------
2482 // ES6 section 26.1 The Reflect Object 2493 // ES6 section 26.1 The Reflect Object
2483 2494
2484 // ES6 section 26.1.3 Reflect.defineProperty 2495 // ES6 section 26.1.3 Reflect.defineProperty
2485 BUILTIN(ReflectDefineProperty) { 2496 BUILTIN(ReflectDefineProperty) {
2486 HandleScope scope(isolate); 2497 HandleScope scope(isolate);
2487 DCHECK_EQ(4, args.length()); 2498 DCHECK_EQ(4, args.length());
2488 Handle<Object> target = args.at<Object>(1); 2499 Handle<Object> target = args.at<Object>(1);
2489 Handle<Object> key = args.at<Object>(2); 2500 Handle<Object> key = args.at<Object>(2);
2490 Handle<Object> attributes = args.at<Object>(3); 2501 Handle<Object> attributes = args.at<Object>(3);
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
4196 4207
4197 // ES6 section 25.2.1.1 GeneratorFunction (p1, p2, ... , pn, body) 4208 // ES6 section 25.2.1.1 GeneratorFunction (p1, p2, ... , pn, body)
4198 BUILTIN(GeneratorFunctionConstructor) { 4209 BUILTIN(GeneratorFunctionConstructor) {
4199 HandleScope scope(isolate); 4210 HandleScope scope(isolate);
4200 Handle<JSFunction> result; 4211 Handle<JSFunction> result;
4201 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 4212 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
4202 isolate, result, CreateDynamicFunction(isolate, args, "function*")); 4213 isolate, result, CreateDynamicFunction(isolate, args, "function*"));
4203 return *result; 4214 return *result;
4204 } 4215 }
4205 4216
4217 BUILTIN(AsyncFunctionConstructor) {
4218 HandleScope scope(isolate);
4219 Handle<JSFunction> result;
4220 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
4221 isolate, result, CreateDynamicFunction(isolate, args, "async function"));
4222 return *result;
4223 }
4206 4224
4207 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case. 4225 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case.
4208 BUILTIN(SymbolConstructor) { 4226 BUILTIN(SymbolConstructor) {
4209 HandleScope scope(isolate); 4227 HandleScope scope(isolate);
4210 Handle<Symbol> result = isolate->factory()->NewSymbol(); 4228 Handle<Symbol> result = isolate->factory()->NewSymbol();
4211 Handle<Object> description = args.atOrUndefined(isolate, 1); 4229 Handle<Object> description = args.atOrUndefined(isolate, 1);
4212 if (!description->IsUndefined()) { 4230 if (!description->IsUndefined()) {
4213 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, description, 4231 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, description,
4214 Object::ToString(isolate, description)); 4232 Object::ToString(isolate, description));
4215 result->set_name(*description); 4233 result->set_name(*description);
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after
5456 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) 5474 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T)
5457 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 5475 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
5458 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 5476 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
5459 #undef DEFINE_BUILTIN_ACCESSOR_C 5477 #undef DEFINE_BUILTIN_ACCESSOR_C
5460 #undef DEFINE_BUILTIN_ACCESSOR_A 5478 #undef DEFINE_BUILTIN_ACCESSOR_A
5461 #undef DEFINE_BUILTIN_ACCESSOR_T 5479 #undef DEFINE_BUILTIN_ACCESSOR_T
5462 #undef DEFINE_BUILTIN_ACCESSOR_H 5480 #undef DEFINE_BUILTIN_ACCESSOR_H
5463 5481
5464 } // namespace internal 5482 } // namespace internal
5465 } // namespace v8 5483 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/code-stubs.h » ('j') | src/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698