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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Declarations list. | 155 // Declarations list. |
156 ZoneList<Declaration*>* declarations() { return &decls_; } | 156 ZoneList<Declaration*>* declarations() { return &decls_; } |
157 | 157 |
158 ZoneList<Variable*>* locals() { return &locals_; } | 158 ZoneList<Variable*>* locals() { return &locals_; } |
159 | 159 |
160 // Create a new unresolved variable. | 160 // Create a new unresolved variable. |
161 VariableProxy* NewUnresolved(AstNodeFactory* factory, | 161 VariableProxy* NewUnresolved(AstNodeFactory* factory, |
162 const AstRawString* name, | 162 const AstRawString* name, |
163 int start_position = kNoSourcePosition, | 163 int start_position = kNoSourcePosition, |
164 int end_position = kNoSourcePosition, | |
165 VariableKind kind = NORMAL_VARIABLE); | 164 VariableKind kind = NORMAL_VARIABLE); |
166 | 165 |
167 void AddUnresolved(VariableProxy* proxy); | 166 void AddUnresolved(VariableProxy* proxy); |
168 | 167 |
169 // Remove a unresolved variable. During parsing, an unresolved variable | 168 // Remove a unresolved variable. During parsing, an unresolved variable |
170 // may have been added optimistically, but then only the variable name | 169 // may have been added optimistically, but then only the variable name |
171 // was used (typically for labels). If the variable was not declared, the | 170 // was used (typically for labels). If the variable was not declared, the |
172 // addition introduced a new unresolved variable which may end up being | 171 // addition introduced a new unresolved variable which may end up being |
173 // allocated globally as a "ghost" variable. RemoveUnresolved removes | 172 // allocated globally as a "ghost" variable. RemoveUnresolved removes |
174 // such a variable again if it was added; otherwise this is a no-op. | 173 // such a variable again if it was added; otherwise this is a no-op. |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 void AllocateModuleExports(); | 867 void AllocateModuleExports(); |
869 | 868 |
870 private: | 869 private: |
871 ModuleDescriptor* module_descriptor_; | 870 ModuleDescriptor* module_descriptor_; |
872 }; | 871 }; |
873 | 872 |
874 } // namespace internal | 873 } // namespace internal |
875 } // namespace v8 | 874 } // namespace v8 |
876 | 875 |
877 #endif // V8_AST_SCOPES_H_ | 876 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |