Commit df4df031 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by Commit Bot

Remove --harmony-optional-chaining and --harmony-nullish

Both features shipped in M80.

Bug: v8:9547, v8:9553
Change-Id: I7a34db05796f22bcc112c36a42826e7c926a7364
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2154768
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67219}
parent 1d8f1376
...@@ -253,8 +253,6 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs) ...@@ -253,8 +253,6 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs)
V(harmony_import_meta, "harmony import.meta property") \ V(harmony_import_meta, "harmony import.meta property") \
V(harmony_dynamic_import, "harmony dynamic import") \ V(harmony_dynamic_import, "harmony dynamic import") \
V(harmony_promise_all_settled, "harmony Promise.allSettled") \ V(harmony_promise_all_settled, "harmony Promise.allSettled") \
V(harmony_nullish, "harmony nullish operator") \
V(harmony_optional_chaining, "harmony optional chaining syntax") \
V(harmony_private_methods, "harmony private methods in class literals") V(harmony_private_methods, "harmony private methods in class literals")
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
......
...@@ -4237,8 +4237,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_private_methods) ...@@ -4237,8 +4237,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_private_methods)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_dynamic_import) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_dynamic_import)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_import_meta)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_sequence) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexp_sequence)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_optional_chaining)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_nullish)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_top_level_await) EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_top_level_await)
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
......
...@@ -64,8 +64,6 @@ ParseInfo::ParseInfo(Isolate* isolate, AccountingAllocator* zone_allocator, ...@@ -64,8 +64,6 @@ ParseInfo::ParseInfo(Isolate* isolate, AccountingAllocator* zone_allocator,
set_allow_natives_syntax(FLAG_allow_natives_syntax); set_allow_natives_syntax(FLAG_allow_natives_syntax);
set_allow_harmony_dynamic_import(FLAG_harmony_dynamic_import); set_allow_harmony_dynamic_import(FLAG_harmony_dynamic_import);
set_allow_harmony_import_meta(FLAG_harmony_import_meta); set_allow_harmony_import_meta(FLAG_harmony_import_meta);
set_allow_harmony_optional_chaining(FLAG_harmony_optional_chaining);
set_allow_harmony_nullish(FLAG_harmony_nullish);
set_allow_harmony_private_methods(FLAG_harmony_private_methods); set_allow_harmony_private_methods(FLAG_harmony_private_methods);
set_allow_harmony_top_level_await(FLAG_harmony_top_level_await); set_allow_harmony_top_level_await(FLAG_harmony_top_level_await);
} }
......
...@@ -105,15 +105,11 @@ class V8_EXPORT_PRIVATE ParseInfo { ...@@ -105,15 +105,11 @@ class V8_EXPORT_PRIVATE ParseInfo {
set_allow_harmony_dynamic_import) set_allow_harmony_dynamic_import)
FLAG_ACCESSOR(kAllowHarmonyImportMeta, allow_harmony_import_meta, FLAG_ACCESSOR(kAllowHarmonyImportMeta, allow_harmony_import_meta,
set_allow_harmony_import_meta) set_allow_harmony_import_meta)
FLAG_ACCESSOR(kAllowHarmonyOptionalChaining, allow_harmony_optional_chaining,
set_allow_harmony_optional_chaining)
FLAG_ACCESSOR(kAllowHarmonyPrivateMethods, allow_harmony_private_methods, FLAG_ACCESSOR(kAllowHarmonyPrivateMethods, allow_harmony_private_methods,
set_allow_harmony_private_methods) set_allow_harmony_private_methods)
FLAG_ACCESSOR(kIsOneshotIIFE, is_oneshot_iife, set_is_oneshot_iife) FLAG_ACCESSOR(kIsOneshotIIFE, is_oneshot_iife, set_is_oneshot_iife)
FLAG_ACCESSOR(kCollectSourcePositions, collect_source_positions, FLAG_ACCESSOR(kCollectSourcePositions, collect_source_positions,
set_collect_source_positions) set_collect_source_positions)
FLAG_ACCESSOR(kAllowHarmonyNullish, allow_harmony_nullish,
set_allow_harmony_nullish)
FLAG_ACCESSOR(kAllowHarmonyTopLevelAwait, allow_harmony_top_level_await, FLAG_ACCESSOR(kAllowHarmonyTopLevelAwait, allow_harmony_top_level_await,
set_allow_harmony_top_level_await) set_allow_harmony_top_level_await)
FLAG_ACCESSOR(kREPLMode, is_repl_mode, set_repl_mode) FLAG_ACCESSOR(kREPLMode, is_repl_mode, set_repl_mode)
......
...@@ -286,22 +286,6 @@ class ParserBase { ...@@ -286,22 +286,6 @@ class ParserBase {
V8_INLINE bool has_error() const { return scanner()->has_parser_error(); } V8_INLINE bool has_error() const { return scanner()->has_parser_error(); }
bool allow_harmony_optional_chaining() const {
return scanner()->allow_harmony_optional_chaining();
}
void set_allow_harmony_optional_chaining(bool allow) {
scanner()->set_allow_harmony_optional_chaining(allow);
}
bool allow_harmony_nullish() const {
return scanner()->allow_harmony_nullish();
}
void set_allow_harmony_nullish(bool allow) {
scanner()->set_allow_harmony_nullish(allow);
}
uintptr_t stack_limit() const { return stack_limit_; } uintptr_t stack_limit() const { return stack_limit_; }
void set_stack_limit(uintptr_t stack_limit) { stack_limit_ = stack_limit; } void set_stack_limit(uintptr_t stack_limit) { stack_limit_ = stack_limit; }
......
...@@ -455,8 +455,6 @@ Parser::Parser(ParseInfo* info) ...@@ -455,8 +455,6 @@ Parser::Parser(ParseInfo* info)
set_allow_natives(info->allow_natives_syntax()); set_allow_natives(info->allow_natives_syntax());
set_allow_harmony_dynamic_import(info->allow_harmony_dynamic_import()); set_allow_harmony_dynamic_import(info->allow_harmony_dynamic_import());
set_allow_harmony_import_meta(info->allow_harmony_import_meta()); set_allow_harmony_import_meta(info->allow_harmony_import_meta());
set_allow_harmony_nullish(info->allow_harmony_nullish());
set_allow_harmony_optional_chaining(info->allow_harmony_optional_chaining());
set_allow_harmony_private_methods(info->allow_harmony_private_methods()); set_allow_harmony_private_methods(info->allow_harmony_private_methods());
set_allow_harmony_top_level_await(info->allow_harmony_top_level_await()); set_allow_harmony_top_level_await(info->allow_harmony_top_level_await());
for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount; for (int feature = 0; feature < v8::Isolate::kUseCounterFeatureCount;
......
...@@ -366,11 +366,11 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() { ...@@ -366,11 +366,11 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() {
case Token::CONDITIONAL: case Token::CONDITIONAL:
// ? ?. ?? // ? ?. ??
Advance(); Advance();
if (V8_UNLIKELY(allow_harmony_optional_chaining() && c0_ == '.')) { if (c0_ == '.') {
Advance(); Advance();
if (!IsDecimalDigit(c0_)) return Token::QUESTION_PERIOD; if (!IsDecimalDigit(c0_)) return Token::QUESTION_PERIOD;
PushBack('.'); PushBack('.');
} else if (V8_UNLIKELY(allow_harmony_nullish() && c0_ == '?')) { } else if (c0_ == '?') {
return Select(Token::NULLISH); return Select(Token::NULLISH);
} }
return Token::CONDITIONAL; return Token::CONDITIONAL;
......
...@@ -92,8 +92,6 @@ bool Scanner::BookmarkScope::HasBeenApplied() const { ...@@ -92,8 +92,6 @@ bool Scanner::BookmarkScope::HasBeenApplied() const {
Scanner::Scanner(Utf16CharacterStream* source, bool is_module) Scanner::Scanner(Utf16CharacterStream* source, bool is_module)
: source_(source), : source_(source),
found_html_comment_(false), found_html_comment_(false),
allow_harmony_optional_chaining_(false),
allow_harmony_nullish_(false),
is_module_(is_module), is_module_(is_module),
octal_pos_(Location::invalid()), octal_pos_(Location::invalid()),
octal_message_(MessageTemplate::kNone) { octal_message_(MessageTemplate::kNone) {
......
...@@ -410,18 +410,6 @@ class V8_EXPORT_PRIVATE Scanner { ...@@ -410,18 +410,6 @@ class V8_EXPORT_PRIVATE Scanner {
bool FoundHtmlComment() const { return found_html_comment_; } bool FoundHtmlComment() const { return found_html_comment_; }
bool allow_harmony_optional_chaining() const {
return allow_harmony_optional_chaining_;
}
void set_allow_harmony_optional_chaining(bool allow) {
allow_harmony_optional_chaining_ = allow;
}
bool allow_harmony_nullish() const { return allow_harmony_nullish_; }
void set_allow_harmony_nullish(bool allow) { allow_harmony_nullish_ = allow; }
const Utf16CharacterStream* stream() const { return source_; } const Utf16CharacterStream* stream() const { return source_; }
private: private:
...@@ -730,10 +718,6 @@ class V8_EXPORT_PRIVATE Scanner { ...@@ -730,10 +718,6 @@ class V8_EXPORT_PRIVATE Scanner {
// Whether this scanner encountered an HTML comment. // Whether this scanner encountered an HTML comment.
bool found_html_comment_; bool found_html_comment_;
// Harmony flags to allow ESNext features.
bool allow_harmony_optional_chaining_;
bool allow_harmony_nullish_;
const bool is_module_; const bool is_module_;
// Values parsed from magic comments. // Values parsed from magic comments.
......
...@@ -1534,8 +1534,6 @@ enum ParserFlag { ...@@ -1534,8 +1534,6 @@ enum ParserFlag {
kAllowHarmonyPrivateMethods, kAllowHarmonyPrivateMethods,
kAllowHarmonyDynamicImport, kAllowHarmonyDynamicImport,
kAllowHarmonyImportMeta, kAllowHarmonyImportMeta,
kAllowHarmonyNullish,
kAllowHarmonyOptionalChaining,
}; };
enum ParserSyncTestResult { enum ParserSyncTestResult {
...@@ -1549,9 +1547,6 @@ void SetGlobalFlags(base::EnumSet<ParserFlag> flags) { ...@@ -1549,9 +1547,6 @@ void SetGlobalFlags(base::EnumSet<ParserFlag> flags) {
i::FLAG_harmony_private_methods = flags.contains(kAllowHarmonyPrivateMethods); i::FLAG_harmony_private_methods = flags.contains(kAllowHarmonyPrivateMethods);
i::FLAG_harmony_dynamic_import = flags.contains(kAllowHarmonyDynamicImport); i::FLAG_harmony_dynamic_import = flags.contains(kAllowHarmonyDynamicImport);
i::FLAG_harmony_import_meta = flags.contains(kAllowHarmonyImportMeta); i::FLAG_harmony_import_meta = flags.contains(kAllowHarmonyImportMeta);
i::FLAG_harmony_optional_chaining =
flags.contains(kAllowHarmonyOptionalChaining);
i::FLAG_harmony_nullish = flags.contains(kAllowHarmonyNullish);
} }
void SetParserFlags(i::PreParser* parser, base::EnumSet<ParserFlag> flags) { void SetParserFlags(i::PreParser* parser, base::EnumSet<ParserFlag> flags) {
...@@ -1562,9 +1557,6 @@ void SetParserFlags(i::PreParser* parser, base::EnumSet<ParserFlag> flags) { ...@@ -1562,9 +1557,6 @@ void SetParserFlags(i::PreParser* parser, base::EnumSet<ParserFlag> flags) {
flags.contains(kAllowHarmonyDynamicImport)); flags.contains(kAllowHarmonyDynamicImport));
parser->set_allow_harmony_import_meta( parser->set_allow_harmony_import_meta(
flags.contains(kAllowHarmonyImportMeta)); flags.contains(kAllowHarmonyImportMeta));
parser->set_allow_harmony_optional_chaining(
flags.contains(kAllowHarmonyOptionalChaining));
parser->set_allow_harmony_nullish(flags.contains(kAllowHarmonyNullish));
} }
void TestParserSyncWithFlags(i::Handle<i::String> source, void TestParserSyncWithFlags(i::Handle<i::String> source,
...@@ -1995,10 +1987,7 @@ TEST(OptionalChaining) { ...@@ -1995,10 +1987,7 @@ TEST(OptionalChaining) {
{"", ""}, {"'use strict';", ""}, {nullptr, nullptr}}; {"", ""}, {"'use strict';", ""}, {nullptr, nullptr}};
const char* statement_data[] = {"a?.b", "a?.['b']", "a?.()", nullptr}; const char* statement_data[] = {"a?.b", "a?.['b']", "a?.()", nullptr};
static const ParserFlag flags[] = {kAllowHarmonyOptionalChaining}; RunParserSyncTest(context_data, statement_data, kSuccess);
RunParserSyncTest(context_data, statement_data, kSuccess, nullptr, 0, flags,
1, nullptr, 0, false, true, true);
RunParserSyncTest(context_data, statement_data, kError);
} }
TEST(OptionalChainingTaggedError) { TEST(OptionalChainingTaggedError) {
...@@ -2010,9 +1999,6 @@ TEST(OptionalChainingTaggedError) { ...@@ -2010,9 +1999,6 @@ TEST(OptionalChainingTaggedError) {
{"", ""}, {"'use strict';", ""}, {nullptr, nullptr}}; {"", ""}, {"'use strict';", ""}, {nullptr, nullptr}};
const char* statement_data[] = {"a?.b``", "a?.['b']``", "a?.()``", nullptr}; const char* statement_data[] = {"a?.b``", "a?.['b']``", "a?.()``", nullptr};
static const ParserFlag flags[] = {kAllowHarmonyOptionalChaining};
RunParserSyncTest(context_data, statement_data, kError, nullptr, 9, flags, 1,
nullptr, 0, false, true, true);
RunParserSyncTest(context_data, statement_data, kError); RunParserSyncTest(context_data, statement_data, kError);
} }
...@@ -2028,10 +2014,7 @@ TEST(Nullish) { ...@@ -2028,10 +2014,7 @@ TEST(Nullish) {
"a ?? b ?? c ? d : e", "a ?? b ?? c ? d : e",
nullptr}; nullptr};
static const ParserFlag flags[] = {kAllowHarmonyNullish}; RunParserSyncTest(context_data, statement_data, kSuccess);
RunParserSyncTest(context_data, statement_data, kSuccess, nullptr, 0, flags,
1, nullptr, 0, false, true, true);
RunParserSyncTest(context_data, statement_data, kError);
} }
TEST(NullishNotContained) { TEST(NullishNotContained) {
...@@ -2046,9 +2029,7 @@ TEST(NullishNotContained) { ...@@ -2046,9 +2029,7 @@ TEST(NullishNotContained) {
"a ?? b && c", "a ?? b && c",
nullptr}; nullptr};
static const ParserFlag flags[] = {kAllowHarmonyNullish}; RunParserSyncTest(context_data, statement_data, kError);
RunParserSyncTest(context_data, statement_data, kError, nullptr, 0, flags, 1,
nullptr, 0, false, true, true);
} }
TEST(ErrorsEvalAndArguments) { TEST(ErrorsEvalAndArguments) {
......
...@@ -56,14 +56,12 @@ FEATURE_FLAGS = { ...@@ -56,14 +56,12 @@ FEATURE_FLAGS = {
'FinalizationRegistry': '--harmony-weak-refs-with-cleanup-some', 'FinalizationRegistry': '--harmony-weak-refs-with-cleanup-some',
'WeakRef': '--harmony-weak-refs-with-cleanup-some', 'WeakRef': '--harmony-weak-refs-with-cleanup-some',
'host-gc-required': '--expose-gc-as=v8GC', 'host-gc-required': '--expose-gc-as=v8GC',
'optional-chaining': '--harmony-optional-chaining',
'top-level-await': '--harmony-top-level-await', 'top-level-await': '--harmony-top-level-await',
'regexp-match-indices': '--harmony-regexp-match-indices', 'regexp-match-indices': '--harmony-regexp-match-indices',
# https://github.com/tc39/test262/pull/2395 # https://github.com/tc39/test262/pull/2395
'regexp-named-groups': '--harmony-regexp-match-indices', 'regexp-named-groups': '--harmony-regexp-match-indices',
'class-methods-private': '--harmony-private-methods', 'class-methods-private': '--harmony-private-methods',
'class-static-methods-private': '--harmony-private-methods', 'class-static-methods-private': '--harmony-private-methods',
'coalesce-expression': '--harmony-nullish',
} }
SKIPPED_FEATURES = set([]) SKIPPED_FEATURES = set([])
......
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