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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 ASSERT(cur_addr_ <= cur_limit_); | 57 ASSERT(cur_addr_ <= cur_limit_); |
58 | 58 |
59 return obj; | 59 return obj; |
60 } | 60 } |
61 | 61 |
62 | 62 |
63 // ----------------------------------------------------------------------------- | 63 // ----------------------------------------------------------------------------- |
64 // PageIterator | 64 // PageIterator |
65 | 65 |
66 bool PageIterator::has_next() { | 66 bool PageIterator::has_next() { |
67 return cur_page_ != stop_page_; | 67 return prev_page_ != stop_page_; |
68 } | 68 } |
69 | 69 |
70 | 70 |
71 Page* PageIterator::next() { | 71 Page* PageIterator::next() { |
72 ASSERT(has_next()); | 72 ASSERT(has_next()); |
73 Page* result = cur_page_; | 73 prev_page_ = (prev_page_ == NULL) |
74 cur_page_ = cur_page_->next_page(); | 74 ? space_->first_page_ |
75 return result; | 75 : prev_page_->next_page(); |
| 76 return prev_page_; |
76 } | 77 } |
77 | 78 |
78 | 79 |
79 // ----------------------------------------------------------------------------- | 80 // ----------------------------------------------------------------------------- |
80 // Page | 81 // Page |
81 | 82 |
82 Page* Page::next_page() { | 83 Page* Page::next_page() { |
83 return MemoryAllocator::GetNextPage(this); | 84 return MemoryAllocator::GetNextPage(this); |
84 } | 85 } |
85 | 86 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 ASSERT(space->low() <= alloc_info->top | 348 ASSERT(space->low() <= alloc_info->top |
348 && alloc_info->top <= space->high() | 349 && alloc_info->top <= space->high() |
349 && alloc_info->limit == space->high()); | 350 && alloc_info->limit == space->high()); |
350 #endif | 351 #endif |
351 return obj; | 352 return obj; |
352 } | 353 } |
353 | 354 |
354 } } // namespace v8::internal | 355 } } // namespace v8::internal |
355 | 356 |
356 #endif // V8_SPACES_INL_H_ | 357 #endif // V8_SPACES_INL_H_ |
OLD | NEW |