本文整理汇总了C++中VMFrame类的典型用法代码示例。如果您正苦于以下问题:C++ VMFrame类的具体用法?C++ VMFrame怎么用?C++ VMFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VMFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: scope
void JS_FASTCALL
stubs::SetName(VMFrame &f, PropertyName *name)
{
AssertCanGC();
JSContext *cx = f.cx;
RootedObject scope(cx, &f.regs.sp[-2].toObject());
HandleValue value = HandleValue::fromMarkedLocation(&f.regs.sp[-1]);
RootedScript fscript(cx, f.script());
if (!SetNameOperation(cx, fscript, f.pc(), scope, value))
THROW();
f.regs.sp[-2] = f.regs.sp[-1];
}
开发者ID:Web5design,项目名称:mozilla-central,代码行数:14,代码来源:StubCalls.cpp
示例2: FinishVarIncOp
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;
}
开发者ID:LyeSS,项目名称:mozilla-central,代码行数:34,代码来源:InvokeHelpers.cpp
示例3: InlineReturn
/*
* 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;
}
开发者ID:Egyptghost1,项目名称:DOMinator,代码行数:17,代码来源:InvokeHelpers.cpp
示例4: Alloc
VMFrame *VMFrameStack::AllocFrame(VMScriptFunction *func)
{
int size = VMFrame::FrameSize(func->NumRegD, func->NumRegF, func->NumRegS, func->NumRegA,
func->MaxParam, func->ExtraSpace);
VMFrame *frame = Alloc(size);
frame->Func = func;
frame->NumRegD = func->NumRegD;
frame->NumRegF = func->NumRegF;
frame->NumRegS = func->NumRegS;
frame->NumRegA = func->NumRegA;
frame->MaxParam = func->MaxParam;
frame->Func = func;
frame->InitRegS();
return frame;
}
开发者ID:Accusedbold,项目名称:zdoom,代码行数:15,代码来源:vmframe.cpp
示例5: THROW
void JS_FASTCALL
stubs::Ursh(VMFrame &f)
{
uint32_t u;
if (!ToUint32(f.cx, f.regs.sp[-2], &u))
THROW();
int32_t j;
if (!ToInt32(f.cx, f.regs.sp[-1], &j))
THROW();
u >>= (j & 31);
if (!f.regs.sp[-2].setNumber(uint32_t(u)))
TypeScript::MonitorOverflow(f.cx, f.script(), f.pc());
}
开发者ID:msliu,项目名称:mozilla-central,代码行数:15,代码来源:StubCalls.cpp
示例6: InlineReturn
/*
* 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;
}
开发者ID:michaelrhanson,项目名称:mozilla-central,代码行数:19,代码来源:InvokeHelpers.cpp
示例7: UpdateSetGlobalName
static LookupStatus
UpdateSetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic, JSObject *obj, Shape *shape)
{
/* Give globals a chance to appear. */
if (!shape)
return Lookup_Uncacheable;
if (!shape->hasDefaultSetter() ||
!shape->writable() ||
!shape->hasSlot() ||
obj->watched())
{
/* Disable the IC for weird shape attributes and watchpoints. */
PatchSetFallback(f, ic);
return Lookup_Uncacheable;
}
/* Object is not branded, so we can use the inline path. */
Repatcher repatcher(f.chunk());
ic->patchInlineShapeGuard(repatcher, obj->lastProperty());
uint32_t index = obj->dynamicSlotIndex(shape->slot());
JSC::CodeLocationLabel label = ic->fastPathStart.labelAtOffset(ic->loadStoreOffset);
repatcher.patchAddressOffsetForValueStore(label, index * sizeof(Value),
ic->vr.isTypeKnown());
return Lookup_Cacheable;
}
开发者ID:CrtronicsStudio,项目名称:spidermonkey,代码行数:28,代码来源:MonoIC.cpp
示例8: fscript
void JS_FASTCALL
stubs::SlowCall(VMFrame &f, uint32_t argc)
{
if (*f.regs.pc == JSOP_FUNAPPLY && !GuardFunApplyArgumentsOptimization(f.cx))
THROW();
CallArgs args = CallArgsFromSp(argc, f.regs.sp);
RootedScript fscript(f.cx, f.script());
if (!MaybeCloneAndPatchCallee(f.cx, args, fscript, f.pc()))
THROW();
if (!InvokeKernel(f.cx, args))
THROW();
types::TypeScript::Monitor(f.cx, fscript, f.pc(), args.rval());
}
开发者ID:vvuk,项目名称:mozilla-central,代码行数:16,代码来源:InvokeHelpers.cpp
示例9: PatchGetFallback
static void
PatchGetFallback(VMFrame &f, ic::GetGlobalNameIC *ic)
{
Repatcher repatch(f.chunk());
JSC::FunctionPtr fptr(JS_FUNC_TO_DATA_PTR(void *, stubs::Name));
repatch.relink(ic->slowPathCall, fptr);
}
开发者ID:CrtronicsStudio,项目名称:spidermonkey,代码行数:7,代码来源:MonoIC.cpp
示例10: 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);
}
开发者ID:moussa1,项目名称:mozilla-central,代码行数:17,代码来源:MonoIC.cpp
示例11: 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();
}
开发者ID:Egyptghost1,项目名称:DOMinator,代码行数:17,代码来源:InvokeHelpers.cpp
示例12: PatchSetFallback
static void
PatchSetFallback(VMFrame &f, ic::SetGlobalNameIC *ic)
{
Repatcher repatch(f.chunk());
VoidStubSetGlobal stub = DisabledSetGlobal;
JSC::FunctionPtr fptr(JS_FUNC_TO_DATA_PTR(void *, stub));
repatch.relink(ic->slowPathCall, fptr);
}
开发者ID:mjschranz,项目名称:mozilla-central,代码行数:8,代码来源:MonoIC.cpp
示例13: Alloc
VMFrame *VMFrameStack::AllocFrame(VMScriptFunction *func)
{
VMFrame *frame = Alloc(func->StackSize);
frame->Func = func;
frame->NumRegD = func->NumRegD;
frame->NumRegF = func->NumRegF;
frame->NumRegS = func->NumRegS;
frame->NumRegA = func->NumRegA;
frame->MaxParam = func->MaxParam;
frame->Func = func;
frame->InitRegS();
if (func->SpecialInits.Size())
{
func->InitExtra(frame->GetExtra());
}
return frame;
}
开发者ID:ArcticPheenix,项目名称:gzdoom,代码行数:17,代码来源:vmframe.cpp
示例14: id
void JS_FASTCALL
stubs::ToId(VMFrame &f)
{
Value &objval = f.regs.sp[-2];
Value &idval = f.regs.sp[-1];
JSObject *obj = ValueToObject(f.cx, objval);
if (!obj)
THROW();
RootedId id(f.cx);
if (!FetchElementId(f.cx, obj, idval, id.address(), &idval))
THROW();
if (!idval.isInt32())
TypeScript::MonitorUnknown(f.cx, f.script(), f.pc());
}
开发者ID:msliu,项目名称:mozilla-central,代码行数:17,代码来源:StubCalls.cpp
示例15: obj
void JS_FASTCALL
ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
{
RootedObject obj(f.cx, &f.fp()->global());
RootedPropertyName name(f.cx, f.script()->getName(GET_UINT32_INDEX(f.pc())));
RecompilationMonitor monitor(f.cx);
Shape *shape = obj->nativeLookup(f.cx, NameToId(name));
if (!monitor.recompiled()) {
LookupStatus status = UpdateSetGlobalName(f, ic, obj, shape);
if (status == Lookup_Error)
THROW();
}
STRICT_VARIANT(f.script(), stubs::SetGlobalName)(f, name);
}
开发者ID:CrtronicsStudio,项目名称:spidermonkey,代码行数:18,代码来源:MonoIC.cpp
示例16: 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);
}
开发者ID:Web5design,项目名称:mozilla-central,代码行数:9,代码来源:StubCalls.cpp
示例17: 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;
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:48,代码来源:InvokeHelpers.cpp
示例18: id
void JS_FASTCALL
stubs::ToId(VMFrame &f)
{
HandleValue objval = HandleValue::fromMarkedLocation(&f.regs.sp[-2]);
MutableHandleValue idval = MutableHandleValue::fromMarkedLocation(&f.regs.sp[-1]);
JSObject *obj = ToObjectFromStack(f.cx, objval);
if (!obj)
THROW();
RootedId id(f.cx);
if (!FetchElementId(f.cx, obj, idval, &id, idval))
THROW();
if (!idval.isInt32()) {
RootedScript fscript(f.cx, f.script());
TypeScript::MonitorUnknown(f.cx, fscript, f.pc());
}
}
开发者ID:Web5design,项目名称:mozilla-central,代码行数:19,代码来源:StubCalls.cpp
示例19: monitor
void JS_FASTCALL
ic::SetGlobalName(VMFrame &f, ic::SetGlobalNameIC *ic)
{
JSObject &obj = f.fp()->global();
JSScript *script = f.script();
PropertyName *name = script->getName(GET_UINT32_INDEX(f.pc()));
RecompilationMonitor monitor(f.cx);
const Shape *shape = obj.nativeLookup(f.cx, NameToId(name));
if (!monitor.recompiled()) {
LookupStatus status = UpdateSetGlobalName(f, ic, &obj, shape);
if (status == Lookup_Error)
THROW();
}
STRICT_VARIANT(stubs::SetGlobalName)(f, name);
}
开发者ID:mozilla,项目名称:pjs,代码行数:19,代码来源:MonoIC.cpp
示例20: assert
VMFrame *VMFrameStack::AllocFrame(int numregd, int numregf, int numregs, int numrega)
{
assert((unsigned)numregd < 255);
assert((unsigned)numregf < 255);
assert((unsigned)numregs < 255);
assert((unsigned)numrega < 255);
// To keep the arguments to this function simpler, it assumes that every
// register might be used as a parameter for a single call.
int numparam = numregd + numregf + numregs + numrega;
int size = VMFrame::FrameSize(numregd, numregf, numregs, numrega, numparam, 0);
VMFrame *frame = Alloc(size);
frame->NumRegD = numregd;
frame->NumRegF = numregf;
frame->NumRegS = numregs;
frame->NumRegA = numrega;
frame->MaxParam = numparam;
frame->InitRegS();
return frame;
}
开发者ID:Accusedbold,项目名称:zdoom,代码行数:19,代码来源:vmframe.cpp
注:本文中的VMFrame类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论