Commit 49898aad authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

Remove always-true --harmony-async-iteration runtime flag

It was shipped in Chrome 63.

Bug: v8:5855
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: Icc00b8300622d1c7b5662be8ac5e425b9781f666
Reviewed-on: https://chromium-review.googlesource.com/858381
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50558}
parent 2838109f
......@@ -2174,6 +2174,8 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
false);
// Install well-known symbols.
InstallConstant(isolate, symbol_fun, "asyncIterator",
factory->async_iterator_symbol());
InstallConstant(isolate, symbol_fun, "hasInstance",
factory->has_instance_symbol());
InstallConstant(isolate, symbol_fun, "isConcatSpreadable",
......@@ -4408,13 +4410,6 @@ void Genesis::InitializeGlobal_harmony_array_prototype_values() {
NONE);
}
void Genesis::InitializeGlobal_harmony_async_iteration() {
if (!FLAG_harmony_async_iteration) return;
Handle<JSFunction> symbol_fun(native_context()->symbol_function());
InstallConstant(isolate(), symbol_fun, "asyncIterator",
factory()->async_iterator_symbol());
}
void Genesis::InitializeGlobal_harmony_promise_finally() {
if (!FLAG_harmony_promise_finally) return;
......
......@@ -223,7 +223,6 @@ DEFINE_IMPLICATION(harmony_class_fields, harmony_static_fields)
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_regexp_named_captures, "harmony regexp named captures") \
V(harmony_regexp_property, "harmony Unicode regexp property classes") \
V(harmony_async_iteration, "harmony async iteration") \
V(harmony_function_tostring, "harmony Function.prototype.toString") \
V(harmony_promise_finally, "harmony Promise.prototype.finally")
......
......@@ -282,7 +282,6 @@ class ParserBase {
allow_harmony_static_fields_(false),
allow_harmony_dynamic_import_(false),
allow_harmony_import_meta_(false),
allow_harmony_async_iteration_(false),
allow_harmony_optional_catch_binding_(false) {}
#define ALLOW_ACCESSORS(name) \
......@@ -296,7 +295,6 @@ class ParserBase {
ALLOW_ACCESSORS(harmony_static_fields);
ALLOW_ACCESSORS(harmony_dynamic_import);
ALLOW_ACCESSORS(harmony_import_meta);
ALLOW_ACCESSORS(harmony_async_iteration);
ALLOW_ACCESSORS(harmony_optional_catch_binding);
#undef ALLOW_ACCESSORS
......@@ -1536,7 +1534,6 @@ class ParserBase {
bool allow_harmony_static_fields_;
bool allow_harmony_dynamic_import_;
bool allow_harmony_import_meta_;
bool allow_harmony_async_iteration_;
bool allow_harmony_optional_catch_binding_;
friend class DiscardableZoneScope;
......@@ -2131,8 +2128,7 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParsePropertyName(
!scanner()->HasAnyLineTerminatorAfterNext()) {
Consume(Token::ASYNC);
token = peek();
if (token == Token::MUL && allow_harmony_async_iteration() &&
!scanner()->HasAnyLineTerminatorBeforeNext()) {
if (token == Token::MUL && !scanner()->HasAnyLineTerminatorBeforeNext()) {
Consume(Token::MUL);
token = peek();
*is_generator = true;
......@@ -3993,7 +3989,7 @@ ParserBase<Impl>::ParseHoistableDeclaration(
const bool is_async = flags & ParseFunctionFlags::kIsAsync;
DCHECK(!is_generator || !is_async);
if (allow_harmony_async_iteration() && is_async && Check(Token::MUL)) {
if (is_async && Check(Token::MUL)) {
// Async generator
is_generator = true;
}
......@@ -4568,7 +4564,7 @@ ParserBase<Impl>::ParseAsyncFunctionLiteral(bool* ok) {
IdentifierT name = impl()->NullIdentifier();
FunctionLiteral::FunctionType type = FunctionLiteral::kAnonymousExpression;
bool is_generator = allow_harmony_async_iteration() && Check(Token::MUL);
bool is_generator = Check(Token::MUL);
const bool kIsAsync = true;
const FunctionKind kind = FunctionKindFor(is_generator, kIsAsync);
......@@ -4957,8 +4953,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseStatement(
case Token::WHILE:
return ParseWhileStatement(labels, ok);
case Token::FOR:
if (V8_UNLIKELY(allow_harmony_async_iteration() && is_async_function() &&
PeekAhead() == Token::AWAIT)) {
if (V8_UNLIKELY(is_async_function() && PeekAhead() == Token::AWAIT)) {
return ParseForAwaitStatement(labels, ok);
}
return ParseForStatement(labels, ok);
......@@ -5955,7 +5950,6 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseForAwaitStatement(
ZoneList<const AstRawString*>* labels, bool* ok) {
// for await '(' ForDeclaration of AssignmentExpression ')'
DCHECK(is_async_function());
DCHECK(allow_harmony_async_iteration());
int stmt_pos = peek_position();
......
......@@ -546,7 +546,6 @@ Parser::Parser(ParseInfo* info)
set_allow_harmony_static_fields(FLAG_harmony_static_fields);
set_allow_harmony_dynamic_import(FLAG_harmony_dynamic_import);
set_allow_harmony_import_meta(FLAG_harmony_import_meta);
set_allow_harmony_async_iteration(FLAG_harmony_async_iteration);
set_allow_harmony_bigint(FLAG_harmony_bigint);
set_allow_harmony_optional_catch_binding(FLAG_harmony_optional_catch_binding);
for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
......
......@@ -304,7 +304,6 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
SET_ALLOW(harmony_static_fields);
SET_ALLOW(harmony_dynamic_import);
SET_ALLOW(harmony_import_meta);
SET_ALLOW(harmony_async_iteration);
SET_ALLOW(harmony_bigint);
SET_ALLOW(harmony_optional_catch_binding);
#undef SET_ALLOW
......
......@@ -415,7 +415,6 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT
}
if (options.do_expressions()) i::FLAG_harmony_do_expressions = true;
if (options.async_iteration()) i::FLAG_harmony_async_iteration = true;
if (options.public_fields()) i::FLAG_harmony_public_fields = true;
if (options.static_fields()) i::FLAG_harmony_static_fields = true;
......@@ -426,7 +425,6 @@ void GenerateExpectationsFile(std::ostream& stream, // NOLINT
}
i::FLAG_harmony_do_expressions = false;
i::FLAG_harmony_async_iteration = false;
i::FLAG_harmony_public_fields = false;
i::FLAG_harmony_static_fields = false;
}
......@@ -475,7 +473,6 @@ void PrintUsage(const char* exec_path) {
"Specify the name of the test function.\n"
" --top-level Process top level code, not the top-level function.\n"
" --do-expressions Enable harmony_do_expressions flag.\n"
" --async-iteration Enable harmony_async_iteration flag.\n"
" --public-fields Enable harmony_public_fields flag.\n"
" --static-fields Enable harmony_static_fields flag.\n"
" --output=file.name\n"
......
......@@ -2380,8 +2380,6 @@ TEST(Generators) {
}
TEST(AsyncGenerators) {
bool old_flag = i::FLAG_harmony_async_iteration;
i::FLAG_harmony_async_iteration = true;
InitializedIgnitionHandleScope scope;
BytecodeExpectationsPrinter printer(CcTest::isolate());
printer.set_wrap(false);
......@@ -2404,7 +2402,6 @@ TEST(AsyncGenerators) {
CHECK(CompareTexts(BuildActual(printer, snippets),
LoadGolden("AsyncGenerators.golden")));
i::FLAG_harmony_async_iteration = old_flag;
}
TEST(Modules) {
......@@ -2522,8 +2519,6 @@ TEST(NewAndSpread) {
}
TEST(ForAwaitOf) {
bool old_flag = i::FLAG_harmony_async_iteration;
i::FLAG_harmony_async_iteration = true;
InitializedIgnitionHandleScope scope;
BytecodeExpectationsPrinter printer(CcTest::isolate());
printer.set_wrap(false);
......@@ -2556,8 +2551,6 @@ TEST(ForAwaitOf) {
CHECK(CompareTexts(BuildActual(printer, snippets),
LoadGolden("ForAwaitOf.golden")));
i::FLAG_harmony_async_iteration = old_flag;
}
TEST(StandardForLoop) {
......
......@@ -1317,7 +1317,6 @@ enum ParserFlag {
kAllowHarmonyPublicFields,
kAllowHarmonyStaticFields,
kAllowHarmonyDynamicImport,
kAllowHarmonyAsyncIteration,
kAllowHarmonyImportMeta,
kAllowHarmonyDoExpressions,
kAllowHarmonyOptionalCatchBinding,
......@@ -1336,7 +1335,6 @@ void SetGlobalFlags(i::EnumSet<ParserFlag> flags) {
i::FLAG_harmony_static_fields = flags.Contains(kAllowHarmonyStaticFields);
i::FLAG_harmony_dynamic_import = flags.Contains(kAllowHarmonyDynamicImport);
i::FLAG_harmony_import_meta = flags.Contains(kAllowHarmonyImportMeta);
i::FLAG_harmony_async_iteration = flags.Contains(kAllowHarmonyAsyncIteration);
i::FLAG_harmony_do_expressions = flags.Contains(kAllowHarmonyDoExpressions);
i::FLAG_harmony_optional_catch_binding =
flags.Contains(kAllowHarmonyOptionalCatchBinding);
......@@ -1354,8 +1352,6 @@ void SetParserFlags(i::PreParser* parser, i::EnumSet<ParserFlag> flags) {
flags.Contains(kAllowHarmonyDynamicImport));
parser->set_allow_harmony_import_meta(
flags.Contains(kAllowHarmonyImportMeta));
parser->set_allow_harmony_async_iteration(
flags.Contains(kAllowHarmonyAsyncIteration));
parser->set_allow_harmony_do_expressions(
flags.Contains(kAllowHarmonyDoExpressions));
parser->set_allow_harmony_optional_catch_binding(
......@@ -2633,7 +2629,6 @@ TEST(ErrorsObjectLiteralChecking) {
"static async get x : 0",
"async static x(){}",
"*async x(){}",
"async *x(){}",
"async x*(){}",
"async x : 0",
"async 0 : 0",
......@@ -4688,6 +4683,7 @@ TEST(ClassBodyNoErrors) {
"*g() {};",
"; *g() {}",
"*g() {}; *h(x) {}",
"async *x(){}",
"static() {}",
"get static() {}",
"set static(v) {}",
......@@ -4708,6 +4704,7 @@ TEST(ClassBodyNoErrors) {
"*async(){}",
"static async(){}",
"static *async(){}",
"static async *x(){}",
// Escaped 'static' should be allowed anywhere
// static-as-PropertyName is.
......@@ -5107,7 +5104,6 @@ TEST(ClassAsyncErrors) {
const char* async_data[] = {
"*async x(){}",
"async *(){}",
"async *x(){}",
"async get x(){}",
"async set x(y){}",
"async x : 0",
......@@ -5117,7 +5113,6 @@ TEST(ClassAsyncErrors) {
"static *async x(){}",
"static async *(){}",
"static async *x(){}",
"static async get x(){}",
"static async set x(y){}",
"static async x : 0",
......@@ -7131,19 +7126,12 @@ TEST(DestructuringNegativeTests) {
"{...[ x = 5 ] }",
"{...x.f }",
"{...x[0] }",
"async function* a() {}",
nullptr
};
const char* async_gen_data[] = {
"async function* a() {}",
nullptr
};
// clang-format on
RunParserSyncTest(context_data, data, kError);
static const ParserFlag async_gen_flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(context_data, async_gen_data, kError, nullptr, 0,
async_gen_flags, arraysize(async_gen_flags));
}
{ // All modes.
......@@ -8399,6 +8387,8 @@ TEST(FunctionDeclarationError) {
"label: function* f() { }",
"if (true) async function f() { }",
"label: async function f() { }",
"if (true) async function* f() { }",
"label: async function* f() { }",
nullptr
};
// Valid only in sloppy mode.
......@@ -8420,20 +8410,6 @@ TEST(FunctionDeclarationError) {
// In sloppy mode, sloppy_data is successful
RunParserSyncTest(sloppy_context, error_data, kError);
RunParserSyncTest(sloppy_context, sloppy_data, kSuccess);
// No single statement async iterators
// clang-format off
const char* async_iterator_data[] = {
"if (true) async function* f() { }",
"label: async function* f() { }",
nullptr,
};
// clang-format on
static const ParserFlag flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(sloppy_context, async_iterator_data, kError, nullptr, 0,
flags, arraysize(flags));
RunParserSyncTest(strict_context, async_iterator_data, kError, nullptr, 0,
flags, arraysize(flags));
}
TEST(ExponentiationOperator) {
......@@ -8599,6 +8575,9 @@ TEST(AsyncAwait) {
"var O = { method(await) { return await; } };",
"var O = { *method() { var await = 1; return await; } };",
"var O = { *method(await) { return await; } };",
"var asyncFn = async function*() {}",
"async function* f() {}",
"var O = { async *method() {} };",
"(function await() {})",
nullptr
......@@ -8637,10 +8616,7 @@ TEST(AsyncAwaitErrors) {
"var f = async() => await;",
"var asyncFn = async function*() {}",
"async function* f() {}",
"var O = { *async method() {} };",
"var O = { async *method() {} };",
"var O = { async method*() {} };",
"var asyncFn = async function(x = await 1) { return x; }",
......@@ -9579,24 +9555,18 @@ TEST(ForAwaitOf) {
nullptr
};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(context_data, expr_data, kSuccess, nullptr, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data2, expr_data, kSuccess, nullptr, 0,
always_flags, arraysize(always_flags));
RunParserSyncTest(context_data, expr_data, kSuccess);
RunParserSyncTest(context_data2, expr_data, kSuccess);
RunParserSyncTest(context_data, var_data, kSuccess, nullptr, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, var_data, kSuccess);
// TODO(marja): PreParser doesn't report early errors.
// (https://bugs.chromium.org/p/v8/issues/detail?id=2728)
// RunParserSyncTest(context_data2, var_data, kError, nullptr, 0,
// always_flags,
// arraysize(always_flags));
RunParserSyncTest(context_data, lexical_data, kSuccess, nullptr, 0,
always_flags, arraysize(always_flags));
RunParserSyncTest(context_data2, lexical_data, kSuccess, nullptr, 0,
always_flags, arraysize(always_flags));
RunParserSyncTest(context_data, lexical_data, kSuccess);
RunParserSyncTest(context_data2, lexical_data, kSuccess);
}
TEST(ForAwaitOfErrors) {
......@@ -9757,9 +9727,7 @@ TEST(ForAwaitOfErrors) {
nullptr
};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(context_data, data, kError, nullptr, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kError);
}
TEST(ForAwaitOfFunctionDeclaration) {
......@@ -9782,9 +9750,7 @@ TEST(ForAwaitOfFunctionDeclaration) {
};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(context_data, data, kError, nullptr, 0, always_flags,
arraysize(always_flags));
RunParserSyncTest(context_data, data, kError);
}
TEST(AsyncGenerator) {
......@@ -9881,9 +9847,7 @@ TEST(AsyncGenerator) {
};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(context_data, statement_data, kSuccess, nullptr, 0,
always_flags, arraysize(always_flags));
RunParserSyncTest(context_data, statement_data, kSuccess);
}
TEST(AsyncGeneratorErrors) {
......@@ -9971,9 +9935,7 @@ TEST(AsyncGeneratorErrors) {
};
// clang-format on
static const ParserFlag always_flags[] = {kAllowHarmonyAsyncIteration};
RunParserSyncTest(context_data, statement_data, kError, nullptr, 0,
always_flags, arraysize(always_flags));
RunParserSyncTest(context_data, statement_data, kError);
}
TEST(LexicalLoopVariable) {
......
......@@ -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-async-iteration
let {session, contextGroup, Protocol} = InspectorTest.start('Checks that async chains for for-await-of are correct.');
contextGroup.addScript(`
......
......@@ -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 --no-always-opt --harmony-async-iteration
// Flags: --allow-natives-syntax --no-always-opt
// Flags: --no-opt
// Files: test/mjsunit/code-coverage-utils.js
......
......@@ -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 --no-always-opt --harmony-async-iteration --opt
// Flags: --allow-natives-syntax --no-always-opt --opt
// Files: test/mjsunit/code-coverage-utils.js
%DebugToggleBlockCoverage(true);
......
......@@ -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 --no-always-opt --harmony-async-iteration
// Flags: --allow-natives-syntax --no-always-opt
// Files: test/mjsunit/code-coverage-utils.js
%DebugToggleBlockCoverage(true);
......
......@@ -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-async-iteration
function ID(x) {
return x;
}
......
......@@ -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-unsafe-function-constructor --harmony-async-iteration
// Flags: --allow-unsafe-function-constructor
(function testReflectConstructArity() {
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-async-iteration
var done = false;
async function f() {
......
......@@ -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-async-iteration --allow-natives-syntax
// Flags: --allow-natives-syntax
let testFailed = false;
let testFailure;
......
......@@ -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-async-iteration --allow-natives-syntax
// Flags: --allow-natives-syntax
function assertThrowsAsync(run, errorType, message) {
var actual;
......
......@@ -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-async-iteration --allow-natives-syntax
// Flags: --allow-natives-syntax
// .return() from state suspendedStart with undefined
testAsync(test => {
......
......@@ -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-async-iteration --allow-natives-syntax
// Flags: --allow-natives-syntax
testAsync(test => {
test.plan(2);
......
......@@ -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-async-iteration --allow-natives-syntax
// Flags: --allow-natives-syntax
// Yield a thenable which is never settled
testAsync(test => {
......
......@@ -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-async-iteration --allow-natives-syntax
// Flags: --allow-natives-syntax
let testFailed = false;
let testFailure;
......
......@@ -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-async-iteration
// Crash with --verify-heap
(async function() { for await (let { a = class b { } } of [{}]) { } })();
(async function() { var a; for await ({ a = class b { } } of [{}]) { } })();
......@@ -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-async-iteration
// Flags: --allow-natives-syntax
async function* gen([[notIterable]] = [null]) {}
assertThrows(() => gen(), TypeError);
......
......@@ -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-async-iteration
assertTrue(Symbol.hasOwnProperty('asyncIterator'));
assertEquals('symbol', typeof Symbol.asyncIterator);
assertInstanceof(Object(Symbol.asyncIterator), Symbol);
......
......@@ -43,7 +43,6 @@ from testrunner.outproc import test262
# TODO(littledan): move the flag mapping into the status file
FEATURE_FLAGS = {
'async-iteration': '--harmony-async-iteration',
'BigInt': '--harmony-bigint',
'regexp-named-groups': '--harmony-regexp-named-captures',
'regexp-unicode-property-escapes': '--harmony-regexp-property',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment