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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 initial_strong_map->set_is_strong(); | 1194 initial_strong_map->set_is_strong(); |
1195 CacheInitialJSArrayMaps(native_context(), initial_strong_map); | 1195 CacheInitialJSArrayMaps(native_context(), initial_strong_map); |
1196 | 1196 |
1197 Handle<JSFunction> is_arraylike = SimpleInstallFunction( | 1197 Handle<JSFunction> is_arraylike = SimpleInstallFunction( |
1198 array_function, isolate->factory()->InternalizeUtf8String("isArray"), | 1198 array_function, isolate->factory()->InternalizeUtf8String("isArray"), |
1199 Builtins::kArrayIsArray, 1, true); | 1199 Builtins::kArrayIsArray, 1, true); |
1200 native_context()->set_is_arraylike(*is_arraylike); | 1200 native_context()->set_is_arraylike(*is_arraylike); |
1201 } | 1201 } |
1202 | 1202 |
1203 { // --- N u m b e r --- | 1203 { // --- N u m b e r --- |
1204 Handle<JSFunction> number_fun = | 1204 Handle<JSFunction> number_fun = InstallFunction( |
1205 InstallFunction(global, "Number", JS_VALUE_TYPE, JSValue::kSize, | 1205 global, "Number", JS_VALUE_TYPE, JSValue::kSize, |
1206 isolate->initial_object_prototype(), | 1206 isolate->initial_object_prototype(), Builtins::kNumberConstructor); |
1207 Builtins::kIllegal); | 1207 number_fun->shared()->DontAdaptArguments(); |
| 1208 number_fun->shared()->set_construct_stub( |
| 1209 *isolate->builtins()->NumberConstructor_ConstructStub()); |
| 1210 number_fun->shared()->set_length(1); |
1208 InstallWithIntrinsicDefaultProto(isolate, number_fun, | 1211 InstallWithIntrinsicDefaultProto(isolate, number_fun, |
1209 Context::NUMBER_FUNCTION_INDEX); | 1212 Context::NUMBER_FUNCTION_INDEX); |
1210 number_fun->shared()->set_construct_stub( | |
1211 *isolate->builtins()->JSBuiltinsConstructStub()); | |
1212 } | 1213 } |
1213 | 1214 |
1214 { // --- B o o l e a n --- | 1215 { // --- B o o l e a n --- |
1215 Handle<JSFunction> boolean_fun = | 1216 Handle<JSFunction> boolean_fun = |
1216 InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize, | 1217 InstallFunction(global, "Boolean", JS_VALUE_TYPE, JSValue::kSize, |
1217 isolate->initial_object_prototype(), | 1218 isolate->initial_object_prototype(), |
1218 Builtins::kIllegal); | 1219 Builtins::kIllegal); |
1219 InstallWithIntrinsicDefaultProto(isolate, boolean_fun, | 1220 InstallWithIntrinsicDefaultProto(isolate, boolean_fun, |
1220 Context::BOOLEAN_FUNCTION_INDEX); | 1221 Context::BOOLEAN_FUNCTION_INDEX); |
1221 } | 1222 } |
(...skipping 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3510 } | 3511 } |
3511 | 3512 |
3512 | 3513 |
3513 // Called when the top-level V8 mutex is destroyed. | 3514 // Called when the top-level V8 mutex is destroyed. |
3514 void Bootstrapper::FreeThreadResources() { | 3515 void Bootstrapper::FreeThreadResources() { |
3515 DCHECK(!IsActive()); | 3516 DCHECK(!IsActive()); |
3516 } | 3517 } |
3517 | 3518 |
3518 } // namespace internal | 3519 } // namespace internal |
3519 } // namespace v8 | 3520 } // namespace v8 |
OLD | NEW |