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

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

Issue 8537014: Simplify the write barrier. Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month 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/incremental-marking.cc ('k') | src/mark-compact-inl.h » ('j') | 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 1724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1735 1735
1736 const MarkBit::CellType next_cell = cells[cell_index + 1]; 1736 const MarkBit::CellType next_cell = cells[cell_index + 1];
1737 MarkBit::CellType grey_objects = current_cell & 1737 MarkBit::CellType grey_objects = current_cell &
1738 ((current_cell >> 1) | (next_cell << (Bitmap::kBitsPerCell - 1))); 1738 ((current_cell >> 1) | (next_cell << (Bitmap::kBitsPerCell - 1)));
1739 1739
1740 int offset = 0; 1740 int offset = 0;
1741 while (grey_objects != 0) { 1741 while (grey_objects != 0) {
1742 int trailing_zeros = CompilerIntrinsics::CountTrailingZeros(grey_objects); 1742 int trailing_zeros = CompilerIntrinsics::CountTrailingZeros(grey_objects);
1743 grey_objects >>= trailing_zeros; 1743 grey_objects >>= trailing_zeros;
1744 offset += trailing_zeros; 1744 offset += trailing_zeros;
1745 MarkBit markbit(&cells[cell_index], 1 << offset, false); 1745 MarkBit markbit(&cells[cell_index], 1 << offset);
1746 ASSERT(Marking::IsGrey(markbit)); 1746 ASSERT(Marking::IsGrey(markbit));
1747 Marking::GreyToBlack(markbit); 1747 Marking::GreyToBlack(markbit);
1748 Address addr = cell_base + offset * kPointerSize; 1748 Address addr = cell_base + offset * kPointerSize;
1749 HeapObject* object = HeapObject::FromAddress(addr); 1749 HeapObject* object = HeapObject::FromAddress(addr);
1750 MemoryChunk::IncrementLiveBytes(object->address(), object->Size()); 1750 MemoryChunk::IncrementLiveBytes(object->address(), object->Size());
1751 marking_deque->PushBlack(object); 1751 marking_deque->PushBlack(object);
1752 if (marking_deque->IsFull()) return; 1752 if (marking_deque->IsFull()) return;
1753 offset += 2; 1753 offset += 2;
1754 grey_objects >>= 2; 1754 grey_objects >>= 2;
1755 } 1755 }
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
3774 while (buffer != NULL) { 3774 while (buffer != NULL) {
3775 SlotsBuffer* next_buffer = buffer->next(); 3775 SlotsBuffer* next_buffer = buffer->next();
3776 DeallocateBuffer(buffer); 3776 DeallocateBuffer(buffer);
3777 buffer = next_buffer; 3777 buffer = next_buffer;
3778 } 3778 }
3779 *buffer_address = NULL; 3779 *buffer_address = NULL;
3780 } 3780 }
3781 3781
3782 3782
3783 } } // namespace v8::internal 3783 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698