Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: src/ast/scopes.h

Issue 2427503002: Also mark the script-scope for eager compilation upon ForceEagerCompilation (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698