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

Unified Diff: src/heap.cc

Issue 5736008: Provide baseline for experimental GC implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 10 years 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
« src/globals.h ('K') | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index ccf9b47a35c56f48f4d6a5beb8f03da7392a469b..3fb0422ab294cc80783b6f039b6859d00c2be946 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -225,23 +225,6 @@ int Heap::GcSafeSizeOfOldObject(HeapObject* object) {
}
-int Heap::GcSafeSizeOfOldObjectWithEncodedMap(HeapObject* object) {
- ASSERT(!Heap::InNewSpace(object)); // Code only works for old objects.
- ASSERT(MarkCompactCollector::are_map_pointers_encoded());
- uint32_t marker = Memory::uint32_at(object->address());
- if (marker == MarkCompactCollector::kSingleFreeEncoding) {
- return kIntSize;
- } else if (marker == MarkCompactCollector::kMultiFreeEncoding) {
- return Memory::int_at(object->address() + kIntSize);
- } else {
- MapWord map_word = object->map_word();
- Address map_address = map_word.DecodeMapAddress(Heap::map_space());
- Map* map = reinterpret_cast<Map*>(HeapObject::FromAddress(map_address));
- return object->SizeFromMap(map);
- }
-}
-
-
GarbageCollector Heap::SelectGarbageCollector(AllocationSpace space) {
// Is global GC requested?
if (space != NEW_SPACE || FLAG_gc_global) {
@@ -3994,9 +3977,8 @@ void Heap::Verify() {
new_space_.Verify();
- VerifyPointersAndDirtyRegionsVisitor dirty_regions_visitor;
- old_pointer_space_->Verify(&dirty_regions_visitor);
- map_space_->Verify(&dirty_regions_visitor);
+ old_pointer_space_->Verify(&visitor);
+ map_space_->Verify(&visitor);
VerifyPointersUnderWatermark(old_pointer_space_,
&IteratePointersInDirtyRegion);
@@ -4217,6 +4199,11 @@ uint32_t Heap::IterateDirtyRegions(
Address area_end,
DirtyRegionCallback visit_dirty_region,
ObjectSlotCallback copy_object_func) {
+#ifndef ENABLE_CARDMARKING_WRITE_BARRIER
+ ASSERT(marks == Page::kAllRegionsDirtyMarks);
+ visit_dirty_region(area_start, area_end, copy_object_func);
+ return Page::kAllRegionsDirtyMarks;
+#else
uint32_t newmarks = 0;
uint32_t mask = 1;
@@ -4273,6 +4260,7 @@ uint32_t Heap::IterateDirtyRegions(
}
return newmarks;
+#endif
}
« src/globals.h ('K') | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698