Fixed a bug in smi-only implementation in x64.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 27 Sep 2011 12:25:42 +0000 (12:25 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 27 Sep 2011 12:25:42 +0000 (12:25 +0000)
Review URL: http://codereview.chromium.org/8060009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9451 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/x64/stub-cache-x64.cc

index 3819c1d..63d45ef 100644 (file)
@@ -3722,13 +3722,14 @@ void KeyedStoreStubCompiler::GenerateStoreFastElement(
   }
 
   // Do the store and update the write barrier.
-  __ SmiToInteger32(rcx, rcx);
   if (elements_kind == FAST_SMI_ONLY_ELEMENTS) {
     __ JumpIfNotSmi(rax, &miss_force_generic);
+    __ SmiToInteger32(rcx, rcx);
     __ movq(FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize),
             rax);
   } else {
     ASSERT(elements_kind == FAST_ELEMENTS);
+    __ SmiToInteger32(rcx, rcx);
     __ lea(rcx,
            FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize));
     __ movq(Operand(rcx, 0), rax);