| 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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 first_unswept_page_ = Page::FromAddress(NULL); | 761 first_unswept_page_ = Page::FromAddress(NULL); |
| 762 } | 762 } |
| 763 } | 763 } |
| 764 | 764 |
| 765 if (page->WasSwept()) { | 765 if (page->WasSwept()) { |
| 766 intptr_t size = free_list_.EvictFreeListItems(page); | 766 intptr_t size = free_list_.EvictFreeListItems(page); |
| 767 accounting_stats_.AllocateBytes(size); | 767 accounting_stats_.AllocateBytes(size); |
| 768 ASSERT_EQ(Page::kObjectAreaSize, static_cast<int>(size)); | 768 ASSERT_EQ(Page::kObjectAreaSize, static_cast<int>(size)); |
| 769 } | 769 } |
| 770 | 770 |
| 771 if (Page::FromAllocationTop(allocation_info_.top) == page) { |
| 772 allocation_info_.top = allocation_info_.limit = NULL; |
| 773 } |
| 774 |
| 771 page->Unlink(); | 775 page->Unlink(); |
| 772 if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) { | 776 if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) { |
| 773 heap()->isolate()->memory_allocator()->Free(page); | 777 heap()->isolate()->memory_allocator()->Free(page); |
| 774 } else { | 778 } else { |
| 775 heap()->QueueMemoryChunkForFree(page); | 779 heap()->QueueMemoryChunkForFree(page); |
| 776 } | 780 } |
| 777 | 781 |
| 778 ASSERT(Capacity() > 0); | 782 ASSERT(Capacity() > 0); |
| 779 ASSERT(Capacity() % Page::kObjectAreaSize == 0); | 783 ASSERT(Capacity() % Page::kObjectAreaSize == 0); |
| 780 accounting_stats_.ShrinkSpace(Page::kObjectAreaSize); | 784 accounting_stats_.ShrinkSpace(Page::kObjectAreaSize); |
| (...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2111 | 2115 |
| 2112 heap()->FreeQueuedChunks(); | 2116 heap()->FreeQueuedChunks(); |
| 2113 | 2117 |
| 2114 return IsSweepingComplete(); | 2118 return IsSweepingComplete(); |
| 2115 } | 2119 } |
| 2116 | 2120 |
| 2117 | 2121 |
| 2118 void PagedSpace::EvictEvacuationCandidatesFromFreeLists() { | 2122 void PagedSpace::EvictEvacuationCandidatesFromFreeLists() { |
| 2119 if (allocation_info_.top >= allocation_info_.limit) return; | 2123 if (allocation_info_.top >= allocation_info_.limit) return; |
| 2120 | 2124 |
| 2121 if (Page::FromAddress(allocation_info_.top)->IsEvacuationCandidate()) { | 2125 if (Page::FromAllocationTop(allocation_info_.top)->IsEvacuationCandidate()) { |
| 2122 // Create filler object to keep page iterable if it was iterable. | 2126 // Create filler object to keep page iterable if it was iterable. |
| 2123 int remaining = | 2127 int remaining = |
| 2124 static_cast<int>(allocation_info_.limit - allocation_info_.top); | 2128 static_cast<int>(allocation_info_.limit - allocation_info_.top); |
| 2125 heap()->CreateFillerObjectAt(allocation_info_.top, remaining); | 2129 heap()->CreateFillerObjectAt(allocation_info_.top, remaining); |
| 2126 | 2130 |
| 2127 allocation_info_.top = NULL; | 2131 allocation_info_.top = NULL; |
| 2128 allocation_info_.limit = NULL; | 2132 allocation_info_.limit = NULL; |
| 2129 } | 2133 } |
| 2130 } | 2134 } |
| 2131 | 2135 |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2632 object->ShortPrint(); | 2636 object->ShortPrint(); |
| 2633 PrintF("\n"); | 2637 PrintF("\n"); |
| 2634 } | 2638 } |
| 2635 printf(" --------------------------------------\n"); | 2639 printf(" --------------------------------------\n"); |
| 2636 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 2640 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 2637 } | 2641 } |
| 2638 | 2642 |
| 2639 #endif // DEBUG | 2643 #endif // DEBUG |
| 2640 | 2644 |
| 2641 } } // namespace v8::internal | 2645 } } // namespace v8::internal |
| OLD | NEW |