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. Generator functions do not have "caller" or |
2181 // prototypes, nor do they have "caller" or "arguments" accessors. | 2181 // "arguments" accessors. |
2182 Handle<Map> strict_function_map(native_context()->strict_function_map()); | 2182 Handle<Map> strict_function_map(strict_function_map_writable_prototype_); |
caitp (gmail)
2015/05/22 21:11:23
Can you add a note here about the `{ [[Writable]]:
| |
2183 Handle<Map> sloppy_generator_function_map = | 2183 Handle<Map> sloppy_generator_function_map = |
2184 Map::Copy(strict_function_map, "SloppyGeneratorFunction"); | 2184 Map::Copy(strict_function_map, "SloppyGeneratorFunction"); |
2185 Map::SetPrototype(sloppy_generator_function_map, | 2185 Map::SetPrototype(sloppy_generator_function_map, |
2186 generator_function_prototype); | 2186 generator_function_prototype); |
2187 native_context()->set_sloppy_generator_function_map( | 2187 native_context()->set_sloppy_generator_function_map( |
2188 *sloppy_generator_function_map); | 2188 *sloppy_generator_function_map); |
2189 | 2189 |
2190 Handle<Map> strict_generator_function_map = | 2190 Handle<Map> strict_generator_function_map = |
2191 Map::Copy(strict_function_map, "StrictGeneratorFunction"); | 2191 Map::Copy(strict_function_map, "StrictGeneratorFunction"); |
2192 Map::SetPrototype(strict_generator_function_map, | 2192 Map::SetPrototype(strict_generator_function_map, |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3045 return from + sizeof(NestingCounterType); | 3045 return from + sizeof(NestingCounterType); |
3046 } | 3046 } |
3047 | 3047 |
3048 | 3048 |
3049 // Called when the top-level V8 mutex is destroyed. | 3049 // Called when the top-level V8 mutex is destroyed. |
3050 void Bootstrapper::FreeThreadResources() { | 3050 void Bootstrapper::FreeThreadResources() { |
3051 DCHECK(!IsActive()); | 3051 DCHECK(!IsActive()); |
3052 } | 3052 } |
3053 | 3053 |
3054 } } // namespace v8::internal | 3054 } } // namespace v8::internal |
OLD | NEW |