Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Unified Diff: src/ast/scopes.cc

Issue 2270743003: Get rid of PropagateScopeInfo, update asm_function in set_asm_module instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/scopes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/ast/scopes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698