本文整理汇总了C++中HandleObject::nativeLookupPure方法的典型用法代码示例。如果您正苦于以下问题:C++ HandleObject::nativeLookupPure方法的具体用法?C++ HandleObject::nativeLookupPure怎么用?C++ HandleObject::nativeLookupPure使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HandleObject
的用法示例。
在下文中一共展示了HandleObject::nativeLookupPure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: v
bool
jit::SetPropertyPar(ForkJoinSlice *slice, HandleObject obj, HandlePropertyName name,
HandleValue value, bool strict, jsbytecode *pc)
{
JS_ASSERT(slice->isThreadLocal(obj));
if (*pc == JSOP_SETALIASEDVAR) {
// See comment in jit::SetProperty.
Shape *shape = obj->nativeLookupPure(name);
JS_ASSERT(shape && shape->hasSlot());
return obj->nativeSetSlotIfHasType(shape, value);
}
// Fail early on hooks.
if (obj->getOps()->setProperty)
return TP_RETRY_SEQUENTIALLY;
RootedValue v(slice, value);
RootedId id(slice, NameToId(name));
return baseops::SetPropertyHelper<ParallelExecution>(slice, obj, obj, id, 0, &v, strict);
}
示例2: value
static bool
GetUnclonedValue(JSContext *cx, HandleObject selfHostedObject, HandleId id, MutableHandleValue vp)
{
vp.setUndefined();
if (JSID_IS_INT(id)) {
size_t index = JSID_TO_INT(id);
if (index < selfHostedObject->getDenseInitializedLength() &&
!selfHostedObject->getDenseElement(index).isMagic(JS_ELEMENTS_HOLE))
{
vp.set(selfHostedObject->getDenseElement(JSID_TO_INT(id)));
return true;
}
}
// Since all atoms used by self hosting are marked as permanent, any
// attempt to look up a non-permanent atom will fail. We should only
// see such atoms when code is looking for properties on the self
// hosted global which aren't present.
if (JSID_IS_STRING(id) && !JSID_TO_STRING(id)->isPermanentAtom()) {
JS_ASSERT(selfHostedObject->is<GlobalObject>());
RootedValue value(cx, IdToValue(id));
return js_ReportValueErrorFlags(cx, JSREPORT_ERROR, JSMSG_NO_SUCH_SELF_HOSTED_PROP,
JSDVG_IGNORE_STACK, value, NullPtr(), nullptr, nullptr);
}
RootedShape shape(cx, selfHostedObject->nativeLookupPure(id));
if (!shape) {
RootedValue value(cx, IdToValue(id));
return js_ReportValueErrorFlags(cx, JSREPORT_ERROR, JSMSG_NO_SUCH_SELF_HOSTED_PROP,
JSDVG_IGNORE_STACK, value, NullPtr(), nullptr, nullptr);
}
JS_ASSERT(shape->hasSlot() && shape->hasDefaultGetter());
vp.set(selfHostedObject->getSlot(shape->slot()));
return true;
}