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/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/extensions/externalize-string-extension.h" | 10 #include "src/extensions/externalize-string-extension.h" |
(...skipping 2041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2052 isolate()->initial_object_prototype(), Builtins::kIllegal); | 2052 isolate()->initial_object_prototype(), Builtins::kIllegal); |
2053 native_context()->set_map_iterator_map( | 2053 native_context()->set_map_iterator_map( |
2054 map_iterator_function->initial_map()); | 2054 map_iterator_function->initial_map()); |
2055 } | 2055 } |
2056 | 2056 |
2057 { | 2057 { |
2058 // Create generator meta-objects and install them on the builtins object. | 2058 // Create generator meta-objects and install them on the builtins object. |
2059 Handle<JSObject> builtins(native_context()->builtins()); | 2059 Handle<JSObject> builtins(native_context()->builtins()); |
2060 Handle<JSObject> generator_object_prototype = | 2060 Handle<JSObject> generator_object_prototype = |
2061 factory()->NewJSObject(isolate()->object_function(), TENURED); | 2061 factory()->NewJSObject(isolate()->object_function(), TENURED); |
2062 Handle<JSFunction> generator_function_prototype = | 2062 Handle<JSObject> generator_function_prototype = |
2063 InstallFunction(builtins, "GeneratorFunctionPrototype", | 2063 factory()->NewJSObject(isolate()->object_function(), TENURED); |
2064 JS_FUNCTION_TYPE, JSFunction::kHeaderSize, | 2064 JSObject::AddProperty(builtins, |
2065 generator_object_prototype, Builtins::kIllegal); | 2065 factory()->InternalizeUtf8String("GeneratorFunctionPrototype"), |
arv (Not doing code reviews)
2015/04/06 15:16:20
Wrong indentation. `git cl upload` should have com
| |
2066 generator_function_prototype, | |
2067 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY)); | |
2068 | |
2069 JSObject::AddProperty(generator_function_prototype, | |
2070 factory()->InternalizeUtf8String("prototype"), | |
arv (Not doing code reviews)
2015/04/06 15:16:18
wrong indentation
| |
2071 generator_object_prototype, | |
2072 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | |
2073 | |
2066 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE, | 2074 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE, |
2067 JSFunction::kSize, generator_function_prototype, | 2075 JSFunction::kSize, generator_function_prototype, |
2068 Builtins::kIllegal); | 2076 Builtins::kIllegal); |
2069 | 2077 |
2070 // Create maps for generator functions and their prototypes. Store those | 2078 // Create maps for generator functions and their prototypes. Store those |
2071 // maps in the native context. | 2079 // maps in the native context. |
2072 Handle<Map> generator_function_map = | 2080 Handle<Map> generator_function_map = |
2073 Map::Copy(sloppy_function_map_writable_prototype_, "GeneratorFunction"); | 2081 Map::Copy(sloppy_function_map_writable_prototype_, "GeneratorFunction"); |
2074 generator_function_map->SetPrototype(generator_function_prototype); | 2082 generator_function_map->SetPrototype(generator_function_prototype); |
2075 native_context()->set_sloppy_generator_function_map( | 2083 native_context()->set_sloppy_generator_function_map( |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2952 return from + sizeof(NestingCounterType); | 2960 return from + sizeof(NestingCounterType); |
2953 } | 2961 } |
2954 | 2962 |
2955 | 2963 |
2956 // Called when the top-level V8 mutex is destroyed. | 2964 // Called when the top-level V8 mutex is destroyed. |
2957 void Bootstrapper::FreeThreadResources() { | 2965 void Bootstrapper::FreeThreadResources() { |
2958 DCHECK(!IsActive()); | 2966 DCHECK(!IsActive()); |
2959 } | 2967 } |
2960 | 2968 |
2961 } } // namespace v8::internal | 2969 } } // namespace v8::internal |
OLD | NEW |