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

Side by Side Diff: src/func-name-inferrer.h

Issue 10414075: Clear pending functions list in FuncNameInferrer when it closes (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/test-func-name-inference.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ASSERT(IsOpen()); 81 ASSERT(IsOpen());
82 if (!funcs_to_infer_.is_empty()) { 82 if (!funcs_to_infer_.is_empty()) {
83 InferFunctionsNames(); 83 InferFunctionsNames();
84 } 84 }
85 } 85 }
86 86
87 // Leaves names collection state. 87 // Leaves names collection state.
88 void Leave() { 88 void Leave() {
89 ASSERT(IsOpen()); 89 ASSERT(IsOpen());
90 names_stack_.Rewind(entries_stack_.RemoveLast()); 90 names_stack_.Rewind(entries_stack_.RemoveLast());
91 if (entries_stack_.is_empty())
92 funcs_to_infer_.Clear();
91 } 93 }
92 94
93 private: 95 private:
94 enum NameType { 96 enum NameType {
95 kEnclosingConstructorName, 97 kEnclosingConstructorName,
96 kLiteralName, 98 kLiteralName,
97 kVariableName 99 kVariableName
98 }; 100 };
99 struct Name { 101 struct Name {
100 Name(Handle<String> name, NameType type) : name(name), type(type) { } 102 Name(Handle<String> name, NameType type) : name(name), type(type) { }
(...skipping 17 matching lines...) Expand all
118 ZoneList<Name> names_stack_; 120 ZoneList<Name> names_stack_;
119 ZoneList<FunctionLiteral*> funcs_to_infer_; 121 ZoneList<FunctionLiteral*> funcs_to_infer_;
120 122
121 DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer); 123 DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer);
122 }; 124 };
123 125
124 126
125 } } // namespace v8::internal 127 } } // namespace v8::internal
126 128
127 #endif // V8_FUNC_NAME_INFERRER_H_ 129 #endif // V8_FUNC_NAME_INFERRER_H_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-func-name-inference.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698