Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index 3ebdb1e6b734e7c6ee5de269ddfb68b46475cdd8..dd71a510789597e135c8808db28c1969d6109428 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -885,8 +885,8 @@ void CodeFlusher::ProcessJSFunctionCandidates() { |
if (!code_mark.Get()) { |
shared->set_code(lazy_compile); |
candidate->set_code(lazy_compile); |
- } else if (code == lazy_compile) { |
- candidate->set_code(lazy_compile); |
+ } else { |
+ candidate->set_code(code); |
} |
// We are in the middle of a GC cycle so the write barrier in the code |
@@ -935,6 +935,36 @@ void CodeFlusher::ProcessSharedFunctionInfoCandidates() { |
} |
+void CodeFlusher::EvictCandidate(SharedFunctionInfo* shared_info) { |
+ ASSERT(shared_info->code()->gc_metadata() != NULL); |
+ |
+ // The function is no longer a candidate, make sure it gets visited |
+ // again so that previous flushing decisions are revisited. |
+ isolate_->heap()->incremental_marking()->RecordWrites(shared_info); |
+ |
+ SharedFunctionInfo* candidate = shared_function_info_candidates_head_; |
+ SharedFunctionInfo* next_candidate; |
+ if (candidate == shared_info) { |
+ next_candidate = GetNextCandidate(shared_info); |
+ shared_function_info_candidates_head_ = next_candidate; |
+ ClearNextCandidate(shared_info); |
+ } else { |
+ while (candidate != NULL) { |
+ next_candidate = GetNextCandidate(candidate); |
+ |
+ if (next_candidate == shared_info) { |
+ next_candidate = GetNextCandidate(shared_info); |
+ SetNextCandidate(candidate, next_candidate); |
+ ClearNextCandidate(shared_info); |
+ break; |
+ } |
+ |
+ candidate = next_candidate; |
+ } |
+ } |
+} |
+ |
+ |
void CodeFlusher::EvictCandidate(JSFunction* function) { |
ASSERT(!function->next_function_link()->IsUndefined()); |
Object* undefined = isolate_->heap()->undefined_value(); |
@@ -957,6 +987,7 @@ void CodeFlusher::EvictCandidate(JSFunction* function) { |
next_candidate = GetNextCandidate(function); |
SetNextCandidate(candidate, next_candidate); |
ClearNextCandidate(function, undefined); |
+ break; |
} |
candidate = next_candidate; |