Index: src/ast/scopes.cc |
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc |
index bbc8155e9bd3f5f54070d480170f6ed4faef91cc..5f03f66ecbb96ed2610618cb3e3a3199058fed46 100644 |
--- a/src/ast/scopes.cc |
+++ b/src/ast/scopes.cc |
@@ -251,6 +251,16 @@ bool Scope::HasSimpleParameters() { |
return !scope->is_function_scope() || scope->has_simple_parameters(); |
} |
+void DeclarationScope::set_asm_module() { |
+ asm_module_ = true; |
+ // Mark any existing inner function scopes as asm function scopes. |
+ for (Scope* inner = inner_scope_; inner != nullptr; inner = inner->sibling_) { |
+ if (inner->is_function_scope()) { |
+ inner->AsDeclarationScope()->set_asm_function(); |
+ } |
+ } |
+} |
+ |
bool Scope::IsAsmModule() const { |
return is_function_scope() && AsDeclarationScope()->asm_module(); |
} |
@@ -329,7 +339,6 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone, |
if (innermost_scope == nullptr) return script_scope; |
script_scope->AddInnerScope(current_scope); |
- script_scope->PropagateScopeInfo(); |
return innermost_scope; |
} |
@@ -878,7 +887,6 @@ Declaration* Scope::CheckLexDeclarationsConflictingWith( |
} |
void DeclarationScope::AllocateVariables(ParseInfo* info, AnalyzeMode mode) { |
- PropagateScopeInfo(); |
ResolveVariablesRecursively(info); |
AllocateVariablesRecursively(); |
AllocateScopeInfosRecursively(info->isolate(), mode); |
@@ -981,9 +989,6 @@ Handle<StringSet> DeclarationScope::CollectNonLocals( |
void DeclarationScope::AnalyzePartially(DeclarationScope* migrate_to, |
AstNodeFactory* ast_node_factory) { |
- // Gather info from inner scopes. |
- PropagateScopeInfo(); |
- |
// 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. |
@@ -1403,16 +1408,6 @@ VariableProxy* Scope::FetchFreeVariables(DeclarationScope* max_outer_scope, |
return stack; |
} |
-void Scope::PropagateScopeInfo() { |
- for (Scope* inner = inner_scope_; inner != nullptr; inner = inner->sibling_) { |
- inner->PropagateScopeInfo(); |
- if (IsAsmModule() && inner->is_function_scope()) { |
- inner->AsDeclarationScope()->set_asm_function(); |
- } |
- } |
-} |
- |
- |
bool Scope::MustAllocate(Variable* var) { |
DCHECK(var->location() != VariableLocation::MODULE); |
// Give var a read/write use if there is a chance it might be accessed |