| 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 | 202 |
| 203 // Creates a new temporary variable in this scope's TemporaryScope. The | 203 // Creates a new temporary variable in this scope's TemporaryScope. The |
| 204 // name is only used for printing and cannot be used to find the variable. | 204 // name is only used for printing and cannot be used to find the variable. |
| 205 // In particular, the only way to get hold of the temporary is by keeping the | 205 // In particular, the only way to get hold of the temporary is by keeping the |
| 206 // Variable* around. The name should not clash with a legitimate variable | 206 // Variable* around. The name should not clash with a legitimate variable |
| 207 // names. | 207 // names. |
| 208 Variable* NewTemporary(const AstRawString* name); | 208 Variable* NewTemporary(const AstRawString* name); |
| 209 | 209 |
| 210 // Remove a temporary variable. This is for adjusting the scope of | 210 // Remove a temporary variable. This is for adjusting the scope of |
| 211 // temporaries used when desugaring parameter initializers. | 211 // temporaries used when desugaring parameter initializers. |
| 212 bool RemoveTemporary(Variable* var); | 212 // Returns the index at which it was found in this scope, or -1 if |
| 213 // it was not found. |
| 214 int RemoveTemporary(Variable* var); |
| 213 | 215 |
| 214 // Adds a temporary variable in this scope's TemporaryScope. This is for | 216 // Adds a temporary variable in this scope's TemporaryScope. This is for |
| 215 // adjusting the scope of temporaries used when desugaring parameter | 217 // adjusting the scope of temporaries used when desugaring parameter |
| 216 // initializers. | 218 // initializers. |
| 217 void AddTemporary(Variable* var) { temps_.Add(var, zone()); } | 219 void AddTemporary(Variable* var) { temps_.Add(var, zone()); } |
| 218 | 220 |
| 219 // Adds the specific declaration node to the list of declarations in | 221 // Adds the specific declaration node to the list of declarations in |
| 220 // this scope. The declarations are processed as part of entering | 222 // this scope. The declarations are processed as part of entering |
| 221 // the scope; see codegen.cc:ProcessDeclarations. | 223 // the scope; see codegen.cc:ProcessDeclarations. |
| 222 void AddDeclaration(Declaration* declaration); | 224 void AddDeclaration(Declaration* declaration); |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 AstValueFactory* ast_value_factory_; | 824 AstValueFactory* ast_value_factory_; |
| 823 Zone* zone_; | 825 Zone* zone_; |
| 824 | 826 |
| 825 PendingCompilationErrorHandler pending_error_handler_; | 827 PendingCompilationErrorHandler pending_error_handler_; |
| 826 }; | 828 }; |
| 827 | 829 |
| 828 } // namespace internal | 830 } // namespace internal |
| 829 } // namespace v8 | 831 } // namespace v8 |
| 830 | 832 |
| 831 #endif // V8_AST_SCOPES_H_ | 833 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |