OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 SemiSpaceIterator(NewSpace* space, HeapObjectCallback size_func); | 1034 SemiSpaceIterator(NewSpace* space, HeapObjectCallback size_func); |
1035 SemiSpaceIterator(NewSpace* space, Address start); | 1035 SemiSpaceIterator(NewSpace* space, Address start); |
1036 | 1036 |
1037 bool has_next() {return current_ < limit_; } | 1037 bool has_next() {return current_ < limit_; } |
1038 | 1038 |
1039 HeapObject* next() { | 1039 HeapObject* next() { |
1040 ASSERT(has_next()); | 1040 ASSERT(has_next()); |
1041 | 1041 |
1042 HeapObject* object = HeapObject::FromAddress(current_); | 1042 HeapObject* object = HeapObject::FromAddress(current_); |
1043 int size = (size_func_ == NULL) ? object->Size() : size_func_(object); | 1043 int size = (size_func_ == NULL) ? object->Size() : size_func_(object); |
1044 ASSERT_OBJECT_SIZE(size); | |
1045 | 1044 |
1046 current_ += size; | 1045 current_ += size; |
1047 return object; | 1046 return object; |
1048 } | 1047 } |
1049 | 1048 |
1050 // Implementation of the ObjectIterator functions. | 1049 // Implementation of the ObjectIterator functions. |
1051 virtual bool has_next_object() { return has_next(); } | 1050 virtual bool has_next_object() { return has_next(); } |
1052 virtual HeapObject* next_object() { return next(); } | 1051 virtual HeapObject* next_object() { return next(); } |
1053 | 1052 |
1054 private: | 1053 private: |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 | 1729 |
1731 private: | 1730 private: |
1732 LargeObjectChunk* current_; | 1731 LargeObjectChunk* current_; |
1733 HeapObjectCallback size_func_; | 1732 HeapObjectCallback size_func_; |
1734 }; | 1733 }; |
1735 | 1734 |
1736 | 1735 |
1737 } } // namespace v8::internal | 1736 } } // namespace v8::internal |
1738 | 1737 |
1739 #endif // V8_SPACES_H_ | 1738 #endif // V8_SPACES_H_ |
OLD | NEW |