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 prev_page_ != stop_page_; | 67 return cur_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 prev_page_ = (prev_page_ == NULL) | 73 Page* result = cur_page_; |
74 ? space_->first_page_ | 74 cur_page_ = cur_page_->next_page(); |
75 : prev_page_->next_page(); | 75 return result; |
76 return prev_page_; | |
77 } | 76 } |
78 | 77 |
79 | 78 |
80 // ----------------------------------------------------------------------------- | 79 // ----------------------------------------------------------------------------- |
81 // Page | 80 // Page |
82 | 81 |
83 Page* Page::next_page() { | 82 Page* Page::next_page() { |
84 return MemoryAllocator::GetNextPage(this); | 83 return MemoryAllocator::GetNextPage(this); |
85 } | 84 } |
86 | 85 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 ASSERT(space->low() <= alloc_info->top | 347 ASSERT(space->low() <= alloc_info->top |
349 && alloc_info->top <= space->high() | 348 && alloc_info->top <= space->high() |
350 && alloc_info->limit == space->high()); | 349 && alloc_info->limit == space->high()); |
351 #endif | 350 #endif |
352 return obj; | 351 return obj; |
353 } | 352 } |
354 | 353 |
355 } } // namespace v8::internal | 354 } } // namespace v8::internal |
356 | 355 |
357 #endif // V8_SPACES_INL_H_ | 356 #endif // V8_SPACES_INL_H_ |
OLD | NEW |