| 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/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
| 10 #include "src/pending-compilation-error-handler.h" | 10 #include "src/pending-compilation-error-handler.h" |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 483 |
| 484 // Inner scope list. | 484 // Inner scope list. |
| 485 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } | 485 ZoneList<Scope*>* inner_scopes() { return &inner_scopes_; } |
| 486 | 486 |
| 487 // The scope immediately surrounding this scope, or NULL. | 487 // The scope immediately surrounding this scope, or NULL. |
| 488 Scope* outer_scope() const { return outer_scope_; } | 488 Scope* outer_scope() const { return outer_scope_; } |
| 489 | 489 |
| 490 // The ModuleDescriptor for this scope; only for module scopes. | 490 // The ModuleDescriptor for this scope; only for module scopes. |
| 491 ModuleDescriptor* module() const { return module_descriptor_; } | 491 ModuleDescriptor* module() const { return module_descriptor_; } |
| 492 | 492 |
| 493 AstRawString* catch_variable_name() const { |
| 494 DCHECK(is_catch_scope()); |
| 495 DCHECK(num_var_or_const() == 1); |
| 496 return static_cast<AstRawString*>(variables_.Start()->key); |
| 497 } |
| 498 |
| 493 // --------------------------------------------------------------------------- | 499 // --------------------------------------------------------------------------- |
| 494 // Variable allocation. | 500 // Variable allocation. |
| 495 | 501 |
| 496 // Collect stack and context allocated local variables in this scope. Note | 502 // Collect stack and context allocated local variables in this scope. Note |
| 497 // that the function variable - if present - is not collected and should be | 503 // that the function variable - if present - is not collected and should be |
| 498 // handled separately. | 504 // handled separately. |
| 499 void CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals, | 505 void CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals, |
| 500 ZoneList<Variable*>* context_locals, | 506 ZoneList<Variable*>* context_locals, |
| 501 ZoneList<Variable*>* context_globals); | 507 ZoneList<Variable*>* context_globals); |
| 502 | 508 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 AstValueFactory* ast_value_factory_; | 819 AstValueFactory* ast_value_factory_; |
| 814 Zone* zone_; | 820 Zone* zone_; |
| 815 | 821 |
| 816 PendingCompilationErrorHandler pending_error_handler_; | 822 PendingCompilationErrorHandler pending_error_handler_; |
| 817 }; | 823 }; |
| 818 | 824 |
| 819 } // namespace internal | 825 } // namespace internal |
| 820 } // namespace v8 | 826 } // namespace v8 |
| 821 | 827 |
| 822 #endif // V8_AST_SCOPES_H_ | 828 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |