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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 } | 801 } |
802 | 802 |
803 #ifdef DEBUG | 803 #ifdef DEBUG |
804 void PrintParameters(); | 804 void PrintParameters(); |
805 #endif | 805 #endif |
806 | 806 |
807 void AllocateLocals(); | 807 void AllocateLocals(); |
808 void AllocateParameterLocals(); | 808 void AllocateParameterLocals(); |
809 void AllocateReceiver(); | 809 void AllocateReceiver(); |
810 | 810 |
811 void ResetAfterPreparsing() { | 811 void ResetAfterPreparsing(bool aborted); |
812 // Reset all non-trivial members. | |
813 decls_.Clear(); | |
814 locals_.Clear(); | |
815 params_.Clear(); | |
816 sloppy_block_function_map_.Clear(); | |
817 variables_.Clear(); | |
818 // Make sure we won't walk the scope tree from here on. | |
819 inner_scope_ = nullptr; | |
820 // Make sure we won't try to allocate the rest parameter. {params_} was | |
821 // cleared above. | |
822 has_rest_ = false; | |
823 } | |
824 | 812 |
825 private: | 813 private: |
826 void AllocateParameter(Variable* var, int index); | 814 void AllocateParameter(Variable* var, int index); |
827 | 815 |
828 // Resolve and fill in the allocation information for all variables | 816 // Resolve and fill in the allocation information for all variables |
829 // in this scopes. Must be called *after* all scopes have been | 817 // in this scopes. Must be called *after* all scopes have been |
830 // processed (parsed) to ensure that unresolved variables can be | 818 // processed (parsed) to ensure that unresolved variables can be |
831 // resolved properly. | 819 // resolved properly. |
832 // | 820 // |
833 // In the case of code compiled and run using 'eval', the context | 821 // In the case of code compiled and run using 'eval', the context |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 void AllocateModuleVariables(); | 881 void AllocateModuleVariables(); |
894 | 882 |
895 private: | 883 private: |
896 ModuleDescriptor* module_descriptor_; | 884 ModuleDescriptor* module_descriptor_; |
897 }; | 885 }; |
898 | 886 |
899 } // namespace internal | 887 } // namespace internal |
900 } // namespace v8 | 888 } // namespace v8 |
901 | 889 |
902 #endif // V8_AST_SCOPES_H_ | 890 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |