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

Unified Diff: src/incremental-marking.cc

Issue 8194012: Merge revision 9585 and revision 9580 to trunk. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 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/incremental-marking.h ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/incremental-marking.h ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698