Avoid unnecessary code target changes during code compaction.

R=ulan@chromium.org

Review URL: https://codereview.chromium.org/11198032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12754 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
danno@chromium.org 2012-10-18 12:01:36 +00:00
parent a38af4256c
commit 9d43ff71b8

View File

@ -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) {