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


C++ ObjectGroupVector类代码示例

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


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

示例1: icEntryFromPC

bool
BaselineInspector::commonGetPropFunction(jsbytecode* pc, JSObject** holder, Shape** holderShape,
        JSFunction** commonGetter, Shape** globalShape,
        bool* isOwnProperty,
        ReceiverVector& receivers,
        ObjectGroupVector& convertUnboxedGroups)
{
    if (!hasBaselineScript())
        return false;

    MOZ_ASSERT(receivers.empty());
    MOZ_ASSERT(convertUnboxedGroups.empty());

    *holder = nullptr;
    const ICEntry& entry = icEntryFromPC(pc);

    for (ICStub* stub = entry.firstStub(); stub; stub = stub->next()) {
        if (stub->isGetProp_CallScripted() ||
                stub->isGetProp_CallNative() ||
                stub->isGetProp_CallNativeGlobal())
        {
            ICGetPropCallGetter* nstub = static_cast<ICGetPropCallGetter*>(stub);
            bool isOwn = nstub->isOwnGetter();
            if (!isOwn && !AddReceiver(nstub->receiverGuard(), receivers, convertUnboxedGroups))
                return false;

            if (!*holder) {
                *holder = nstub->holder();
                *holderShape = nstub->holderShape();
                *commonGetter = nstub->getter();
                *globalShape = GlobalShapeForGetPropFunction(nstub);
                *isOwnProperty = isOwn;
            } else if (nstub->holderShape() != *holderShape ||
                       GlobalShapeForGetPropFunction(nstub) != *globalShape ||
                       isOwn != *isOwnProperty)
            {
                return false;
            } else {
                MOZ_ASSERT(*commonGetter == nstub->getter());
            }
        } else if (stub->isGetProp_Fallback()) {
            // If we have an unoptimizable access, don't try to optimize.
            if (stub->toGetProp_Fallback()->hadUnoptimizableAccess())
                return false;
        } else if (stub->isGetName_Fallback()) {
            if (stub->toGetName_Fallback()->hadUnoptimizableAccess())
                return false;
        } else {
            return false;
        }
    }

    if (!*holder)
        return false;

    MOZ_ASSERT(*isOwnProperty == (receivers.empty() && convertUnboxedGroups.empty()));
    return true;
}
开发者ID:frap129,项目名称:hyperfox,代码行数:58,代码来源:BaselineInspector.cpp

示例2: commonSetPropFunction

bool BaselineInspector::commonSetPropFunction(
    jsbytecode* pc, JSObject** holder, Shape** holderShape,
    JSFunction** commonSetter, bool* isOwnProperty, ReceiverVector& receivers,
    ObjectGroupVector& convertUnboxedGroups) {
  if (!hasICScript()) {
    return false;
  }

  MOZ_ASSERT(receivers.empty());
  MOZ_ASSERT(convertUnboxedGroups.empty());

  *commonSetter = nullptr;
  const ICEntry& entry = icEntryFromPC(pc);

  for (ICStub* stub = entry.firstStub(); stub; stub = stub->next()) {
    if (stub->isCacheIR_Updated()) {
      if (!AddCacheIRSetPropFunction(stub->toCacheIR_Updated(), holder,
                                     holderShape, commonSetter, isOwnProperty,
                                     receivers, convertUnboxedGroups)) {
        return false;
      }
    } else if (!stub->isFallback() ||
               stub->toFallbackStub()->state().hasFailures()) {
      // We have an unoptimizable access, so don't try to optimize.
      return false;
    }
  }

  if (!*commonSetter) {
    return false;
  }

  MOZ_ASSERT(*isOwnProperty == !*holder);
  return true;
}
开发者ID:servo,项目名称:mozjs,代码行数:35,代码来源:BaselineInspector.cpp

示例3: maybeInfoForProtoReadSlot

bool BaselineInspector::maybeInfoForProtoReadSlot(
    jsbytecode* pc, ReceiverVector& receivers,
    ObjectGroupVector& convertUnboxedGroups, JSObject** holder) {
  // This is like maybeInfoForPropertyOp, but for when the property exists on
  // the prototype.

  MOZ_ASSERT(receivers.empty());
  MOZ_ASSERT(convertUnboxedGroups.empty());
  MOZ_ASSERT(!*holder);

  if (!hasICScript()) {
    return true;
  }

  MOZ_ASSERT(isValidPC(pc));
  const ICEntry& entry = icEntryFromPC(pc);

  ICStub* stub = entry.firstStub();
  while (stub->next()) {
    ReceiverGuard receiver;
    if (stub->isCacheIR_Monitored()) {
      if (!GetCacheIRReceiverForProtoReadSlot(stub->toCacheIR_Monitored(),
                                              &receiver, holder)) {
        receivers.clear();
        return true;
      }
    } else {
      receivers.clear();
      return true;
    }

    if (!AddReceiver(receiver, receivers, convertUnboxedGroups)) {
      return false;
    }

    stub = stub->next();
  }

  if (stub->toFallbackStub()->state().hasFailures()) {
    receivers.clear();
  }

  // Don't inline if there are more than 5 receivers.
  if (receivers.length() > 5) {
    receivers.clear();
  }

  MOZ_ASSERT_IF(!receivers.empty(), *holder);
  return true;
}
开发者ID:servo,项目名称:mozjs,代码行数:50,代码来源:BaselineInspector.cpp

示例4: icEntryFromPC

bool
BaselineInspector::commonSetPropFunction(jsbytecode* pc, JSObject** holder, Shape** holderShape,
                                         JSFunction** commonSetter, bool* isOwnProperty,
                                         ReceiverVector& receivers,
                                         ObjectGroupVector& convertUnboxedGroups)
{
    if (!hasBaselineScript())
        return false;

    MOZ_ASSERT(receivers.empty());
    MOZ_ASSERT(convertUnboxedGroups.empty());

    *holder = nullptr;
    const ICEntry& entry = icEntryFromPC(pc);

    for (ICStub* stub = entry.firstStub(); stub; stub = stub->next()) {
        if (stub->isSetProp_CallScripted() || stub->isSetProp_CallNative()) {
            ICSetPropCallSetter* nstub = static_cast<ICSetPropCallSetter*>(stub);
            if (!AddReceiver(nstub->guard(), receivers, convertUnboxedGroups))
                return false;

            if (!*holder) {
                *holder = nstub->holder();
                *holderShape = nstub->holderShape();
                *commonSetter = nstub->setter();
                *isOwnProperty = false;
            } else if (nstub->holderShape() != *holderShape) {
                return false;
            } else {
                MOZ_ASSERT(*commonSetter == nstub->setter());
            }
        } else if (!stub->isSetProp_Fallback() ||
                   stub->toSetProp_Fallback()->hadUnoptimizableAccess())
        {
            // We have an unoptimizable access, so don't try to optimize.
            return false;
        }
    }

    if (!*holder)
        return false;

    return true;
}
开发者ID:LordJZ,项目名称:gecko-dev,代码行数:44,代码来源:BaselineInspector.cpp

示例5: icEntryFromPC

bool
BaselineInspector::maybeInfoForPropertyOp(jsbytecode *pc,
                                          ShapeVector &nativeShapes,
                                          ObjectGroupVector &unboxedGroups,
                                          ObjectGroupVector &convertUnboxedGroups)
{
    // Return lists of native shapes and unboxed objects seen by the baseline
    // IC for the current op. Empty lists indicate no shapes/types are known,
    // or there was an uncacheable access. convertUnboxedGroups is used for
    // unboxed object groups which have been seen, but have had instances
    // converted to native objects and should be eagerly converted by Ion.
    MOZ_ASSERT(nativeShapes.empty());
    MOZ_ASSERT(unboxedGroups.empty());
    MOZ_ASSERT(convertUnboxedGroups.empty());

    if (!hasBaselineScript())
        return true;

    MOZ_ASSERT(isValidPC(pc));
    const ICEntry &entry = icEntryFromPC(pc);

    ICStub *stub = entry.firstStub();
    while (stub->next()) {
        Shape *shape = nullptr;
        ObjectGroup *group = nullptr;
        if (stub->isGetProp_Native()) {
            shape = stub->toGetProp_Native()->shape();
        } else if (stub->isSetProp_Native()) {
            shape = stub->toSetProp_Native()->shape();
        } else if (stub->isGetProp_Unboxed()) {
            group = stub->toGetProp_Unboxed()->group();
        } else if (stub->isSetProp_Unboxed()) {
            group = stub->toSetProp_Unboxed()->group();
        } else {
            nativeShapes.clear();
            unboxedGroups.clear();
            return true;
        }

        if (group && group->unboxedLayout().nativeGroup()) {
            if (!VectorAppendNoDuplicate(convertUnboxedGroups, group))
                return false;
            shape = group->unboxedLayout().nativeShape();
            group = nullptr;
        }

        if (shape) {
            if (!VectorAppendNoDuplicate(nativeShapes, shape))
                return false;
        } else {
            if (!VectorAppendNoDuplicate(unboxedGroups, group))
                return false;
        }

        stub = stub->next();
    }

    if (stub->isGetProp_Fallback()) {
        if (stub->toGetProp_Fallback()->hadUnoptimizableAccess()) {
            nativeShapes.clear();
            unboxedGroups.clear();
        }
    } else {
        if (stub->toSetProp_Fallback()->hadUnoptimizableAccess()) {
            nativeShapes.clear();
            unboxedGroups.clear();
        }
    }

    // Don't inline if there are more than 5 shapes/groups.
    if (nativeShapes.length() + unboxedGroups.length() > 5) {
        nativeShapes.clear();
        unboxedGroups.clear();
    }

    return true;
}
开发者ID:fatman2021,项目名称:gecko-dev,代码行数:77,代码来源:BaselineInspector.cpp


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