| 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 | 784 |
| 785 Handle<StringSet> CollectNonLocals(ParseInfo* info, | 785 Handle<StringSet> CollectNonLocals(ParseInfo* info, |
| 786 Handle<StringSet> non_locals); | 786 Handle<StringSet> non_locals); |
| 787 | 787 |
| 788 // Determine if we can use lazy compilation for this scope. | 788 // Determine if we can use lazy compilation for this scope. |
| 789 bool AllowsLazyCompilation() const; | 789 bool AllowsLazyCompilation() const; |
| 790 | 790 |
| 791 // Make sure this closure and all outer closures are eagerly compiled. | 791 // Make sure this closure and all outer closures are eagerly compiled. |
| 792 void ForceEagerCompilation() { | 792 void ForceEagerCompilation() { |
| 793 DCHECK_EQ(this, GetClosureScope()); | 793 DCHECK_EQ(this, GetClosureScope()); |
| 794 for (DeclarationScope* s = this; !s->is_script_scope(); | 794 DeclarationScope* s; |
| 795 for (s = this; !s->is_script_scope(); |
| 795 s = s->outer_scope()->GetClosureScope()) { | 796 s = s->outer_scope()->GetClosureScope()) { |
| 796 s->force_eager_compilation_ = true; | 797 s->force_eager_compilation_ = true; |
| 797 } | 798 } |
| 799 s->force_eager_compilation_ = true; |
| 798 } | 800 } |
| 799 | 801 |
| 800 #ifdef DEBUG | 802 #ifdef DEBUG |
| 801 void PrintParameters(); | 803 void PrintParameters(); |
| 802 #endif | 804 #endif |
| 803 | 805 |
| 804 void AllocateLocals(); | 806 void AllocateLocals(); |
| 805 void AllocateParameterLocals(); | 807 void AllocateParameterLocals(); |
| 806 void AllocateReceiver(); | 808 void AllocateReceiver(); |
| 807 | 809 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 void AllocateModuleVariables(); | 878 void AllocateModuleVariables(); |
| 877 | 879 |
| 878 private: | 880 private: |
| 879 ModuleDescriptor* module_descriptor_; | 881 ModuleDescriptor* module_descriptor_; |
| 880 }; | 882 }; |
| 881 | 883 |
| 882 } // namespace internal | 884 } // namespace internal |
| 883 } // namespace v8 | 885 } // namespace v8 |
| 884 | 886 |
| 885 #endif // V8_AST_SCOPES_H_ | 887 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |