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/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/hashmap.h" | 9 #include "src/hashmap.h" |
10 #include "src/pending-compilation-error-handler.h" | 10 #include "src/pending-compilation-error-handler.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // such a variable again if it was added; otherwise this is a no-op. | 202 // such a variable again if it was added; otherwise this is a no-op. |
203 bool RemoveUnresolved(VariableProxy* var); | 203 bool RemoveUnresolved(VariableProxy* var); |
204 | 204 |
205 // Creates a new temporary variable in this scope's TemporaryScope. The | 205 // Creates a new temporary variable in this scope's TemporaryScope. The |
206 // name is only used for printing and cannot be used to find the variable. | 206 // name is only used for printing and cannot be used to find the variable. |
207 // In particular, the only way to get hold of the temporary is by keeping the | 207 // In particular, the only way to get hold of the temporary is by keeping the |
208 // Variable* around. The name should not clash with a legitimate variable | 208 // Variable* around. The name should not clash with a legitimate variable |
209 // names. | 209 // names. |
210 Variable* NewTemporary(const AstRawString* name); | 210 Variable* NewTemporary(const AstRawString* name); |
211 | 211 |
| 212 // Remove a temporary variable. This is for adjusting the scope of |
| 213 // temporaries used when desugaring parameter initializers. |
| 214 bool RemoveTemporary(Variable* var); |
| 215 |
| 216 // Adds a temporary variable in this scope's TemporaryScope. This is for |
| 217 // adjusting the scope of temporaries used when desugaring parameter |
| 218 // initializers. |
| 219 void AddTemporary(Variable* var) { temps_.Add(var, zone()); } |
| 220 |
212 // Adds the specific declaration node to the list of declarations in | 221 // Adds the specific declaration node to the list of declarations in |
213 // this scope. The declarations are processed as part of entering | 222 // this scope. The declarations are processed as part of entering |
214 // the scope; see codegen.cc:ProcessDeclarations. | 223 // the scope; see codegen.cc:ProcessDeclarations. |
215 void AddDeclaration(Declaration* declaration); | 224 void AddDeclaration(Declaration* declaration); |
216 | 225 |
217 // --------------------------------------------------------------------------- | 226 // --------------------------------------------------------------------------- |
218 // Illegal redeclaration support. | 227 // Illegal redeclaration support. |
219 | 228 |
220 // Set an expression node that will be executed when the scope is | 229 // Set an expression node that will be executed when the scope is |
221 // entered. We only keep track of one illegal redeclaration node per | 230 // entered. We only keep track of one illegal redeclaration node per |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 | 840 |
832 // For tracking which classes are declared consecutively. Needed for strong | 841 // For tracking which classes are declared consecutively. Needed for strong |
833 // mode. | 842 // mode. |
834 int class_declaration_group_start_; | 843 int class_declaration_group_start_; |
835 }; | 844 }; |
836 | 845 |
837 } // namespace internal | 846 } // namespace internal |
838 } // namespace v8 | 847 } // namespace v8 |
839 | 848 |
840 #endif // V8_AST_SCOPES_H_ | 849 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |