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 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1696 // so that we don't waste effort pointlessly scanning for objects. | 1696 // so that we don't waste effort pointlessly scanning for objects. |
1697 ASSERT(!marking_deque->IsFull()); | 1697 ASSERT(!marking_deque->IsFull()); |
1698 | 1698 |
1699 Map* filler_map = heap->one_pointer_filler_map(); | 1699 Map* filler_map = heap->one_pointer_filler_map(); |
1700 for (HeapObject* object = it->Next(); | 1700 for (HeapObject* object = it->Next(); |
1701 object != NULL; | 1701 object != NULL; |
1702 object = it->Next()) { | 1702 object = it->Next()) { |
1703 MarkBit markbit = Marking::MarkBitFrom(object); | 1703 MarkBit markbit = Marking::MarkBitFrom(object); |
1704 if ((object->map() != filler_map) && Marking::IsGrey(markbit)) { | 1704 if ((object->map() != filler_map) && Marking::IsGrey(markbit)) { |
1705 Marking::GreyToBlack(markbit); | 1705 Marking::GreyToBlack(markbit); |
| 1706 MemoryChunk::IncrementLiveBytes(object->address(), object->Size()); |
1706 marking_deque->PushBlack(object); | 1707 marking_deque->PushBlack(object); |
1707 if (marking_deque->IsFull()) return; | 1708 if (marking_deque->IsFull()) return; |
1708 } | 1709 } |
1709 } | 1710 } |
1710 } | 1711 } |
1711 | 1712 |
1712 | 1713 |
1713 static inline int MarkWordToObjectStarts(uint32_t mark_bits, int* starts); | 1714 static inline int MarkWordToObjectStarts(uint32_t mark_bits, int* starts); |
1714 | 1715 |
1715 | 1716 |
(...skipping 30 matching lines...) Expand all Loading... |
1746 | 1747 |
1747 int offset = 0; | 1748 int offset = 0; |
1748 while (grey_objects != 0) { | 1749 while (grey_objects != 0) { |
1749 int trailing_zeros = CompilerIntrinsics::CountTrailingZeros(grey_objects); | 1750 int trailing_zeros = CompilerIntrinsics::CountTrailingZeros(grey_objects); |
1750 grey_objects >>= trailing_zeros; | 1751 grey_objects >>= trailing_zeros; |
1751 offset += trailing_zeros; | 1752 offset += trailing_zeros; |
1752 MarkBit markbit(&cells[cell_index], 1 << offset, false); | 1753 MarkBit markbit(&cells[cell_index], 1 << offset, false); |
1753 ASSERT(Marking::IsGrey(markbit)); | 1754 ASSERT(Marking::IsGrey(markbit)); |
1754 Marking::GreyToBlack(markbit); | 1755 Marking::GreyToBlack(markbit); |
1755 Address addr = cell_base + offset * kPointerSize; | 1756 Address addr = cell_base + offset * kPointerSize; |
1756 marking_deque->PushBlack(HeapObject::FromAddress(addr)); | 1757 HeapObject* object = HeapObject::FromAddress(addr); |
| 1758 MemoryChunk::IncrementLiveBytes(object->address(), object->Size()); |
| 1759 marking_deque->PushBlack(object); |
1757 if (marking_deque->IsFull()) return; | 1760 if (marking_deque->IsFull()) return; |
1758 offset += 2; | 1761 offset += 2; |
1759 grey_objects >>= 2; | 1762 grey_objects >>= 2; |
1760 } | 1763 } |
1761 | 1764 |
1762 grey_objects >>= (Bitmap::kBitsPerCell - 1); | 1765 grey_objects >>= (Bitmap::kBitsPerCell - 1); |
1763 } | 1766 } |
1764 } | 1767 } |
1765 | 1768 |
1766 | 1769 |
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3799 while (buffer != NULL) { | 3802 while (buffer != NULL) { |
3800 SlotsBuffer* next_buffer = buffer->next(); | 3803 SlotsBuffer* next_buffer = buffer->next(); |
3801 DeallocateBuffer(buffer); | 3804 DeallocateBuffer(buffer); |
3802 buffer = next_buffer; | 3805 buffer = next_buffer; |
3803 } | 3806 } |
3804 *buffer_address = NULL; | 3807 *buffer_address = NULL; |
3805 } | 3808 } |
3806 | 3809 |
3807 | 3810 |
3808 } } // namespace v8::internal | 3811 } } // namespace v8::internal |
OLD | NEW |