Revision: 7049
Author: [email protected]
Date: Thu Mar  3 08:09:52 2011
Log: Revert change 7048
Review URL: http://codereview.chromium.org/6613019
http://code.google.com/p/v8/source/detail?r=7049

Modified:
 /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.cc
 /branches/bleeding_edge/src/x64/lithium-x64.h

=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu Mar 3 07:36:13 2011 +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Thu Mar 3 08:09:52 2011
@@ -1966,20 +1966,19 @@


 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
+  Register context = ToRegister(instr->context());
   Register result = ToRegister(instr->result());
-  __ movq(result, ContextOperand(rsi, instr->slot_index()));
+  __ movq(result, ContextOperand(context, instr->slot_index()));
 }


 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
+  Register context = ToRegister(instr->context());
   Register value = ToRegister(instr->value());
-  __ movq(ContextOperand(rsi, instr->slot_index()), value);
+  __ movq(ContextOperand(context, instr->slot_index()), value);
   if (instr->needs_write_barrier()) {
     int offset = Context::SlotOffset(instr->slot_index());
-    Register scratch_1 = ToRegister(instr->TempAt(0));
-    Register scratch_2 = ToRegister(instr->TempAt(1));
-    __ movq(scratch_1, rsi);
-    __ RecordWrite(scratch_1, offset, value, scratch_2);
+    __ RecordWrite(context, offset, value, kScratchRegister);
   }
 }

=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc      Thu Mar  3 07:36:13 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc      Thu Mar  3 08:09:52 2011
@@ -291,13 +291,15 @@


 void LLoadContextSlot::PrintDataTo(StringStream* stream) {
+  InputAt(0)->PrintTo(stream);
   stream->Add("[%d]", slot_index());
 }


 void LStoreContextSlot::PrintDataTo(StringStream* stream) {
-  stream->Add("[%d] <- ", slot_index());
   InputAt(0)->PrintTo(stream);
+  stream->Add("[%d] <- ", slot_index());
+  InputAt(1)->PrintTo(stream);
 }


@@ -1718,22 +1720,23 @@


 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) {
-  return DefineAsRegister(new LLoadContextSlot());
+  LOperand* context = UseRegisterAtStart(instr->value());
+  return DefineAsRegister(new LLoadContextSlot(context));
 }


 LInstruction* LChunkBuilder::DoStoreContextSlot(HStoreContextSlot* instr) {
+ Abort("Unimplemented: DoStoreContextSlot"); // Temporarily disabled (whesse).
+  LOperand* context;
   LOperand* value;
-  LOperand* temp_1 = NULL;
-  LOperand* temp_2 = NULL;
   if (instr->NeedsWriteBarrier()) {
+    context = UseTempRegister(instr->context());
     value = UseTempRegister(instr->value());
-    temp_1 = TempRegister();
-    temp_2 = TempRegister();
   } else {
+    context = UseRegister(instr->context());
     value = UseRegister(instr->value());
   }
-  return new LStoreContextSlot(value, temp_1, temp_2);
+  return new LStoreContextSlot(context, value);
 }


=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h       Thu Mar  3 07:36:13 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.h       Thu Mar  3 08:09:52 2011
@@ -1242,32 +1242,34 @@
 };


-class LLoadContextSlot: public LTemplateInstruction<1, 0, 0> {
+class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
  public:
-  explicit LLoadContextSlot() {
+  explicit LLoadContextSlot(LOperand* context) {
+    inputs_[0] = context;
   }

   DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
   DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)

+  LOperand* context() { return InputAt(0); }
   int slot_index() { return hydrogen()->slot_index(); }

   virtual void PrintDataTo(StringStream* stream);
 };


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

   DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
   DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)

-  LOperand* value() { return InputAt(0); }
+  LOperand* context() { return InputAt(0); }
+  LOperand* value() { return InputAt(1); }
   int slot_index() { return hydrogen()->slot_index(); }
   int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }

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

Reply via email to