| 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_SCOPES_H_ | 5 #ifndef V8_SCOPES_H_ |
| 6 #define V8_SCOPES_H_ | 6 #define V8_SCOPES_H_ |
| 7 | 7 |
| 8 #include "src/ast.h" | 8 #include "src/ast.h" |
| 9 #include "src/pending-compilation-error-handler.h" | 9 #include "src/pending-compilation-error-handler.h" |
| 10 #include "src/zone.h" | 10 #include "src/zone.h" |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 | 477 |
| 478 // The number of contexts between this and scope; zero if this == scope. | 478 // The number of contexts between this and scope; zero if this == scope. |
| 479 int ContextChainLength(Scope* scope); | 479 int ContextChainLength(Scope* scope); |
| 480 | 480 |
| 481 // Find the first function, script, eval or (declaration) block scope. This is | 481 // Find the first function, script, eval or (declaration) block scope. This is |
| 482 // the scope where var declarations will be hoisted to in the implementation. | 482 // the scope where var declarations will be hoisted to in the implementation. |
| 483 Scope* DeclarationScope(); | 483 Scope* DeclarationScope(); |
| 484 | 484 |
| 485 // Find the first non-block declaration scope. This should be either a script, | 485 // Find the first non-block declaration scope. This should be either a script, |
| 486 // function, or eval scope. Same as DeclarationScope(), but skips | 486 // function, or eval scope. Same as DeclarationScope(), but skips |
| 487 // declaration "block" scopes. Used for declaring temporaries. | 487 // declaration "block" scopes. Used for differentiating associated |
| 488 Scope* TemporaryScope(); | 488 // function objects (i.e., the scope for which a function prologue allocates |
| 489 // a context) or declaring temporaries. |
| 490 Scope* ClosureScope(); |
| 489 | 491 |
| 490 // Find the first (non-arrow) function or script scope. This is where | 492 // Find the first (non-arrow) function or script scope. This is where |
| 491 // 'this' is bound, and what determines the function kind. | 493 // 'this' is bound, and what determines the function kind. |
| 492 Scope* ReceiverScope(); | 494 Scope* ReceiverScope(); |
| 493 | 495 |
| 494 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); | 496 Handle<ScopeInfo> GetScopeInfo(Isolate* isolate); |
| 495 | 497 |
| 496 // Get the chain of nested scopes within this scope for the source statement | 498 // Get the chain of nested scopes within this scope for the source statement |
| 497 // position. The scopes will be added to the list from the outermost scope to | 499 // position. The scopes will be added to the list from the outermost scope to |
| 498 // the innermost scope. Only nested block, catch or with scopes are tracked | 500 // the innermost scope. Only nested block, catch or with scopes are tracked |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 PendingCompilationErrorHandler pending_error_handler_; | 767 PendingCompilationErrorHandler pending_error_handler_; |
| 766 | 768 |
| 767 // For tracking which classes are declared consecutively. Needed for strong | 769 // For tracking which classes are declared consecutively. Needed for strong |
| 768 // mode. | 770 // mode. |
| 769 int class_declaration_group_start_; | 771 int class_declaration_group_start_; |
| 770 }; | 772 }; |
| 771 | 773 |
| 772 } } // namespace v8::internal | 774 } } // namespace v8::internal |
| 773 | 775 |
| 774 #endif // V8_SCOPES_H_ | 776 #endif // V8_SCOPES_H_ |
| OLD | NEW |