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 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 JSObject::AddProperty( | 1109 JSObject::AddProperty( |
1110 global_object, object_name, isolate->object_function(), DONT_ENUM); | 1110 global_object, object_name, isolate->object_function(), DONT_ENUM); |
1111 | 1111 |
1112 Handle<JSObject> global(native_context()->global_object()); | 1112 Handle<JSObject> global(native_context()->global_object()); |
1113 | 1113 |
1114 // Install global Function object | 1114 // Install global Function object |
1115 Handle<JSFunction> function_function = | 1115 Handle<JSFunction> function_function = |
1116 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, | 1116 InstallFunction(global, "Function", JS_FUNCTION_TYPE, JSFunction::kSize, |
1117 empty_function, Builtins::kIllegal); | 1117 empty_function, Builtins::kIllegal); |
1118 function_function->initial_map()->set_is_callable(); | 1118 function_function->initial_map()->set_is_callable(); |
1119 function_function->initial_map()->set_is_constructor(true); | |
1120 | 1119 |
1121 { // --- A r r a y --- | 1120 { // --- A r r a y --- |
1122 Handle<JSFunction> array_function = | 1121 Handle<JSFunction> array_function = |
1123 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, | 1122 InstallFunction(global, "Array", JS_ARRAY_TYPE, JSArray::kSize, |
1124 isolate->initial_object_prototype(), | 1123 isolate->initial_object_prototype(), |
1125 Builtins::kArrayCode); | 1124 Builtins::kArrayCode); |
1126 array_function->shared()->DontAdaptArguments(); | 1125 array_function->shared()->DontAdaptArguments(); |
1127 array_function->shared()->set_function_data(Smi::FromInt(kArrayCode)); | 1126 array_function->shared()->set_function_data(Smi::FromInt(kArrayCode)); |
1128 | 1127 |
1129 // This seems a bit hackish, but we need to make sure Array.length | 1128 // This seems a bit hackish, but we need to make sure Array.length |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 JSObject::AddProperty( | 1944 JSObject::AddProperty( |
1946 container, factory->InternalizeUtf8String("GeneratorFunctionPrototype"), | 1945 container, factory->InternalizeUtf8String("GeneratorFunctionPrototype"), |
1947 generator_function_prototype, NONE); | 1946 generator_function_prototype, NONE); |
1948 | 1947 |
1949 static const bool kUseStrictFunctionMap = true; | 1948 static const bool kUseStrictFunctionMap = true; |
1950 Handle<JSFunction> generator_function_function = | 1949 Handle<JSFunction> generator_function_function = |
1951 InstallFunction(container, "GeneratorFunction", JS_FUNCTION_TYPE, | 1950 InstallFunction(container, "GeneratorFunction", JS_FUNCTION_TYPE, |
1952 JSFunction::kSize, generator_function_prototype, | 1951 JSFunction::kSize, generator_function_prototype, |
1953 Builtins::kIllegal, kUseStrictFunctionMap); | 1952 Builtins::kIllegal, kUseStrictFunctionMap); |
1954 generator_function_function->initial_map()->set_is_callable(); | 1953 generator_function_function->initial_map()->set_is_callable(); |
1955 generator_function_function->initial_map()->set_is_constructor(true); | |
1956 } | 1954 } |
1957 | 1955 |
1958 { // -- S e t I t e r a t o r | 1956 { // -- S e t I t e r a t o r |
1959 Handle<JSObject> set_iterator_prototype = | 1957 Handle<JSObject> set_iterator_prototype = |
1960 isolate->factory()->NewJSObject(isolate->object_function(), TENURED); | 1958 isolate->factory()->NewJSObject(isolate->object_function(), TENURED); |
1961 SetObjectPrototype(set_iterator_prototype, iterator_prototype); | 1959 SetObjectPrototype(set_iterator_prototype, iterator_prototype); |
1962 Handle<JSFunction> set_iterator_function = InstallFunction( | 1960 Handle<JSFunction> set_iterator_function = InstallFunction( |
1963 container, "SetIterator", JS_SET_ITERATOR_TYPE, JSSetIterator::kSize, | 1961 container, "SetIterator", JS_SET_ITERATOR_TYPE, JSSetIterator::kSize, |
1964 set_iterator_prototype, Builtins::kIllegal); | 1962 set_iterator_prototype, Builtins::kIllegal); |
1965 native_context->set_set_iterator_map(set_iterator_function->initial_map()); | 1963 native_context->set_set_iterator_map(set_iterator_function->initial_map()); |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3329 } | 3327 } |
3330 | 3328 |
3331 | 3329 |
3332 // Called when the top-level V8 mutex is destroyed. | 3330 // Called when the top-level V8 mutex is destroyed. |
3333 void Bootstrapper::FreeThreadResources() { | 3331 void Bootstrapper::FreeThreadResources() { |
3334 DCHECK(!IsActive()); | 3332 DCHECK(!IsActive()); |
3335 } | 3333 } |
3336 | 3334 |
3337 } // namespace internal | 3335 } // namespace internal |
3338 } // namespace v8 | 3336 } // namespace v8 |
OLD | NEW |