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

Side by Side Diff: src/bootstrapper.cc

Issue 1127063003: [es6] implement default parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't AllocateParameter() if hasParameterExpressions is true Created 5 years, 7 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/parser.cc » ('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/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 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode) 1748 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode)
1749 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps) 1749 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_unicode_regexps)
1750 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names) 1750 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_computed_property_names)
1751 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters) 1751 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_rest_parameters)
1752 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect) 1752 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_reflect)
1753 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls) 1753 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spreadcalls)
1754 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring) 1754 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_destructuring)
1755 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object) 1755 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_object)
1756 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spread_arrays) 1756 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_spread_arrays)
1757 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sharedarraybuffer) 1757 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_sharedarraybuffer)
1758 EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_default_parameters)
1758 1759
1759 1760
1760 void Genesis::InstallNativeFunctions_harmony_proxies() { 1761 void Genesis::InstallNativeFunctions_harmony_proxies() {
1761 if (FLAG_harmony_proxies) { 1762 if (FLAG_harmony_proxies) {
1762 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap); 1763 INSTALL_NATIVE(JSFunction, "$proxyDerivedHasTrap", derived_has_trap);
1763 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap); 1764 INSTALL_NATIVE(JSFunction, "$proxyDerivedGetTrap", derived_get_trap);
1764 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap); 1765 INSTALL_NATIVE(JSFunction, "$proxyDerivedSetTrap", derived_set_trap);
1765 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate); 1766 INSTALL_NATIVE(JSFunction, "$proxyEnumerate", proxy_enumerate);
1766 } 1767 }
1767 } 1768 }
(...skipping 11 matching lines...) Expand all
1779 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions) 1780 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_arrow_functions)
1780 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies) 1781 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_proxies)
1781 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) 1782 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
1782 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode) 1783 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode)
1783 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names) 1784 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_computed_property_names)
1784 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters) 1785 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
1785 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls) 1786 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spreadcalls)
1786 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring) 1787 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring)
1787 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object) 1788 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object)
1788 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_arrays) 1789 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_spread_arrays)
1790 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_default_parameters)
1789 1791
1790 void Genesis::InitializeGlobal_harmony_regexps() { 1792 void Genesis::InitializeGlobal_harmony_regexps() {
1791 Handle<JSObject> builtins(native_context()->builtins()); 1793 Handle<JSObject> builtins(native_context()->builtins());
1792 1794
1793 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value() 1795 Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value()
1794 : heap()->false_value()); 1796 : heap()->false_value());
1795 Runtime::SetObjectProperty(isolate(), builtins, 1797 Runtime::SetObjectProperty(isolate(), builtins,
1796 factory()->harmony_regexps_string(), flag, 1798 factory()->harmony_regexps_string(), flag,
1797 STRICT).Assert(); 1799 STRICT).Assert();
1798 } 1800 }
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2421 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", 2423 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js",
2422 nullptr}; 2424 nullptr};
2423 static const char* harmony_spreadcalls_natives[] = { 2425 static const char* harmony_spreadcalls_natives[] = {
2424 "native harmony-spread.js", nullptr}; 2426 "native harmony-spread.js", nullptr};
2425 static const char* harmony_destructuring_natives[] = {nullptr}; 2427 static const char* harmony_destructuring_natives[] = {nullptr};
2426 static const char* harmony_object_natives[] = {"native harmony-object.js", 2428 static const char* harmony_object_natives[] = {"native harmony-object.js",
2427 NULL}; 2429 NULL};
2428 static const char* harmony_spread_arrays_natives[] = {nullptr}; 2430 static const char* harmony_spread_arrays_natives[] = {nullptr};
2429 static const char* harmony_sharedarraybuffer_natives[] = { 2431 static const char* harmony_sharedarraybuffer_natives[] = {
2430 "native harmony-sharedarraybuffer.js", NULL}; 2432 "native harmony-sharedarraybuffer.js", NULL};
2433 static const char* harmony_default_parameters_natives[] = {nullptr};
2431 2434
2432 for (int i = ExperimentalNatives::GetDebuggerCount(); 2435 for (int i = ExperimentalNatives::GetDebuggerCount();
2433 i < ExperimentalNatives::GetBuiltinsCount(); i++) { 2436 i < ExperimentalNatives::GetBuiltinsCount(); i++) {
2434 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \ 2437 #define INSTALL_EXPERIMENTAL_NATIVES(id, desc) \
2435 if (FLAG_##id) { \ 2438 if (FLAG_##id) { \
2436 for (size_t j = 0; id##_natives[j] != NULL; j++) { \ 2439 for (size_t j = 0; id##_natives[j] != NULL; j++) { \
2437 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \ 2440 Vector<const char> script_name = ExperimentalNatives::GetScriptName(i); \
2438 if (strncmp(script_name.start(), id##_natives[j], \ 2441 if (strncmp(script_name.start(), id##_natives[j], \
2439 script_name.length()) == 0) { \ 2442 script_name.length()) == 0) { \
2440 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \ 2443 if (!CompileExperimentalBuiltin(isolate(), i)) return false; \
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 return from + sizeof(NestingCounterType); 3074 return from + sizeof(NestingCounterType);
3072 } 3075 }
3073 3076
3074 3077
3075 // Called when the top-level V8 mutex is destroyed. 3078 // Called when the top-level V8 mutex is destroyed.
3076 void Bootstrapper::FreeThreadResources() { 3079 void Bootstrapper::FreeThreadResources() {
3077 DCHECK(!IsActive()); 3080 DCHECK(!IsActive());
3078 } 3081 }
3079 3082
3080 } } // namespace v8::internal 3083 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698