本文整理汇总了C++中SnapshotIterator::storeInstructionResult方法的典型用法代码示例。如果您正苦于以下问题:C++ SnapshotIterator::storeInstructionResult方法的具体用法?C++ SnapshotIterator::storeInstructionResult怎么用?C++ SnapshotIterator::storeInstructionResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SnapshotIterator
的用法示例。
在下文中一共展示了SnapshotIterator::storeInstructionResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
bool
RNewDerivedTypedObject::recover(JSContext* cx, SnapshotIterator& iter) const
{
Rooted<TypeDescr*> descr(cx, &iter.read().toObject().as<TypeDescr>());
Rooted<TypedObject*> owner(cx, &iter.read().toObject().as<TypedObject>());
int32_t offset = iter.read().toInt32();
JSObject* obj = OutlineTypedObject::createDerived(cx, descr, owner, offset);
if (!obj)
return false;
RootedValue result(cx, ObjectValue(*obj));
iter.storeInstructionResult(result);
return true;
}
示例2: 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;
}
示例3: scopeChain
bool
RLambda::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedObject scopeChain(cx, &iter.read().toObject());
RootedFunction fun(cx, &iter.read().toObject().as<JSFunction>());
JSObject* resultObject = js::Lambda(cx, fun, scopeChain);
if (!resultObject)
return false;
RootedValue result(cx);
result.setObject(*resultObject);
iter.storeInstructionResult(result);
return true;
}
示例4: recover
bool RStringReplace::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedString string(cx, iter.read().toString());
RootedString pattern(cx, iter.read().toString());
RootedString replace(cx, iter.read().toString());
JSString* result = isFlatReplacement_ ? js::str_flat_replace_string(cx, string, pattern, replace) :
js::str_replace_string_raw(cx, string, pattern, replace);
if (!result)
return false;
iter.storeInstructionResult(StringValue(result));
return true;
}
示例5: str
bool
RStringSplit::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedString str(cx, iter.read().toString());
RootedString sep(cx, iter.read().toString());
RootedTypeObject typeObj(cx, iter.read().toObject().type());
RootedValue result(cx);
JSObject *res = str_split_string(cx, typeObj, str, sep);
if (!res)
return false;
result.setObject(*res);
iter.storeInstructionResult(result);
return true;
}
示例6: string
bool
RRegExpTester::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedString string(cx, iter.read().toString());
RootedObject regexp(cx, &iter.read().toObject());
int32_t lastIndex = iter.read().toInt32();
int32_t endIndex;
if (!js::RegExpTesterRaw(cx, regexp, string, lastIndex, &endIndex))
return false;
RootedValue result(cx);
result.setInt32(endIndex);
iter.storeInstructionResult(result);
return true;
}
示例7: regexp
bool
RRegExpSearcher::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedObject regexp(cx, &iter.read().toObject());
RootedString input(cx, iter.read().toString());
int32_t lastIndex = iter.read().toInt32();
int32_t result;
if (!RegExpSearcherRaw(cx, regexp, input, lastIndex, nullptr, &result))
return false;
RootedValue resultVal(cx);
resultVal.setInt32(result);
iter.storeInstructionResult(resultVal);
return true;
}
示例8: object
bool
RObjectState::recover(JSContext *cx, SnapshotIterator &iter) const
{
RootedNativeObject object(cx, &iter.read().toObject().as<NativeObject>());
MOZ_ASSERT(object->slotSpan() == numSlots());
RootedValue val(cx);
for (size_t i = 0; i < numSlots(); i++) {
val = iter.read();
object->setSlot(i, val);
}
val.setObject(*object);
iter.storeInstructionResult(val);
return true;
}
示例9: 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;
}
示例10: 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;
}
示例11: 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;
}
示例12: 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;
}
示例13: 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;
}
示例14: enter
bool
RNewDerivedTypedObject::recover(JSContext *cx, SnapshotIterator &iter) const
{
Rooted<SizedTypeDescr *> descr(cx, &iter.read().toObject().as<SizedTypeDescr>());
Rooted<TypedObject *> owner(cx, &iter.read().toObject().as<TypedObject>());
int32_t offset = iter.read().toInt32();
// Use AutoEnterAnalysis to avoid invoking the object metadata callback
// while bailing out, which could try to walk the stack.
types::AutoEnterAnalysis enter(cx);
JSObject *obj = TypedObject::createDerived(cx, descr, owner, offset);
if (!obj)
return false;
RootedValue result(cx, ObjectValue(*obj));
iter.storeInstructionResult(result);
return true;
}
示例15: object
bool
RObjectState::recover(JSContext* cx, SnapshotIterator& iter) const
{
RootedObject object(cx, &iter.read().toObject());
RootedValue val(cx);
if (object->is<UnboxedPlainObject>()) {
const UnboxedLayout& layout = object->as<UnboxedPlainObject>().layout();
RootedId id(cx);
RootedValue receiver(cx, ObjectValue(*object));
const UnboxedLayout::PropertyVector& properties = layout.properties();
for (size_t i = 0; i < properties.length(); i++) {
val = iter.read();
// This is the default placeholder value of MObjectState, when no
// properties are defined yet.
if (val.isUndefined())
continue;
id = NameToId(properties[i].name);
ObjectOpResult result;
// SetProperty can only fail due to OOM.
if (!SetProperty(cx, object, id, val, receiver, result))
return false;
if (!result)
return result.reportError(cx, object, id);
}
} else {
RootedNativeObject nativeObject(cx, &object->as<NativeObject>());
MOZ_ASSERT(nativeObject->slotSpan() == numSlots());
for (size_t i = 0; i < numSlots(); i++) {
val = iter.read();
nativeObject->setSlot(i, val);
}
}
val.setObject(*object);
iter.storeInstructionResult(val);
return true;
}