示例#1
0
void
CodeGeneratorX86::linkAbsoluteLabels()
{
    JSScript *script = gen->info().script();
    IonCode *method = script->ion->method();

    for (size_t i = 0; i < deferredDoubles_.length(); i++) {
        DeferredDouble *d = deferredDoubles_[i];
        const Value &v = script->ion->getConstant(d->index());
        MacroAssembler::Bind(method, d->label(), &v);
    }
}
示例#2
0
void
CodeGeneratorX86::linkAbsoluteLabels()
{
    ExecutionMode executionMode = gen->info().executionMode();
    UnrootedScript script = gen->info().script();
    IonScript *ionScript = GetIonScript(script, executionMode);
    IonCode *method = ionScript->method();

    for (size_t i = 0; i < deferredDoubles_.length(); i++) {
        DeferredDouble *d = deferredDoubles_[i];
        const Value &v = ionScript->getConstant(d->index());
        MacroAssembler::Bind(method, d->label(), &v);
    }
}
示例#3
0
bool
CodeGeneratorX86::visitDouble(LDouble *ins)
{
    const LDefinition *out = ins->getDef(0);
    const LConstantIndex *cindex = ins->getOperand(0)->toConstantIndex();
    const Value &v = graph.getConstant(cindex->index());

    union DoublePun {
        uint64_t u;
        double d;
    } dpun;
    dpun.d = v.toDouble();

    if (masm.maybeInlineDouble(dpun.u, ToFloatRegister(out)))
        return true;

    DeferredDouble *d = new DeferredDouble(cindex->index());
    if (!deferredDoubles_.append(d))
        return false;

    masm.movsd(d->label(), ToFloatRegister(out));
    return true;
}