| 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/base/hashmap.h" | 8 #include "src/base/hashmap.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 // know what they will resolve to since the outer Scopes are incomplete) and | 784 // know what they will resolve to since the outer Scopes are incomplete) and |
| 785 // migrates them into migrate_to. | 785 // migrates them into migrate_to. |
| 786 void AnalyzePartially(AstNodeFactory* ast_node_factory); | 786 void AnalyzePartially(AstNodeFactory* ast_node_factory); |
| 787 | 787 |
| 788 Handle<StringSet> CollectNonLocals(ParseInfo* info, | 788 Handle<StringSet> CollectNonLocals(ParseInfo* info, |
| 789 Handle<StringSet> non_locals); | 789 Handle<StringSet> non_locals); |
| 790 | 790 |
| 791 // Determine if we can use lazy compilation for this scope. | 791 // Determine if we can use lazy compilation for this scope. |
| 792 bool AllowsLazyCompilation() const; | 792 bool AllowsLazyCompilation() const; |
| 793 | 793 |
| 794 // Determine if we can use lazy compilation for this scope without a context. | |
| 795 bool AllowsLazyCompilationWithoutContext() const; | |
| 796 | |
| 797 // Make sure this closure and all outer closures are eagerly compiled. | 794 // Make sure this closure and all outer closures are eagerly compiled. |
| 798 void ForceEagerCompilation() { | 795 void ForceEagerCompilation() { |
| 799 DCHECK_EQ(this, GetClosureScope()); | 796 DCHECK_EQ(this, GetClosureScope()); |
| 800 for (DeclarationScope* s = this; !s->is_script_scope(); | 797 for (DeclarationScope* s = this; !s->is_script_scope(); |
| 801 s = s->outer_scope()->GetClosureScope()) { | 798 s = s->outer_scope()->GetClosureScope()) { |
| 802 s->force_eager_compilation_ = true; | 799 s->force_eager_compilation_ = true; |
| 803 } | 800 } |
| 804 } | 801 } |
| 805 | 802 |
| 806 #ifdef DEBUG | 803 #ifdef DEBUG |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 void AllocateModuleVariables(); | 881 void AllocateModuleVariables(); |
| 885 | 882 |
| 886 private: | 883 private: |
| 887 ModuleDescriptor* module_descriptor_; | 884 ModuleDescriptor* module_descriptor_; |
| 888 }; | 885 }; |
| 889 | 886 |
| 890 } // namespace internal | 887 } // namespace internal |
| 891 } // namespace v8 | 888 } // namespace v8 |
| 892 | 889 |
| 893 #endif // V8_AST_SCOPES_H_ | 890 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |