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

Unified Diff: src/spaces-inl.h

Issue 7247002: Estimate a (close) upper bound on the size of black-marked objects on each page. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Address review comments. Make compile on x64. Created 9 years, 6 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
« no previous file with comments | « src/spaces.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces-inl.h
diff --git a/src/spaces-inl.h b/src/spaces-inl.h
index 45f99612989ccfbeca802c067d890f1713a25588..19c1b3611b81abcd4bb2cda73480a2c229ab2e48 100644
--- a/src/spaces-inl.h
+++ b/src/spaces-inl.h
@@ -37,6 +37,16 @@ namespace internal {
// -----------------------------------------------------------------------------
+// Bitmap
+
+void Bitmap::Clear(MemoryChunk* chunk) {
+ Bitmap* bitmap = chunk->markbits();
+ for (int i = 0; i < bitmap->CellsCount(); i++) bitmap->cells()[i] = 0;
+ chunk->ResetLiveBytes();
+}
+
+
+// -----------------------------------------------------------------------------
// PageIterator
@@ -154,11 +164,8 @@ Page* Page::Initialize(Heap* heap,
Executability executable,
PagedSpace* owner) {
Page* page = reinterpret_cast<Page*>(chunk);
- MemoryChunk::Initialize(heap,
- reinterpret_cast<Address>(chunk),
- kPageSize,
- executable,
- owner);
+ ASSERT(chunk->size() == static_cast<size_t>(kPageSize));
+ ASSERT(chunk->owner() == owner);
owner->IncreaseCapacity(Page::kObjectAreaSize);
owner->Free(page->ObjectAreaStart(),
page->ObjectAreaEnd() - page->ObjectAreaStart());
@@ -334,9 +341,14 @@ void NewSpace::ShrinkStringAtAllocationBoundary(String* string, int length) {
ASSERT(string->IsSeqString());
ASSERT(string->address() + StringType::SizeFor(string->length()) ==
allocation_info_.top);
+ Address old_top = allocation_info_.top;
allocation_info_.top =
string->address() + StringType::SizeFor(length);
string->set_length(length);
+ if (Marking::IsBlack(Marking::MarkBitFrom(string))) {
+ int delta = static_cast<int>(old_top - allocation_info_.top);
+ MemoryChunk::IncrementLiveBytes(string->address(), -delta);
+ }
}
« no previous file with comments | « src/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698