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

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: Added operator== and operator!= to Scanner::Location 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') | no next file with comments »
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/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 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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 builtins->ObjectVerify(); 2299 builtins->ObjectVerify();
2298 } 2300 }
2299 #endif 2301 #endif
2300 2302
2301 return true; 2303 return true;
2302 } 2304 }
2303 2305
2304 2306
2305 bool Genesis::InstallExperimentalNatives() { 2307 bool Genesis::InstallExperimentalNatives() {
2306 static const char* harmony_arrays_natives[] = { 2308 static const char* harmony_arrays_natives[] = {
2307 "native harmony-array.js", "native harmony-typedarray.js", NULL}; 2309 "native harmony-array.js", "native harmony-typedarray.js", nullptr};
2308 static const char* harmony_array_includes_natives[] = { 2310 static const char* harmony_array_includes_natives[] = {
2309 "native harmony-array-includes.js", NULL}; 2311 "native harmony-array-includes.js", nullptr};
2310 static const char* harmony_proxies_natives[] = {"native proxy.js", NULL}; 2312 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr};
2311 static const char* harmony_classes_natives[] = {NULL}; 2313 static const char* harmony_classes_natives[] = {nullptr};
2312 static const char* harmony_modules_natives[] = {NULL}; 2314 static const char* harmony_modules_natives[] = {nullptr};
2313 static const char* harmony_object_literals_natives[] = {NULL}; 2315 static const char* harmony_object_literals_natives[] = {nullptr};
2314 static const char* harmony_regexps_natives[] = { 2316 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js",
2315 "native harmony-regexp.js", NULL}; 2317 nullptr};
2316 static const char* harmony_arrow_functions_natives[] = {NULL}; 2318 static const char* harmony_arrow_functions_natives[] = {nullptr};
2317 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js", 2319 static const char* harmony_tostring_natives[] = {"native harmony-tostring.js",
2318 NULL}; 2320 nullptr};
2319 static const char* harmony_sloppy_natives[] = {NULL}; 2321 static const char* harmony_sloppy_natives[] = {nullptr};
2320 static const char* harmony_unicode_natives[] = {NULL}; 2322 static const char* harmony_unicode_natives[] = {nullptr};
2321 static const char* harmony_unicode_regexps_natives[] = {NULL}; 2323 static const char* harmony_unicode_regexps_natives[] = {nullptr};
2322 static const char* harmony_computed_property_names_natives[] = {NULL}; 2324 static const char* harmony_computed_property_names_natives[] = {nullptr};
2323 static const char* harmony_rest_parameters_natives[] = {NULL}; 2325 static const char* harmony_rest_parameters_natives[] = {nullptr};
2324 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", 2326 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js",
2325 NULL}; 2327 nullptr};
2326 static const char* harmony_spreadcalls_natives[] = { 2328 static const char* harmony_spreadcalls_natives[] = {
2327 "native harmony-spread.js", NULL}; 2329 "native harmony-spread.js", nullptr};
2330 static const char* harmony_destructuring_natives[] = {nullptr};
2328 2331
2329 for (int i = ExperimentalNatives::GetDebuggerCount(); 2332 for (int i = ExperimentalNatives::GetDebuggerCount();
2330 i < ExperimentalNatives::GetBuiltinsCount(); i++) { 2333 i < ExperimentalNatives::GetBuiltinsCount(); i++) {
2331 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ 2334 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
2332 if (FLAG_##id) { \ 2335 if (FLAG_##id) { \
2333 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ 2336 for (size_t j = 0; id##_natives[j] != NULL; j++) { \
2334 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ 2337 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \
2335 if (strncmp(script_name.start(), id##_natives[j], \ 2338 if (strncmp(script_name.start(), id##_natives[j], \
2336 script_name.length()) == 0) { \ 2339 script_name.length()) == 0) { \
2337 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ 2340 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 return from + sizeof(NestingCounterType); 2963 return from + sizeof(NestingCounterType);
2961 } 2964 }
2962 2965
2963 2966
2964 // Called when the top-level V8 mutex is destroyed. 2967 // Called when the top-level V8 mutex is destroyed.
2965 void Bootstrapper::FreeThreadResources() { 2968 void Bootstrapper::FreeThreadResources() {
2966 DCHECK(!IsActive()); 2969 DCHECK(!IsActive());
2967 } 2970 }
2968 2971
2969 } } // namespace v8::internal 2972 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698