Index: src/incremental-marking.cc |
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc |
index c4f166bb9877f0fad7a27843e2f5d95636d75033..8fe89b4a98c4500ed5527fd602ab55793e21896a 100644 |
--- a/src/incremental-marking.cc |
+++ b/src/incremental-marking.cc |
@@ -178,7 +178,12 @@ class IncrementalMarkingMarkingVisitor : public ObjectVisitor { |
void VisitCodeTarget(RelocInfo* rinfo) { |
ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
- Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
+ Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
+ if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() |
+ && (target->ic_age() != heap_->global_ic_age())) { |
+ IC::Clear(rinfo->pc()); |
+ target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
+ } |
heap_->mark_compact_collector()->RecordRelocSlot(rinfo, Code::cast(target)); |
MarkObject(target); |
} |
@@ -795,6 +800,12 @@ void IncrementalMarking::Step(intptr_t allocated_bytes) { |
Map* map = obj->map(); |
if (map == filler_map) continue; |
+ if (obj->IsMap()) { |
+ Map* map = Map::cast(obj); |
+ heap_->ClearCacheOnMap(map); |
+ } |
+ |
+ |
int size = obj->SizeFromMap(map); |
bytes_to_process -= size; |
MarkBit map_mark_bit = Marking::MarkBitFrom(map); |