Reviewers: Vyacheslav Egorov,
Description:
Merge revision 9585 to trunk.
Fix free list node ending up on evacuation candidate.
This is a temporary fix which avoids compaction when incremental marking
is restarted during an old-space-step. That could turn the page that
holds the chosen free list node into an evacuation candidate. It could
also cause several other inconsistencies if it happens during scavenge.
Please review this at http://codereview.chromium.org/8194012/
SVN Base: http://v8.googlecode.com/svn/trunk/
Affected files:
M src/incremental-marking.h
M src/incremental-marking.cc
M src/spaces.cc
M src/version.cc
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;
@@ -696,7 +696,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();
Index: src/incremental-marking.h
===================================================================
--- src/incremental-marking.h (revision 9585)
+++ src/incremental-marking.h (working copy)
@@ -206,8 +206,10 @@
void ResetStepCounters();
- void StartMarking();
+ enum CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION };
+ void StartMarking(CompactionFlag flag);
+
void ActivateIncrementalWriteBarrier(PagedSpace* space);
static void ActivateIncrementalWriteBarrier(NewSpace* space);
void ActivateIncrementalWriteBarrier();
Index: src/spaces.cc
===================================================================
--- src/spaces.cc (revision 9585)
+++ src/spaces.cc (working copy)
@@ -1798,6 +1798,11 @@
owner_->heap()->incremental_marking()->OldSpaceStep(
size_in_bytes - old_linear_size);
+ // The old-space-step might have finished sweeping and restarted marking.
+ // Verify that it did not turn the page of the new node into an
evacuation
+ // candidate.
+ ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(new_node));
+
const int kThreshold = IncrementalMarking::kAllocatedThreshold;
// Memory in the linear allocation area is counted as allocated. We may
free
Index: src/version.cc
===================================================================
--- src/version.cc (revision 9585)
+++ src/version.cc (working copy)
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 6
#define BUILD_NUMBER 6
-#define PATCH_LEVEL 0
+#define PATCH_LEVEL 1
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev