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

Side by Side Diff: src/ast/scopes.cc

Issue 2654423004: [async-functions] support await expressions in finally statements (Closed)
Patch Set: I'd like to build with -Wunused-variables locally, but how!? Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopes.h ('k') | src/bailout-reason.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/ast/ast.h" 10 #include "src/ast/ast.h"
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 } 1342 }
1343 1343
1344 Scope* Scope::GetOuterScopeWithContext() { 1344 Scope* Scope::GetOuterScopeWithContext() {
1345 Scope* scope = outer_scope_; 1345 Scope* scope = outer_scope_;
1346 while (scope && !scope->NeedsContext()) { 1346 while (scope && !scope->NeedsContext()) {
1347 scope = scope->outer_scope(); 1347 scope = scope->outer_scope();
1348 } 1348 }
1349 return scope; 1349 return scope;
1350 } 1350 }
1351 1351
1352 bool Scope::HasLazilyParsedInnerFunctionScope() const {
1353 for (Scope* scope = inner_scope_; scope; scope = scope->sibling_) {
1354 if (scope->is_function_scope()) {
1355 if (static_cast<DeclarationScope*>(scope)->was_lazily_parsed()) {
1356 return true;
1357 }
1358 }
1359 if (scope->HasLazilyParsedInnerFunctionScope()) return true;
1360 }
1361 return false;
1362 }
1363
1352 Handle<StringSet> DeclarationScope::CollectNonLocals( 1364 Handle<StringSet> DeclarationScope::CollectNonLocals(
1353 ParseInfo* info, Handle<StringSet> non_locals) { 1365 ParseInfo* info, Handle<StringSet> non_locals) {
1354 VariableProxy* free_variables = FetchFreeVariables(this, info); 1366 VariableProxy* free_variables = FetchFreeVariables(this, info);
1355 for (VariableProxy* proxy = free_variables; proxy != nullptr; 1367 for (VariableProxy* proxy = free_variables; proxy != nullptr;
1356 proxy = proxy->next_unresolved()) { 1368 proxy = proxy->next_unresolved()) {
1357 non_locals = StringSet::Add(non_locals, proxy->name()); 1369 non_locals = StringSet::Add(non_locals, proxy->name());
1358 } 1370 }
1359 return non_locals; 1371 return non_locals;
1360 } 1372 }
1361 1373
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 Variable* function = 2219 Variable* function =
2208 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; 2220 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr;
2209 bool is_function_var_in_context = 2221 bool is_function_var_in_context =
2210 function != nullptr && function->IsContextSlot(); 2222 function != nullptr && function->IsContextSlot();
2211 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - 2223 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS -
2212 (is_function_var_in_context ? 1 : 0); 2224 (is_function_var_in_context ? 1 : 0);
2213 } 2225 }
2214 2226
2215 } // namespace internal 2227 } // namespace internal
2216 } // namespace v8 2228 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.h ('k') | src/bailout-reason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698