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

Unified Diff: src/mark-compact.h

Issue 7032005: Unify markbits for old and new spaces. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: src/mark-compact.h
diff --git a/src/mark-compact.h b/src/mark-compact.h
index 5f84b46a8f5f7d5e6bc5fec3d5bfa798c7181f98..0c896b6f77cc94c1a65cba9d462feca9135b8f5f 100644
--- a/src/mark-compact.h
+++ b/src/mark-compact.h
@@ -49,27 +49,15 @@ class RootMarkingVisitor;
class Marking {
public:
explicit Marking(Heap* heap)
- : heap_(heap),
- new_space_bitmap_(NULL) {
+ : heap_(heap) {
}
- inline MarkBit MarkBitFromNewSpace(HeapObject* obj);
+ static inline MarkBit MarkBitFrom(Address addr);
- static inline MarkBit MarkBitFromOldSpace(HeapObject* obj);
-
- inline MarkBit MarkBitFrom(Address addr);
-
- // For embedding in generated code.
- inline Address new_space_bitmap() {
- return reinterpret_cast<Address>(new_space_bitmap_);
- }
-
- inline MarkBit MarkBitFrom(HeapObject* obj) {
+ static inline MarkBit MarkBitFrom(HeapObject* obj) {
return MarkBitFrom(reinterpret_cast<Address>(obj));
}
- inline void ClearRange(Address addr, int size);
-
void TransferMark(Address old_start, Address new_start);
bool Setup();
@@ -77,51 +65,7 @@ class Marking {
void TearDown();
private:
- class BitmapStorageDescriptor {
- public:
- INLINE(static int CellsCount(Address addr)) {
- return HeaderOf(addr)->cells_count_;
- }
-
- static Bitmap<BitmapStorageDescriptor>* Allocate(int cells_count) {
- VirtualMemory* memory = new VirtualMemory(SizeFor(cells_count));
-
- if (!memory->Commit(memory->address(), memory->size(), false)) {
- delete memory;
- return NULL;
- }
-
- Address bitmap_address =
- reinterpret_cast<Address>(memory->address()) + sizeof(Header);
- HeaderOf(bitmap_address)->cells_count_ = cells_count;
- HeaderOf(bitmap_address)->storage_ = memory;
- return Bitmap<BitmapStorageDescriptor>::FromAddress(bitmap_address);
- }
-
- static void Free(Bitmap<BitmapStorageDescriptor>* bitmap) {
- delete HeaderOf(bitmap->address())->storage_;
- }
-
- private:
- struct Header {
- VirtualMemory* storage_;
- int cells_count_;
- };
-
- static int SizeFor(int cell_count) {
- return sizeof(Header) +
- Bitmap<BitmapStorageDescriptor>::SizeFor(cell_count);
- }
-
- static Header* HeaderOf(Address addr) {
- return reinterpret_cast<Header*>(addr - sizeof(Header));
- }
- };
-
- typedef Bitmap<BitmapStorageDescriptor> NewSpaceMarkbitsBitmap;
-
Heap* heap_;
- NewSpaceMarkbitsBitmap* new_space_bitmap_;
};
// ----------------------------------------------------------------------------
« no previous file with comments | « src/incremental-marking.cc ('k') | src/mark-compact.cc » ('j') | src/serialize.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698