Reviewers: Rico, Kasper Lund,

Description:
X64 Crankshaft: Revert r7071 and fix DoStoreContextSlot in a different way.

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

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/x64/lithium-codegen-x64.cc
  M     src/x64/lithium-x64.h
  M     src/x64/lithium-x64.cc
  M     src/x64/macro-assembler-x64.cc


Index: src/x64/lithium-codegen-x64.cc
===================================================================
--- src/x64/lithium-codegen-x64.cc      (revision 7071)
+++ src/x64/lithium-codegen-x64.cc      (working copy)
@@ -1977,7 +1977,8 @@
   __ movq(ContextOperand(context, instr->slot_index()), value);
   if (instr->needs_write_barrier()) {
     int offset = Context::SlotOffset(instr->slot_index());
-    __ RecordWrite(context, offset, value, kScratchRegister);
+    Register scratch = ToRegister(instr->TempAt(0));
+    __ RecordWrite(context, offset, value, scratch);
   }
 }

Index: src/x64/lithium-x64.cc
===================================================================
--- src/x64/lithium-x64.cc      (revision 7071)
+++ src/x64/lithium-x64.cc      (working copy)
@@ -1728,14 +1728,17 @@
 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
   LOperand* context;
   LOperand* value;
+  LOperand* temp;
   if (instr->NeedsWriteBarrier()) {
     context = UseTempRegister(instr->context());
     value = UseTempRegister(instr->value());
+    temp = TempRegister();
   } else {
     context = UseRegister(instr->context());
     value = UseRegister(instr->value());
+    temp = NULL;
   }
-  return new LStoreContextSlot(context, value);
+  return new LStoreContextSlot(context, value, temp);
 }


Index: src/x64/lithium-x64.h
===================================================================
--- src/x64/lithium-x64.h       (revision 7071)
+++ src/x64/lithium-x64.h       (working copy)
@@ -1258,11 +1258,12 @@
 };


-class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> {
+class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
  public:
-  LStoreContextSlot(LOperand* context, LOperand* value) {
+  LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
     inputs_[0] = context;
     inputs_[1] = value;
+    temps_[0] = temp;
   }

   DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
Index: src/x64/macro-assembler-x64.cc
===================================================================
--- src/x64/macro-assembler-x64.cc      (revision 7071)
+++ src/x64/macro-assembler-x64.cc      (working copy)
@@ -95,13 +95,7 @@
   if (FLAG_debug_code) {
     // Check that the object is not in new space.
     NearLabel not_in_new_space;
-    if (addr.is(kScratchRegister)) {
-      push(kScratchRegister);
-      InNewSpace(object, scratch, not_equal, &not_in_new_space);
-      pop(kScratchRegister);
-    } else {
-      InNewSpace(object, scratch, not_equal, &not_in_new_space);
-    }
+    InNewSpace(object, scratch, not_equal, &not_in_new_space);
     Abort("new-space object passed to RecordWriteHelper");
     bind(&not_in_new_space);
   }


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

Reply via email to