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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 // Creates a new object iterator in a given space. If a start | 749 // Creates a new object iterator in a given space. If a start |
750 // address is not given, the iterator starts from the space bottom. | 750 // address is not given, the iterator starts from the space bottom. |
751 // If the size function is not given, the iterator calls the default | 751 // If the size function is not given, the iterator calls the default |
752 // Object::Size(). | 752 // Object::Size(). |
753 explicit HeapObjectIterator(PagedSpace* space); | 753 explicit HeapObjectIterator(PagedSpace* space); |
754 HeapObjectIterator(PagedSpace* space, HeapObjectCallback size_func); | 754 HeapObjectIterator(PagedSpace* space, HeapObjectCallback size_func); |
755 HeapObjectIterator(PagedSpace* space, Address start); | 755 HeapObjectIterator(PagedSpace* space, Address start); |
756 HeapObjectIterator(PagedSpace* space, | 756 HeapObjectIterator(PagedSpace* space, |
757 Address start, | 757 Address start, |
758 HeapObjectCallback size_func); | 758 HeapObjectCallback size_func); |
| 759 HeapObjectIterator(Page* page, HeapObjectCallback size_func); |
759 | 760 |
760 inline HeapObject* next() { | 761 inline HeapObject* next() { |
761 return (cur_addr_ < cur_limit_) ? FromCurrentPage() : FromNextPage(); | 762 return (cur_addr_ < cur_limit_) ? FromCurrentPage() : FromNextPage(); |
762 } | 763 } |
763 | 764 |
764 // implementation of ObjectIterator. | 765 // implementation of ObjectIterator. |
765 virtual HeapObject* next_object() { return next(); } | 766 virtual HeapObject* next_object() { return next(); } |
766 | 767 |
767 private: | 768 private: |
768 Address cur_addr_; // current iteration point | 769 Address cur_addr_; // current iteration point |
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 | 2131 |
2131 int PageCount() { | 2132 int PageCount() { |
2132 return page_count_; | 2133 return page_count_; |
2133 } | 2134 } |
2134 | 2135 |
2135 // Finds an object for a given address, returns Failure::Exception() | 2136 // Finds an object for a given address, returns Failure::Exception() |
2136 // if it is not found. The function iterates through all objects in this | 2137 // if it is not found. The function iterates through all objects in this |
2137 // space, may be slow. | 2138 // space, may be slow. |
2138 Object* FindObject(Address a); | 2139 Object* FindObject(Address a); |
2139 | 2140 |
| 2141 // Finds a large object page containing the given pc, returns NULL |
| 2142 // if such a page doesn't exist. |
| 2143 LargeObjectChunk* FindChunkContainingPc(Address pc); |
| 2144 |
| 2145 |
2140 // Iterates objects covered by dirty regions. | 2146 // Iterates objects covered by dirty regions. |
2141 void IterateDirtyRegions(ObjectSlotCallback func); | 2147 void IterateDirtyRegions(ObjectSlotCallback func); |
2142 | 2148 |
2143 // Frees unmarked objects. | 2149 // Frees unmarked objects. |
2144 void FreeUnmarkedObjects(); | 2150 void FreeUnmarkedObjects(); |
2145 | 2151 |
2146 // Checks whether a heap object is in this space; O(1). | 2152 // Checks whether a heap object is in this space; O(1). |
2147 bool Contains(HeapObject* obj); | 2153 bool Contains(HeapObject* obj); |
2148 | 2154 |
2149 // Checks whether the space is empty. | 2155 // Checks whether the space is empty. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2202 | 2208 |
2203 private: | 2209 private: |
2204 LargeObjectChunk* current_; | 2210 LargeObjectChunk* current_; |
2205 HeapObjectCallback size_func_; | 2211 HeapObjectCallback size_func_; |
2206 }; | 2212 }; |
2207 | 2213 |
2208 | 2214 |
2209 } } // namespace v8::internal | 2215 } } // namespace v8::internal |
2210 | 2216 |
2211 #endif // V8_SPACES_H_ | 2217 #endif // V8_SPACES_H_ |
OLD | NEW |