MIPS: Properly check fast array property in StoreIC::GenerateArrayLength.
authormstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 1 Mar 2012 17:20:11 +0000 (17:20 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 1 Mar 2012 17:20:11 +0000 (17:20 +0000)
This is the cleanup of an old todo from r10254 (93483b6eb).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9570010
Patch from Daniel Kalmar <kalmard@homejinni.com>.

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

src/mips/ic-mips.cc

index 2dd0522247362348deae6fe27e4ab9fc19770636..b6f019f478565c23bb8f9ec2a39ce83bb7eeccd5 100644 (file)
@@ -1571,7 +1571,10 @@ void StoreIC::GenerateArrayLength(MacroAssembler* masm) {
 
   // Check that the array has fast properties, otherwise the length
   // property might have been redefined.
-  // TODO(mstarzinger): Port this check to MIPS.
+  __ lw(scratch, FieldMemOperand(receiver, JSArray::kPropertiesOffset));
+  __ lw(scratch, FieldMemOperand(scratch, FixedArray::kMapOffset));
+  __ LoadRoot(at, Heap::kHashTableMapRootIndex);
+  __ Branch(&miss, eq, scratch, Operand(at));
 
   // Check that value is a smi.
   __ JumpIfNotSmi(value, &miss);