Reviewers: Kasper Lund,

Description:
Remove duplicated code, the two emit_operand were basically identical.

Please review this at http://codereview.chromium.org/9327

Affected files:
   M src/assembler-ia32.h
   M src/assembler-ia32.cc


Index: src/assembler-ia32.cc
diff --git a/src/assembler-ia32.cc b/src/assembler-ia32.cc
index  
fbe63de67a1401010b59f40d657f740264c83a83..610542b596e7f6fa26b7e48bd1c353ea076172bd
  
100644
--- a/src/assembler-ia32.cc
+++ b/src/assembler-ia32.cc
@@ -781,7 +781,7 @@ void Assembler::and_(const Operand& dst, Register src) {
    EnsureSpace ensure_space(this);
    last_pc_ = pc_;
    EMIT(0x21);
-  emit_operand(dst, src);
+  emit_operand(src, dst);
  }


@@ -949,7 +949,7 @@ void Assembler::or_(const Operand& dst, Register src) {
    EnsureSpace ensure_space(this);
    last_pc_ = pc_;
    EMIT(0x09);
-  emit_operand(dst, src);
+  emit_operand(src, dst);
  }


@@ -1077,7 +1077,7 @@ void Assembler::sub(const Operand& dst, Register src)  
{
    EnsureSpace ensure_space(this);
    last_pc_ = pc_;
    EMIT(0x29);
-  emit_operand(dst, src);
+  emit_operand(src, dst);
  }


@@ -2017,18 +2017,6 @@ void Assembler::emit_operand(Register reg, const  
Operand& adr) {
  }


-void Assembler::emit_operand(const Operand& adr, Register reg) {
-  adr.set_reg(reg);
-  memmove(pc_, adr.buf_, adr.len_);
-  pc_ += adr.len_;
-  if (adr.len_ >= sizeof(int32_t) && adr.rmode_ != RelocInfo::NONE) {
-    pc_ -= sizeof(int32_t);  // pc_ must be *at* disp32
-    RecordRelocInfo(adr.rmode_);
-    pc_ += sizeof(int32_t);
-  }
-}
-
-
  void Assembler::emit_farith(int b1, int b2, int i) {
    ASSERT(is_uint8(b1) && is_uint8(b2));  // wrong opcode
    ASSERT(0 <= i &&  i < 8);  // illegal stack offset
Index: src/assembler-ia32.h
diff --git a/src/assembler-ia32.h b/src/assembler-ia32.h
index  
84131043804f32e07a0285dcfa9accd3e5935771..579e4c215633e15df632bc4bdf36a9c0109c9332
  
100644
--- a/src/assembler-ia32.h
+++ b/src/assembler-ia32.h
@@ -757,7 +757,6 @@ class Assembler : public Malloced {
    void emit_arith(int sel, Operand dst, const Immediate& x);

    void emit_operand(Register reg, const Operand& adr);
-  void emit_operand(const Operand& adr, Register reg);

    void emit_farith(int b1, int b2, int i);




--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to