OLD | NEW |
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 Loading... |
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. |
523 VariableProxy* FetchFreeVariables(DeclarationScope* max_outer_scope, | 524 VariableProxy* FetchFreeVariables(DeclarationScope* max_outer_scope, |
524 bool try_to_resolve = true, | 525 bool try_to_resolve = true, |
| 526 ParseInfo* info = nullptr, |
525 VariableProxy* stack = nullptr); | 527 VariableProxy* stack = nullptr); |
526 | 528 |
527 // Predicates. | 529 // Predicates. |
528 bool MustAllocate(Variable* var); | 530 bool MustAllocate(Variable* var); |
529 bool MustAllocateInContext(Variable* var); | 531 bool MustAllocateInContext(Variable* var); |
530 | 532 |
531 // Variable allocation. | 533 // Variable allocation. |
532 void AllocateStackSlot(Variable* var); | 534 void AllocateStackSlot(Variable* var); |
533 void AllocateHeapSlot(Variable* var); | 535 void AllocateHeapSlot(Variable* var); |
534 void AllocateNonParameterLocal(Variable* var); | 536 void AllocateNonParameterLocal(Variable* var); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 void AllocateModuleVariables(); | 854 void AllocateModuleVariables(); |
853 | 855 |
854 private: | 856 private: |
855 ModuleDescriptor* module_descriptor_; | 857 ModuleDescriptor* module_descriptor_; |
856 }; | 858 }; |
857 | 859 |
858 } // namespace internal | 860 } // namespace internal |
859 } // namespace v8 | 861 } // namespace v8 |
860 | 862 |
861 #endif // V8_AST_SCOPES_H_ | 863 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |