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 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy) | 1740 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy) |
1741 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode) | 1741 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode) |
1742 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps) | 1742 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps) |
1743 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) | 1743 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) |
1744 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) | 1744 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) |
1745 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect) | 1745 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect) |
1746 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) | 1746 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) |
1747 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring) | 1747 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring) |
1748 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object) | 1748 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object) |
1749 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spread_arrays) | 1749 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spread_arrays) |
1750 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sharedarraybuffer) | |
1751 | 1750 |
1752 | 1751 |
1753 void Genesis::InstallNativeFunctions_harmony_proxies() { | 1752 void Genesis::InstallNativeFunctions_harmony_proxies() { |
1754 if (FLAG_harmony_proxies) { | 1753 if (FLAG_harmony_proxies) { |
1755 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap); | 1754 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap); |
1756 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap); | 1755 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap); |
1757 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap); | 1756 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap); |
1758 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate); | 1757 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate); |
1759 } | 1758 } |
1760 } | 1759 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1834 Handle<JSObject> builtins(native_context()->builtins()); | 1833 Handle<JSObject> builtins(native_context()->builtins()); |
1835 | 1834 |
1836 Handle<HeapObject> flag(FLAG_harmony_tostring ? heap()->true_value() | 1835 Handle<HeapObject> flag(FLAG_harmony_tostring ? heap()->true_value() |
1837 : heap()->false_value()); | 1836 : heap()->false_value()); |
1838 Runtime::SetObjectProperty(isolate(), builtins, | 1837 Runtime::SetObjectProperty(isolate(), builtins, |
1839 factory()->harmony_tostring_string(), flag, | 1838 factory()->harmony_tostring_string(), flag, |
1840 STRICT).Assert(); | 1839 STRICT).Assert(); |
1841 } | 1840 } |
1842 | 1841 |
1843 | 1842 |
1844 void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { | |
1845 if (!FLAG_harmony_sharedarraybuffer) return; | |
1846 | |
1847 Handle<JSGlobalObject> global( | |
1848 JSGlobalObject::cast(native_context()->global_object())); | |
1849 | |
1850 Handle<JSFunction> shared_array_buffer_fun = InstallFunction( | |
1851 global, "SharedArrayBuffer", JS_ARRAY_BUFFER_TYPE, | |
1852 JSArrayBuffer::kSizeWithInternalFields, | |
1853 isolate()->initial_object_prototype(), Builtins::kIllegal); | |
1854 native_context()->set_shared_array_buffer_fun(*shared_array_buffer_fun); | |
1855 } | |
1856 | |
1857 | |
1858 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, | 1843 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, |
1859 const char* name, | 1844 const char* name, |
1860 ElementsKind elements_kind) { | 1845 ElementsKind elements_kind) { |
1861 // --- I n t e r n a l A r r a y --- | 1846 // --- I n t e r n a l A r r a y --- |
1862 // An array constructor on the builtins object that works like | 1847 // An array constructor on the builtins object that works like |
1863 // the public Array constructor, except that its prototype | 1848 // the public Array constructor, except that its prototype |
1864 // doesn't inherit from Object.prototype. | 1849 // doesn't inherit from Object.prototype. |
1865 // To be used only for internal work by builtins. Instances | 1850 // To be used only for internal work by builtins. Instances |
1866 // must not be leaked to user code. | 1851 // must not be leaked to user code. |
1867 Handle<JSObject> prototype = | 1852 Handle<JSObject> prototype = |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 static const char* harmony_computed_property_names_natives[] = {nullptr}; | 2397 static const char* harmony_computed_property_names_natives[] = {nullptr}; |
2413 static const char* harmony_rest_parameters_natives[] = {nullptr}; | 2398 static const char* harmony_rest_parameters_natives[] = {nullptr}; |
2414 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", | 2399 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", |
2415 nullptr}; | 2400 nullptr}; |
2416 static const char* harmony_spreadcalls_natives[] = { | 2401 static const char* harmony_spreadcalls_natives[] = { |
2417 "native harmony-spread.js", nullptr}; | 2402 "native harmony-spread.js", nullptr}; |
2418 static const char* harmony_destructuring_natives[] = {nullptr}; | 2403 static const char* harmony_destructuring_natives[] = {nullptr}; |
2419 static const char* harmony_object_natives[] = {"native harmony-object.js", | 2404 static const char* harmony_object_natives[] = {"native harmony-object.js", |
2420 NULL}; | 2405 NULL}; |
2421 static const char* harmony_spread_arrays_natives[] = {nullptr}; | 2406 static const char* harmony_spread_arrays_natives[] = {nullptr}; |
2422 static const char* harmony_sharedarraybuffer_natives[] = { | |
2423 "native harmony-sharedarraybuffer.js", NULL}; | |
2424 | 2407 |
2425 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2408 for (int i = ExperimentalNatives::GetDebuggerCount(); |
2426 i < ExperimentalNatives::GetBuiltinsCount(); i++) { | 2409 i < ExperimentalNatives::GetBuiltinsCount(); i++) { |
2427 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ | 2410 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ |
2428 if (FLAG_##id) { \ | 2411 if (FLAG_##id) { \ |
2429 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ | 2412 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ |
2430 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ | 2413 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ |
2431 if (strncmp(script_name.start(), id##_natives[j], \ | 2414 if (strncmp(script_name.start(), id##_natives[j], \ |
2432 script_name.length()) == 0) { \ | 2415 script_name.length()) == 0) { \ |
2433 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ | 2416 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3062 return from + sizeof(NestingCounterType); | 3045 return from + sizeof(NestingCounterType); |
3063 } | 3046 } |
3064 | 3047 |
3065 | 3048 |
3066 // Called when the top-level V8 mutex is destroyed. | 3049 // Called when the top-level V8 mutex is destroyed. |
3067 void Bootstrapper::FreeThreadResources() { | 3050 void Bootstrapper::FreeThreadResources() { |
3068 DCHECK(!IsActive()); | 3051 DCHECK(!IsActive()); |
3069 } | 3052 } |
3070 | 3053 |
3071 } } // namespace v8::internal | 3054 } } // namespace v8::internal |
OLD | NEW |