Revision: 2647
Author: [email protected]
Date: Fri Aug  7 03:55:19 2009
Log: Factor out some platform-independent code into the shared cfg.cc.

Review URL: http://codereview.chromium.org/165127
http://code.google.com/p/v8/source/detail?r=2647

Modified:
  /branches/bleeding_edge/src/arm/cfg-arm.cc
  /branches/bleeding_edge/src/cfg.cc
  /branches/bleeding_edge/src/ia32/cfg-ia32.cc
  /branches/bleeding_edge/src/x64/cfg-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/cfg-arm.cc  Fri Aug  7 00:15:31 2009
+++ /branches/bleeding_edge/src/arm/cfg-arm.cc  Fri Aug  7 03:55:19 2009
@@ -98,19 +98,6 @@
    __ add(sp, sp, Operand((count + 1) * kPointerSize));
    __ Jump(lr);
  }
-
-
-void PositionInstr::Compile(MacroAssembler* masm) {
-  if (FLAG_debug_info && pos_ != RelocInfo::kNoPosition) {
-    __ RecordStatementPosition(pos_);
-    __ RecordPosition(pos_);
-  }
-}
-
-
-void MoveInstr::Compile(MacroAssembler* masm) {
-  location()->Move(masm, value());
-}


  void BinaryOpInstr::Compile(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/cfg.cc  Fri Aug  7 03:35:48 2009
+++ /branches/bleeding_edge/src/cfg.cc  Fri Aug  7 03:55:19 2009
@@ -228,6 +228,19 @@
      temp->set_where(TempLocation::STACK);
    }
  }
+
+
+void PositionInstr::Compile(MacroAssembler* masm) {
+  if (FLAG_debug_info && pos_ != RelocInfo::kNoPosition) {
+    masm->RecordStatementPosition(pos_);
+    masm->RecordPosition(pos_);
+  }
+}
+
+
+void MoveInstr::Compile(MacroAssembler* masm) {
+  location()->Move(masm, value());
+}


  // The expression builder should not be used for declarations or  
statements.
=======================================
--- /branches/bleeding_edge/src/ia32/cfg-ia32.cc        Fri Aug  7 00:15:31 2009
+++ /branches/bleeding_edge/src/ia32/cfg-ia32.cc        Fri Aug  7 03:55:19 2009
@@ -111,19 +111,6 @@
    int count = CfgGlobals::current()->fun()->scope()->num_parameters();
    __ ret((count + 1) * kPointerSize);
  }
-
-
-void PositionInstr::Compile(MacroAssembler* masm) {
-  if (FLAG_debug_info && pos_ != RelocInfo::kNoPosition) {
-    __ RecordStatementPosition(pos_);
-    __ RecordPosition(pos_);
-  }
-}
-
-
-void MoveInstr::Compile(MacroAssembler* masm) {
-  location()->Move(masm, value());
-}


  void BinaryOpInstr::Compile(MacroAssembler* masm) {
@@ -211,6 +198,7 @@
    // we can use a single instruction.
    value->MoveToSlot(masm, this);
  }
+

  void SlotLocation::MoveToSlot(MacroAssembler* masm, SlotLocation* loc) {
    // The accumulator is not live across a MoveInstr.
=======================================
--- /branches/bleeding_edge/src/x64/cfg-x64.cc  Fri Aug  7 00:15:31 2009
+++ /branches/bleeding_edge/src/x64/cfg-x64.cc  Fri Aug  7 03:55:19 2009
@@ -103,7 +103,6 @@
  void ExitNode::Compile(MacroAssembler* masm) {
    ASSERT(!is_marked());
    is_marked_ = true;
-
    Comment cmnt(masm, "[ ExitNode");
    if (FLAG_trace) {
      __ push(rax);
@@ -121,19 +120,6 @@
      __ int3();
    }
  }
-
-
-void PositionInstr::Compile(MacroAssembler* masm) {
-  if (FLAG_debug_info && pos_ != RelocInfo::kNoPosition) {
-    __ RecordStatementPosition(pos_);
-    __ RecordPosition(pos_);
-  }
-}
-
-
-void MoveInstr::Compile(MacroAssembler* masm) {
-  location()->Move(masm, value());
-}


  void BinaryOpInstr::Compile(MacroAssembler* masm) {
@@ -209,6 +195,11 @@
  void SlotLocation::Set(MacroAssembler* masm, Register reg) {
    __ movq(ToOperand(this), reg);
  }
+
+
+void SlotLocation::Push(MacroAssembler* masm) {
+  __ push(ToOperand(this));
+}


  void SlotLocation::Move(MacroAssembler* masm, Value* value) {
@@ -222,11 +213,6 @@
    __ movq(kScratchRegister, ToOperand(this));
    __ movq(ToOperand(loc), kScratchRegister);
  }
-
-
-void SlotLocation::Push(MacroAssembler* masm) {
-  __ push(ToOperand(this));
-}


  void TempLocation::Get(MacroAssembler* masm, Register reg) {

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

Reply via email to