Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(801)

Unified Diff: src/codegen-ia32.cc

Issue 2002: Fix performace regression due to missed peephole optimization (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/codegen-arm.cc ('K') | « src/codegen-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 282)
+++ src/codegen-ia32.cc (working copy)
@@ -975,6 +975,7 @@
ASSERT(var()->mode() != Variable::DYNAMIC);
Label exit;
+ bool skipped_write = false;
if (init_state == CONST_INIT) {
ASSERT(var()->mode() == Variable::CONST);
// Only the first const initialization must be executed (the slot
@@ -984,6 +985,7 @@
masm->mov(eax, Ia32CodeGenerator::SlotOperand(masm, scope, this, ecx));
masm->cmp(eax, Factory::the_hole_value());
masm->j(not_equal, &exit);
+ skipped_write = true;
}
// We must execute the store.
@@ -1003,7 +1005,9 @@
int offset = FixedArray::kHeaderSize + index() * kPointerSize;
masm->RecordWrite(ecx, offset, eax, ebx);
}
- masm->bind(&exit);
+ // If we did not jump over the assignment, we do not need to bind the
+ // exit label. Doing so can defeat peephole optimization.
+ if (skipped_write) masm->bind(&exit);
}
}
« src/codegen-arm.cc ('K') | « src/codegen-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698