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

Unified Diff: src/bootstrapper.cc

Issue 1408223004: Expose string/regexp related public symbols on harmony flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 0b63ceb8f980bd336b027ba46b5c067a656a19d6..4029e8f17b1d100923fa809fa04e6b77dba2864d 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2157,10 +2157,8 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_rest_parameters)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_default_parameters)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_observe)
-EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_concat_spreadable)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps)
-EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tostring)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_completion)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tolength)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions)
@@ -2180,6 +2178,47 @@ static void SimpleInstallFunction(Handle<JSObject>& base, const char* name,
}
+void InstallPublicSymbol(Factory* factory, Handle<Context> native_context,
+ const char* name, Handle<Symbol> value) {
+ Handle<JSGlobalObject> global(
+ JSGlobalObject::cast(native_context->global_object()));
+ Handle<String> symbol_string = factory->InternalizeUtf8String("Symbol");
+ Handle<JSObject> symbol = Handle<JSObject>::cast(
+ JSObject::GetProperty(global, symbol_string).ToHandleChecked());
+ Handle<String> name_string = factory->InternalizeUtf8String(name);
+ PropertyAttributes attributes =
+ static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
+ JSObject::AddProperty(symbol, name_string, value, attributes);
+}
+
+
+void Genesis::InitializeGlobal_harmony_tostring() {
+ if (!FLAG_harmony_tostring) return;
+ InstallPublicSymbol(factory(), native_context(), "toStringTag",
+ factory()->to_string_tag_symbol());
+}
+
+
+void Genesis::InitializeGlobal_harmony_concat_spreadable() {
+ if (!FLAG_harmony_concat_spreadable) return;
+ InstallPublicSymbol(factory(), native_context(), "isConcatSpreadable",
+ factory()->is_concat_spreadable_symbol());
+}
+
+
+void Genesis::InitializeGlobal_harmony_regexp_subclass() {
+ if (!FLAG_harmony_regexp_subclass) return;
+ InstallPublicSymbol(factory(), native_context(), "match",
+ factory()->match_symbol());
+ InstallPublicSymbol(factory(), native_context(), "replace",
+ factory()->replace_symbol());
+ InstallPublicSymbol(factory(), native_context(), "search",
+ factory()->search_symbol());
+ InstallPublicSymbol(factory(), native_context(), "split",
+ factory()->split_symbol());
+}
+
+
void Genesis::InitializeGlobal_harmony_reflect() {
if (!FLAG_harmony_reflect) return;
@@ -2616,8 +2655,7 @@ bool Genesis::InstallExperimentalNatives() {
static const char* harmony_modules_natives[] = {nullptr};
static const char* harmony_regexps_natives[] = {"native harmony-regexp.js",
nullptr};
- static const char* harmony_tostring_natives[] = {"native harmony-tostring.js",
- nullptr};
+ static const char* harmony_tostring_natives[] = {nullptr};
static const char* harmony_sloppy_natives[] = {nullptr};
static const char* harmony_sloppy_function_natives[] = {nullptr};
static const char* harmony_sloppy_let_natives[] = {nullptr};
@@ -2631,13 +2669,13 @@ bool Genesis::InstallExperimentalNatives() {
"native harmony-object-observe.js", nullptr};
static const char* harmony_sharedarraybuffer_natives[] = {
"native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL};
- static const char* harmony_concat_spreadable_natives[] = {
- "native harmony-concat-spreadable.js", nullptr};
+ static const char* harmony_concat_spreadable_natives[] = {nullptr};
static const char* harmony_simd_natives[] = {"native harmony-simd.js",
nullptr};
static const char* harmony_tolength_natives[] = {nullptr};
static const char* harmony_completion_natives[] = {nullptr};
static const char* harmony_do_expressions_natives[] = {nullptr};
+ static const char* harmony_regexp_subclass_natives[] = {nullptr};
for (int i = ExperimentalNatives::GetDebuggerCount();
i < ExperimentalNatives::GetBuiltinsCount(); i++) {
« 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