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


C++ HandleObject::hasUncacheableProto方法代码示例

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


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

示例1: while

bool
GetPropIRGenerator::tryAttachDenseElementHole(HandleObject obj, ObjOperandId objId,
                                              ValOperandId indexId)
{
    MOZ_ASSERT(idVal_.isInt32());

    if (idVal_.toInt32() < 0)
        return false;

    if (!obj->isNative() || !CanAttachDenseElementHole(obj))
        return false;

    // Guard on the shape, to prevent non-dense elements from appearing.
    writer.guardShape(objId, obj->as<NativeObject>().lastProperty());

    if (obj->hasUncacheableProto()) {
        // If the shape does not imply the proto, emit an explicit proto guard.
        writer.guardProto(objId, obj->staticPrototype());
    }

    JSObject* pobj = obj->staticPrototype();
    while (pobj) {
        ObjOperandId protoId = writer.loadObject(pobj);

        // Non-singletons with uncacheable protos can change their proto
        // without a shape change, so also guard on the group (which determines
        // the proto) in this case.
        if (pobj->hasUncacheableProto() && !pobj->isSingleton())
            writer.guardGroup(protoId, pobj->group());

        // Make sure the shape matches, to avoid non-dense elements or anything
        // else that is being checked by CanAttachDenseElementHole.
        writer.guardShape(protoId, pobj->as<NativeObject>().lastProperty());

        // Also make sure there are no dense elements.
        writer.guardNoDenseElements(protoId);

        pobj = pobj->staticPrototype();
    }

    Int32OperandId int32IndexId = writer.guardIsInt32(indexId);
    writer.loadDenseElementHoleResult(objId, int32IndexId);
    writer.typeMonitorResult();
    return true;
}
开发者ID:mozilla,项目名称:positron-spidernode,代码行数:45,代码来源:CacheIR.cpp


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