void LIRGeneratorMIPS::visitAsmJSStoreHeap(MAsmJSStoreHeap *ins) { MDefinition *ptr = ins->ptr(); MOZ_ASSERT(ptr->type() == MIRType_Int32); LAllocation ptrAlloc; if (ptr->isConstantValue() && !ins->needsBoundsCheck()) { MOZ_ASSERT(ptr->constantValue().toInt32() >= 0); ptrAlloc = LAllocation(ptr->constantVp()); } else ptrAlloc = useRegisterAtStart(ptr); add(new(alloc()) LAsmJSStoreHeap(ptrAlloc, useRegisterAtStart(ins->value())), ins); }
void LIRGeneratorMIPS::visitAsmJSLoadHeap(MAsmJSLoadHeap *ins) { MDefinition *ptr = ins->ptr(); MOZ_ASSERT(ptr->type() == MIRType_Int32); LAllocation ptrAlloc; // For MIPS it is best to keep the 'ptr' in a register if a bounds check // is needed. if (ptr->isConstantValue() && !ins->needsBoundsCheck()) { // A bounds check is only skipped for a positive index. MOZ_ASSERT(ptr->constantValue().toInt32() >= 0); ptrAlloc = LAllocation(ptr->constantVp()); } else ptrAlloc = useRegisterAtStart(ptr); define(new(alloc()) LAsmJSLoadHeap(ptrAlloc), ins); }