| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1745 T* it) { | 1745 T* it) { |
| 1746 // The caller should ensure that the marking stack is initially not full, | 1746 // The caller should ensure that the marking stack is initially not full, |
| 1747 // so that we don't waste effort pointlessly scanning for objects. | 1747 // so that we don't waste effort pointlessly scanning for objects. |
| 1748 DCHECK(!marking_deque->IsFull()); | 1748 DCHECK(!marking_deque->IsFull()); |
| 1749 | 1749 |
| 1750 Map* filler_map = heap->one_pointer_filler_map(); | 1750 Map* filler_map = heap->one_pointer_filler_map(); |
| 1751 for (HeapObject* object = it->Next(); object != NULL; object = it->Next()) { | 1751 for (HeapObject* object = it->Next(); object != NULL; object = it->Next()) { |
| 1752 MarkBit markbit = Marking::MarkBitFrom(object); | 1752 MarkBit markbit = Marking::MarkBitFrom(object); |
| 1753 if ((object->map() != filler_map) && Marking::IsGrey(markbit)) { | 1753 if ((object->map() != filler_map) && Marking::IsGrey(markbit)) { |
| 1754 Marking::GreyToBlack(markbit); | 1754 Marking::GreyToBlack(markbit); |
| 1755 MemoryChunk::IncrementLiveBytesFromGC(object->address(), object->Size()); | 1755 MemoryChunk::IncrementLiveBytesFromGC(object, object->Size()); |
| 1756 marking_deque->PushBlack(object); | 1756 marking_deque->PushBlack(object); |
| 1757 if (marking_deque->IsFull()) return; | 1757 if (marking_deque->IsFull()) return; |
| 1758 } | 1758 } |
| 1759 } | 1759 } |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 | 1762 |
| 1763 static inline int MarkWordToObjectStarts(uint32_t mark_bits, int* starts); | 1763 static inline int MarkWordToObjectStarts(uint32_t mark_bits, int* starts); |
| 1764 | 1764 |
| 1765 | 1765 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1790 int offset = 0; | 1790 int offset = 0; |
| 1791 while (grey_objects != 0) { | 1791 while (grey_objects != 0) { |
| 1792 int trailing_zeros = base::bits::CountTrailingZeros32(grey_objects); | 1792 int trailing_zeros = base::bits::CountTrailingZeros32(grey_objects); |
| 1793 grey_objects >>= trailing_zeros; | 1793 grey_objects >>= trailing_zeros; |
| 1794 offset += trailing_zeros; | 1794 offset += trailing_zeros; |
| 1795 MarkBit markbit(cell, 1 << offset); | 1795 MarkBit markbit(cell, 1 << offset); |
| 1796 DCHECK(Marking::IsGrey(markbit)); | 1796 DCHECK(Marking::IsGrey(markbit)); |
| 1797 Marking::GreyToBlack(markbit); | 1797 Marking::GreyToBlack(markbit); |
| 1798 Address addr = cell_base + offset * kPointerSize; | 1798 Address addr = cell_base + offset * kPointerSize; |
| 1799 HeapObject* object = HeapObject::FromAddress(addr); | 1799 HeapObject* object = HeapObject::FromAddress(addr); |
| 1800 MemoryChunk::IncrementLiveBytesFromGC(object->address(), object->Size()); | 1800 MemoryChunk::IncrementLiveBytesFromGC(object, object->Size()); |
| 1801 marking_deque->PushBlack(object); | 1801 marking_deque->PushBlack(object); |
| 1802 if (marking_deque->IsFull()) return; | 1802 if (marking_deque->IsFull()) return; |
| 1803 offset += 2; | 1803 offset += 2; |
| 1804 grey_objects >>= 2; | 1804 grey_objects >>= 2; |
| 1805 } | 1805 } |
| 1806 | 1806 |
| 1807 grey_objects >>= (Bitmap::kBitsPerCell - 1); | 1807 grey_objects >>= (Bitmap::kBitsPerCell - 1); |
| 1808 } | 1808 } |
| 1809 } | 1809 } |
| 1810 | 1810 |
| (...skipping 2938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4749 SlotsBuffer* buffer = *buffer_address; | 4749 SlotsBuffer* buffer = *buffer_address; |
| 4750 while (buffer != NULL) { | 4750 while (buffer != NULL) { |
| 4751 SlotsBuffer* next_buffer = buffer->next(); | 4751 SlotsBuffer* next_buffer = buffer->next(); |
| 4752 DeallocateBuffer(buffer); | 4752 DeallocateBuffer(buffer); |
| 4753 buffer = next_buffer; | 4753 buffer = next_buffer; |
| 4754 } | 4754 } |
| 4755 *buffer_address = NULL; | 4755 *buffer_address = NULL; |
| 4756 } | 4756 } |
| 4757 } // namespace internal | 4757 } // namespace internal |
| 4758 } // namespace v8 | 4758 } // namespace v8 |
| OLD | NEW |