Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: src/bootstrapper.cc

Issue 1065983005: Introduce "expression classifier" to the parser. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | src/preparser.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_regexps) 1665 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_regexps)
1666 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_arrow_functions) 1666 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_arrow_functions)
1667 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_tostring) 1667 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_tostring)
1668 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy) 1668 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sloppy)
1669 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode) 1669 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode)
1670 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps) 1670 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps)
1671 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) 1671 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names)
1672 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) 1672 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters)
1673 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect) 1673 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect)
1674 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) 1674 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls)
1675 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring)
1675 1676
1676 1677
1677 void Genesis::InstallNativeFunctions_harmony_proxies() { 1678 void Genesis::InstallNativeFunctions_harmony_proxies() {
1678 if (FLAG_harmony_proxies) { 1679 if (FLAG_harmony_proxies) {
1679 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap); 1680 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap);
1680 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap); 1681 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap);
1681 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap); 1682 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap);
1682 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate); 1683 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate);
1683 } 1684 }
1684 } 1685 }
1685 1686
1686 #undef INSTALL_NATIVE 1687 #undef INSTALL_NATIVE
1687 1688
1688 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ 1689 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \
1689 void Genesis::InitializeGlobal_##id() {} 1690 void Genesis::InitializeGlobal_##id() {}
1690 1691
1691 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules) 1692 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules)
1692 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrays) 1693 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrays)
1693 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes) 1694 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_array_includes)
1694 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_classes) 1695 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_classes)
1695 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals) 1696 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_literals)
1696 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions) 1697 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions)
1697 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies) 1698 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies)
1698 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) 1699 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
1699 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode) 1700 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode)
1700 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) 1701 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names)
1701 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) 1702 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
1702 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls) 1703 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls)
1704 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring)
1703 1705
1704 void Genesis::InitializeGlobal_harmony_regexps() { 1706 void Genesis::InitializeGlobal_harmony_regexps() {
1705 Handle<JSObject> builtins(native_context()->builtins()); 1707 Handle<JSObject> builtins(native_context()->builtins());
1706 1708
1707 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() 1709 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value()
1708 : heap()->false_value()); 1710 : heap()->false_value());
1709 Runtime::SetObjectProperty(isolate(), builtins, 1711 Runtime::SetObjectProperty(isolate(), builtins,
1710 factory()->harmony_regexps_string(), flag, 1712 factory()->harmony_regexps_string(), flag,
1711 STRICT).Assert(); 1713 STRICT).Assert();
1712 } 1714 }
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 builtins->ObjectVerify(); 2301 builtins->ObjectVerify();
2300 } 2302 }
2301 #endif 2303 #endif
2302 2304
2303 return true; 2305 return true;
2304 } 2306 }
2305 2307
2306 2308
2307 bool Genesis::InstallExperimentalNatives() { 2309 bool Genesis::InstallExperimentalNatives() {
2308 static const char* harmony_arrays_natives[] = { 2310 static const char* harmony_arrays_natives[] = {
2309 "native harmony-array.js", "native harmony-typedarray.js", NULL}; 2311 "native harmony-array.js", "native harmony-typedarray.js", nullptr};
2310 static const char* harmony_array_includes_natives[] = { 2312 static const char* harmony_array_includes_natives[] = {
2311 "native harmony-array-includes.js", NULL}; 2313 "native harmony-array-includes.js", nullptr};
2312 static const char* harmony_proxies_natives[] = {"native proxy.js", NULL}; 2314 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr};
2313 static const char* harmony_classes_natives[] = {NULL}; 2315 static const char* harmony_classes_natives[] = {nullptr};
2314 static const char* harmony_modules_natives[] = {NULL}; 2316 static const char* harmony_modules_natives[] = {nullptr};
2315 static const char* harmony_object_literals_natives[] = {NULL}; 2317 static const char* harmony_object_literals_natives[] = {nullptr};
2316 static const char* harmony_regexps_natives[] = { 2318 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js",
2317 "native harmony-regexp.js", NULL}; 2319 nullptr};
2318 static const char* harmony_arrow_functions_natives[] = {NULL}; 2320 static const char* harmony_arrow_functions_natives[] = {nullptr};
2319 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js", 2321 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js",
2320 NULL}; 2322 nullptr};
2321 static const char* harmony_sloppy_natives[] = {NULL}; 2323 static const char* harmony_sloppy_natives[] = {nullptr};
2322 static const char* harmony_unicode_natives[] = {NULL}; 2324 static const char* harmony_unicode_natives[] = {nullptr};
2323 static const char* harmony_unicode_regexps_natives[] = {NULL}; 2325 static const char* harmony_unicode_regexps_natives[] = {nullptr};
2324 static const char* harmony_computed_property_names_natives[] = {NULL}; 2326 static const char* harmony_computed_property_names_natives[] = {nullptr};
2325 static const char* harmony_rest_parameters_natives[] = {NULL}; 2327 static const char* harmony_rest_parameters_natives[] = {nullptr};
2326 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", 2328 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js",
2327 NULL}; 2329 nullptr};
2328 static const char* harmony_spreadcalls_natives[] = { 2330 static const char* harmony_spreadcalls_natives[] = {
2329 "native harmony-spread.js", NULL}; 2331 "native harmony-spread.js", nullptr};
2332 static const char* harmony_destructuring_natives[] = {nullptr};
2330 2333
2331 for (int i = ExperimentalNatives::GetDebuggerCount(); 2334 for (int i = ExperimentalNatives::GetDebuggerCount();
2332 i < ExperimentalNatives::GetBuiltinsCount(); i++) { 2335 i < ExperimentalNatives::GetBuiltinsCount(); i++) {
2333 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ 2336 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
2334 if (FLAG_##id) { \ 2337 if (FLAG_##id) { \
2335 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ 2338 for (size_t j = 0; id##_natives[j] != NULL; j++) { \
2336 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ 2339 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \
2337 if (strncmp(script_name.start(), id##_natives[j], \ 2340 if (strncmp(script_name.start(), id##_natives[j], \
2338 script_name.length()) == 0) { \ 2341 script_name.length()) == 0) { \
2339 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ 2342 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2962 return from + sizeof(NestingCounterType); 2965 return from + sizeof(NestingCounterType);
2963 } 2966 }
2964 2967
2965 2968
2966 // Called when the top-level V8 mutex is destroyed. 2969 // Called when the top-level V8 mutex is destroyed.
2967 void Bootstrapper::FreeThreadResources() { 2970 void Bootstrapper::FreeThreadResources() {
2968 DCHECK(!IsActive()); 2971 DCHECK(!IsActive());
2969 } 2972 }
2970 2973
2971 } } // namespace v8::internal 2974 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698