| Index: src/mark-compact.cc
 | 
| diff --git a/src/mark-compact.cc b/src/mark-compact.cc
 | 
| index 641293399e6297d6824c2d07ee1d0ecf6cddd91b..24730c6c0a5db4a56d379772c0079989dbd0a729 100644
 | 
| --- a/src/mark-compact.cc
 | 
| +++ b/src/mark-compact.cc
 | 
| @@ -926,47 +926,6 @@ void CodeFlusher::ProcessSharedFunctionInfoCandidates() {
 | 
|  }
 | 
|  
 | 
|  
 | 
| -void CodeFlusher::EvictCandidate(JSFunction* function) {
 | 
| -  ASSERT(!function->next_function_link()->IsUndefined());
 | 
| -  Object* undefined = isolate_->heap()->undefined_value();
 | 
| -
 | 
| -  JSFunction* candidate = jsfunction_candidates_head_;
 | 
| -  JSFunction* next_candidate;
 | 
| -  if (candidate == function) {
 | 
| -    next_candidate = GetNextCandidate(function);
 | 
| -    jsfunction_candidates_head_ = next_candidate;
 | 
| -    ClearNextCandidate(function, undefined);
 | 
| -  } else {
 | 
| -    while (candidate != NULL) {
 | 
| -      next_candidate = GetNextCandidate(candidate);
 | 
| -
 | 
| -      if (next_candidate == function) {
 | 
| -        next_candidate = GetNextCandidate(function);
 | 
| -        SetNextCandidate(candidate, next_candidate);
 | 
| -        ClearNextCandidate(function, undefined);
 | 
| -      }
 | 
| -
 | 
| -      candidate = next_candidate;
 | 
| -    }
 | 
| -  }
 | 
| -}
 | 
| -
 | 
| -
 | 
| -void CodeFlusher::IteratePointersToFromSpace(ObjectVisitor* v) {
 | 
| -  Heap* heap = isolate_->heap();
 | 
| -
 | 
| -  JSFunction** slot = &jsfunction_candidates_head_;
 | 
| -  JSFunction* candidate = jsfunction_candidates_head_;
 | 
| -  while (candidate != NULL) {
 | 
| -    if (heap->InFromSpace(candidate)) {
 | 
| -      v->VisitPointer(reinterpret_cast<Object**>(slot));
 | 
| -    }
 | 
| -    candidate = GetNextCandidate(*slot);
 | 
| -    slot = GetNextCandidateSlot(*slot);
 | 
| -  }
 | 
| -}
 | 
| -
 | 
| -
 | 
|  MarkCompactCollector::~MarkCompactCollector() {
 | 
|    if (code_flusher_ != NULL) {
 | 
|      delete code_flusher_;
 | 
| @@ -1471,8 +1430,21 @@ void MarkCompactCollector::PrepareThreadForCodeFlushing(Isolate* isolate,
 | 
|  void MarkCompactCollector::PrepareForCodeFlushing() {
 | 
|    ASSERT(heap() == Isolate::Current()->heap());
 | 
|  
 | 
| -  // If code flushing is disabled, there is no need to prepare for it.
 | 
| -  if (!is_code_flushing_enabled()) return;
 | 
| +  // TODO(1609) Currently incremental marker does not support code flushing.
 | 
| +  if (!FLAG_flush_code || was_marked_incrementally_) {
 | 
| +    EnableCodeFlushing(false);
 | 
| +    return;
 | 
| +  }
 | 
| +
 | 
| +#ifdef ENABLE_DEBUGGER_SUPPORT
 | 
| +  if (heap()->isolate()->debug()->IsLoaded() ||
 | 
| +      heap()->isolate()->debug()->has_break_points()) {
 | 
| +    EnableCodeFlushing(false);
 | 
| +    return;
 | 
| +  }
 | 
| +#endif
 | 
| +
 | 
| +  EnableCodeFlushing(true);
 | 
|  
 | 
|    // Ensure that empty descriptor array is marked. Method MarkDescriptorArray
 | 
|    // relies on it being marked before any other descriptor array.
 | 
| @@ -2033,6 +2005,9 @@ void MarkCompactCollector::AfterMarking() {
 | 
|    // Flush code from collected candidates.
 | 
|    if (is_code_flushing_enabled()) {
 | 
|      code_flusher_->ProcessCandidates();
 | 
| +    // TODO(1609) Currently incremental marker does not support code flushing,
 | 
| +    // we need to disable it before incremental marking steps for next cycle.
 | 
| +    EnableCodeFlushing(false);
 | 
|    }
 | 
|  
 | 
|    if (!FLAG_watch_ic_patching) {
 | 
| 
 |