From: ager@chromium.org Date: Fri, 18 Feb 2011 12:54:43 +0000 (+0000) Subject: x64: Implement the missing generic load and store operations. X-Git-Tag: upstream/4.7.83~20159 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc7e79a838e2fe9593e326cbd2e8f474e90ab8b9;p=platform%2Fupstream%2Fv8.git x64: Implement the missing generic load and store operations. Review URL: http://codereview.chromium.org/6541019 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6852 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 4f8ddaf..f8204c5 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -1938,7 +1938,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 ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); + CallCode(ic, RelocInfo::CODE_TARGET, instr); } @@ -2227,7 +2231,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 ic(Builtins::builtin(Builtins::StoreIC_Initialize)); + CallCode(ic, RelocInfo::CODE_TARGET, instr); } @@ -2291,7 +2300,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 ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); + CallCode(ic, RelocInfo::CODE_TARGET, instr); } diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index db68471..c2ede2c 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -1697,8 +1697,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); } @@ -1736,8 +1739,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); } @@ -1762,8 +1773,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); } diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index cd01492..66df23f 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -1471,9 +1471,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) @@ -1489,8 +1489,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; } @@ -1506,8 +1506,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) @@ -1565,8 +1565,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") }; diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index a7422c2..b926097 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 ]