Index: src/ast/scopes.cc |
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc |
index 129cbceaf5bef5c1104efa1332481c23582f7ce3..59be90d9c6d7676ee1e5275107392e2cc0e07322 100644 |
--- a/src/ast/scopes.cc |
+++ b/src/ast/scopes.cc |
@@ -811,14 +811,10 @@ void Scope::CollectVariables(ZoneList<Variable*>* stack_locals, |
} |
void DeclarationScope::AllocateVariables(ParseInfo* info) { |
- // 1) Propagate scope information. |
PropagateScopeInfo(); |
- |
- // 2) Resolve variables. |
ResolveVariablesRecursively(info); |
- |
- // 3) Allocate variables. |
AllocateVariablesRecursively(); |
+ AllocateScopeInfosRecursively(info); |
} |
@@ -907,15 +903,6 @@ DeclarationScope* Scope::GetReceiverScope() { |
return scope->AsDeclarationScope(); |
} |
- |
- |
-Handle<ScopeInfo> Scope::GetScopeInfo(Isolate* isolate) { |
- if (scope_info_.is_null()) { |
- scope_info_ = ScopeInfo::Create(isolate, zone(), this); |
- } |
- return scope_info_; |
-} |
- |
Handle<StringSet> DeclarationScope::CollectNonLocals( |
ParseInfo* info, Handle<StringSet> non_locals) { |
VariableProxy* free_variables = FetchFreeVariables(this, info); |
@@ -1599,6 +1586,15 @@ void Scope::AllocateVariablesRecursively() { |
DCHECK(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
} |
+void Scope::AllocateScopeInfosRecursively(ParseInfo* info) { |
+ DCHECK(scope_info_.is_null()); |
marja
2016/08/29 10:49:30
Discussed offline: maybe we should create ScopeInf
|
+ scope_info_ = ScopeInfo::Create(info->isolate(), zone(), this); |
Toon Verwaest
2016/08/29 11:46:25
Wut? We pass along info just to get the isolate?
jochen (gone - plz use gerrit)
2016/08/29 12:15:25
Eventually, I'd like get the ScopeInfo of the oute
|
+ |
+ // Allocate ScopeInfos for inner scopes. |
+ for (Scope* scope = inner_scope_; scope != nullptr; scope = scope->sibling_) { |
+ scope->AllocateScopeInfosRecursively(info); |
+ } |
+} |
int Scope::StackLocalCount() const { |
Variable* function = |