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

Side by Side Diff: src/lithium-allocator.h

Issue 6993023: Fix a bug in Lithium environment iteration. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added x64 and ARM files. Created 9 years, 6 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 | « src/lithium.h ('k') | src/lithium-allocator.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // A register-allocator view of a Lithium instruction. It contains the id of 155 // A register-allocator view of a Lithium instruction. It contains the id of
156 // the output operand and a list of input operand uses. 156 // the output operand and a list of input operand uses.
157 157
158 class LInstruction; 158 class LInstruction;
159 class LEnvironment; 159 class LEnvironment;
160 160
161 // Iterator for non-null temp operands. 161 // Iterator for non-null temp operands.
162 class TempIterator BASE_EMBEDDED { 162 class TempIterator BASE_EMBEDDED {
163 public: 163 public:
164 inline explicit TempIterator(LInstruction* instr); 164 inline explicit TempIterator(LInstruction* instr);
165 inline bool HasNext(); 165 inline bool Done();
166 inline LOperand* Next(); 166 inline LOperand* Current();
167 inline void Advance(); 167 inline void Advance();
168 168
169 private: 169 private:
170 inline int AdvanceToNext(int start); 170 inline void SkipUninteresting();
171 LInstruction* instr_; 171 LInstruction* instr_;
172 int limit_; 172 int limit_;
173 int current_; 173 int current_;
174 }; 174 };
175 175
176 176
177 // Iterator for non-constant input operands. 177 // Iterator for non-constant input operands.
178 class InputIterator BASE_EMBEDDED { 178 class InputIterator BASE_EMBEDDED {
179 public: 179 public:
180 inline explicit InputIterator(LInstruction* instr); 180 inline explicit InputIterator(LInstruction* instr);
181 inline bool HasNext(); 181 inline bool Done();
182 inline LOperand* Next(); 182 inline LOperand* Current();
183 inline void Advance(); 183 inline void Advance();
184 184
185 private: 185 private:
186 inline int AdvanceToNext(int start); 186 inline void SkipUninteresting();
187 LInstruction* instr_; 187 LInstruction* instr_;
188 int limit_; 188 int limit_;
189 int current_; 189 int current_;
190 }; 190 };
191 191
192 192
193 class UseIterator BASE_EMBEDDED { 193 class UseIterator BASE_EMBEDDED {
194 public: 194 public:
195 inline explicit UseIterator(LInstruction* instr); 195 inline explicit UseIterator(LInstruction* instr);
196 inline bool HasNext(); 196 inline bool Done();
197 inline LOperand* Next(); 197 inline LOperand* Current();
198 inline void Advance(); 198 inline void Advance();
199 199
200 private: 200 private:
201 InputIterator input_iterator_; 201 InputIterator input_iterator_;
202 DeepIterator env_iterator_; 202 DeepIterator env_iterator_;
203 }; 203 };
204 204
205 205
206 // Representation of the non-empty interval [start,end[. 206 // Representation of the non-empty interval [start,end[.
207 class UseInterval: public ZoneObject { 207 class UseInterval: public ZoneObject {
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 621
622 bool has_osr_entry_; 622 bool has_osr_entry_;
623 623
624 DISALLOW_COPY_AND_ASSIGN(LAllocator); 624 DISALLOW_COPY_AND_ASSIGN(LAllocator);
625 }; 625 };
626 626
627 627
628 } } // namespace v8::internal 628 } } // namespace v8::internal
629 629
630 #endif // V8_LITHIUM_ALLOCATOR_H_ 630 #endif // V8_LITHIUM_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « src/lithium.h ('k') | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698