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 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1307 native_context()->set_iterator_result_map(*iterator_result_map); | 1307 native_context()->set_iterator_result_map(*iterator_result_map); |
1308 } | 1308 } |
1309 | 1309 |
1310 // -- W e a k M a p | 1310 // -- W e a k M a p |
1311 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, | 1311 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
1312 isolate->initial_object_prototype(), Builtins::kIllegal); | 1312 isolate->initial_object_prototype(), Builtins::kIllegal); |
1313 // -- W e a k S e t | 1313 // -- W e a k S e t |
1314 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, | 1314 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, |
1315 isolate->initial_object_prototype(), Builtins::kIllegal); | 1315 isolate->initial_object_prototype(), Builtins::kIllegal); |
1316 | 1316 |
1317 { | |
Dan Ehrenberg
2015/07/09 00:23:17
Looks like this code runs regardless of --harmony_
bbudge
2015/07/09 01:11:32
Fixed.
| |
1318 // -- S I M D | |
1319 Handle<String> name = factory->InternalizeUtf8String("SIMD"); | |
1320 Handle<JSFunction> cons = factory->NewFunction(name); | |
1321 JSFunction::SetInstancePrototype( | |
1322 cons, | |
1323 Handle<Object>(native_context()->initial_object_prototype(), isolate)); | |
1324 cons->SetInstanceClassName(*name); | |
1325 Handle<JSObject> simd_object = factory->NewJSObject(cons, TENURED); | |
1326 DCHECK(simd_object->IsJSObject()); | |
1327 JSObject::AddProperty(global, name, simd_object, DONT_ENUM); | |
1328 | |
1329 Handle<JSFunction> float32x4_function = InstallFunction( | |
1330 simd_object, "Float32x4", JS_VALUE_TYPE, JSValue::kSize, | |
1331 isolate->initial_object_prototype(), Builtins::kIllegal); | |
1332 // Set the instance class name since InstallFunction only does this when | |
1333 // we install on the GlobalObject. | |
1334 float32x4_function->SetInstanceClassName(*factory->Float32x4_string()); | |
1335 native_context()->set_float32x4_function(*float32x4_function); | |
1336 } | |
1337 | |
1317 { // --- sloppy arguments map | 1338 { // --- sloppy arguments map |
1318 // Make sure we can recognize argument objects at runtime. | 1339 // Make sure we can recognize argument objects at runtime. |
1319 // This is done by introducing an anonymous function with | 1340 // This is done by introducing an anonymous function with |
1320 // class_name equals 'Arguments'. | 1341 // class_name equals 'Arguments'. |
1321 Handle<String> arguments_string = factory->Arguments_string(); | 1342 Handle<String> arguments_string = factory->Arguments_string(); |
1322 Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal)); | 1343 Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal)); |
1323 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( | 1344 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( |
1324 arguments_string, code); | 1345 arguments_string, code); |
1325 function->shared()->set_instance_class_name(*arguments_string); | 1346 function->shared()->set_instance_class_name(*arguments_string); |
1326 | 1347 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1812 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) | 1833 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) |
1813 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) | 1834 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) |
1814 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect) | 1835 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect) |
1815 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) | 1836 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) |
1816 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring) | 1837 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring) |
1817 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object) | 1838 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object) |
1818 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spread_arrays) | 1839 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spread_arrays) |
1819 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sharedarraybuffer) | 1840 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sharedarraybuffer) |
1820 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_atomics) | 1841 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_atomics) |
1821 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_new_target) | 1842 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_new_target) |
1843 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_simd) | |
1822 | 1844 |
1823 | 1845 |
1824 void Genesis::InstallNativeFunctions_harmony_proxies() { | 1846 void Genesis::InstallNativeFunctions_harmony_proxies() { |
1825 if (FLAG_harmony_proxies) { | 1847 if (FLAG_harmony_proxies) { |
1826 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap); | 1848 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap); |
1827 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap); | 1849 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap); |
1828 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap); | 1850 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap); |
1829 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate); | 1851 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate); |
1830 } | 1852 } |
1831 } | 1853 } |
(...skipping 11 matching lines...) Expand all Loading... | |
1843 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) | 1865 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) |
1844 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode) | 1866 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode) |
1845 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) | 1867 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) |
1846 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) | 1868 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) |
1847 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls) | 1869 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls) |
1848 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring) | 1870 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring) |
1849 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object) | 1871 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object) |
1850 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_arrays) | 1872 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_arrays) |
1851 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_atomics) | 1873 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_atomics) |
1852 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_new_target) | 1874 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_new_target) |
1875 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_simd) | |
1853 | 1876 |
1854 void Genesis::InitializeGlobal_harmony_regexps() { | 1877 void Genesis::InitializeGlobal_harmony_regexps() { |
1855 Handle<JSObject> builtins(native_context()->builtins()); | 1878 Handle<JSObject> builtins(native_context()->builtins()); |
1856 | 1879 |
1857 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() | 1880 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() |
1858 : heap()->false_value()); | 1881 : heap()->false_value()); |
1859 Runtime::SetObjectProperty(isolate(), builtins, | 1882 Runtime::SetObjectProperty(isolate(), builtins, |
1860 factory()->harmony_regexps_string(), flag, | 1883 factory()->harmony_regexps_string(), flag, |
1861 STRICT).Assert(); | 1884 STRICT).Assert(); |
1862 } | 1885 } |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2493 "native harmony-spread.js", nullptr}; | 2516 "native harmony-spread.js", nullptr}; |
2494 static const char* harmony_destructuring_natives[] = {nullptr}; | 2517 static const char* harmony_destructuring_natives[] = {nullptr}; |
2495 static const char* harmony_object_natives[] = {"native harmony-object.js", | 2518 static const char* harmony_object_natives[] = {"native harmony-object.js", |
2496 NULL}; | 2519 NULL}; |
2497 static const char* harmony_spread_arrays_natives[] = {nullptr}; | 2520 static const char* harmony_spread_arrays_natives[] = {nullptr}; |
2498 static const char* harmony_sharedarraybuffer_natives[] = { | 2521 static const char* harmony_sharedarraybuffer_natives[] = { |
2499 "native harmony-sharedarraybuffer.js", NULL}; | 2522 "native harmony-sharedarraybuffer.js", NULL}; |
2500 static const char* harmony_atomics_natives[] = {"native harmony-atomics.js", | 2523 static const char* harmony_atomics_natives[] = {"native harmony-atomics.js", |
2501 nullptr}; | 2524 nullptr}; |
2502 static const char* harmony_new_target_natives[] = {nullptr}; | 2525 static const char* harmony_new_target_natives[] = {nullptr}; |
2526 static const char* harmony_simd_natives[] = {"native harmony-simd.js", | |
2527 nullptr}; | |
2503 | 2528 |
2504 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2529 for (int i = ExperimentalNatives::GetDebuggerCount(); |
2505 i < ExperimentalNatives::GetBuiltinsCount(); i++) { | 2530 i < ExperimentalNatives::GetBuiltinsCount(); i++) { |
2506 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ | 2531 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ |
2507 if (FLAG_##id) { \ | 2532 if (FLAG_##id) { \ |
2508 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ | 2533 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ |
2509 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ | 2534 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ |
2510 if (strncmp(script_name.start(), id##_natives[j], \ | 2535 if (strncmp(script_name.start(), id##_natives[j], \ |
2511 script_name.length()) == 0) { \ | 2536 script_name.length()) == 0) { \ |
2512 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ | 2537 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3198 } | 3223 } |
3199 | 3224 |
3200 | 3225 |
3201 // Called when the top-level V8 mutex is destroyed. | 3226 // Called when the top-level V8 mutex is destroyed. |
3202 void Bootstrapper::FreeThreadResources() { | 3227 void Bootstrapper::FreeThreadResources() { |
3203 DCHECK(!IsActive()); | 3228 DCHECK(!IsActive()); |
3204 } | 3229 } |
3205 | 3230 |
3206 } // namespace internal | 3231 } // namespace internal |
3207 } // namespace v8 | 3232 } // namespace v8 |
OLD | NEW |