Fix x64 array length operations in Crankshaft
authordanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 11 Mar 2011 10:30:33 +0000 (10:30 +0000)
committerdanno@chromium.org <danno@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 11 Mar 2011 10:30:33 +0000 (10:30 +0000)
x64-bit array length loads and bounds checks should be 32-bits

Review URL: http://codereview.chromium.org/6676009

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

src/x64/lithium-codegen-x64.cc
src/x64/lithium-x64.cc

index cca99a1..326585f 100644 (file)
@@ -1059,7 +1059,7 @@ void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) {
 void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) {
   Register result = ToRegister(instr->result());
   Register array = ToRegister(instr->InputAt(0));
-  __ movq(result, FieldOperand(array, ExternalPixelArray::kLengthOffset));
+  __ movl(result, FieldOperand(array, ExternalPixelArray::kLengthOffset));
 }
 
 
index e387cee..a29a337 100644 (file)
@@ -1791,7 +1791,6 @@ LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
 
 LInstruction* LChunkBuilder::DoLoadPixelArrayElement(
     HLoadPixelArrayElement* instr) {
-  Abort("Pixel array loads in generated code cause segfaults (danno)");
   ASSERT(instr->representation().IsInteger32());
   ASSERT(instr->key()->representation().IsInteger32());
   LOperand* external_pointer =
@@ -1833,7 +1832,6 @@ LInstruction* LChunkBuilder::DoStoreKeyedFastElement(
 
 LInstruction* LChunkBuilder::DoStorePixelArrayElement(
     HStorePixelArrayElement* instr) {
-  Abort("Pixel array stores in generated code sometimes segfaults (danno)");
   ASSERT(instr->value()->representation().IsInteger32());
   ASSERT(instr->external_pointer()->representation().IsExternal());
   ASSERT(instr->key()->representation().IsInteger32());