Backed out changeset 49ad7c6f44db

This commit is contained in:
Tom Schuster 2013-02-04 18:44:34 +01:00
parent 376a8d5df3
commit f95641f79d
2 changed files with 0 additions and 115 deletions

View File

@ -107,11 +107,6 @@ ICStub::trace(JSTracer *trc)
MarkShape(trc, &getElemStub->shape(), "baseline-getelem-dense-shape");
break;
}
case ICStub::GetElem_TypedArray: {
ICGetElem_TypedArray *getElemStub = toGetElem_TypedArray();
MarkShape(trc, &getElemStub->shape(), "baseline-getelem-typedarray-shape");
break;
}
case ICStub::SetElem_Dense: {
ICSetElem_Dense *setElemStub = toSetElem_Dense();
MarkShape(trc, &setElemStub->shape(), "baseline-getelem-dense-shape");
@ -1703,17 +1698,6 @@ DoGetElemFallback(JSContext *cx, ICGetElem_Fallback *stub, HandleValue lhs, Hand
return false;
stub->addNewStub(denseStub);
return true;
}
if (obj->isTypedArray() && rhs.isInt32() && res.isNumber()) {
ICGetElem_TypedArray::Compiler compiler(cx, obj->lastProperty(), TypedArray::type(obj));
ICStub *typedArrayStub = compiler.getStub(ICStubSpace::StubSpaceFor(script));
if (!typedArrayStub)
return false;
stub->addNewStub(typedArrayStub);
return true;
}
return true;
@ -1835,48 +1819,6 @@ ICGetElem_Dense::Compiler::generateStubCode(MacroAssembler &masm)
return true;
}
//
// GetElem_TypedArray
//
bool
ICGetElem_TypedArray::Compiler::generateStubCode(MacroAssembler &masm)
{
Label failure;
masm.branchTestObject(Assembler::NotEqual, R0, &failure);
masm.branchTestInt32(Assembler::NotEqual, R1, &failure);
GeneralRegisterSet regs(availableGeneralRegs(2));
Register scratchReg = regs.takeAny();
// Unbox R0 and shape guard.
Register obj = masm.extractObject(R0, ExtractTemp0);
masm.loadPtr(Address(BaselineStubReg, ICGetElem_TypedArray::offsetOfShape()), scratchReg);
masm.branchTestObjShape(Assembler::NotEqual, obj, scratchReg, &failure);
// Unbox key.
Register key = masm.extractInt32(R1, ExtractTemp1);
// Bounds check.
masm.unboxInt32(Address(obj, TypedArray::lengthOffset()), scratchReg);
masm.branch32(Assembler::BelowOrEqual, scratchReg, key, &failure);
// Load the elements vector.
masm.loadPtr(Address(obj, TypedArray::dataOffset()), scratchReg);
// Load the value.
BaseIndex source(scratchReg, key, ScaleFromElemWidth(TypedArray::slotWidth(type_)));
masm.loadFromTypedArray(type_, source, R0, false, scratchReg, &failure);
// Todo: Allow loading doubles from uint32 arrays, but this requires monitoring.
EmitReturnFromIC(masm);
// Failure case - jump to next stub
masm.bind(&failure);
EmitStubGuardFailure(masm);
return true;
}
//
// SetElem_Fallback
//

View File

@ -310,7 +310,6 @@ class ICEntry
_(GetElem_Fallback) \
_(GetElem_String) \
_(GetElem_Dense) \
_(GetElem_TypedArray) \
\
_(SetElem_Fallback) \
_(SetElem_Dense) \
@ -1692,62 +1691,6 @@ class ICGetElem_Dense : public ICMonitoredStub
};
};
class ICGetElem_TypedArray : public ICStub
{
friend class ICStubSpace;
HeapPtrShape shape_;
uint32_t type_;
ICGetElem_TypedArray(IonCode *stubCode, HandleShape shape, uint32_t type)
: ICStub(GetElem_TypedArray, stubCode),
shape_(shape),
type_(type)
{}
public:
static inline ICGetElem_TypedArray *New(ICStubSpace *space, IonCode *code,
HandleShape shape, uint32_t type)
{
return space->allocate<ICGetElem_TypedArray>(code, shape, type);
}
static size_t offsetOfShape() {
return offsetof(ICGetElem_TypedArray, shape_);
}
static size_t offsetOfType() {
return offsetof(ICGetElem_TypedArray, type_);
}
HeapPtrShape &shape() {
return shape_;
}
class Compiler : public ICStubCompiler {
RootedShape shape_;
uint32_t type_;
protected:
bool generateStubCode(MacroAssembler &masm);
virtual int32_t getKey() const {
return static_cast<int32_t>(kind) | (static_cast<int32_t>(type_) << 16);
}
public:
Compiler(JSContext *cx, UnrootedShape shape, uint32_t type)
: ICStubCompiler(cx, ICStub::GetElem_TypedArray),
shape_(cx, shape),
type_(type)
{}
ICStub *getStub(ICStubSpace *space) {
return ICGetElem_TypedArray::New(space, getStubCode(), shape_, type_);
}
};
};
// SetElem
// JSOP_SETELEM