Пример #1
0
bool
EagerSimdUnbox(MIRGenerator* mir, MIRGraph& graph)
{
    const JitCompartment* jitCompartment = GetJitContext()->compartment->jitCompartment();
    for (PostorderIterator block = graph.poBegin(); block != graph.poEnd(); block++) {
        if (mir->shouldCancel("Eager Simd Unbox"))
            return false;

        for (MInstructionReverseIterator ins = block->rbegin(); ins != block->rend(); ins++) {
            if (!ins->isSimdUnbox())
                continue;

            MSimdUnbox* unbox = ins->toSimdUnbox();
            if (!unbox->input()->isPhi())
                continue;

            MPhi* phi = unbox->input()->toPhi();
            if (!CanUnboxSimdPhi(jitCompartment, phi, unbox->simdType()))
                continue;

            UnboxSimdPhi(jitCompartment, graph, phi, unbox->simdType());
        }
    }

    return true;
}
Пример #2
0
static bool
MaybeSimdUnbox(TempAllocator &alloc, MInstruction *ins, MIRType type, unsigned op)
{
    MOZ_ASSERT(IsSimdType(type));
    MDefinition *in = ins->getOperand(op);
    if (in->type() == type)
        return true;

    MSimdUnbox *replace = MSimdUnbox::New(alloc, in, type);
    ins->block()->insertBefore(ins, replace);
    ins->replaceOperand(op, replace);

    return replace->typePolicy()->adjustInputs(alloc, replace);
}
Пример #3
0
bool
SimdSameAsReturnedTypePolicy<Op>::staticAdjustInputs(TempAllocator &alloc, MInstruction *ins)
{
    MIRType type = ins->type();
    MOZ_ASSERT(IsSimdType(type));

    MDefinition *in = ins->getOperand(Op);
    if (in->type() == type)
        return true;

    MSimdUnbox *replace = MSimdUnbox::New(alloc, in, type);
    ins->block()->insertBefore(ins, replace);
    ins->replaceOperand(Op, replace);

    return replace->typePolicy()->adjustInputs(alloc, replace);
}