| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 | 475 |
| 476 // Determine if we can use lazy compilation for this scope. | 476 // Determine if we can use lazy compilation for this scope. |
| 477 bool AllowsLazyCompilation() const; | 477 bool AllowsLazyCompilation() const; |
| 478 | 478 |
| 479 // Determine if we can use lazy compilation for this scope without a context. | 479 // Determine if we can use lazy compilation for this scope without a context. |
| 480 bool AllowsLazyCompilationWithoutContext() const; | 480 bool AllowsLazyCompilationWithoutContext() const; |
| 481 | 481 |
| 482 // True if the outer context of this scope is always the native context. | 482 // True if the outer context of this scope is always the native context. |
| 483 bool HasTrivialOuterContext() const; | 483 bool HasTrivialOuterContext() const; |
| 484 | 484 |
| 485 // True if the outer context allows lazy compilation of this scope. | |
| 486 bool HasLazyCompilableOuterContext() const; | |
| 487 | |
| 488 // The number of contexts between this and scope; zero if this == scope. | 485 // The number of contexts between this and scope; zero if this == scope. |
| 489 int ContextChainLength(Scope* scope); | 486 int ContextChainLength(Scope* scope); |
| 490 | 487 |
| 491 // Find the script scope. | 488 // Find the script scope. |
| 492 // Used in modules implemenetation to find hosting scope. | 489 // Used in modules implemenetation to find hosting scope. |
| 493 // TODO(rossberg): is this needed? | 490 // TODO(rossberg): is this needed? |
| 494 Scope* ScriptScope(); | 491 Scope* ScriptScope(); |
| 495 | 492 |
| 496 // Find the first function, global, or eval scope. This is the scope | 493 // Find the first function, global, or eval scope. This is the scope |
| 497 // where var declarations will be hoisted to in the implementation. | 494 // where var declarations will be hoisted to in the implementation. |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 PendingCompilationErrorHandler pending_error_handler_; | 765 PendingCompilationErrorHandler pending_error_handler_; |
| 769 | 766 |
| 770 // For tracking which classes are declared consecutively. Needed for strong | 767 // For tracking which classes are declared consecutively. Needed for strong |
| 771 // mode. | 768 // mode. |
| 772 int class_declaration_group_start_; | 769 int class_declaration_group_start_; |
| 773 }; | 770 }; |
| 774 | 771 |
| 775 } } // namespace v8::internal | 772 } } // namespace v8::internal |
| 776 | 773 |
| 777 #endif // V8_SCOPES_H_ | 774 #endif // V8_SCOPES_H_ |
| OLD | NEW |