Commit d6bde5d9 authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[parsing] Use v8_flags for accessing flag values

Avoid the deprecated FLAG_* syntax, access flag values via the
{v8_flags} struct instead.

R=marja@chromium.org

Bug: v8:12887
Change-Id: Id315d33eee6b45e457766b0ba06c9d21c1e32807
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3899268
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83264}
parent 2523e6c1
......@@ -31,16 +31,16 @@ UnoptimizedCompileFlags::UnoptimizedCompileFlags(Isolate* isolate,
set_collect_type_profile(isolate->is_collecting_type_profile());
set_coverage_enabled(!isolate->is_best_effort_code_coverage());
set_block_coverage_enabled(isolate->is_block_code_coverage());
set_might_always_turbofan(FLAG_always_turbofan ||
FLAG_prepare_always_turbofan);
set_allow_natives_syntax(FLAG_allow_natives_syntax);
set_might_always_turbofan(v8_flags.always_turbofan ||
v8_flags.prepare_always_turbofan);
set_allow_natives_syntax(v8_flags.allow_natives_syntax);
set_allow_lazy_compile(true);
set_collect_source_positions(!FLAG_enable_lazy_source_positions ||
set_collect_source_positions(!v8_flags.enable_lazy_source_positions ||
isolate->NeedsDetailedOptimizedCodeLineInfo());
set_post_parallel_compile_tasks_for_eager_toplevel(
FLAG_parallel_compile_tasks_for_eager_toplevel);
v8_flags.parallel_compile_tasks_for_eager_toplevel);
set_post_parallel_compile_tasks_for_lazy(
FLAG_parallel_compile_tasks_for_lazy);
v8_flags.parallel_compile_tasks_for_lazy);
}
// static
......@@ -86,7 +86,7 @@ UnoptimizedCompileFlags UnoptimizedCompileFlags::ForScriptCompile(
flags.outer_language_mode(), construct_repl_mode(script.is_repl_mode()),
script.origin_options().IsModule() ? ScriptType::kModule
: ScriptType::kClassic,
FLAG_lazy);
v8_flags.lazy);
if (script.is_wrapped()) {
flags.set_function_syntax_kind(FunctionSyntaxKind::kWrapped);
}
......
......@@ -459,7 +459,7 @@ class ParserBase {
}
void set_next_function_is_likely_called() {
next_function_is_likely_called_ = !FLAG_max_lazy;
next_function_is_likely_called_ = !v8_flags.max_lazy;
}
void RecordFunctionOrEvalCall() { contains_function_or_eval_ = true; }
......@@ -3735,7 +3735,7 @@ ParserBase<Impl>::ParseImportExpressions() {
AcceptINScope scope(this, true);
ExpressionT specifier = ParseAssignmentExpressionCoverGrammar();
if (FLAG_harmony_import_assertions && Check(Token::COMMA)) {
if (v8_flags.harmony_import_assertions && Check(Token::COMMA)) {
if (Check(Token::RPAREN)) {
// A trailing comma allowed after the specifier.
return factory()->NewImportCallExpression(specifier, pos);
......@@ -4737,7 +4737,7 @@ typename ParserBase<Impl>::ExpressionT ParserBase<Impl>::ParseClassLiteral(
if (Check(Token::SEMICOLON)) continue;
// Either we're parsing a `static { }` initialization block or a property.
if (FLAG_harmony_class_static_blocks && peek() == Token::STATIC &&
if (v8_flags.harmony_class_static_blocks && peek() == Token::STATIC &&
PeekAhead() == Token::LBRACE) {
BlockT static_block = ParseClassStaticBlock(&class_info);
impl()->AddClassStaticBlock(static_block, &class_info);
......
......@@ -379,7 +379,7 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name,
Runtime::FunctionForName(name->raw_data(), name->length());
// Be more permissive when fuzzing. Intrinsics are not supported.
if (FLAG_fuzzing) {
if (v8_flags.fuzzing) {
return NewV8RuntimeFunctionForFuzzing(function, args, pos);
}
......@@ -413,7 +413,7 @@ Expression* Parser::NewV8Intrinsic(const AstRawString* name,
Expression* Parser::NewV8RuntimeFunctionForFuzzing(
const Runtime::Function* function, const ScopedPtrList<Expression>& args,
int pos) {
CHECK(FLAG_fuzzing);
CHECK(v8_flags.fuzzing);
// Intrinsics are not supported for fuzzing. Only allow allowlisted runtime
// functions. Also prevent later errors due to too few arguments and just
......@@ -1363,7 +1363,7 @@ ImportAssertions* Parser::ParseImportAssertClause() {
auto import_assertions = zone()->New<ImportAssertions>(zone());
if (!FLAG_harmony_import_assertions) {
if (!v8_flags.harmony_import_assertions) {
return import_assertions;
}
......
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