Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/ieee754.h" | 10 #include "src/base/ieee754.h" |
| (...skipping 4485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4496 | 4496 |
| 4497 // ES6 section 25.2.1.1 GeneratorFunction (p1, p2, ... , pn, body) | 4497 // ES6 section 25.2.1.1 GeneratorFunction (p1, p2, ... , pn, body) |
| 4498 BUILTIN(GeneratorFunctionConstructor) { | 4498 BUILTIN(GeneratorFunctionConstructor) { |
| 4499 HandleScope scope(isolate); | 4499 HandleScope scope(isolate); |
| 4500 RETURN_RESULT_OR_FAILURE(isolate, | 4500 RETURN_RESULT_OR_FAILURE(isolate, |
| 4501 CreateDynamicFunction(isolate, args, "function*")); | 4501 CreateDynamicFunction(isolate, args, "function*")); |
| 4502 } | 4502 } |
| 4503 | 4503 |
| 4504 BUILTIN(AsyncFunctionConstructor) { | 4504 BUILTIN(AsyncFunctionConstructor) { |
| 4505 HandleScope scope(isolate); | 4505 HandleScope scope(isolate); |
| 4506 RETURN_RESULT_OR_FAILURE( | 4506 Handle<JSFunction> func; |
| 4507 isolate, CreateDynamicFunction(isolate, args, "async function")); | 4507 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( |
| 4508 isolate, func, CreateDynamicFunction(isolate, args, "async function")); | |
| 4509 | |
| 4510 // Do not lazily compute eval position for AsyncFunction, as they may not be | |
| 4511 // determined after the function is resumed. | |
| 4512 Handle<Script> script = handle(Script::cast(func->shared()->script())); | |
| 4513 int position = script->GetEvalPosition(); | |
| 4514 USE(position); | |
|
Dan Ehrenberg
2016/06/14 16:36:01
Should we be doing this for generators as well? Ca
| |
| 4515 | |
| 4516 return *func; | |
| 4508 } | 4517 } |
| 4509 | 4518 |
| 4510 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case. | 4519 // ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case. |
| 4511 BUILTIN(SymbolConstructor) { | 4520 BUILTIN(SymbolConstructor) { |
| 4512 HandleScope scope(isolate); | 4521 HandleScope scope(isolate); |
| 4513 Handle<Symbol> result = isolate->factory()->NewSymbol(); | 4522 Handle<Symbol> result = isolate->factory()->NewSymbol(); |
| 4514 Handle<Object> description = args.atOrUndefined(isolate, 1); | 4523 Handle<Object> description = args.atOrUndefined(isolate, 1); |
| 4515 if (!description->IsUndefined(isolate)) { | 4524 if (!description->IsUndefined(isolate)) { |
| 4516 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, description, | 4525 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, description, |
| 4517 Object::ToString(isolate, description)); | 4526 Object::ToString(isolate, description)); |
| (...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6021 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 6030 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 6022 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 6031 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 6023 #undef DEFINE_BUILTIN_ACCESSOR_C | 6032 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 6024 #undef DEFINE_BUILTIN_ACCESSOR_A | 6033 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 6025 #undef DEFINE_BUILTIN_ACCESSOR_T | 6034 #undef DEFINE_BUILTIN_ACCESSOR_T |
| 6026 #undef DEFINE_BUILTIN_ACCESSOR_S | 6035 #undef DEFINE_BUILTIN_ACCESSOR_S |
| 6027 #undef DEFINE_BUILTIN_ACCESSOR_H | 6036 #undef DEFINE_BUILTIN_ACCESSOR_H |
| 6028 | 6037 |
| 6029 } // namespace internal | 6038 } // namespace internal |
| 6030 } // namespace v8 | 6039 } // namespace v8 |
| OLD | NEW |