OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/heap/spaces.h" | 5 #include "src/heap/spaces.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/base/platform/semaphore.h" | 9 #include "src/base/platform/semaphore.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 } | 1081 } |
1082 | 1082 |
1083 | 1083 |
1084 bool PagedSpace::SetUp() { return true; } | 1084 bool PagedSpace::SetUp() { return true; } |
1085 | 1085 |
1086 | 1086 |
1087 bool PagedSpace::HasBeenSetUp() { return true; } | 1087 bool PagedSpace::HasBeenSetUp() { return true; } |
1088 | 1088 |
1089 | 1089 |
1090 void PagedSpace::TearDown() { | 1090 void PagedSpace::TearDown() { |
1091 PageIterator iterator(this); | 1091 for (auto it = begin(); it != end();) { |
1092 while (iterator.has_next()) { | 1092 Page* page = *(it++); // Will be erased. |
1093 Page* page = iterator.next(); | |
1094 ArrayBufferTracker::FreeAll(page); | 1093 ArrayBufferTracker::FreeAll(page); |
1095 heap()->memory_allocator()->Free<MemoryAllocator::kFull>(page); | 1094 heap()->memory_allocator()->Free<MemoryAllocator::kFull>(page); |
1096 } | 1095 } |
1097 anchor_.set_next_page(&anchor_); | 1096 anchor_.set_next_page(&anchor_); |
1098 anchor_.set_prev_page(&anchor_); | 1097 anchor_.set_prev_page(&anchor_); |
1099 accounting_stats_.Clear(); | 1098 accounting_stats_.Clear(); |
1100 } | 1099 } |
1101 | 1100 |
1102 void PagedSpace::RefillFreeList() { | 1101 void PagedSpace::RefillFreeList() { |
1103 // Any PagedSpace might invoke RefillFreeList. We filter all but our old | 1102 // Any PagedSpace might invoke RefillFreeList. We filter all but our old |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 accounting_stats_.Merge(other->accounting_stats_); | 1140 accounting_stats_.Merge(other->accounting_stats_); |
1142 other->accounting_stats_.Clear(); | 1141 other->accounting_stats_.Clear(); |
1143 | 1142 |
1144 // The linear allocation area of {other} should be destroyed now. | 1143 // The linear allocation area of {other} should be destroyed now. |
1145 DCHECK(other->top() == nullptr); | 1144 DCHECK(other->top() == nullptr); |
1146 DCHECK(other->limit() == nullptr); | 1145 DCHECK(other->limit() == nullptr); |
1147 | 1146 |
1148 AccountCommitted(other->CommittedMemory()); | 1147 AccountCommitted(other->CommittedMemory()); |
1149 | 1148 |
1150 // Move over pages. | 1149 // Move over pages. |
1151 PageIterator it(other); | 1150 for (auto it = other->begin(); it != other->end();) { |
1152 Page* p = nullptr; | 1151 Page* p = *(it++); |
1153 while (it.has_next()) { | |
1154 p = it.next(); | |
1155 | 1152 |
1156 // Relinking requires the category to be unlinked. | 1153 // Relinking requires the category to be unlinked. |
1157 other->UnlinkFreeListCategories(p); | 1154 other->UnlinkFreeListCategories(p); |
1158 | 1155 |
1159 p->Unlink(); | 1156 p->Unlink(); |
1160 p->set_owner(this); | 1157 p->set_owner(this); |
1161 p->InsertAfter(anchor_.prev_page()); | 1158 p->InsertAfter(anchor_.prev_page()); |
1162 RelinkFreeListCategories(p); | 1159 RelinkFreeListCategories(p); |
1163 } | 1160 } |
1164 } | 1161 } |
1165 | 1162 |
1166 | 1163 |
1167 size_t PagedSpace::CommittedPhysicalMemory() { | 1164 size_t PagedSpace::CommittedPhysicalMemory() { |
1168 if (!base::VirtualMemory::HasLazyCommits()) return CommittedMemory(); | 1165 if (!base::VirtualMemory::HasLazyCommits()) return CommittedMemory(); |
1169 MemoryChunk::UpdateHighWaterMark(allocation_info_.top()); | 1166 MemoryChunk::UpdateHighWaterMark(allocation_info_.top()); |
1170 size_t size = 0; | 1167 size_t size = 0; |
1171 PageIterator it(this); | 1168 for (Page* page : *this) { |
1172 while (it.has_next()) { | 1169 size += page->CommittedPhysicalMemory(); |
1173 size += it.next()->CommittedPhysicalMemory(); | |
1174 } | 1170 } |
1175 return size; | 1171 return size; |
1176 } | 1172 } |
1177 | 1173 |
1178 bool PagedSpace::ContainsSlow(Address addr) { | 1174 bool PagedSpace::ContainsSlow(Address addr) { |
1179 Page* p = Page::FromAddress(addr); | 1175 Page* p = Page::FromAddress(addr); |
1180 PageIterator iterator(this); | 1176 for (Page* page : *this) { |
1181 while (iterator.has_next()) { | 1177 if (page == p) return true; |
1182 if (iterator.next() == p) return true; | |
1183 } | 1178 } |
1184 return false; | 1179 return false; |
1185 } | 1180 } |
1186 | 1181 |
1187 | 1182 |
1188 Object* PagedSpace::FindObject(Address addr) { | 1183 Object* PagedSpace::FindObject(Address addr) { |
1189 // Note: this function can only be called on iterable spaces. | 1184 // Note: this function can only be called on iterable spaces. |
1190 DCHECK(!heap()->mark_compact_collector()->in_use()); | 1185 DCHECK(!heap()->mark_compact_collector()->in_use()); |
1191 | 1186 |
1192 if (!Contains(addr)) return Smi::FromInt(0); // Signaling not found. | 1187 if (!Contains(addr)) return Smi::FromInt(0); // Signaling not found. |
1193 | 1188 |
1194 Page* p = Page::FromAddress(addr); | 1189 Page* p = Page::FromAddress(addr); |
1195 HeapObjectIterator it(p); | 1190 HeapObjectIterator it(p); |
1196 for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { | 1191 for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { |
1197 Address cur = obj->address(); | 1192 Address cur = obj->address(); |
1198 Address next = cur + obj->Size(); | 1193 Address next = cur + obj->Size(); |
1199 if ((cur <= addr) && (addr < next)) return obj; | 1194 if ((cur <= addr) && (addr < next)) return obj; |
1200 } | 1195 } |
1201 | 1196 |
1202 UNREACHABLE(); | 1197 UNREACHABLE(); |
1203 return Smi::FromInt(0); | 1198 return Smi::FromInt(0); |
1204 } | 1199 } |
1205 | 1200 |
1206 | |
1207 bool PagedSpace::Expand() { | 1201 bool PagedSpace::Expand() { |
1208 int size = AreaSize(); | 1202 int size = AreaSize(); |
1209 if (snapshotable() && !HasPages()) { | 1203 if (snapshotable() && !HasPages()) { |
1210 size = Snapshot::SizeOfFirstPage(heap()->isolate(), identity()); | 1204 size = Snapshot::SizeOfFirstPage(heap()->isolate(), identity()); |
1211 } | 1205 } |
1212 | 1206 |
1213 if (!heap()->CanExpandOldGeneration(size)) return false; | 1207 if (!heap()->CanExpandOldGeneration(size)) return false; |
1214 | 1208 |
1215 Page* p = heap()->memory_allocator()->AllocatePage(size, this, executable()); | 1209 Page* p = heap()->memory_allocator()->AllocatePage(size, this, executable()); |
1216 if (p == nullptr) return false; | 1210 if (p == nullptr) return false; |
(...skipping 17 matching lines...) Expand all Loading... |
1234 | 1228 |
1235 DCHECK(Capacity() <= heap()->MaxOldGenerationSize()); | 1229 DCHECK(Capacity() <= heap()->MaxOldGenerationSize()); |
1236 | 1230 |
1237 p->InsertAfter(anchor_.prev_page()); | 1231 p->InsertAfter(anchor_.prev_page()); |
1238 | 1232 |
1239 return true; | 1233 return true; |
1240 } | 1234 } |
1241 | 1235 |
1242 | 1236 |
1243 int PagedSpace::CountTotalPages() { | 1237 int PagedSpace::CountTotalPages() { |
1244 PageIterator it(this); | |
1245 int count = 0; | 1238 int count = 0; |
1246 while (it.has_next()) { | 1239 for (Page* page : *this) { |
1247 it.next(); | |
1248 count++; | 1240 count++; |
| 1241 USE(page); |
1249 } | 1242 } |
1250 return count; | 1243 return count; |
1251 } | 1244 } |
1252 | 1245 |
1253 | 1246 |
1254 void PagedSpace::ResetFreeListStatistics() { | 1247 void PagedSpace::ResetFreeListStatistics() { |
1255 PageIterator page_iterator(this); | 1248 for (Page* page : *this) { |
1256 while (page_iterator.has_next()) { | |
1257 Page* page = page_iterator.next(); | |
1258 page->ResetFreeListStatistics(); | 1249 page->ResetFreeListStatistics(); |
1259 } | 1250 } |
1260 } | 1251 } |
1261 | 1252 |
1262 | 1253 |
1263 void PagedSpace::IncreaseCapacity(int size) { | 1254 void PagedSpace::IncreaseCapacity(int size) { |
1264 accounting_stats_.ExpandSpace(size); | 1255 accounting_stats_.ExpandSpace(size); |
1265 } | 1256 } |
1266 | 1257 |
1267 void PagedSpace::ReleasePage(Page* page) { | 1258 void PagedSpace::ReleasePage(Page* page) { |
(...skipping 22 matching lines...) Expand all Loading... |
1290 } | 1281 } |
1291 | 1282 |
1292 #ifdef DEBUG | 1283 #ifdef DEBUG |
1293 void PagedSpace::Print() {} | 1284 void PagedSpace::Print() {} |
1294 #endif | 1285 #endif |
1295 | 1286 |
1296 #ifdef VERIFY_HEAP | 1287 #ifdef VERIFY_HEAP |
1297 void PagedSpace::Verify(ObjectVisitor* visitor) { | 1288 void PagedSpace::Verify(ObjectVisitor* visitor) { |
1298 bool allocation_pointer_found_in_space = | 1289 bool allocation_pointer_found_in_space = |
1299 (allocation_info_.top() == allocation_info_.limit()); | 1290 (allocation_info_.top() == allocation_info_.limit()); |
1300 PageIterator page_iterator(this); | 1291 for (Page* page : *this) { |
1301 while (page_iterator.has_next()) { | |
1302 Page* page = page_iterator.next(); | |
1303 CHECK(page->owner() == this); | 1292 CHECK(page->owner() == this); |
1304 if (page == Page::FromAllocationAreaAddress(allocation_info_.top())) { | 1293 if (page == Page::FromAllocationAreaAddress(allocation_info_.top())) { |
1305 allocation_pointer_found_in_space = true; | 1294 allocation_pointer_found_in_space = true; |
1306 } | 1295 } |
1307 CHECK(page->SweepingDone()); | 1296 CHECK(page->SweepingDone()); |
1308 HeapObjectIterator it(page); | 1297 HeapObjectIterator it(page); |
1309 Address end_of_previous_object = page->area_start(); | 1298 Address end_of_previous_object = page->area_start(); |
1310 Address top = page->area_end(); | 1299 Address top = page->area_end(); |
1311 int black_size = 0; | 1300 int black_size = 0; |
1312 for (HeapObject* object = it.Next(); object != NULL; object = it.Next()) { | 1301 for (HeapObject* object = it.Next(); object != NULL; object = it.Next()) { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 UpdateInlineAllocationLimit(0); | 1512 UpdateInlineAllocationLimit(0); |
1524 DCHECK_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); | 1513 DCHECK_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); |
1525 } | 1514 } |
1526 | 1515 |
1527 | 1516 |
1528 void NewSpace::ResetAllocationInfo() { | 1517 void NewSpace::ResetAllocationInfo() { |
1529 Address old_top = allocation_info_.top(); | 1518 Address old_top = allocation_info_.top(); |
1530 to_space_.Reset(); | 1519 to_space_.Reset(); |
1531 UpdateAllocationInfo(); | 1520 UpdateAllocationInfo(); |
1532 // Clear all mark-bits in the to-space. | 1521 // Clear all mark-bits in the to-space. |
1533 NewSpacePageIterator it(&to_space_); | 1522 for (Page* p : to_space_) { |
1534 while (it.has_next()) { | 1523 Bitmap::Clear(p); |
1535 Bitmap::Clear(it.next()); | |
1536 } | 1524 } |
1537 InlineAllocationStep(old_top, allocation_info_.top(), nullptr, 0); | 1525 InlineAllocationStep(old_top, allocation_info_.top(), nullptr, 0); |
1538 } | 1526 } |
1539 | 1527 |
1540 | 1528 |
1541 void NewSpace::UpdateInlineAllocationLimit(int size_in_bytes) { | 1529 void NewSpace::UpdateInlineAllocationLimit(int size_in_bytes) { |
1542 if (heap()->inline_allocation_disabled()) { | 1530 if (heap()->inline_allocation_disabled()) { |
1543 // Lowest limit when linear allocation was disabled. | 1531 // Lowest limit when linear allocation was disabled. |
1544 Address high = to_space_.page_high(); | 1532 Address high = to_space_.page_high(); |
1545 Address new_top = allocation_info_.top() + size_in_bytes; | 1533 Address new_top = allocation_info_.top() + size_in_bytes; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 minimum_capacity_ = RoundDown(initial_capacity, Page::kPageSize); | 1731 minimum_capacity_ = RoundDown(initial_capacity, Page::kPageSize); |
1744 current_capacity_ = minimum_capacity_; | 1732 current_capacity_ = minimum_capacity_; |
1745 maximum_capacity_ = RoundDown(maximum_capacity, Page::kPageSize); | 1733 maximum_capacity_ = RoundDown(maximum_capacity, Page::kPageSize); |
1746 committed_ = false; | 1734 committed_ = false; |
1747 } | 1735 } |
1748 | 1736 |
1749 | 1737 |
1750 void SemiSpace::TearDown() { | 1738 void SemiSpace::TearDown() { |
1751 // Properly uncommit memory to keep the allocator counters in sync. | 1739 // Properly uncommit memory to keep the allocator counters in sync. |
1752 if (is_committed()) { | 1740 if (is_committed()) { |
1753 NewSpacePageIterator it(this); | 1741 for (Page* p : *this) { |
1754 while (it.has_next()) { | 1742 ArrayBufferTracker::FreeAll(p); |
1755 Page* page = it.next(); | |
1756 ArrayBufferTracker::FreeAll(page); | |
1757 } | 1743 } |
1758 Uncommit(); | 1744 Uncommit(); |
1759 } | 1745 } |
1760 current_capacity_ = maximum_capacity_ = 0; | 1746 current_capacity_ = maximum_capacity_ = 0; |
1761 } | 1747 } |
1762 | 1748 |
1763 | 1749 |
1764 bool SemiSpace::Commit() { | 1750 bool SemiSpace::Commit() { |
1765 DCHECK(!is_committed()); | 1751 DCHECK(!is_committed()); |
1766 Page* current = anchor(); | 1752 Page* current = anchor(); |
(...skipping 14 matching lines...) Expand all Loading... |
1781 if (age_mark_ == nullptr) { | 1767 if (age_mark_ == nullptr) { |
1782 age_mark_ = first_page()->area_start(); | 1768 age_mark_ = first_page()->area_start(); |
1783 } | 1769 } |
1784 committed_ = true; | 1770 committed_ = true; |
1785 return true; | 1771 return true; |
1786 } | 1772 } |
1787 | 1773 |
1788 | 1774 |
1789 bool SemiSpace::Uncommit() { | 1775 bool SemiSpace::Uncommit() { |
1790 DCHECK(is_committed()); | 1776 DCHECK(is_committed()); |
1791 NewSpacePageIterator it(this); | 1777 for (auto it = begin(); it != end();) { |
1792 while (it.has_next()) { | 1778 Page* p = *(it++); |
1793 heap()->memory_allocator()->Free<MemoryAllocator::kPooledAndQueue>( | 1779 heap()->memory_allocator()->Free<MemoryAllocator::kPooledAndQueue>(p); |
1794 it.next()); | |
1795 } | 1780 } |
1796 anchor()->set_next_page(anchor()); | 1781 anchor()->set_next_page(anchor()); |
1797 anchor()->set_prev_page(anchor()); | 1782 anchor()->set_prev_page(anchor()); |
1798 AccountUncommitted(current_capacity_); | 1783 AccountUncommitted(current_capacity_); |
1799 committed_ = false; | 1784 committed_ = false; |
1800 heap()->memory_allocator()->unmapper()->FreeQueuedChunks(); | 1785 heap()->memory_allocator()->unmapper()->FreeQueuedChunks(); |
1801 return true; | 1786 return true; |
1802 } | 1787 } |
1803 | 1788 |
1804 | 1789 |
1805 size_t SemiSpace::CommittedPhysicalMemory() { | 1790 size_t SemiSpace::CommittedPhysicalMemory() { |
1806 if (!is_committed()) return 0; | 1791 if (!is_committed()) return 0; |
1807 size_t size = 0; | 1792 size_t size = 0; |
1808 NewSpacePageIterator it(this); | 1793 for (Page* p : *this) { |
1809 while (it.has_next()) { | 1794 size += p->CommittedPhysicalMemory(); |
1810 size += it.next()->CommittedPhysicalMemory(); | |
1811 } | 1795 } |
1812 return size; | 1796 return size; |
1813 } | 1797 } |
1814 | 1798 |
1815 | 1799 |
1816 bool SemiSpace::GrowTo(int new_capacity) { | 1800 bool SemiSpace::GrowTo(int new_capacity) { |
1817 if (!is_committed()) { | 1801 if (!is_committed()) { |
1818 if (!Commit()) return false; | 1802 if (!Commit()) return false; |
1819 } | 1803 } |
1820 DCHECK_EQ(new_capacity & Page::kPageAlignmentMask, 0); | 1804 DCHECK_EQ(new_capacity & Page::kPageAlignmentMask, 0); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1881 } | 1865 } |
1882 current_capacity_ = new_capacity; | 1866 current_capacity_ = new_capacity; |
1883 return true; | 1867 return true; |
1884 } | 1868 } |
1885 | 1869 |
1886 void SemiSpace::FixPagesFlags(intptr_t flags, intptr_t mask) { | 1870 void SemiSpace::FixPagesFlags(intptr_t flags, intptr_t mask) { |
1887 anchor_.set_owner(this); | 1871 anchor_.set_owner(this); |
1888 anchor_.prev_page()->set_next_page(&anchor_); | 1872 anchor_.prev_page()->set_next_page(&anchor_); |
1889 anchor_.next_page()->set_prev_page(&anchor_); | 1873 anchor_.next_page()->set_prev_page(&anchor_); |
1890 | 1874 |
1891 NewSpacePageIterator it(this); | 1875 for (Page* page : *this) { |
1892 while (it.has_next()) { | |
1893 Page* page = it.next(); | |
1894 page->set_owner(this); | 1876 page->set_owner(this); |
1895 page->SetFlags(flags, mask); | 1877 page->SetFlags(flags, mask); |
1896 if (id_ == kToSpace) { | 1878 if (id_ == kToSpace) { |
1897 page->ClearFlag(MemoryChunk::IN_FROM_SPACE); | 1879 page->ClearFlag(MemoryChunk::IN_FROM_SPACE); |
1898 page->SetFlag(MemoryChunk::IN_TO_SPACE); | 1880 page->SetFlag(MemoryChunk::IN_TO_SPACE); |
1899 page->ClearFlag(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK); | 1881 page->ClearFlag(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK); |
1900 page->ResetLiveBytes(); | 1882 page->ResetLiveBytes(); |
1901 } else { | 1883 } else { |
1902 page->SetFlag(MemoryChunk::IN_FROM_SPACE); | 1884 page->SetFlag(MemoryChunk::IN_FROM_SPACE); |
1903 page->ClearFlag(MemoryChunk::IN_TO_SPACE); | 1885 page->ClearFlag(MemoryChunk::IN_TO_SPACE); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1946 | 1928 |
1947 to->FixPagesFlags(saved_to_space_flags, Page::kCopyOnFlipFlagsMask); | 1929 to->FixPagesFlags(saved_to_space_flags, Page::kCopyOnFlipFlagsMask); |
1948 from->FixPagesFlags(0, 0); | 1930 from->FixPagesFlags(0, 0); |
1949 } | 1931 } |
1950 | 1932 |
1951 | 1933 |
1952 void SemiSpace::set_age_mark(Address mark) { | 1934 void SemiSpace::set_age_mark(Address mark) { |
1953 DCHECK_EQ(Page::FromAllocationAreaAddress(mark)->owner(), this); | 1935 DCHECK_EQ(Page::FromAllocationAreaAddress(mark)->owner(), this); |
1954 age_mark_ = mark; | 1936 age_mark_ = mark; |
1955 // Mark all pages up to the one containing mark. | 1937 // Mark all pages up to the one containing mark. |
1956 NewSpacePageIterator it(space_start(), mark); | 1938 for (Page* p : NewSpacePageRange(space_start(), mark)) { |
1957 while (it.has_next()) { | 1939 p->SetFlag(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK); |
1958 it.next()->SetFlag(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK); | |
1959 } | 1940 } |
1960 } | 1941 } |
1961 | 1942 |
1962 | 1943 |
1963 #ifdef DEBUG | 1944 #ifdef DEBUG |
1964 void SemiSpace::Print() {} | 1945 void SemiSpace::Print() {} |
1965 #endif | 1946 #endif |
1966 | 1947 |
1967 #ifdef VERIFY_HEAP | 1948 #ifdef VERIFY_HEAP |
1968 void SemiSpace::Verify() { | 1949 void SemiSpace::Verify() { |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2654 | 2635 |
2655 | 2636 |
2656 // After we have booted, we have created a map which represents free space | 2637 // After we have booted, we have created a map which represents free space |
2657 // on the heap. If there was already a free list then the elements on it | 2638 // on the heap. If there was already a free list then the elements on it |
2658 // were created with the wrong FreeSpaceMap (normally NULL), so we need to | 2639 // were created with the wrong FreeSpaceMap (normally NULL), so we need to |
2659 // fix them. | 2640 // fix them. |
2660 void PagedSpace::RepairFreeListsAfterDeserialization() { | 2641 void PagedSpace::RepairFreeListsAfterDeserialization() { |
2661 free_list_.RepairLists(heap()); | 2642 free_list_.RepairLists(heap()); |
2662 // Each page may have a small free space that is not tracked by a free list. | 2643 // Each page may have a small free space that is not tracked by a free list. |
2663 // Update the maps for those free space objects. | 2644 // Update the maps for those free space objects. |
2664 PageIterator iterator(this); | 2645 for (Page* page : *this) { |
2665 while (iterator.has_next()) { | |
2666 Page* page = iterator.next(); | |
2667 int size = static_cast<int>(page->wasted_memory()); | 2646 int size = static_cast<int>(page->wasted_memory()); |
2668 if (size == 0) continue; | 2647 if (size == 0) continue; |
2669 Address address = page->OffsetToAddress(Page::kPageSize - size); | 2648 Address address = page->OffsetToAddress(Page::kPageSize - size); |
2670 heap()->CreateFillerObjectAt(address, size, ClearRecordedSlots::kNo); | 2649 heap()->CreateFillerObjectAt(address, size, ClearRecordedSlots::kNo); |
2671 } | 2650 } |
2672 } | 2651 } |
2673 | 2652 |
2674 | 2653 |
2675 void PagedSpace::EvictEvacuationCandidatesFromLinearAllocationArea() { | 2654 void PagedSpace::EvictEvacuationCandidatesFromLinearAllocationArea() { |
2676 if (allocation_info_.top() >= allocation_info_.limit()) return; | 2655 if (allocation_info_.top() >= allocation_info_.limit()) return; |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3257 object->ShortPrint(); | 3236 object->ShortPrint(); |
3258 PrintF("\n"); | 3237 PrintF("\n"); |
3259 } | 3238 } |
3260 printf(" --------------------------------------\n"); | 3239 printf(" --------------------------------------\n"); |
3261 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3240 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3262 } | 3241 } |
3263 | 3242 |
3264 #endif // DEBUG | 3243 #endif // DEBUG |
3265 } // namespace internal | 3244 } // namespace internal |
3266 } // namespace v8 | 3245 } // namespace v8 |
OLD | NEW |