OLD | NEW |
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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 factory()->to_string_tag_symbol(), | 696 factory()->to_string_tag_symbol(), |
697 factory()->NewStringFromAsciiChecked("Generator"), | 697 factory()->NewStringFromAsciiChecked("Generator"), |
698 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 698 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
699 SimpleInstallFunction(generator_object_prototype, "next", | 699 SimpleInstallFunction(generator_object_prototype, "next", |
700 Builtins::kGeneratorPrototypeNext, 1, true); | 700 Builtins::kGeneratorPrototypeNext, 1, true); |
701 SimpleInstallFunction(generator_object_prototype, "return", | 701 SimpleInstallFunction(generator_object_prototype, "return", |
702 Builtins::kGeneratorPrototypeReturn, 1, true); | 702 Builtins::kGeneratorPrototypeReturn, 1, true); |
703 SimpleInstallFunction(generator_object_prototype, "throw", | 703 SimpleInstallFunction(generator_object_prototype, "throw", |
704 Builtins::kGeneratorPrototypeThrow, 1, true); | 704 Builtins::kGeneratorPrototypeThrow, 1, true); |
705 | 705 |
706 // Internal version of generator_prototype_next, flagged as non-native. | |
707 Handle<JSFunction> generator_next_internal = | |
708 SimpleCreateFunction(isolate(), factory()->next_string(), | |
709 Builtins::kGeneratorPrototypeNext, 1, true); | |
710 native_context()->set_generator_next_internal(*generator_next_internal); | |
711 | |
712 // Create maps for generator functions and their prototypes. Store those | 706 // Create maps for generator functions and their prototypes. Store those |
713 // maps in the native context. The "prototype" property descriptor is | 707 // maps in the native context. The "prototype" property descriptor is |
714 // writable, non-enumerable, and non-configurable (as per ES6 draft | 708 // writable, non-enumerable, and non-configurable (as per ES6 draft |
715 // 04-14-15, section 25.2.4.3). | 709 // 04-14-15, section 25.2.4.3). |
716 Handle<Map> strict_function_map(strict_function_map_writable_prototype_); | 710 Handle<Map> strict_function_map(strict_function_map_writable_prototype_); |
717 // Generator functions do not have "caller" or "arguments" accessors. | 711 // Generator functions do not have "caller" or "arguments" accessors. |
718 Handle<Map> sloppy_generator_function_map = | 712 Handle<Map> sloppy_generator_function_map = |
719 Map::Copy(strict_function_map, "SloppyGeneratorFunction"); | 713 Map::Copy(strict_function_map, "SloppyGeneratorFunction"); |
720 sloppy_generator_function_map->set_is_constructor(false); | 714 sloppy_generator_function_map->set_is_constructor(false); |
721 Map::SetPrototype(sloppy_generator_function_map, | 715 Map::SetPrototype(sloppy_generator_function_map, |
(...skipping 3469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4191 } | 4185 } |
4192 | 4186 |
4193 | 4187 |
4194 // Called when the top-level V8 mutex is destroyed. | 4188 // Called when the top-level V8 mutex is destroyed. |
4195 void Bootstrapper::FreeThreadResources() { | 4189 void Bootstrapper::FreeThreadResources() { |
4196 DCHECK(!IsActive()); | 4190 DCHECK(!IsActive()); |
4197 } | 4191 } |
4198 | 4192 |
4199 } // namespace internal | 4193 } // namespace internal |
4200 } // namespace v8 | 4194 } // namespace v8 |
OLD | NEW |