Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index 6d7fbdff2b5953a40b4950c17b8848a641e13951..95d819551da9de63974aa45d4cb0033037bfc46f 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -884,17 +884,9 @@ class StaticMarkingVisitor : public StaticVisitorBase { |
if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()) { |
IC::Clear(rinfo->pc()); |
target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
- } else { |
- if (FLAG_cleanup_code_caches_at_gc && |
- target->kind() == Code::STUB && |
- target->major_key() == CodeStub::CallFunction && |
- target->has_function_cache()) { |
- CallFunctionStub::Clear(heap, rinfo->pc()); |
- } |
} |
MarkBit code_mark = Marking::MarkBitFrom(target); |
heap->mark_compact_collector()->MarkObject(target, code_mark); |
- |
heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
} |
@@ -1015,8 +1007,17 @@ class StaticMarkingVisitor : public StaticVisitorBase { |
} |
static void VisitCode(Map* map, HeapObject* object) { |
- reinterpret_cast<Code*>(object)->CodeIterateBody<StaticMarkingVisitor>( |
- map->GetHeap()); |
+ Heap* heap = map->GetHeap(); |
+ Code* code = reinterpret_cast<Code*>(object); |
+ if (FLAG_cleanup_code_caches_at_gc) { |
+ TypeFeedbackCells* type_feedback_cells = code->type_feedback_cells(); |
+ for (int i = 0; i < type_feedback_cells->CellCount(); i++) { |
+ ASSERT(type_feedback_cells->AstId(i)->IsSmi()); |
+ JSGlobalPropertyCell* cell = type_feedback_cells->Cell(i); |
+ cell->set_value(TypeFeedbackCells::RawUninitializedSentinel(heap)); |
+ } |
+ } |
+ code->CodeIterateBody<StaticMarkingVisitor>(heap); |
} |
// Code flushing support. |