Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index 0740ca04a820d42cc2682bd1a36a10af207d7bae..7a25855d5316ed643837ba356b0a6e64ffebbdc6 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -2315,8 +2315,13 @@ class PointersUpdatingVisitor: public ObjectVisitor { |
void VisitEmbeddedPointer(RelocInfo* rinfo) { |
ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT); |
Object* target = rinfo->target_object(); |
+ Object* old_target = target; |
VisitPointer(&target); |
- rinfo->set_target_object(target); |
+ // Avoid unnecessary changes that might unnecessary flush the instruction |
+ // cache. |
+ if (target != old_target) { |
+ rinfo->set_target_object(target); |
+ } |
} |
void VisitCodeTarget(RelocInfo* rinfo) { |