Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Remove all harmony runtime flags which shipped in M51
Browse files Browse the repository at this point in the history
Flags removed (all begin with "harmony-"):
  function-name
  instanceof
  iterator-close
  unicode-regexps
  regexp-exec
  regexp-subclass
  species

BUG=v8:3566, v8:3648, v8:3699, v8:4093, v8:4447, v8:4602

Review-Url: https://codereview.chromium.org/2096933002
Cr-Commit-Position: refs/heads/master@{#37235}
  • Loading branch information
ajklein authored and Commit bot committed Jun 24, 2016
1 parent f788bd9 commit c7eb436
Show file tree
Hide file tree
Showing 93 changed files with 179 additions and 577 deletions.
3 changes: 0 additions & 3 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,8 @@ action("js2c_experimental") {
"src/messages.h",
"src/js/harmony-async-await.js",
"src/js/harmony-atomics.js",
"src/js/harmony-regexp-exec.js",
"src/js/harmony-sharedarraybuffer.js",
"src/js/harmony-simd.js",
"src/js/harmony-species.js",
"src/js/harmony-unicode-regexps.js",
"src/js/harmony-string-padding.js",
"src/js/promise-extra.js",
]
Expand Down
36 changes: 0 additions & 36 deletions src/bootstrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2671,7 +2671,6 @@ void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate,
isolate->factory()->ToBoolean(FLAG), NONE); \
}

INITIALIZE_FLAG(FLAG_harmony_species)
INITIALIZE_FLAG(FLAG_intl_extra)

#undef INITIALIZE_FLAG
Expand All @@ -2681,21 +2680,16 @@ void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate,
#define EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(id) \
void Genesis::InitializeGlobal_##id() {}

EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_for_in)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_iterator_close)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_exec)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_named_captures)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_property)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_name)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_sent)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(promise_extra)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(intl_extra)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_explicit_tailcalls)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tailcalls)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_instanceof)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_restrictive_declarations)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_exponentiation_operator)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_string_padding)
Expand All @@ -2719,19 +2713,6 @@ void InstallPublicSymbol(Factory* factory, Handle<Context> native_context,
}


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_sharedarraybuffer() {
if (!FLAG_harmony_sharedarraybuffer) return;

Expand Down Expand Up @@ -2870,13 +2851,6 @@ Handle<JSFunction> Genesis::InstallArrayBuffer(Handle<JSObject> target,
}


void Genesis::InitializeGlobal_harmony_species() {
if (!FLAG_harmony_species) return;
InstallPublicSymbol(factory(), native_context(), "species",
factory()->species_symbol());
}


Handle<JSFunction> Genesis::InstallInternalArray(Handle<JSObject> target,
const char* name,
ElementsKind elements_kind) {
Expand Down Expand Up @@ -3275,28 +3249,18 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {


bool Genesis::InstallExperimentalNatives() {
static const char* harmony_iterator_close_natives[] = {nullptr};
static const char* harmony_species_natives[] = {"native harmony-species.js",
nullptr};
static const char* harmony_explicit_tailcalls_natives[] = {nullptr};
static const char* harmony_tailcalls_natives[] = {nullptr};
static const char* harmony_unicode_regexps_natives[] = {
"native harmony-unicode-regexps.js", nullptr};
static const char* harmony_sharedarraybuffer_natives[] = {
"native harmony-sharedarraybuffer.js", "native harmony-atomics.js", NULL};
static const char* harmony_simd_natives[] = {"native harmony-simd.js",
nullptr};
static const char* harmony_do_expressions_natives[] = {nullptr};
static const char* harmony_for_in_natives[] = {nullptr};
static const char* harmony_regexp_exec_natives[] = {
"native harmony-regexp-exec.js", nullptr};
static const char* harmony_regexp_subclass_natives[] = {nullptr};
static const char* harmony_regexp_lookbehind_natives[] = {nullptr};
static const char* harmony_instanceof_natives[] = {nullptr};
static const char* harmony_restrictive_declarations_natives[] = {nullptr};
static const char* harmony_regexp_named_captures_natives[] = {nullptr};
static const char* harmony_regexp_property_natives[] = {nullptr};
static const char* harmony_function_name_natives[] = {nullptr};
static const char* harmony_function_sent_natives[] = {nullptr};
static const char* promise_extra_natives[] = {"native promise-extra.js",
nullptr};
Expand Down
7 changes: 0 additions & 7 deletions src/flag-definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,8 @@ DEFINE_IMPLICATION(es_staging, move_object_start)

// Features that are shipping (turned on by default, but internal flag remains).
#define HARMONY_SHIPPING(V) \
V(harmony_function_name, "harmony Function name inference") \
V(harmony_instanceof, "harmony instanceof support") \
V(harmony_iterator_close, "harmony iterator finalization") \
V(harmony_unicode_regexps, "harmony unicode regexps") \
V(harmony_regexp_exec, "harmony RegExp exec override behavior") \
V(harmony_regexp_subclass, "harmony regexp subclassing") \
V(harmony_restrictive_declarations, \
"harmony limitations on sloppy mode function declarations") \
V(harmony_species, "harmony Symbol.species") \
V(harmony_exponentiation_operator, "harmony exponentiation operator `**`")

// Once a shipping feature has proved stable in the wild, it will be dropped
Expand Down
2 changes: 0 additions & 2 deletions src/isolate-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR)
#undef NATIVE_CONTEXT_FIELD_ACCESSOR

bool Isolate::IsArraySpeciesLookupChainIntact() {
if (!FLAG_harmony_species) return true;
// Note: It would be nice to have debug checks to make sure that the
// species protector is accurate, but this would be hard to do for most of
// what the protector stands for:
Expand All @@ -121,7 +120,6 @@ bool Isolate::IsArraySpeciesLookupChainIntact() {
}

bool Isolate::IsHasInstanceLookupChainIntact() {
if (!FLAG_harmony_instanceof) return true;
PropertyCell* has_instance_cell = heap()->has_instance_protector();
return has_instance_cell->value() == Smi::FromInt(kArrayProtectorValid);
}
Expand Down
1 change: 0 additions & 1 deletion src/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,6 @@ void Isolate::InvalidateIsConcatSpreadableProtector() {
}

void Isolate::InvalidateArraySpeciesProtector() {
if (!FLAG_harmony_species) return;
DCHECK(factory()->species_protector()->value()->IsSmi());
DCHECK(IsArraySpeciesLookupChainIntact());
factory()->species_protector()->set_value(
Expand Down
23 changes: 10 additions & 13 deletions src/js/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// -------------------------------------------------------------------
// Imports

var FLAG_harmony_species;
var GetIterator;
var GetMethod;
var GlobalArray = global.Array;
Expand All @@ -23,6 +22,7 @@ var MinSimple;
var ObjectHasOwnProperty;
var ObjectToString = utils.ImportNow("object_to_string");
var iteratorSymbol = utils.ImportNow("iterator_symbol");
var speciesSymbol = utils.ImportNow("species_symbol");
var unscopablesSymbol = utils.ImportNow("unscopables_symbol");

utils.Import(function(from) {
Expand All @@ -34,23 +34,12 @@ utils.Import(function(from) {
ObjectHasOwnProperty = from.ObjectHasOwnProperty;
});

utils.ImportFromExperimental(function(from) {
FLAG_harmony_species = from.FLAG_harmony_species;
});

// -------------------------------------------------------------------


function ArraySpeciesCreate(array, length) {
var constructor;

length = INVERT_NEG_ZERO(length);

if (FLAG_harmony_species) {
constructor = %ArraySpeciesConstructor(array);
} else {
constructor = GlobalArray;
}
var constructor = %ArraySpeciesConstructor(array);
return new constructor(length);
}

Expand Down Expand Up @@ -1642,6 +1631,12 @@ function ArrayOf(...args) {
return array;
}


function ArraySpecies() {
return this;
}


// -------------------------------------------------------------------

// Set up non-enumerable constructor property on the Array.prototype
Expand Down Expand Up @@ -1717,6 +1712,8 @@ utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
"includes", getFunction("includes", ArrayIncludes, 1),
]);

utils.InstallGetter(GlobalArray, speciesSymbol, ArraySpecies);

%FinishArrayPrototypeSetup(GlobalArray.prototype);

// The internal Array prototype doesn't need to be fancy, since it's never
Expand Down
8 changes: 8 additions & 0 deletions src/js/arraybuffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var MakeTypeError;
var MaxSimple;
var MinSimple;
var SpeciesConstructor;
var speciesSymbol = utils.ImportNow("species_symbol");

utils.Import(function(from) {
MakeTypeError = from.MakeTypeError;
Expand Down Expand Up @@ -84,6 +85,13 @@ function ArrayBufferSlice(start, end) {
return result;
}


function ArrayBufferSpecies() {
return this;
}

utils.InstallGetter(GlobalArrayBuffer, speciesSymbol, ArrayBufferSpecies);

utils.InstallGetter(GlobalArrayBuffer.prototype, "byteLength",
ArrayBufferGetByteLen);

Expand Down
16 changes: 16 additions & 0 deletions src/js/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var MakeTypeError;
var MapIterator;
var NumberIsNaN;
var SetIterator;
var speciesSymbol = utils.ImportNow("species_symbol");
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");

utils.Import(function(from) {
Expand Down Expand Up @@ -255,6 +256,12 @@ function SetForEach(f, receiver) {
}
}


function SetSpecies() {
return this;
}


// -------------------------------------------------------------------

%SetCode(GlobalSet, SetConstructor);
Expand All @@ -266,6 +273,8 @@ function SetForEach(f, receiver) {

%FunctionSetLength(SetForEach, 1);

utils.InstallGetter(GlobalSet, speciesSymbol, SetSpecies);

// Set up the non-enumerable functions on the Set prototype object.
utils.InstallGetter(GlobalSet.prototype, "size", SetGetSize);
utils.InstallFunctions(GlobalSet.prototype, DONT_ENUM, [
Expand Down Expand Up @@ -435,6 +444,11 @@ function MapForEach(f, receiver) {
}
}


function MapSpecies() {
return this;
}

// -------------------------------------------------------------------

%SetCode(GlobalMap, MapConstructor);
Expand All @@ -446,6 +460,8 @@ function MapForEach(f, receiver) {

%FunctionSetLength(MapForEach, 1);

utils.InstallGetter(GlobalMap, speciesSymbol, MapSpecies);

// Set up the non-enumerable functions on the Map prototype object.
utils.InstallGetter(GlobalMap.prototype, "size", MapGetSize);
utils.InstallFunctions(GlobalMap.prototype, DONT_ENUM, [
Expand Down
37 changes: 0 additions & 37 deletions src/js/harmony-regexp-exec.js

This file was deleted.

60 changes: 0 additions & 60 deletions src/js/harmony-species.js

This file was deleted.

Loading

0 comments on commit c7eb436

Please sign in to comment.