Remove flags for ES2015 features shipped in M48

This removes --harmony-completion, --harmony-concat-spreadable, and
--harmony-tolength and moves the appropriate tests from harmony/ to es6/.

Review URL: https://codereview.chromium.org/1667453002

Cr-Commit-Position: refs/heads/master@{#33712}
This commit is contained in:
adamk 2016-02-03 12:51:26 -08:00 committed by Commit bot
parent bb1d2817f8
commit 8a4a5bf9e0
18 changed files with 42 additions and 78 deletions

View File

@ -2294,7 +2294,6 @@ void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate,
}
INITIALIZE_FLAG(FLAG_harmony_tostring)
INITIALIZE_FLAG(FLAG_harmony_tolength)
INITIALIZE_FLAG(FLAG_harmony_species)
#undef INITIALIZE_FLAG
@ -2314,8 +2313,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_destructuring_assignment)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_object_observe)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_completion)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tolength)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_do_expressions)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_lookbehind)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_function_name)
@ -2344,13 +2341,6 @@ void Genesis::InitializeGlobal_harmony_tostring() {
}
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",
@ -2948,11 +2938,8 @@ 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[] = {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};
static const char* harmony_regexp_lookbehind_natives[] = {nullptr};

View File

@ -1261,7 +1261,6 @@ bool IterateElements(Isolate* isolate, Handle<JSReceiver> receiver,
bool HasConcatSpreadableModifier(Isolate* isolate, Handle<JSArray> obj) {
DCHECK(isolate->IsFastArrayConstructorPrototypeChainIntact());
if (!FLAG_harmony_concat_spreadable) return false;
Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol());
Maybe<bool> maybe = JSReceiver::HasProperty(obj, key);
return maybe.FromMaybe(false);
@ -1271,14 +1270,12 @@ bool HasConcatSpreadableModifier(Isolate* isolate, Handle<JSArray> obj) {
static Maybe<bool> IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) {
HandleScope handle_scope(isolate);
if (!obj->IsJSReceiver()) return Just(false);
if (FLAG_harmony_concat_spreadable) {
Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol());
Handle<Object> value;
MaybeHandle<Object> maybeValue =
i::Runtime::GetObjectProperty(isolate, obj, key);
if (!maybeValue.ToHandle(&value)) return Nothing<bool>();
if (!value->IsUndefined()) return Just(value->BooleanValue());
}
return Object::IsArray(obj);
}

View File

@ -224,11 +224,8 @@ DEFINE_IMPLICATION(es_staging, move_object_start)
V(harmony_default_parameters, "harmony default parameters") \
V(harmony_destructuring_assignment, "harmony destructuring assignment") \
V(harmony_destructuring_bind, "harmony destructuring bind") \
V(harmony_concat_spreadable, "harmony isConcatSpreadable") \
V(harmony_object_observe, "harmony Object.observe") \
V(harmony_tolength, "harmony ToLength") \
V(harmony_tostring, "harmony toString") \
V(harmony_completion, "harmony completion value semantics") \
V(harmony_regexps, "harmony regular expression extensions") \
V(harmony_sloppy, "harmony features in sloppy mode") \
V(harmony_sloppy_let, "harmony let in sloppy mode") \

View File

@ -12,7 +12,6 @@
// Imports
var AddIndexedProperty;
var FLAG_harmony_tolength;
var FLAG_harmony_species;
var GetIterator;
var GetMethod;
@ -48,7 +47,6 @@ utils.Import(function(from) {
});
utils.ImportFromExperimental(function(from) {
FLAG_harmony_tolength = from.FLAG_harmony_tolength;
FLAG_harmony_species = from.FLAG_harmony_species;
});
@ -431,7 +429,7 @@ function ArrayToString() {
function InnerArrayToLocaleString(array, length) {
var len = TO_LENGTH_OR_UINT32(length);
var len = TO_LENGTH(length);
if (len === 0) return "";
return Join(array, len, ',', ConvertToLocaleString);
}
@ -469,7 +467,7 @@ function ArrayJoin(separator) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.join");
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
return InnerArrayJoin(separator, array, length);
}
@ -498,7 +496,7 @@ function ArrayPop() {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.pop");
var array = TO_OBJECT(this);
var n = TO_LENGTH_OR_UINT32(array.length);
var n = TO_LENGTH(array.length);
if (n == 0) {
array.length = n;
return;
@ -516,7 +514,7 @@ function ArrayPop() {
function ObservedArrayPush() {
var n = TO_LENGTH_OR_UINT32(this.length);
var n = TO_LENGTH(this.length);
var m = %_ArgumentsLength();
try {
@ -544,7 +542,7 @@ function ArrayPush() {
return ObservedArrayPush.apply(this, arguments);
var array = TO_OBJECT(this);
var n = TO_LENGTH_OR_UINT32(array.length);
var n = TO_LENGTH(array.length);
var m = %_ArgumentsLength();
// It appears that there is no enforced, absolute limit on the number of
@ -650,7 +648,7 @@ function ArrayReverse() {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.reverse");
var array = TO_OBJECT(this);
var len = TO_LENGTH_OR_UINT32(array.length);
var len = TO_LENGTH(array.length);
var isArray = IS_ARRAY(array);
if (UseSparseVariant(array, len, isArray, len)) {
@ -685,7 +683,7 @@ function ArrayShift() {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.shift");
var array = TO_OBJECT(this);
var len = TO_LENGTH_OR_UINT32(array.length);
var len = TO_LENGTH(array.length);
if (len === 0) {
array.length = 0;
@ -712,7 +710,7 @@ function ArrayShift() {
function ObservedArrayUnshift() {
var len = TO_LENGTH_OR_UINT32(this.length);
var len = TO_LENGTH(this.length);
var num_arguments = %_ArgumentsLength();
try {
@ -739,7 +737,7 @@ function ArrayUnshift(arg1) { // length == 1
return ObservedArrayUnshift.apply(this, arguments);
var array = TO_OBJECT(this);
var len = TO_LENGTH_OR_UINT32(array.length);
var len = TO_LENGTH(array.length);
var num_arguments = %_ArgumentsLength();
if (len > 0 && UseSparseVariant(array, len, IS_ARRAY(array), len) &&
@ -763,7 +761,7 @@ function ArraySlice(start, end) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.slice");
var array = TO_OBJECT(this);
var len = TO_LENGTH_OR_UINT32(array.length);
var len = TO_LENGTH(array.length);
var start_i = TO_INTEGER(start);
var end_i = len;
@ -834,7 +832,7 @@ function ComputeSpliceDeleteCount(delete_count, num_arguments, len, start_i) {
function ObservedArraySplice(start, delete_count) {
var num_arguments = %_ArgumentsLength();
var len = TO_LENGTH_OR_UINT32(this.length);
var len = TO_LENGTH(this.length);
var start_i = ComputeSpliceStartIndex(TO_INTEGER(start), len);
var del_count = ComputeSpliceDeleteCount(delete_count, num_arguments, len,
start_i);
@ -881,7 +879,7 @@ function ArraySplice(start, delete_count) {
var num_arguments = %_ArgumentsLength();
var array = TO_OBJECT(this);
var len = TO_LENGTH_OR_UINT32(array.length);
var len = TO_LENGTH(array.length);
var start_i = ComputeSpliceStartIndex(TO_INTEGER(start), len);
var del_count = ComputeSpliceDeleteCount(delete_count, num_arguments, len,
start_i);
@ -1217,7 +1215,7 @@ function ArraySort(comparefn) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.sort");
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
return InnerArraySort(array, length, comparefn);
}
@ -1248,7 +1246,7 @@ function ArrayFilter(f, receiver) {
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
var result = ArraySpeciesCreate(array, 0);
return InnerArrayFilter(f, receiver, array, length, result);
@ -1274,7 +1272,7 @@ function ArrayForEach(f, receiver) {
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
InnerArrayForEach(f, receiver, array, length);
}
@ -1301,7 +1299,7 @@ function ArraySome(f, receiver) {
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
return InnerArraySome(f, receiver, array, length);
}
@ -1325,7 +1323,7 @@ function ArrayEvery(f, receiver) {
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
return InnerArrayEvery(f, receiver, array, length);
}
@ -1336,7 +1334,7 @@ function ArrayMap(f, receiver) {
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f);
var result = ArraySpeciesCreate(array, length);
var is_array = IS_ARRAY(array);
@ -1411,7 +1409,7 @@ function InnerArrayIndexOf(array, element, index, length) {
function ArrayIndexOf(element, index) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.indexOf");
var length = TO_LENGTH_OR_UINT32(this.length);
var length = TO_LENGTH(this.length);
return InnerArrayIndexOf(this, element, index, length);
}
@ -1469,7 +1467,7 @@ function InnerArrayLastIndexOf(array, element, index, length, argumentsLength) {
function ArrayLastIndexOf(element, index) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.lastIndexOf");
var length = TO_LENGTH_OR_UINT32(this.length);
var length = TO_LENGTH(this.length);
return InnerArrayLastIndexOf(this, element, index, length,
%_ArgumentsLength());
}
@ -1508,7 +1506,7 @@ function ArrayReduce(callback, current) {
// Pull out the length so that modifications to the length in the
// loop will not affect the looping and side effects are visible.
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
return InnerArrayReduce(callback, current, array, length,
%_ArgumentsLength());
}
@ -1548,7 +1546,7 @@ function ArrayReduceRight(callback, current) {
// Pull out the length so that side effects are visible before the
// callback function is checked.
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
return InnerArrayReduceRight(callback, current, array, length,
%_ArgumentsLength());
}
@ -1701,7 +1699,7 @@ function ArrayFill(value, start, end) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill");
var array = TO_OBJECT(this);
var length = TO_LENGTH_OR_UINT32(array.length);
var length = TO_LENGTH(array.length);
return InnerArrayFill(value, start, end, array, length);
}

View File

@ -114,8 +114,6 @@ macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
macro TO_INT32(arg) = ((arg) | 0);
macro TO_UINT32(arg) = ((arg) >>> 0);
macro TO_LENGTH(arg) = (%_ToLength(arg));
macro TO_LENGTH_OR_UINT32(arg) = (FLAG_harmony_tolength ? TO_LENGTH(arg) : TO_UINT32(arg));
macro TO_LENGTH_OR_INTEGER(arg) = (FLAG_harmony_tolength ? TO_LENGTH(arg) : TO_INTEGER(arg));
macro TO_STRING(arg) = (%_ToString(arg));
macro TO_NUMBER(arg) = (%_ToNumber(arg));
macro TO_OBJECT(arg) = (%_ToObject(arg));

View File

@ -10,7 +10,6 @@
// Imports
var ExpandReplacement;
var FLAG_harmony_tolength;
var GlobalObject = global.Object;
var GlobalRegExp = global.RegExp;
var GlobalRegExpPrototype;
@ -22,10 +21,6 @@ var replaceSymbol = utils.ImportNow("replace_symbol");
var searchSymbol = utils.ImportNow("search_symbol");
var splitSymbol = utils.ImportNow("split_symbol");
utils.ImportFromExperimental(function(from) {
FLAG_harmony_tolength = from.FLAG_harmony_tolength;
});
utils.Import(function(from) {
ExpandReplacement = from.ExpandReplacement;
MakeTypeError = from.MakeTypeError;
@ -176,7 +171,7 @@ function RegExpExecJS(string) {
// Conversion is required by the ES2015 specification (RegExpBuiltinExec
// algorithm, step 4) even if the value is discarded for non-global RegExps.
var i = TO_LENGTH_OR_INTEGER(lastIndex);
var i = TO_LENGTH(lastIndex);
var updateLastIndex = REGEXP_GLOBAL(this) || REGEXP_STICKY(this);
if (updateLastIndex) {
@ -223,7 +218,7 @@ function RegExpTest(string) {
// Conversion is required by the ES2015 specification (RegExpBuiltinExec
// algorithm, step 4) even if the value is discarded for non-global RegExps.
var i = TO_LENGTH_OR_INTEGER(lastIndex);
var i = TO_LENGTH(lastIndex);
if (REGEXP_GLOBAL(this) || REGEXP_STICKY(this)) {
if (i < 0 || i > string.length) {

View File

@ -77,7 +77,7 @@ function SymbolKeyFor(symbol) {
utils.InstallConstants(GlobalSymbol, [
// TODO(rossberg): expose when implemented.
// "hasInstance", hasInstanceSymbol,
// "isConcatSpreadable", isConcatSpreadableSymbol,
"isConcatSpreadable", isConcatSpreadableSymbol,
"iterator", iteratorSymbol,
// TODO(yangguo): expose when implemented.
// "match", matchSymbol,

View File

@ -148,7 +148,7 @@ void Processor::VisitIfStatement(IfStatement* node) {
is_set_ = is_set_ && set_in_then;
replacement_ = node;
if (FLAG_harmony_completion && !is_set_) {
if (!is_set_) {
is_set_ = true;
replacement_ = AssignUndefinedBefore(node);
}
@ -164,7 +164,7 @@ void Processor::VisitIterationStatement(IterationStatement* node) {
is_set_ = is_set_ && set_after;
replacement_ = node;
if (FLAG_harmony_completion && !is_set_) {
if (!is_set_) {
is_set_ = true;
replacement_ = AssignUndefinedBefore(node);
}
@ -208,7 +208,7 @@ void Processor::VisitTryCatchStatement(TryCatchStatement* node) {
is_set_ = is_set_ && set_in_try;
replacement_ = node;
if (FLAG_harmony_completion && !is_set_) {
if (!is_set_) {
is_set_ = true;
replacement_ = AssignUndefinedBefore(node);
}
@ -245,7 +245,7 @@ void Processor::VisitTryFinallyStatement(TryFinallyStatement* node) {
node->set_try_block(replacement_->AsBlock());
replacement_ = node;
if (FLAG_harmony_completion && !is_set_) {
if (!is_set_) {
is_set_ = true;
replacement_ = AssignUndefinedBefore(node);
}
@ -263,7 +263,7 @@ void Processor::VisitSwitchStatement(SwitchStatement* node) {
is_set_ = is_set_ && set_after;
replacement_ = node;
if (FLAG_harmony_completion && !is_set_) {
if (!is_set_) {
is_set_ = true;
replacement_ = AssignUndefinedBefore(node);
}
@ -287,7 +287,7 @@ void Processor::VisitWithStatement(WithStatement* node) {
node->set_statement(replacement_);
replacement_ = node;
if (FLAG_harmony_completion && !is_set_) {
if (!is_set_) {
is_set_ = true;
replacement_ = AssignUndefinedBefore(node);
}

View File

@ -745,6 +745,7 @@
'test-heap/AddInstructionChangesNewSpacePromotion': [PASS, FAIL],
'test-api/ExternalWrap': [PASS, FAIL],
'test-decls/CrossScriptReferencesHarmony': [PASS, FAIL],
'test-lockers/IsolateNestedLocking': [PASS, FAIL],
}], # ignition == True and arch == arm64
]

View File

@ -24517,7 +24517,6 @@ TEST(AbortOnUncaughtExceptionNoAbort) {
TEST(AccessCheckedIsConcatSpreadable) {
i::FLAG_harmony_concat_spreadable = true;
v8::Isolate* isolate = CcTest::isolate();
HandleScope scope(isolate);
LocalContext env;

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-concat-spreadable --harmony-proxies --harmony-reflect
// Flags: --harmony-proxies --harmony-reflect
(function testArrayConcatArity() {
"use strict";

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-tolength
// Test array functions do not cause infinite loops when length is negative,
// max_value, etc.

View File

@ -25,8 +25,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --harmony-completion
"use strict";
function props(x) {

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-completion --harmony-sloppy-let --no-legacy-const
// Flags: --harmony-sloppy-let --no-legacy-const
function assertUndef(x) {

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-tolength
'use strict';
let regexp = /x/g;

View File

@ -26,7 +26,6 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --no-legacy-const --harmony-sloppy --harmony-sloppy-let
// Flags: --harmony-completion
function props(x) {
var array = [];

View File

@ -4,7 +4,6 @@
// Flags: --harmony-do-expressions --harmony-sloppy-let --allow-natives-syntax
// Flags: --harmony-default-parameters --harmony-destructuring-bind
// Flags: --harmony-completion
function returnValue(v) { return v; }
function MyError() {}

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax --harmony-concat-spreadable
// Flags: --allow-natives-syntax
function arguments_with_length_getter(f) {
arguments.__defineGetter__('length', f);