本文整理汇总了C++中VMFrame::fp方法的典型用法代码示例。如果您正苦于以下问题:C++ VMFrame::fp方法的具体用法?C++ VMFrame::fp怎么用?C++ VMFrame::fp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMFrame
的用法示例。
在下文中一共展示了VMFrame::fp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: THROW
void JS_FASTCALL
stubs::CreateFunCallObject(VMFrame &f)
{
JS_ASSERT(f.fp()->fun()->isHeavyweight());
if (!js::CreateFunCallObject(f.cx, f.fp()))
THROW();
}
示例2:
/*
* Clean up a frame and return.
*/
static void
InlineReturn(VMFrame &f)
{
JS_ASSERT(f.fp() != f.entryfp);
JS_ASSERT(!js_IsActiveWithOrBlock(f.cx, &f.fp()->scopeChain(), 0));
f.cx->stack.popInlineFrame(f.regs);
}
示例3: fscript
static void
FinishVarIncOp(VMFrame &f, RejoinState rejoin, Value ov, Value nv, Value *vp)
{
/* Finish an increment operation on a LOCAL or ARG. These do not involve property accesses. */
JS_ASSERT(rejoin == REJOIN_POS || rejoin == REJOIN_BINARY);
JSContext *cx = f.cx;
JSOp op = JSOp(*f.pc());
JS_ASSERT(op == JSOP_LOCALINC || op == JSOP_INCLOCAL ||
op == JSOP_LOCALDEC || op == JSOP_DECLOCAL ||
op == JSOP_ARGINC || op == JSOP_INCARG ||
op == JSOP_ARGDEC || op == JSOP_DECARG);
const JSCodeSpec *cs = &js_CodeSpec[op];
if (rejoin == REJOIN_POS) {
double d = ov.toNumber();
double N = (cs->format & JOF_INC) ? 1 : -1;
if (!nv.setNumber(d + N)) {
RootedScript fscript(cx, f.script());
types::TypeScript::MonitorOverflow(cx, fscript, f.pc());
}
}
unsigned i = GET_SLOTNO(f.pc());
if (JOF_TYPE(cs->format) == JOF_LOCAL)
f.fp()->unaliasedLocal(i) = nv;
else if (f.fp()->script()->argsObjAliasesFormals())
f.fp()->argsObj().setArg(i, nv);
else
f.fp()->unaliasedFormal(i) = nv;
*vp = (cs->format & JOF_POST) ? ov : nv;
}
示例4:
void JS_FASTCALL
stubs::PutStrictEvalCallObject(VMFrame &f)
{
JS_ASSERT(f.fp()->isEvalFrame());
JS_ASSERT(f.fp()->script()->strictModeCode);
JS_ASSERT(f.fp()->hasCallObj());
js_PutCallObject(f.cx, f.fp());
}
示例5:
/*
* Clean up a frame and return.
*/
static void
InlineReturn(VMFrame &f)
{
JS_ASSERT(f.fp() != f.entryfp);
JS_ASSERT(!js_IsActiveWithOrBlock(f.cx, &f.fp()->scopeChain(), 0));
f.cx->stack.popInlineFrame(f.regs);
JS_ASSERT(*f.regs.pc == JSOP_CALL ||
*f.regs.pc == JSOP_NEW ||
*f.regs.pc == JSOP_EVAL ||
*f.regs.pc == JSOP_FUNCALL ||
*f.regs.pc == JSOP_FUNAPPLY);
f.regs.pc += JSOP_CALL_LENGTH;
}
示例6: RemovePartialFrame
/*
* HitStackQuota is called after the early prologue pushing the new frame would
* overflow f.stackLimit.
*/
void JS_FASTCALL
stubs::HitStackQuota(VMFrame &f)
{
/* Include space to push another frame. */
uintN nvals = f.fp()->script()->nslots + VALUES_PER_STACK_FRAME;
JS_ASSERT(f.regs.sp == f.fp()->base());
if (f.cx->stack().bumpCommitAndLimit(f.entryfp, f.regs.sp, nvals, &f.stackLimit))
return;
/* Remove the current partially-constructed frame before throwing. */
RemovePartialFrame(f.cx, f.fp());
js_ReportOverRecursed(f.cx);
THROW();
}
示例7: repatcher
void JS_FASTCALL
ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
{
JSObject *obj = f.fp()->scopeChain().getGlobal();
JSAtom *atom = f.script()->getAtom(GET_INDEX(f.pc()));
jsid id = ATOM_TO_JSID(atom);
const Shape *shape = obj->nativeLookup(f.cx, id);
if (!shape ||
!shape->hasDefaultGetterOrIsMethod() ||
!shape->hasSlot())
{
if (shape)
PatchGetFallback(f, ic);
stubs::GetGlobalName(f);
return;
}
uint32 slot = shape->slot;
/* Patch shape guard. */
Repatcher repatcher(f.jit());
repatcher.repatch(ic->fastPathStart.dataLabel32AtOffset(ic->shapeOffset), obj->shape());
/* Patch loads. */
uint32 index = obj->dynamicSlotIndex(slot);
JSC::CodeLocationLabel label = ic->fastPathStart.labelAtOffset(ic->loadStoreOffset);
repatcher.patchAddressOffsetForValueLoad(label, index * sizeof(Value));
/* Do load anyway... this time. */
stubs::GetGlobalName(f);
}
示例8: JSOp
/*
* Clean up a frame and return.
*/
static void
InlineReturn(VMFrame &f)
{
JS_ASSERT(f.fp() != f.entryfp);
JS_ASSERT(!IsActiveWithOrBlock(f.cx, f.fp()->scopeChain(), 0));
JS_ASSERT(!f.fp()->hasBlockChain());
f.cx->stack.popInlineFrame(f.regs);
DebugOnly<JSOp> op = JSOp(*f.regs.pc);
JS_ASSERT(op == JSOP_CALL ||
op == JSOP_NEW ||
op == JSOP_EVAL ||
op == JSOP_FUNCALL ||
op == JSOP_FUNAPPLY);
f.regs.pc += JSOP_CALL_LENGTH;
}
示例9: CallArgsFromSp
void JS_FASTCALL
stubs::Eval(VMFrame &f, uint32 argc)
{
CallArgs args = CallArgsFromSp(argc, f.regs.sp);
if (!IsBuiltinEvalForScope(&f.fp()->scopeChain(), args.calleev())) {
if (!Invoke(f.cx, args))
THROW();
return;
}
JS_ASSERT(f.fp() == f.cx->fp());
if (!DirectEval(f.cx, args))
THROW();
f.regs.sp = args.spAfterCall();
}
示例10: name
void JS_FASTCALL
stubs::BindName(VMFrame &f, PropertyName *name_)
{
RootedPropertyName name(f.cx, name_);
RootedObject scope(f.cx);
if (!LookupNameWithGlobalDefault(f.cx, name, f.fp()->scopeChain(), &scope))
THROW();
f.regs.sp[0].setObject(*scope);
}
示例11: THROWV
/*
* This function must only be called after the early prologue, since it depends
* on fp->exec.fun.
*/
void * JS_FASTCALL
stubs::FixupArity(VMFrame &f, uint32 nactual)
{
JSContext *cx = f.cx;
JSStackFrame *oldfp = f.fp();
JS_ASSERT(nactual != oldfp->numFormalArgs());
/*
* Grossssss! *move* the stack frame. If this ends up being perf-critical,
* we can figure out how to spot-optimize it. Be careful to touch only the
* members that have been initialized by initCallFrameCallerHalf and the
* early prologue.
*/
uint32 flags = oldfp->isConstructingFlag();
JSFunction *fun = oldfp->fun();
void *ncode = oldfp->nativeReturnAddress();
/* Pop the inline frame. */
f.fp() = oldfp->prev();
f.regs.sp = (Value*) oldfp;
/* Reserve enough space for a callee frame. */
JSStackFrame *newfp = cx->stack().getInlineFrameWithinLimit(cx, (Value*) oldfp, nactual,
fun, fun->script(), &flags,
f.entryfp, &f.stackLimit);
if (!newfp) {
/*
* The PC is not coherent with the current frame, so fix it up for
* exception handling.
*/
f.regs.pc = f.jit()->nativeToPC(ncode);
THROWV(NULL);
}
/* Reset the part of the stack frame set by the caller. */
newfp->initCallFrameCallerHalf(cx, flags, ncode);
/* Reset the part of the stack frame set by the prologue up to now. */
newfp->initCallFrameEarlyPrologue(fun, nactual);
/* The caller takes care of assigning fp to regs. */
return newfp;
}
示例12: callee
void JS_FASTCALL
stubs::CreateThis(VMFrame &f, JSObject *proto)
{
JSContext *cx = f.cx;
StackFrame *fp = f.fp();
RootedObject callee(cx, &fp->callee());
JSObject *obj = js_CreateThisForFunctionWithProto(cx, callee, proto);
if (!obj)
THROW();
fp->thisValue() = ObjectValue(*obj);
}
示例13: reset
void * JS_FASTCALL
stubs::CompileFunction(VMFrame &f, uint32_t argc)
{
/*
* Note: the stubRejoin kind for the frame was written before the call, and
* needs to be cleared out on all return paths (doing this directly in the
* IC stub will not handle cases where we recompiled or threw).
*/
JS_ASSERT_IF(f.cx->typeInferenceEnabled(), f.stubRejoin);
ResetStubRejoin reset(f);
InitialFrameFlags initial = f.fp()->initialFlags();
f.regs.popPartialFrame((Value *)f.fp());
if (InitialFrameFlagsAreConstructing(initial))
return UncachedNew(f, argc);
else if (InitialFrameFlagsAreLowered(initial))
return UncachedLoweredCall(f, argc);
else
return UncachedCall(f, argc);
}
示例14:
/*
* Clean up a frame and return.
*/
static void
InlineReturn(VMFrame &f)
{
JSContext *cx = f.cx;
JSStackFrame *fp = f.regs.fp;
JS_ASSERT(f.fp() != f.entryfp);
JS_ASSERT(!js_IsActiveWithOrBlock(cx, &fp->scopeChain(), 0));
Value *newsp = fp->actualArgs() - 1;
newsp[-1] = fp->returnValue();
cx->stack().popInlineFrame(cx, fp->prev(), newsp);
}
示例15: UpdateSetGlobalName
void JS_FASTCALL
ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
{
JSObject *obj = f.fp()->scopeChain().getGlobal();
JSScript *script = f.script();
JSAtom *atom = script->getAtom(GET_INDEX(f.pc()));
const Shape *shape = obj->nativeLookup(f.cx, ATOM_TO_JSID(atom));
LookupStatus status = UpdateSetGlobalName(f, ic, obj, shape);
if (status == Lookup_Error)
THROW();
if (ic->usePropertyCache)
STRICT_VARIANT(stubs::SetGlobalName)(f, atom);
else
STRICT_VARIANT(stubs::SetGlobalNameNoCache)(f, atom);
}