Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(987)

Side by Side Diff: src/mark-compact.cc

Issue 9178021: When adjusting page's live bytes counter from the mutator adjust owners unswept free bytes counter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 1634
1635 1635
1636 void MarkCompactCollector::MarkMapContents(Map* map) { 1636 void MarkCompactCollector::MarkMapContents(Map* map) {
1637 // Mark prototype transitions array but don't push it into marking stack. 1637 // Mark prototype transitions array but don't push it into marking stack.
1638 // This will make references from it weak. We will clean dead prototype 1638 // This will make references from it weak. We will clean dead prototype
1639 // transitions in ClearNonLiveTransitions. 1639 // transitions in ClearNonLiveTransitions.
1640 FixedArray* prototype_transitions = map->prototype_transitions(); 1640 FixedArray* prototype_transitions = map->prototype_transitions();
1641 MarkBit mark = Marking::MarkBitFrom(prototype_transitions); 1641 MarkBit mark = Marking::MarkBitFrom(prototype_transitions);
1642 if (!mark.Get()) { 1642 if (!mark.Get()) {
1643 mark.Set(); 1643 mark.Set();
1644 MemoryChunk::IncrementLiveBytes(prototype_transitions->address(), 1644 MemoryChunk::IncrementLiveBytesFromGC(prototype_transitions->address(),
1645 prototype_transitions->Size()); 1645 prototype_transitions->Size());
1646 } 1646 }
1647 1647
1648 Object** raw_descriptor_array_slot = 1648 Object** raw_descriptor_array_slot =
1649 HeapObject::RawField(map, Map::kInstanceDescriptorsOrBitField3Offset); 1649 HeapObject::RawField(map, Map::kInstanceDescriptorsOrBitField3Offset);
1650 Object* raw_descriptor_array = *raw_descriptor_array_slot; 1650 Object* raw_descriptor_array = *raw_descriptor_array_slot;
1651 if (!raw_descriptor_array->IsSmi()) { 1651 if (!raw_descriptor_array->IsSmi()) {
1652 MarkDescriptorArray( 1652 MarkDescriptorArray(
1653 reinterpret_cast<DescriptorArray*>(raw_descriptor_array)); 1653 reinterpret_cast<DescriptorArray*>(raw_descriptor_array));
1654 } 1654 }
1655 1655
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 // so that we don't waste effort pointlessly scanning for objects. 1749 // so that we don't waste effort pointlessly scanning for objects.
1750 ASSERT(!marking_deque->IsFull()); 1750 ASSERT(!marking_deque->IsFull());
1751 1751
1752 Map* filler_map = heap->one_pointer_filler_map(); 1752 Map* filler_map = heap->one_pointer_filler_map();
1753 for (HeapObject* object = it->Next(); 1753 for (HeapObject* object = it->Next();
1754 object != NULL; 1754 object != NULL;
1755 object = it->Next()) { 1755 object = it->Next()) {
1756 MarkBit markbit = Marking::MarkBitFrom(object); 1756 MarkBit markbit = Marking::MarkBitFrom(object);
1757 if ((object->map() != filler_map) && Marking::IsGrey(markbit)) { 1757 if ((object->map() != filler_map) && Marking::IsGrey(markbit)) {
1758 Marking::GreyToBlack(markbit); 1758 Marking::GreyToBlack(markbit);
1759 MemoryChunk::IncrementLiveBytes(object->address(), object->Size()); 1759 MemoryChunk::IncrementLiveBytesFromGC(object->address(), object->Size());
1760 marking_deque->PushBlack(object); 1760 marking_deque->PushBlack(object);
1761 if (marking_deque->IsFull()) return; 1761 if (marking_deque->IsFull()) return;
1762 } 1762 }
1763 } 1763 }
1764 } 1764 }
1765 1765
1766 1766
1767 static inline int MarkWordToObjectStarts(uint32_t mark_bits, int* starts); 1767 static inline int MarkWordToObjectStarts(uint32_t mark_bits, int* starts);
1768 1768
1769 1769
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1801 int offset = 0; 1801 int offset = 0;
1802 while (grey_objects != 0) { 1802 while (grey_objects != 0) {
1803 int trailing_zeros = CompilerIntrinsics::CountTrailingZeros(grey_objects); 1803 int trailing_zeros = CompilerIntrinsics::CountTrailingZeros(grey_objects);
1804 grey_objects >>= trailing_zeros; 1804 grey_objects >>= trailing_zeros;
1805 offset += trailing_zeros; 1805 offset += trailing_zeros;
1806 MarkBit markbit(&cells[cell_index], 1 << offset, false); 1806 MarkBit markbit(&cells[cell_index], 1 << offset, false);
1807 ASSERT(Marking::IsGrey(markbit)); 1807 ASSERT(Marking::IsGrey(markbit));
1808 Marking::GreyToBlack(markbit); 1808 Marking::GreyToBlack(markbit);
1809 Address addr = cell_base + offset * kPointerSize; 1809 Address addr = cell_base + offset * kPointerSize;
1810 HeapObject* object = HeapObject::FromAddress(addr); 1810 HeapObject* object = HeapObject::FromAddress(addr);
1811 MemoryChunk::IncrementLiveBytes(object->address(), object->Size()); 1811 MemoryChunk::IncrementLiveBytesFromGC(object->address(), object->Size());
1812 marking_deque->PushBlack(object); 1812 marking_deque->PushBlack(object);
1813 if (marking_deque->IsFull()) return; 1813 if (marking_deque->IsFull()) return;
1814 offset += 2; 1814 offset += 2;
1815 grey_objects >>= 2; 1815 grey_objects >>= 2;
1816 } 1816 }
1817 1817
1818 grey_objects >>= (Bitmap::kBitsPerCell - 1); 1818 grey_objects >>= (Bitmap::kBitsPerCell - 1);
1819 } 1819 }
1820 } 1820 }
1821 1821
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after
3907 while (buffer != NULL) { 3907 while (buffer != NULL) {
3908 SlotsBuffer* next_buffer = buffer->next(); 3908 SlotsBuffer* next_buffer = buffer->next();
3909 DeallocateBuffer(buffer); 3909 DeallocateBuffer(buffer);
3910 buffer = next_buffer; 3910 buffer = next_buffer;
3911 } 3911 }
3912 *buffer_address = NULL; 3912 *buffer_address = NULL;
3913 } 3913 }
3914 3914
3915 3915
3916 } } // namespace v8::internal 3916 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.h ('k') | src/mark-compact-inl.h » ('j') | src/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698