当前位置: 首页>>代码示例>>C++>>正文


C++ SnapshotIterator::read方法代码示例

本文整理汇总了C++中SnapshotIterator::read方法的典型用法代码示例。如果您正苦于以下问题:C++ SnapshotIterator::read方法的具体用法?C++ SnapshotIterator::read怎么用?C++ SnapshotIterator::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SnapshotIterator的用法示例。


在下文中一共展示了SnapshotIterator::read方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: base

bool
RPowHalf::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedValue base(cx, iter.read());
    RootedValue power(cx);
    RootedValue result(cx);
    power.setNumber(0.5);

    MOZ_ASSERT(base.isNumber());
    if (!js::math_pow_handle(cx, base, power, &result))
        return false;

    iter.storeInstructionResult(result);
    return true;
}
开发者ID:mlasak,项目名称:gecko-dev,代码行数:15,代码来源:Recover.cpp

示例2: templateObject

bool
RCreateThisWithTemplate::recover(JSContext* cx, SnapshotIterator& iter) const
{
    RootedObject templateObject(cx, &iter.read().toObject());

    // See CodeGenerator::visitCreateThisWithTemplate
    JSObject* resultObject = NewObjectOperationWithTemplate(cx, templateObject);
    if (!resultObject)
        return false;

    RootedValue result(cx);
    result.setObject(*resultObject);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:digideskio,项目名称:gecko-dev,代码行数:15,代码来源:Recover.cpp

示例3: templateObject

bool
RNewArray::recover(JSContext* cx, SnapshotIterator& iter) const
{
    RootedObject templateObject(cx, &iter.read().toObject());
    RootedValue result(cx);
    RootedObjectGroup group(cx, templateObject->group());

    JSObject* resultObject = NewFullyAllocatedArrayTryUseGroup(cx, group, count_);
    if (!resultObject)
        return false;

    result.setObject(*resultObject);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:15,代码来源:Recover.cpp

示例4: lhs

bool
RRsh::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedValue lhs(cx, iter.read());
    RootedValue rhs(cx, iter.read());
    MOZ_ASSERT(!lhs.isObject() && !rhs.isObject());

    int32_t result;
    if (!js::BitRsh(cx, lhs, rhs, &result))
        return false;

    RootedValue rootedResult(cx, js::Int32Value(result));
    iter.storeInstructionResult(rootedResult);
    return true;
}
开发者ID:mlasak,项目名称:gecko-dev,代码行数:15,代码来源:Recover.cpp

示例5: v

bool
RToDouble::recover(JSContext* cx, SnapshotIterator& iter) const
{
    RootedValue v(cx, iter.read());
    RootedValue result(cx);

    MOZ_ASSERT(!v.isObject());
    MOZ_ASSERT(!v.isSymbol());

    double dbl;
    if (!ToNumber(cx, v, &dbl))
        return false;

    result.setDouble(dbl);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:Phoxygen,项目名称:gecko-dev,代码行数:17,代码来源:Recover.cpp

示例6: templateObject

bool
RCreateThisWithTemplate::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedNativeObject templateObject(cx, &iter.read().toObject().as<NativeObject>());

    // See CodeGenerator::visitCreateThisWithTemplate
    gc::AllocKind allocKind = templateObject->asTenured().getAllocKind();
    gc::InitialHeap initialHeap = tenuredHeap_ ? gc::TenuredHeap : gc::DefaultHeap;
    JSObject *resultObject = NativeObject::copy(cx, allocKind, initialHeap, templateObject);
    if (!resultObject)
        return false;

    RootedValue result(cx);
    result.setObject(*resultObject);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:msliu,项目名称:gecko-dev,代码行数:17,代码来源:Recover.cpp

示例7: num

bool
RSqrt::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedValue num(cx, iter.read());
    RootedValue result(cx);

    MOZ_ASSERT(num.isNumber());
    if (!math_sqrt_handle(cx, num, &result))
        return false;

    // MIRType_Float32 is a specialization embedding the fact that the result is
    // rounded to a Float32.
    if (isFloatOperation_ && !RoundFloat32(cx, result, &result))
        return false;

    iter.storeInstructionResult(result);
    return true;
}
开发者ID:msliu,项目名称:gecko-dev,代码行数:18,代码来源:Recover.cpp

示例8: lhs

bool
RDiv::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedValue lhs(cx, iter.read());
    RootedValue rhs(cx, iter.read());
    RootedValue result(cx);

    if (!js::DivValues(cx, &lhs, &rhs, &result))
        return false;

    // MIRType_Float32 is a specialization embedding the fact that the result is
    // rounded to a Float32.
    if (isFloatOperation_ && !RoundFloat32(cx, result, &result))
        return false;

    iter.storeInstructionResult(result);
    return true;
}
开发者ID:msliu,项目名称:gecko-dev,代码行数:18,代码来源:Recover.cpp

示例9: vec

bool
RHypot::recover(JSContext* cx, SnapshotIterator& iter) const
{
    JS::AutoValueVector vec(cx);

    if (!vec.reserve(numOperands_))
        return false;

    for (uint32_t i = 0 ; i < numOperands_ ; ++i)
       vec.infallibleAppend(iter.read());

    RootedValue result(cx);

    if(!js::math_hypot_handle(cx, vec, &result))
        return false;

    iter.storeInstructionResult(result);
    return true;
}
开发者ID:Phoxygen,项目名称:gecko-dev,代码行数:19,代码来源:Recover.cpp

示例10: CountArgSlots

static void
CloseLiveIterator(JSContext *cx, const InlineFrameIterator &frame, uint32 localSlot)
{
    SnapshotIterator si = frame.snapshotIterator();

    // Skip stack slots until we reach the iterator object.
    uint32 base = CountArgSlots(frame.maybeCallee()) + frame.script()->nfixed;
    uint32 skipSlots = base + localSlot - 1;

    for (unsigned i = 0; i < skipSlots; i++)
        si.skip();

    Value v = si.read();
    JSObject *obj = &v.toObject();

    if (cx->isExceptionPending())
        UnwindIteratorForException(cx, obj);
    else
        UnwindIteratorForUncatchableException(cx, obj);
}
开发者ID:mokerjoke,项目名称:mozilla-central,代码行数:20,代码来源:IonFrames.cpp

示例11: operand

bool
RSignExtend::recover(JSContext* cx, SnapshotIterator& iter) const
{
    RootedValue operand(cx, iter.read());

    int32_t result;
    switch (MSignExtend::Mode(mode_)) {
      case MSignExtend::Byte:
        if (!js::SignExtendOperation<int8_t>(cx, operand, &result))
            return false;
        break;
      case MSignExtend::Half:
        if (!js::SignExtendOperation<int16_t>(cx, operand, &result))
            return false;
        break;
    }

    RootedValue rootedResult(cx, js::Int32Value(result));
    iter.storeInstructionResult(rootedResult);
    return true;
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:21,代码来源:Recover.cpp

示例12: templateObject

bool
RCreateThisWithTemplate::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedNativeObject templateObject(cx, &iter.read().toObject().as<NativeObject>());

    // Use AutoEnterAnalysis to avoid invoking the object metadata callback
    // while bailing out, which could try to walk the stack.
    types::AutoEnterAnalysis enter(cx);

    // See CodeGenerator::visitCreateThisWithTemplate
    gc::AllocKind allocKind = templateObject->asTenured().getAllocKind();
    gc::InitialHeap initialHeap = tenuredHeap_ ? gc::TenuredHeap : gc::DefaultHeap;
    JSObject *resultObject = NativeObject::copy(cx, allocKind, initialHeap, templateObject);
    if (!resultObject)
        return false;

    RootedValue result(cx);
    result.setObject(*resultObject);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:alex-tifrea,项目名称:gecko-dev,代码行数:21,代码来源:Recover.cpp

示例13: templateObject

bool
RNewObject::recover(JSContext* cx, SnapshotIterator& iter) const
{
    RootedObject templateObject(cx, &iter.read().toObject());
    RootedValue result(cx);
    JSObject* resultObject = nullptr;

    // See CodeGenerator::visitNewObjectVMCall
    if (mode_ == MNewObject::ObjectLiteral) {
        resultObject = NewObjectOperationWithTemplate(cx, templateObject);
    } else {
        MOZ_ASSERT(mode_ == MNewObject::ObjectCreate);
        resultObject = ObjectCreateWithTemplate(cx, templateObject.as<PlainObject>());
    }

    if (!resultObject)
        return false;

    result.setObject(*resultObject);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:Phoxygen,项目名称:gecko-dev,代码行数:22,代码来源:Recover.cpp

示例14: templateObject

bool
RNewArray::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedObject templateObject(cx, &iter.read().toObject());
    RootedValue result(cx);
    RootedTypeObject type(cx);

    // Use AutoEnterAnalysis to avoid invoking the object metadata callback
    // while bailing out, which could try to walk the stack.
    types::AutoEnterAnalysis enter(cx);

    // See CodeGenerator::visitNewArrayCallVM
    if (!templateObject->hasSingletonType())
        type = templateObject->type();

    JSObject *resultObject = NewDenseArray(cx, count_, type, allocatingBehaviour_);
    if (!resultObject)
        return false;

    result.setObject(*resultObject);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:mlasak,项目名称:gecko-dev,代码行数:23,代码来源:Recover.cpp

示例15: templateObject

bool
RNewObject::recover(JSContext *cx, SnapshotIterator &iter) const
{
    RootedObject templateObject(cx, &iter.read().toObject());
    RootedValue result(cx);
    JSObject *resultObject = nullptr;

    // Use AutoEnterAnalysis to avoid invoking the object metadata callback
    // while bailing out, which could try to walk the stack.
    types::AutoEnterAnalysis enter(cx);

    // See CodeGenerator::visitNewObjectVMCall
    if (templateObjectIsClassPrototype_)
        resultObject = NewInitObjectWithClassPrototype(cx, templateObject);
    else
        resultObject = NewInitObject(cx, templateObject);

    if (!resultObject)
        return false;

    result.setObject(*resultObject);
    iter.storeInstructionResult(result);
    return true;
}
开发者ID:chenhequn,项目名称:gecko,代码行数:24,代码来源:Recover.cpp


注:本文中的SnapshotIterator::read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。