| OLD | NEW |
| 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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1199 // skipping the special garbage section of which there is one per space. | 1199 // skipping the special garbage section of which there is one per space. |
| 1200 // Returns NULL when the iteration has ended. | 1200 // Returns NULL when the iteration has ended. |
| 1201 inline HeapObject* Next() { | 1201 inline HeapObject* Next() { |
| 1202 do { | 1202 do { |
| 1203 HeapObject* next_obj = FromCurrentPage(); | 1203 HeapObject* next_obj = FromCurrentPage(); |
| 1204 if (next_obj != NULL) return next_obj; | 1204 if (next_obj != NULL) return next_obj; |
| 1205 } while (AdvanceToNextPage()); | 1205 } while (AdvanceToNextPage()); |
| 1206 return NULL; | 1206 return NULL; |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 // Advance to the next object, skipping free spaces, evacuation canditates, |
| 1210 // and other fillers and skipping the special garbage section of which |
| 1211 // there is one per space. Returns NULL when the iteration has ended. |
| 1212 inline HeapObject* NextIgnoreEvacuationCandidates() { |
| 1213 do { |
| 1214 if (cur_addr_ != 0 && |
| 1215 !Page::FromAddress(cur_addr_ - 1)->IsEvacuationCandidate()) { |
| 1216 HeapObject* next_obj = FromCurrentPage(); |
| 1217 if (next_obj != NULL) return next_obj; |
| 1218 } |
| 1219 } while (AdvanceToNextPage()); |
| 1220 return NULL; |
| 1221 } |
| 1222 |
| 1209 virtual HeapObject* next_object() { | 1223 virtual HeapObject* next_object() { |
| 1210 return Next(); | 1224 return Next(); |
| 1211 } | 1225 } |
| 1212 | 1226 |
| 1213 private: | 1227 private: |
| 1214 enum PageMode { kOnePageOnly, kAllPagesInSpace }; | 1228 enum PageMode { kOnePageOnly, kAllPagesInSpace }; |
| 1215 | 1229 |
| 1216 Address cur_addr_; // Current iteration point. | 1230 Address cur_addr_; // Current iteration point. |
| 1217 Address cur_end_; // End iteration point. | 1231 Address cur_end_; // End iteration point. |
| 1218 HeapObjectCallback size_func_; // Size function or NULL. | 1232 HeapObjectCallback size_func_; // Size function or NULL. |
| (...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2823 } | 2837 } |
| 2824 // Must be small, since an iteration is used for lookup. | 2838 // Must be small, since an iteration is used for lookup. |
| 2825 static const int kMaxComments = 64; | 2839 static const int kMaxComments = 64; |
| 2826 }; | 2840 }; |
| 2827 #endif | 2841 #endif |
| 2828 | 2842 |
| 2829 | 2843 |
| 2830 } } // namespace v8::internal | 2844 } } // namespace v8::internal |
| 2831 | 2845 |
| 2832 #endif // V8_SPACES_H_ | 2846 #endif // V8_SPACES_H_ |
| OLD | NEW |