Reviewers: William Hesse,

Description:
x64: Implement the missing generic load and store operations.

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

SVN Base: https://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 test/cctest/cctest.status


Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 9540bbc6283d75a464278209d03a9894e69a9d58..eb46d7b4cf2e113b9b255f63f8693b11b4e97b82 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -1926,7 +1926,11 @@ void LCodeGen::DoLoadPixelArrayElement(LLoadPixelArrayElement* instr) {


 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);
 }


@@ -2215,7 +2219,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {


 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);
 }


@@ -2279,7 +2288,12 @@ void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {


 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);
 }


Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index db7636f419b824272c39750b49e14eae46b80d24..3148f79ea8969642a5af2eb0cb024768a8434ee9 100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -1696,8 +1696,11 @@ LInstruction* LChunkBuilder::DoLoadPixelArrayElement(


 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);
 }


@@ -1735,8 +1738,16 @@ LInstruction* LChunkBuilder::DoStorePixelArrayElement(


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);
 }


@@ -1761,8 +1772,11 @@ LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {


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);
 }


Index: src/x64/lithium-x64.h
diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h
index 0063a7b55746b2de2dd94f339c988833ab2de486..9fa1a691990a3bd2c053acb8140419fe2dde61ef 100644
--- a/src/x64/lithium-x64.h
+++ b/src/x64/lithium-x64.h
@@ -1472,9 +1472,9 @@ class LSmiUntag: public LTemplateInstruction<1, 1, 0> {

 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)
@@ -1490,8 +1490,8 @@ class LStoreNamed: public LTemplateInstruction<0, 2, 1> {

 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;
   }

@@ -1507,8 +1507,8 @@ class LStoreNamedField: public LStoreNamed {

 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)
@@ -1566,8 +1566,8 @@ class LStorePixelArrayElement: public LTemplateInstruction<0, 3, 0> {

 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")
 };
Index: test/cctest/cctest.status
diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status
index a7422c254304b79748f7f0b46b261a822b1352e8..b9260978d481dada23794f90d0bfb21060efdca4 100644
--- a/test/cctest/cctest.status
+++ b/test/cctest/cctest.status
@@ -59,9 +59,6 @@ test-heap/TestInternalWeakListsTraverseWithGC: PASS || FAIL

 # 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