Commit c3cf3d06 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[parser] Skipping inner funcs: drop "experimental" from flag name.

Makes ClusterFuzz start fuzzing with the flag on.

BUG=v8:5516

Change-Id: Ia80f7d22f12fe25efb226102a896e8b0e3537947
Reviewed-on: https://chromium-review.googlesource.com/610000
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47366}
parent 7e15bf81
......@@ -616,7 +616,7 @@ void DeclarationScope::HoistSloppyBlockFunctions(AstNodeFactory* factory) {
Variable* var = DeclareVariableName(name, VAR);
if (var != kDummyPreParserVariable &&
var != kDummyPreParserLexicalVariable) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
var->set_maybe_assigned();
}
}
......@@ -677,7 +677,7 @@ void DeclarationScope::Analyze(ParseInfo* info) {
scope->set_should_eager_compile();
if (scope->must_use_preparsed_scope_data_) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
DCHECK_EQ(scope->scope_type_, ScopeType::FUNCTION_SCOPE);
info->consumed_preparsed_scope_data()->RestoreScopeAllocationData(scope);
}
......@@ -1047,7 +1047,7 @@ Variable* DeclarationScope::DeclareParameterName(
if (name == ast_value_factory->arguments_string()) {
has_arguments_parameter_ = true;
}
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
Variable* var;
if (declare_as_local) {
var = Declare(zone(), name, VAR);
......@@ -1216,7 +1216,7 @@ Variable* Scope::DeclareVariableName(const AstRawString* name,
DCHECK(scope_info_.is_null());
// Declare the variable in the declaration scope.
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
Variable* var = LookupLocal(name);
DCHECK_NE(var, kDummyPreParserLexicalVariable);
DCHECK_NE(var, kDummyPreParserVariable);
......@@ -1507,7 +1507,7 @@ void DeclarationScope::ResetAfterPreparsing(AstValueFactory* ast_value_factory,
}
void Scope::SavePreParsedScopeData() {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
if (ProducedPreParsedScopeData::ScopeIsSkippableFunctionScope(this)) {
AsDeclarationScope()->SavePreParsedScopeDataForDeclarationScope();
}
......@@ -1519,7 +1519,7 @@ void Scope::SavePreParsedScopeData() {
void DeclarationScope::SavePreParsedScopeDataForDeclarationScope() {
if (produced_preparsed_scope_data_ != nullptr) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
produced_preparsed_scope_data_->SaveScopeAllocationData(this);
}
}
......@@ -1528,8 +1528,7 @@ void DeclarationScope::AnalyzePartially(AstNodeFactory* ast_node_factory) {
DCHECK(!force_eager_compilation_);
VariableProxy* unresolved = nullptr;
if (!outer_scope_->is_script_scope() ||
FLAG_experimental_preparser_scope_analysis) {
if (!outer_scope_->is_script_scope() || FLAG_preparser_scope_analysis) {
// Try to resolve unresolved variables for this Scope and migrate those
// which cannot be resolved inside. It doesn't make sense to try to resolve
// them in the outer Scopes here, because they are incomplete.
......@@ -1552,7 +1551,7 @@ void DeclarationScope::AnalyzePartially(AstNodeFactory* ast_node_factory) {
function_ = ast_node_factory->CopyVariable(function_);
}
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
SavePreParsedScopeData();
}
}
......@@ -2271,8 +2270,7 @@ void ModuleScope::AllocateModuleVariables() {
void Scope::AllocateVariablesRecursively() {
DCHECK(!already_resolved_);
DCHECK_IMPLIES(!FLAG_experimental_preparser_scope_analysis,
num_stack_slots_ == 0);
DCHECK_IMPLIES(!FLAG_preparser_scope_analysis, num_stack_slots_ == 0);
// Don't allocate variables of preparsed scopes.
if (is_declaration_scope() && AsDeclarationScope()->was_lazily_parsed()) {
......
......@@ -850,7 +850,7 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
Handle<SharedFunctionInfo> shared(function->shared());
ParseInfo parse_info(shared);
parse_info.set_lazy_compile();
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
if (shared->HasPreParsedScopeData()) {
Handle<PreParsedScopeData> data(
PreParsedScopeData::cast(shared->preparsed_scope_data()));
......
......@@ -885,7 +885,7 @@ DEFINE_BOOL(trace_maps, false, "trace map creation")
// preparser.cc
DEFINE_BOOL(use_parse_tasks, false, "use parse tasks")
DEFINE_BOOL(trace_parse_tasks, false, "trace parse task creation")
DEFINE_NEG_IMPLICATION(use_parse_tasks, experimental_preparser_scope_analysis)
DEFINE_NEG_IMPLICATION(use_parse_tasks, preparser_scope_analysis)
// parser.cc
DEFINE_BOOL(allow_natives_syntax, false, "allow natives syntax")
......@@ -895,10 +895,9 @@ DEFINE_BOOL(lazy_inner_functions, true, "enable lazy parsing inner functions")
DEFINE_BOOL(aggressive_lazy_inner_functions, false,
"even lazier inner function parsing")
DEFINE_IMPLICATION(aggressive_lazy_inner_functions, lazy_inner_functions)
DEFINE_BOOL(experimental_preparser_scope_analysis, false,
DEFINE_BOOL(preparser_scope_analysis, false,
"perform scope analysis for preparsed inner functions")
DEFINE_IMPLICATION(experimental_preparser_scope_analysis,
aggressive_lazy_inner_functions)
DEFINE_IMPLICATION(preparser_scope_analysis, aggressive_lazy_inner_functions)
// simulator-arm.cc, simulator-arm64.cc and simulator-mips.cc
DEFINE_BOOL(trace_sim, false, "Trace simulator execution")
......
......@@ -13846,7 +13846,7 @@ void SharedFunctionInfo::InitFromFunctionLiteral(
// value after compiling, but avoid overwriting values set manually by the
// bootstrapper.
shared_info->set_length(SharedFunctionInfo::kInvalidLength);
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
ProducedPreParsedScopeData* scope_data =
lit->produced_preparsed_scope_data();
if (scope_data != nullptr) {
......
......@@ -2844,7 +2844,7 @@ Parser::LazyParsingResult Parser::SkipFunction(
// FIXME(marja): There are 3 ways to skip functions now. Unify them.
DCHECK_NOT_NULL(consumed_preparsed_scope_data_);
if (consumed_preparsed_scope_data_->HasData()) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
int end_position;
LanguageMode language_mode;
int num_inner_functions;
......
......@@ -109,7 +109,7 @@ ProducedPreParsedScopeData::DataGatheringScope::DataGatheringScope(
: function_scope_(function_scope),
preparser_(preparser),
produced_preparsed_scope_data_(nullptr) {
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
ProducedPreParsedScopeData* parent =
preparser->produced_preparsed_scope_data();
Zone* main_zone = preparser->main_zone();
......@@ -123,7 +123,7 @@ ProducedPreParsedScopeData::DataGatheringScope::DataGatheringScope(
}
ProducedPreParsedScopeData::DataGatheringScope::~DataGatheringScope() {
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
preparser_->set_produced_preparsed_scope_data(
produced_preparsed_scope_data_->parent_);
}
......@@ -131,7 +131,7 @@ ProducedPreParsedScopeData::DataGatheringScope::~DataGatheringScope() {
void ProducedPreParsedScopeData::DataGatheringScope::MarkFunctionAsSkippable(
int end_position, int num_inner_functions) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
DCHECK_NOT_NULL(produced_preparsed_scope_data_);
DCHECK_NOT_NULL(produced_preparsed_scope_data_->parent_);
produced_preparsed_scope_data_->parent_->AddSkippableFunction(
......@@ -144,7 +144,7 @@ void ProducedPreParsedScopeData::AddSkippableFunction(
int start_position, int end_position, int num_parameters,
int num_inner_functions, LanguageMode language_mode,
bool uses_super_property) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
DCHECK_EQ(scope_data_start_, -1);
DCHECK(previously_produced_preparsed_scope_data_.is_null());
......@@ -174,7 +174,7 @@ void ProducedPreParsedScopeData::AddSkippableFunction(
void ProducedPreParsedScopeData::SaveScopeAllocationData(
DeclarationScope* scope) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
DCHECK(previously_produced_preparsed_scope_data_.is_null());
DCHECK_EQ(scope_data_start_, -1);
DCHECK_EQ(backing_store_.size() % SkippableFunctionDataOffsets::kSize, 0);
......@@ -434,7 +434,7 @@ ConsumedPreParsedScopeData::GetDataForSkippableFunction(
void ConsumedPreParsedScopeData::RestoreScopeAllocationData(
DeclarationScope* scope) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
DCHECK_EQ(scope->scope_type(), ScopeType::FUNCTION_SCOPE);
DCHECK(!data_.is_null());
......
......@@ -149,7 +149,7 @@ PreParser::PreParseResult PreParser::PreParseFunction(
// functions.
std::unique_ptr<ProducedPreParsedScopeData::DataGatheringScope>
produced_preparsed_scope_data_scope;
if (FLAG_experimental_preparser_scope_analysis && !IsArrowFunction(kind)) {
if (FLAG_preparser_scope_analysis && !IsArrowFunction(kind)) {
track_unresolved_variables_ = true;
produced_preparsed_scope_data_scope.reset(
new ProducedPreParsedScopeData::DataGatheringScope(function_scope,
......@@ -301,7 +301,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
produced_preparsed_scope_data_scope;
if (!function_state_->next_function_is_likely_called() &&
produced_preparsed_scope_data_ != nullptr) {
DCHECK(FLAG_experimental_preparser_scope_analysis);
DCHECK(FLAG_preparser_scope_analysis);
DCHECK(track_unresolved_variables_);
produced_preparsed_scope_data_scope.reset(
new ProducedPreParsedScopeData::DataGatheringScope(function_scope,
......@@ -387,7 +387,7 @@ PreParserStatement PreParser::BuildParameterInitializationBlock(
const PreParserFormalParameters& parameters, bool* ok) {
DCHECK(!parameters.is_simple);
DCHECK(scope()->is_function_scope());
if (FLAG_experimental_preparser_scope_analysis &&
if (FLAG_preparser_scope_analysis &&
scope()->AsDeclarationScope()->calls_sloppy_eval()) {
DCHECK_NOT_NULL(produced_preparsed_scope_data_);
// We cannot replicate the Scope structure constructed by the Parser,
......@@ -431,7 +431,7 @@ void PreParser::DeclareAndInitializeVariables(
declaration_descriptor->scope->RemoveUnresolved(variable);
Variable* var = scope()->DeclareVariableName(
variable->raw_name(), declaration_descriptor->mode);
if (FLAG_experimental_preparser_scope_analysis) {
if (FLAG_preparser_scope_analysis) {
MarkLoopVariableAsAssigned(declaration_descriptor->scope, var);
// This is only necessary if there is an initializer, but we don't have
// that information here. Consequently, the preparser sometimes says
......
......@@ -33,7 +33,7 @@ enum class Bailout { BAILOUT_IF_OUTER_SLOPPY, NO };
TEST(PreParserScopeAnalysis) {
i::FLAG_lazy_inner_functions = true;
i::FLAG_experimental_preparser_scope_analysis = true;
i::FLAG_preparser_scope_analysis = true;
i::FLAG_aggressive_lazy_inner_functions = true;
i::Isolate* isolate = CcTest::i_isolate();
i::Factory* factory = isolate->factory();
......@@ -773,7 +773,7 @@ TEST(PreParserScopeAnalysis) {
// https://bugs.chromium.org/p/chromium/issues/detail?id=753896. Should not
// crash.
TEST(Regress753896) {
i::FLAG_experimental_preparser_scope_analysis = true;
i::FLAG_preparser_scope_analysis = true;
i::Isolate* isolate = CcTest::i_isolate();
i::Factory* factory = isolate->factory();
i::HandleScope scope(isolate);
......
......@@ -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: --experimental-preparser-scope-analysis
// Flags: --preparser-scope-analysis
// Tests for cases where PreParser must bail out of creating data for skipping
// inner functions, since it cannot replicate the Scope structure created by
......
......@@ -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: --experimental-preparser-scope-analysis
// Flags: --preparser-scope-analysis
(function TestBasicSkipping() {
var result = 0;
......
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