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

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

Issue 2491373004: [ast] Simplify FetchFreeVariables. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | src/ast/scopes.cc » ('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 #ifndef V8_AST_SCOPES_H_ 5 #ifndef V8_AST_SCOPES_H_
6 #define V8_AST_SCOPES_H_ 6 #define V8_AST_SCOPES_H_
7 7
8 #include "src/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/base/hashmap.h" 9 #include "src/base/hashmap.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // scope, and stopping when reaching the outer_scope_end scope. If the code is 513 // scope, and stopping when reaching the outer_scope_end scope. If the code is
514 // executed because of a call to 'eval', the context parameter should be set 514 // executed because of a call to 'eval', the context parameter should be set
515 // to the calling context of 'eval'. 515 // to the calling context of 'eval'.
516 Variable* LookupRecursive(VariableProxy* proxy, Scope* outer_scope_end); 516 Variable* LookupRecursive(VariableProxy* proxy, Scope* outer_scope_end);
517 void ResolveTo(ParseInfo* info, VariableProxy* proxy, Variable* var); 517 void ResolveTo(ParseInfo* info, VariableProxy* proxy, Variable* var);
518 void ResolveVariable(ParseInfo* info, VariableProxy* proxy); 518 void ResolveVariable(ParseInfo* info, VariableProxy* proxy);
519 void ResolveVariablesRecursively(ParseInfo* info); 519 void ResolveVariablesRecursively(ParseInfo* info);
520 520
521 // Finds free variables of this scope. This mutates the unresolved variables 521 // Finds free variables of this scope. This mutates the unresolved variables
522 // list along the way, so full resolution cannot be done afterwards. 522 // list along the way, so full resolution cannot be done afterwards.
523 // If a ParseInfo* is passed, non-free variables will be resolved.
524 VariableProxy* FetchFreeVariables(DeclarationScope* max_outer_scope, 523 VariableProxy* FetchFreeVariables(DeclarationScope* max_outer_scope,
525 bool try_to_resolve = true, 524 bool try_to_resolve = true,
526 ParseInfo* info = nullptr,
527 VariableProxy* stack = nullptr); 525 VariableProxy* stack = nullptr);
528 526
529 // Predicates. 527 // Predicates.
530 bool MustAllocate(Variable* var); 528 bool MustAllocate(Variable* var);
531 bool MustAllocateInContext(Variable* var); 529 bool MustAllocateInContext(Variable* var);
532 530
533 // Variable allocation. 531 // Variable allocation.
534 void AllocateStackSlot(Variable* var); 532 void AllocateStackSlot(Variable* var);
535 void AllocateHeapSlot(Variable* var); 533 void AllocateHeapSlot(Variable* var);
536 void AllocateNonParameterLocal(Variable* var); 534 void AllocateNonParameterLocal(Variable* var);
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 void AllocateModuleVariables(); 852 void AllocateModuleVariables();
855 853
856 private: 854 private:
857 ModuleDescriptor* module_descriptor_; 855 ModuleDescriptor* module_descriptor_;
858 }; 856 };
859 857
860 } // namespace internal 858 } // namespace internal
861 } // namespace v8 859 } // namespace v8
862 860
863 #endif // V8_AST_SCOPES_H_ 861 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698