本文整理汇总了C++中StackTypeSet::getTypeObject方法的典型用法代码示例。如果您正苦于以下问题:C++ StackTypeSet::getTypeObject方法的具体用法?C++ StackTypeSet::getTypeObject怎么用?C++ StackTypeSet::getTypeObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StackTypeSet
的用法示例。
在下文中一共展示了StackTypeSet::getTypeObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
MIRType
TypeInferenceOracle::elementWrite(UnrootedScript script, jsbytecode *pc)
{
StackTypeSet *objTypes = script->analysis()->poppedTypes(pc, 2);
MIRType elementType = MIRType_None;
unsigned count = objTypes->getObjectCount();
for (unsigned i = 0; i < count; i++) {
if (objTypes->getSingleObject(i))
return MIRType_None;
if (TypeObject *object = objTypes->getTypeObject(i)) {
types::HeapTypeSet *elementTypes = object->getProperty(cx, JSID_VOID, false);
if (!elementTypes)
return MIRType_None;
MIRType type = getMIRType(elementTypes);
if (type == MIRType_None)
return MIRType_None;
if (elementType == MIRType_None)
elementType = type;
else if (elementType != type)
return MIRType_None;
}
}
return elementType;
}
示例2:
bool
TypeInferenceOracle::propertyReadIdempotent(HandleScript script, jsbytecode *pc, HandleId id)
{
if (script->analysis()->getCode(pc).notIdempotent)
return false;
if (id != MakeTypeId(cx, id))
return false;
StackTypeSet *types = script->analysis()->poppedTypes(pc, 0);
if (!types || types->unknownObject())
return false;
for (unsigned i = 0; i < types->getObjectCount(); i++) {
if (types->getSingleObject(i))
return false;
if (TypeObject *obj = types->getTypeObject(i)) {
if (obj->unknownProperties())
return false;
// Check if the property has been reconfigured or is a getter.
HeapTypeSet *propertyTypes = obj->getProperty(cx, id, false);
if (!propertyTypes || propertyTypes->isOwnProperty(cx, obj, true))
return false;
}
}
return true;
}