Index: src/incremental-marking.cc |
=================================================================== |
--- src/incremental-marking.cc (revision 9585) |
+++ src/incremental-marking.cc (working copy) |
@@ -410,7 +410,7 @@ |
if (heap_->old_pointer_space()->IsSweepingComplete() && |
heap_->old_data_space()->IsSweepingComplete()) { |
- StartMarking(); |
+ StartMarking(ALLOW_COMPACTION); |
} else { |
if (FLAG_trace_incremental_marking) { |
PrintF("[IncrementalMarking] Start sweeping.\n"); |
@@ -435,12 +435,12 @@ |
} |
-void IncrementalMarking::StartMarking() { |
+void IncrementalMarking::StartMarking(CompactionFlag flag) { |
if (FLAG_trace_incremental_marking) { |
PrintF("[IncrementalMarking] Start marking\n"); |
} |
- is_compacting_ = !FLAG_never_compact && |
+ is_compacting_ = !FLAG_never_compact && (flag == ALLOW_COMPACTION) && |
heap_->mark_compact_collector()->StartCompaction(); |
state_ = MARKING; |
@@ -517,7 +517,11 @@ |
array[new_top] = dest; |
new_top = ((new_top + 1) & mask); |
ASSERT(new_top != marking_deque_.bottom()); |
- ASSERT(Marking::IsGrey(Marking::MarkBitFrom(obj))); |
+#ifdef DEBUG |
+ MarkBit mark_bit = Marking::MarkBitFrom(obj); |
+ ASSERT(Marking::IsGrey(mark_bit) || |
+ (obj->IsFiller() && Marking::IsWhite(mark_bit))); |
+#endif |
} |
} else if (obj->map() != filler_map) { |
// Skip one word filler objects that appear on the |
@@ -525,7 +529,11 @@ |
array[new_top] = obj; |
new_top = ((new_top + 1) & mask); |
ASSERT(new_top != marking_deque_.bottom()); |
- ASSERT(Marking::IsGrey(Marking::MarkBitFrom(obj))); |
+#ifdef DEBUG |
+ MarkBit mark_bit = Marking::MarkBitFrom(obj); |
+ ASSERT(Marking::IsGrey(mark_bit) || |
+ (obj->IsFiller() && Marking::IsWhite(mark_bit))); |
+#endif |
} |
} |
marking_deque_.set_top(new_top); |
@@ -696,7 +704,7 @@ |
if (state_ == SWEEPING) { |
if (heap_->old_pointer_space()->AdvanceSweeper(bytes_to_process) && |
heap_->old_data_space()->AdvanceSweeper(bytes_to_process)) { |
- StartMarking(); |
+ StartMarking(PREVENT_COMPACTION); |
} |
} else if (state_ == MARKING) { |
Map* filler_map = heap_->one_pointer_filler_map(); |
@@ -710,7 +718,6 @@ |
Map* map = obj->map(); |
if (map == filler_map) continue; |
- ASSERT(Marking::IsGrey(Marking::MarkBitFrom(obj))); |
int size = obj->SizeFromMap(map); |
bytes_to_process -= size; |
MarkBit map_mark_bit = Marking::MarkBitFrom(map); |
@@ -733,7 +740,8 @@ |
} |
MarkBit obj_mark_bit = Marking::MarkBitFrom(obj); |
- ASSERT(!Marking::IsBlack(obj_mark_bit)); |
+ ASSERT(Marking::IsGrey(obj_mark_bit) || |
+ (obj->IsFiller() && Marking::IsWhite(obj_mark_bit))); |
Marking::MarkBlack(obj_mark_bit); |
MemoryChunk::IncrementLiveBytes(obj->address(), size); |
} |