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 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_array_includes) | 1586 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_array_includes) |
1587 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_classes) | 1587 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_classes) |
1588 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object_literals) | 1588 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object_literals) |
1589 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_regexps) | 1589 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_regexps) |
1590 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_arrow_functions) | 1590 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_arrow_functions) |
1591 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_numeric_literals) | 1591 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_numeric_literals) |
1592 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_tostring) | 1592 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_tostring) |
1593 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_templates) | 1593 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_templates) |
1594 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy) | 1594 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy) |
1595 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode) | 1595 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode) |
| 1596 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps) |
1596 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) | 1597 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) |
1597 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) | 1598 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) |
1598 | 1599 |
1599 | 1600 |
1600 void Genesis::InstallNativeFunctions_harmony_proxies() { | 1601 void Genesis::InstallNativeFunctions_harmony_proxies() { |
1601 if (FLAG_harmony_proxies) { | 1602 if (FLAG_harmony_proxies) { |
1602 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); | 1603 INSTALL_NATIVE(JSFunction, "DerivedHasTrap", derived_has_trap); |
1603 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); | 1604 INSTALL_NATIVE(JSFunction, "DerivedGetTrap", derived_get_trap); |
1604 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); | 1605 INSTALL_NATIVE(JSFunction, "DerivedSetTrap", derived_set_trap); |
1605 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); | 1606 INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate); |
(...skipping 11 matching lines...) Expand all Loading... |
1617 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrays) | 1618 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrays) |
1618 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes) | 1619 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes) |
1619 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_classes) | 1620 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_classes) |
1620 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals) | 1621 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals) |
1621 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions) | 1622 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions) |
1622 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_literals) | 1623 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_numeric_literals) |
1623 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tostring) | 1624 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tostring) |
1624 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies) | 1625 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies) |
1625 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_templates) | 1626 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_templates) |
1626 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) | 1627 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) |
| 1628 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode) |
1627 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) | 1629 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) |
1628 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) | 1630 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) |
1629 | 1631 |
1630 void Genesis::InitializeGlobal_harmony_regexps() { | 1632 void Genesis::InitializeGlobal_harmony_regexps() { |
1631 Handle<JSObject> builtins(native_context()->builtins()); | 1633 Handle<JSObject> builtins(native_context()->builtins()); |
1632 | 1634 |
1633 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() | 1635 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() |
1634 : heap()->false_value()); | 1636 : heap()->false_value()); |
1635 PropertyAttributes attributes = | 1637 PropertyAttributes attributes = |
1636 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); | 1638 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); |
1637 Runtime::DefineObjectProperty(builtins, factory()->harmony_regexps_string(), | 1639 Runtime::DefineObjectProperty(builtins, factory()->harmony_regexps_string(), |
1638 flag, attributes).Assert(); | 1640 flag, attributes).Assert(); |
1639 } | 1641 } |
1640 | 1642 |
1641 | 1643 |
1642 void Genesis::InitializeGlobal_harmony_unicode() { | 1644 void Genesis::InitializeGlobal_harmony_unicode_regexps() { |
1643 Handle<JSObject> builtins(native_context()->builtins()); | 1645 Handle<JSObject> builtins(native_context()->builtins()); |
1644 | 1646 |
1645 Handle<HeapObject> flag(FLAG_harmony_unicode ? heap()->true_value() | 1647 Handle<HeapObject> flag(FLAG_harmony_unicode_regexps ? heap()->true_value() |
1646 : heap()->false_value()); | 1648 : heap()->false_value()); |
1647 PropertyAttributes attributes = | 1649 PropertyAttributes attributes = |
1648 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); | 1650 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); |
1649 Runtime::DefineObjectProperty(builtins, factory()->harmony_unicode_string(), | 1651 Runtime::DefineObjectProperty(builtins, |
| 1652 factory()->harmony_unicode_regexps_string(), |
1650 flag, attributes).Assert(); | 1653 flag, attributes).Assert(); |
1651 } | 1654 } |
1652 | 1655 |
1653 | 1656 |
1654 Handle<JSFunction> Genesis::InstallInternalArray( | 1657 Handle<JSFunction> Genesis::InstallInternalArray( |
1655 Handle<JSBuiltinsObject> builtins, | 1658 Handle<JSBuiltinsObject> builtins, |
1656 const char* name, | 1659 const char* name, |
1657 ElementsKind elements_kind) { | 1660 ElementsKind elements_kind) { |
1658 // --- I n t e r n a l A r r a y --- | 1661 // --- I n t e r n a l A r r a y --- |
1659 // An array constructor on the builtins object that works like | 1662 // An array constructor on the builtins object that works like |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 static const char* harmony_regexps_natives[] = { | 2202 static const char* harmony_regexps_natives[] = { |
2200 "native harmony-regexp.js", NULL}; | 2203 "native harmony-regexp.js", NULL}; |
2201 static const char* harmony_arrow_functions_natives[] = {NULL}; | 2204 static const char* harmony_arrow_functions_natives[] = {NULL}; |
2202 static const char* harmony_numeric_literals_natives[] = {NULL}; | 2205 static const char* harmony_numeric_literals_natives[] = {NULL}; |
2203 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js", | 2206 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js", |
2204 NULL}; | 2207 NULL}; |
2205 static const char* harmony_templates_natives[] = { | 2208 static const char* harmony_templates_natives[] = { |
2206 "native harmony-templates.js", NULL}; | 2209 "native harmony-templates.js", NULL}; |
2207 static const char* harmony_sloppy_natives[] = {NULL}; | 2210 static const char* harmony_sloppy_natives[] = {NULL}; |
2208 static const char* harmony_unicode_natives[] = {NULL}; | 2211 static const char* harmony_unicode_natives[] = {NULL}; |
| 2212 static const char* harmony_unicode_regexps_natives[] = {NULL}; |
2209 static const char* harmony_computed_property_names_natives[] = {NULL}; | 2213 static const char* harmony_computed_property_names_natives[] = {NULL}; |
2210 static const char* harmony_rest_parameters_natives[] = {NULL}; | 2214 static const char* harmony_rest_parameters_natives[] = {NULL}; |
2211 | 2215 |
2212 for (int i = ExperimentalNatives::GetDebuggerCount(); | 2216 for (int i = ExperimentalNatives::GetDebuggerCount(); |
2213 i < ExperimentalNatives::GetBuiltinsCount(); i++) { | 2217 i < ExperimentalNatives::GetBuiltinsCount(); i++) { |
2214 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ | 2218 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ |
2215 if (FLAG_##id) { \ | 2219 if (FLAG_##id) { \ |
2216 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ | 2220 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ |
2217 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ | 2221 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ |
2218 if (strncmp(script_name.start(), id##_natives[j], \ | 2222 if (strncmp(script_name.start(), id##_natives[j], \ |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2876 return from + sizeof(NestingCounterType); | 2880 return from + sizeof(NestingCounterType); |
2877 } | 2881 } |
2878 | 2882 |
2879 | 2883 |
2880 // Called when the top-level V8 mutex is destroyed. | 2884 // Called when the top-level V8 mutex is destroyed. |
2881 void Bootstrapper::FreeThreadResources() { | 2885 void Bootstrapper::FreeThreadResources() { |
2882 DCHECK(!IsActive()); | 2886 DCHECK(!IsActive()); |
2883 } | 2887 } |
2884 | 2888 |
2885 } } // namespace v8::internal | 2889 } } // namespace v8::internal |
OLD | NEW |