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

Side by Side Diff: src/bootstrapper.cc

Issue 1558543002: Add a --harmony-species flag, defining @@species on constructors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « BUILD.gn ('k') | 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/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 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 #define INITIALIZE_FLAG(FLAG) \ 2110 #define INITIALIZE_FLAG(FLAG) \
2111 { \ 2111 { \
2112 Handle<String> name = \ 2112 Handle<String> name = \
2113 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \ 2113 isolate->factory()->NewStringFromAsciiChecked(#FLAG); \
2114 JSObject::AddProperty(container, name, \ 2114 JSObject::AddProperty(container, name, \
2115 isolate->factory()->ToBoolean(FLAG), NONE); \ 2115 isolate->factory()->ToBoolean(FLAG), NONE); \
2116 } 2116 }
2117 2117
2118 INITIALIZE_FLAG(FLAG_harmony_tostring) 2118 INITIALIZE_FLAG(FLAG_harmony_tostring)
2119 INITIALIZE_FLAG(FLAG_harmony_tolength) 2119 INITIALIZE_FLAG(FLAG_harmony_tolength)
2120 INITIALIZE_FLAG(FLAG_harmony_species)
2120 2121
2121 #undef INITIALIZE_FLAG 2122 #undef INITIALIZE_FLAG
2122 } 2123 }
2123 2124
2124 2125
2125 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \ 2126 #define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \
2126 void Genesis::InitializeGlobal_##id() {} 2127 void Genesis::InitializeGlobal_##id() {}
2127 2128
2128 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules) 2129 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_modules)
2129 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy) 2130 EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_sloppy)
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
2327 proxy_function->shared()->set_construct_stub( 2328 proxy_function->shared()->set_construct_stub(
2328 *isolate->builtins()->ProxyConstructor_ConstructStub()); 2329 *isolate->builtins()->ProxyConstructor_ConstructStub());
2329 proxy_function->shared()->set_internal_formal_parameter_count(2); 2330 proxy_function->shared()->set_internal_formal_parameter_count(2);
2330 proxy_function->shared()->set_length(2); 2331 proxy_function->shared()->set_length(2);
2331 2332
2332 native_context()->set_proxy_function(*proxy_function); 2333 native_context()->set_proxy_function(*proxy_function);
2333 InstallFunction(global, name, proxy_function, factory->Object_string()); 2334 InstallFunction(global, name, proxy_function, factory->Object_string());
2334 } 2335 }
2335 2336
2336 2337
2338 void Genesis::InitializeGlobal_harmony_species() {
2339 if (!FLAG_harmony_species) return;
2340 InstallPublicSymbol(factory(), native_context(), "species",
2341 factory()->species_symbol());
2342 }
2343
2344
2337 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target, 2345 Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target,
2338 const char* name, 2346 const char* name,
2339 ElementsKind elements_kind) { 2347 ElementsKind elements_kind) {
2340 // --- I n t e r n a l A r r a y --- 2348 // --- I n t e r n a l A r r a y ---
2341 // An array constructor on the builtins object that works like 2349 // An array constructor on the builtins object that works like
2342 // the public Array constructor, except that its prototype 2350 // the public Array constructor, except that its prototype
2343 // doesn't inherit from Object.prototype. 2351 // doesn't inherit from Object.prototype.
2344 // To be used only for internal work by builtins. Instances 2352 // To be used only for internal work by builtins. Instances
2345 // must not be leaked to user code. 2353 // must not be leaked to user code.
2346 Handle<JSObject> prototype = 2354 Handle<JSObject> prototype =
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 2666
2659 bool Genesis::InstallExperimentalNatives() { 2667 bool Genesis::InstallExperimentalNatives() {
2660 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr}; 2668 static const char* harmony_proxies_natives[] = {"native proxy.js", nullptr};
2661 static const char* harmony_modules_natives[] = {nullptr}; 2669 static const char* harmony_modules_natives[] = {nullptr};
2662 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js", 2670 static const char* harmony_regexps_natives[] = {"native harmony-regexp.js",
2663 nullptr}; 2671 nullptr};
2664 static const char* harmony_tostring_natives[] = {nullptr}; 2672 static const char* harmony_tostring_natives[] = {nullptr};
2665 static const char* harmony_sloppy_natives[] = {nullptr}; 2673 static const char* harmony_sloppy_natives[] = {nullptr};
2666 static const char* harmony_sloppy_function_natives[] = {nullptr}; 2674 static const char* harmony_sloppy_function_natives[] = {nullptr};
2667 static const char* harmony_sloppy_let_natives[] = {nullptr}; 2675 static const char* harmony_sloppy_let_natives[] = {nullptr};
2676 static const char* harmony_species_natives[] = {"native harmony-species.js",
2677 nullptr};
2668 static const char* harmony_unicode_regexps_natives[] = { 2678 static const char* harmony_unicode_regexps_natives[] = {
2669 "native harmony-unicode-regexps.js", nullptr}; 2679 "native harmony-unicode-regexps.js", nullptr};
2670 static const char* harmony_default_parameters_natives[] = {nullptr}; 2680 static const char* harmony_default_parameters_natives[] = {nullptr};
2671 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js", 2681 static const char* harmony_reflect_natives[] = {"native harmony-reflect.js",
2672 nullptr}; 2682 nullptr};
2673 static const char* harmony_destructuring_bind_natives[] = {nullptr}; 2683 static const char* harmony_destructuring_bind_natives[] = {nullptr};
2674 static const char* harmony_destructuring_assignment_natives[] = {nullptr}; 2684 static const char* harmony_destructuring_assignment_natives[] = {nullptr};
2675 static const char* harmony_object_observe_natives[] = { 2685 static const char* harmony_object_observe_natives[] = {
2676 "native harmony-object-observe.js", nullptr}; 2686 "native harmony-object-observe.js", nullptr};
2677 static const char* harmony_sharedarraybuffer_natives[] = { 2687 static const char* harmony_sharedarraybuffer_natives[] = {
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
3357 } 3367 }
3358 3368
3359 3369
3360 // Called when the top-level V8 mutex is destroyed. 3370 // Called when the top-level V8 mutex is destroyed.
3361 void Bootstrapper::FreeThreadResources() { 3371 void Bootstrapper::FreeThreadResources() {
3362 DCHECK(!IsActive()); 3372 DCHECK(!IsActive());
3363 } 3373 }
3364 3374
3365 } // namespace internal 3375 } // namespace internal
3366 } // namespace v8 3376 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698