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

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

Issue 8139025: Keep MemoryChunk::LiveBytes in sync when marking deque overflows. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
« no previous file with comments | « src/mark-compact.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1685 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « src/mark-compact.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698