Index: src/mark-compact-inl.h |
=================================================================== |
--- src/mark-compact-inl.h (revision 10437) |
+++ src/mark-compact-inl.h (working copy) |
@@ -49,6 +49,13 @@ |
} |
+void MarkCompactCollector::ClearCacheOnMap(Map* map) { |
+ if (FLAG_cleanup_code_caches_at_gc) { |
+ map->ClearCodeCache(heap()); |
+ } |
+} |
+ |
+ |
void MarkCompactCollector::MarkObject(HeapObject* obj, MarkBit mark_bit) { |
ASSERT(Marking::MarkBitFrom(obj) == mark_bit); |
if (!mark_bit.Get()) { |
@@ -64,6 +71,9 @@ |
ASSERT(Marking::MarkBitFrom(obj) == mark_bit); |
mark_bit.Set(); |
MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); |
+ if (obj->IsMap()) { |
+ ClearCacheOnMap(Map::cast(obj)); |
+ } |
} |