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

Unified Diff: src/assembler-ia32.cc

Issue 7117: Fix a missing peephole optimization in ia32 code exposed with Kevin's... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler-ia32.cc
===================================================================
--- src/assembler-ia32.cc (revision 490)
+++ src/assembler-ia32.cc (working copy)
@@ -720,6 +720,23 @@
void Assembler::add(const Operand& dst, const Immediate& x) {
+ ASSERT(reloc_info_writer.last_pc() != NULL);
+ if (FLAG_push_pop_elimination && (reloc_info_writer.last_pc() <= last_pc_)) {
+ byte instr = last_pc_[0];
+ if ((instr & 0xf8) == 0x50) {
+ // Last instruction was a push. Check whether this is a pop without a
+ // result.
+ if ((dst.is_reg(esp)) &&
+ (x.x_ == kPointerSize) && (x.rmode_ == RelocInfo::NONE)) {
+ pc_ = last_pc_;
+ last_pc_ = NULL;
+ if (FLAG_print_push_pop_elimination) {
+ PrintF("%d push/pop(noreg) eliminated\n", pc_offset());
+ }
+ return;
+ }
+ }
+ }
EnsureSpace ensure_space(this);
last_pc_ = pc_;
emit_arith(0, dst, x);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698