From 7fcf658a7b1c82041931046d306eb74ad8aae474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marja=20H=C3=B6ltt=C3=A4?= Date: Tue, 18 Apr 2017 16:43:15 +0200 Subject: [PATCH] [parser] Skipping inner funcs: make the flag experimental. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The feature is not quite ready for getting ClusterFuzzed. BUG=v8:5516 Change-Id: I90a42f950727c8ecf46cb2987c9a459b2ba1f5a7 Reviewed-on: https://chromium-review.googlesource.com/480400 Commit-Queue: Marja Hölttä Reviewed-by: Daniel Vogelheim Cr-Commit-Position: refs/heads/master@{#44693} --- src/ast/scopes.cc | 14 ++++++++------ src/compiler.cc | 4 ++-- src/flag-definitions.h | 4 ++-- src/parsing/parser.cc | 2 +- src/parsing/preparser.cc | 8 +++++--- test/cctest/parsing/test-preparser.cc | 2 +- test/mjsunit/skipping-inner-functions.js | 2 +- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc index 99be5cd343..f0dbdd219a 100644 --- a/src/ast/scopes.cc +++ b/src/ast/scopes.cc @@ -612,7 +612,7 @@ void DeclarationScope::HoistSloppyBlockFunctions(AstNodeFactory* factory) { Variable* var = DeclareVariableName(name, VAR); if (var != kDummyPreParserVariable && var != kDummyPreParserLexicalVariable) { - DCHECK(FLAG_preparser_scope_analysis); + DCHECK(FLAG_experimental_preparser_scope_analysis); var->set_maybe_assigned(); } } @@ -662,7 +662,7 @@ void DeclarationScope::Analyze(ParseInfo* info, Isolate* isolate, scope->set_should_eager_compile(); if (scope->must_use_preparsed_scope_data_) { - DCHECK(FLAG_preparser_scope_analysis); + DCHECK(FLAG_experimental_preparser_scope_analysis); DCHECK_NOT_NULL(info->preparsed_scope_data()); DCHECK_EQ(scope->scope_type_, ScopeType::FUNCTION_SCOPE); info->preparsed_scope_data()->RestoreData(scope); @@ -1044,7 +1044,7 @@ Variable* DeclarationScope::DeclareParameterName( if (name == ast_value_factory->arguments_string()) { has_arguments_parameter_ = true; } - if (FLAG_preparser_scope_analysis) { + if (FLAG_experimental_preparser_scope_analysis) { Variable* var = Declare(zone(), name, VAR); params_.Add(var, zone()); return var; @@ -1205,7 +1205,7 @@ Variable* Scope::DeclareVariableName(const AstRawString* name, DCHECK(scope_info_.is_null()); // Declare the variable in the declaration scope. - if (FLAG_preparser_scope_analysis) { + if (FLAG_experimental_preparser_scope_analysis) { Variable* var = LookupLocal(name); DCHECK_NE(var, kDummyPreParserLexicalVariable); DCHECK_NE(var, kDummyPreParserVariable); @@ -1552,7 +1552,8 @@ void DeclarationScope::AnalyzePartially( arguments_ = nullptr; } - if (FLAG_preparser_scope_analysis && preparsed_scope_data->Producing()) { + if (FLAG_experimental_preparser_scope_analysis && + preparsed_scope_data->Producing()) { // Store the information needed for allocating the locals of this scope // and its inner scopes. preparsed_scope_data->SaveData(this); @@ -2257,7 +2258,8 @@ void ModuleScope::AllocateModuleVariables() { void Scope::AllocateVariablesRecursively() { DCHECK(!already_resolved_); - DCHECK_IMPLIES(!FLAG_preparser_scope_analysis, num_stack_slots_ == 0); + DCHECK_IMPLIES(!FLAG_experimental_preparser_scope_analysis, + num_stack_slots_ == 0); // Don't allocate variables of preparsed scopes. if (is_declaration_scope() && AsDeclarationScope()->was_lazily_parsed()) { diff --git a/src/compiler.cc b/src/compiler.cc index fe7d8758b4..0bccb558c2 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -1082,7 +1082,7 @@ MaybeHandle GetLazyCode(Handle function) { ParseInfo parse_info(handle(function->shared())); Zone compile_zone(isolate->allocator(), ZONE_NAME); CompilationInfo info(&compile_zone, &parse_info, isolate, function); - if (FLAG_preparser_scope_analysis) { + if (FLAG_experimental_preparser_scope_analysis) { Handle shared(function->shared()); Handle