Revision: 6852
Author: [email protected]
Date: Fri Feb 18 04:54:43 2011
Log: x64: Implement the missing generic load and store operations.

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

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/test/cctest/cctest.status

=======================================
--- /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Fri Feb 18 04:06:52 2011 +++ /branches/bleeding_edge/src/x64/lithium-codegen-x64.cc Fri Feb 18 04:54:43 2011
@@ -1938,7 +1938,11 @@


 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
-  Abort("Unimplemented: %s", "DoLoadKeyedGeneric");
+  ASSERT(ToRegister(instr->object()).is(rdx));
+  ASSERT(ToRegister(instr->key()).is(rax));
+
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
 }


@@ -2227,7 +2231,12 @@


 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
-  Abort("Unimplemented: %s", "DoStoreNamedGeneric");
+  ASSERT(ToRegister(instr->object()).is(rdx));
+  ASSERT(ToRegister(instr->value()).is(rax));
+
+  __ Move(rcx, instr->hydrogen()->name());
+  Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
 }


@@ -2291,7 +2300,12 @@


 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
-  Abort("Unimplemented: %s", "DoStoreKeyedGeneric");
+  ASSERT(ToRegister(instr->object()).is(rdx));
+  ASSERT(ToRegister(instr->key()).is(rcx));
+  ASSERT(ToRegister(instr->value()).is(rax));
+
+  Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
+  CallCode(ic, RelocInfo::CODE_TARGET, instr);
 }


=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc      Fri Feb 18 04:06:52 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc      Fri Feb 18 04:54:43 2011
@@ -1697,8 +1697,11 @@


 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
-  Abort("Unimplemented: %s", "DoLoadKeyedGeneric");
-  return NULL;
+  LOperand* object = UseFixed(instr->object(), rdx);
+  LOperand* key = UseFixed(instr->key(), rax);
+
+  LLoadKeyedGeneric* result = new LLoadKeyedGeneric(object, key);
+  return MarkAsCall(DefineFixed(result, rax), instr);
 }


@@ -1736,8 +1739,16 @@


LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
-  Abort("Unimplemented: %s", "DoStoreKeyedGeneric");
-  return NULL;
+  LOperand* object = UseFixed(instr->object(), rdx);
+  LOperand* key = UseFixed(instr->key(), rcx);
+  LOperand* value = UseFixed(instr->value(), rax);
+
+  ASSERT(instr->object()->representation().IsTagged());
+  ASSERT(instr->key()->representation().IsTagged());
+  ASSERT(instr->value()->representation().IsTagged());
+
+  LStoreKeyedGeneric* result = new LStoreKeyedGeneric(object, key, value);
+  return MarkAsCall(result, instr);
 }


@@ -1762,8 +1773,11 @@


LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
-  Abort("Unimplemented: %s", "DoStoreNamedGeneric");
-  return NULL;
+  LOperand* object = UseFixed(instr->object(), rdx);
+  LOperand* value = UseFixed(instr->value(), rax);
+
+  LStoreNamedGeneric* result = new LStoreNamedGeneric(object, value);
+  return MarkAsCall(result, instr);
 }


=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.h       Fri Feb 18 04:06:52 2011
+++ /branches/bleeding_edge/src/x64/lithium-x64.h       Fri Feb 18 04:54:43 2011
@@ -1471,9 +1471,9 @@

 class LStoreNamed: public LTemplateInstruction<0, 2, 1> {
  public:
-  LStoreNamed(LOperand* obj, LOperand* val) {
-    inputs_[0] = obj;
-    inputs_[1] = val;
+  LStoreNamed(LOperand* object, LOperand* value) {
+    inputs_[0] = object;
+    inputs_[1] = value;
   }

   DECLARE_INSTRUCTION(StoreNamed)
@@ -1489,8 +1489,8 @@

 class LStoreNamedField: public LStoreNamed {
  public:
-  LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp)
-      : LStoreNamed(obj, val) {
+  LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp)
+      : LStoreNamed(object, value) {
     temps_[0] = temp;
   }

@@ -1506,8 +1506,8 @@

 class LStoreNamedGeneric: public LStoreNamed {
  public:
-  LStoreNamedGeneric(LOperand* obj, LOperand* val)
-      : LStoreNamed(obj, val) { }
+  LStoreNamedGeneric(LOperand* object, LOperand* value)
+      : LStoreNamed(object, value) { }

   DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
   DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
@@ -1565,8 +1565,8 @@

 class LStoreKeyedGeneric: public LStoreKeyed {
  public:
-  LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val)
-      : LStoreKeyed(obj, key, val) { }
+  LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value)
+      : LStoreKeyed(object, key, value) { }

   DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
 };
=======================================
--- /branches/bleeding_edge/test/cctest/cctest.status Thu Feb 10 08:33:01 2011 +++ /branches/bleeding_edge/test/cctest/cctest.status Fri Feb 18 04:54:43 2011
@@ -59,9 +59,6 @@

 # Tests that fail with crankshaft.
 test-deoptimization/DeoptimizeBinaryOperationMOD: FAIL
-test-deoptimization/DeoptimizeLoadICStoreIC: FAIL
-test-deoptimization/DeoptimizeLoadICStoreICNested: FAIL
-test-deoptimization/DeoptimizeCompare: PASS || FAIL

##############################################################################
 [ $arch == arm ]

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

Reply via email to