Bug 902722 - Guard typed arrays' shape instead of clasps in ICs. (r=jandem)

This commit is contained in:
Shu-yu Guo 2013-08-09 17:07:50 -07:00
parent 7362ecfb80
commit ffc54d673f

View File

@ -2311,14 +2311,13 @@ GenerateTypedArrayElement(JSContext *cx, MacroAssembler &masm, IonCache::StubAtt
// The array type is the object within the table of typed array classes.
int arrayType = tarr->type();
Register tmpReg = output.scratchReg().gpr();
JS_ASSERT(tmpReg != InvalidReg);
// Check that the typed array is of the same type as the current object
// because load size differ in function of the typed array data width.
masm.branchTestObjClass(Assembler::NotEqual, object, tmpReg, tarr->getClass(), &failures);
// Guard on the shape.
Shape *shape = tarr->lastProperty();
masm.branchTestObjShape(Assembler::NotEqual, object, shape, &failures);
// Decide to what type index the stub should be optimized
Register tmpReg = output.scratchReg().gpr();
JS_ASSERT(tmpReg != InvalidReg);
Register indexReg = tmpReg;
JS_ASSERT(!index.constant());
if (idval.isString()) {