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

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

Issue 2370713003: Preparse functions in the scope that was created when parsing of the function was started (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 | src/parsing/parser.cc » ('j') | src/parsing/parser-base.h » ('J')
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 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 } 799 }
800 800
801 #ifdef DEBUG 801 #ifdef DEBUG
802 void PrintParameters(); 802 void PrintParameters();
803 #endif 803 #endif
804 804
805 void AllocateLocals(); 805 void AllocateLocals();
806 void AllocateParameterLocals(); 806 void AllocateParameterLocals();
807 void AllocateReceiver(); 807 void AllocateReceiver();
808 808
809 void ResetAfterPreparsing() {
marja 2016/09/26 12:38:27 Why do we need this? Just by reading the code, it'
810 decls_.Clear();
811 has_rest_ = false;
812 inner_scope_ = nullptr;
813 locals_.Clear();
814 params_.Clear();
815 sloppy_block_function_map_.Clear();
816 variables_.Clear();
817 }
818
809 private: 819 private:
810 void AllocateParameter(Variable* var, int index); 820 void AllocateParameter(Variable* var, int index);
811 821
812 // Resolve and fill in the allocation information for all variables 822 // Resolve and fill in the allocation information for all variables
813 // in this scopes. Must be called *after* all scopes have been 823 // in this scopes. Must be called *after* all scopes have been
814 // processed (parsed) to ensure that unresolved variables can be 824 // processed (parsed) to ensure that unresolved variables can be
815 // resolved properly. 825 // resolved properly.
816 // 826 //
817 // In the case of code compiled and run using 'eval', the context 827 // In the case of code compiled and run using 'eval', the context
818 // parameter is the context in which eval was called. In all other 828 // parameter is the context in which eval was called. In all other
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 void AllocateModuleVariables(); 887 void AllocateModuleVariables();
878 888
879 private: 889 private:
880 ModuleDescriptor* module_descriptor_; 890 ModuleDescriptor* module_descriptor_;
881 }; 891 };
882 892
883 } // namespace internal 893 } // namespace internal
884 } // namespace v8 894 } // namespace v8
885 895
886 #endif // V8_AST_SCOPES_H_ 896 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser-base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698