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/utils/random-number-generator.h" | 9 #include "src/base/utils/random-number-generator.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 factory()->InternalizeUtf8String("prototype"), | 2170 factory()->InternalizeUtf8String("prototype"), |
2171 generator_object_prototype, | 2171 generator_object_prototype, |
2172 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 2172 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
2173 | 2173 |
2174 static const bool kUseStrictFunctionMap = true; | 2174 static const bool kUseStrictFunctionMap = true; |
2175 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE, | 2175 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE, |
2176 JSFunction::kSize, generator_function_prototype, | 2176 JSFunction::kSize, generator_function_prototype, |
2177 Builtins::kIllegal, kUseStrictFunctionMap); | 2177 Builtins::kIllegal, kUseStrictFunctionMap); |
2178 | 2178 |
2179 // Create maps for generator functions and their prototypes. Store those | 2179 // Create maps for generator functions and their prototypes. Store those |
2180 // maps in the native context. Generator functions do not have writable | 2180 // maps in the native context. The "prototype" property descriptor is |
2181 // prototypes, nor do they have "caller" or "arguments" accessors. | 2181 // writable, non-enumerable, and non-configurable (as per ES6 draft |
2182 Handle<Map> strict_function_map(native_context()->strict_function_map()); | 2182 // 04-14-15, section 25.2.4.3). |
| 2183 Handle<Map> strict_function_map(strict_function_map_writable_prototype_); |
| 2184 // Generator functions do not have "caller" or "arguments" accessors. |
2183 Handle<Map> sloppy_generator_function_map = | 2185 Handle<Map> sloppy_generator_function_map = |
2184 Map::Copy(strict_function_map, "SloppyGeneratorFunction"); | 2186 Map::Copy(strict_function_map, "SloppyGeneratorFunction"); |
2185 Map::SetPrototype(sloppy_generator_function_map, | 2187 Map::SetPrototype(sloppy_generator_function_map, |
2186 generator_function_prototype); | 2188 generator_function_prototype); |
2187 native_context()->set_sloppy_generator_function_map( | 2189 native_context()->set_sloppy_generator_function_map( |
2188 *sloppy_generator_function_map); | 2190 *sloppy_generator_function_map); |
2189 | 2191 |
2190 Handle<Map> strict_generator_function_map = | 2192 Handle<Map> strict_generator_function_map = |
2191 Map::Copy(strict_function_map, "StrictGeneratorFunction"); | 2193 Map::Copy(strict_function_map, "StrictGeneratorFunction"); |
2192 Map::SetPrototype(strict_generator_function_map, | 2194 Map::SetPrototype(strict_generator_function_map, |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3045 return from + sizeof(NestingCounterType); | 3047 return from + sizeof(NestingCounterType); |
3046 } | 3048 } |
3047 | 3049 |
3048 | 3050 |
3049 // Called when the top-level V8 mutex is destroyed. | 3051 // Called when the top-level V8 mutex is destroyed. |
3050 void Bootstrapper::FreeThreadResources() { | 3052 void Bootstrapper::FreeThreadResources() { |
3051 DCHECK(!IsActive()); | 3053 DCHECK(!IsActive()); |
3052 } | 3054 } |
3053 | 3055 |
3054 } } // namespace v8::internal | 3056 } } // namespace v8::internal |
OLD | NEW |