本文整理汇总了C++中VMFrame::chunk方法的典型用法代码示例。如果您正苦于以下问题:C++ VMFrame::chunk方法的具体用法?C++ VMFrame::chunk怎么用?C++ VMFrame::chunk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VMFrame
的用法示例。
在下文中一共展示了VMFrame::chunk方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: repatch
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);
}
示例2: repatcher
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;
}
示例3: obj
void JS_FASTCALL
ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
{
AssertCanGC();
RootedObject obj(f.cx, &f.fp()->global());
PropertyName *name = f.script()->getName(GET_UINT32_INDEX(f.pc()));
RecompilationMonitor monitor(f.cx);
uint32_t slot;
{
RootedShape shape(f.cx, obj->nativeLookup(f.cx, NameToId(name)));
if (monitor.recompiled()) {
stubs::Name(f);
return;
}
if (!shape ||
!shape->hasDefaultGetter() ||
!shape->hasSlot())
{
if (shape)
PatchGetFallback(f, ic);
stubs::Name(f);
return;
}
slot = shape->slot();
/* Patch shape guard. */
Repatcher repatcher(f.chunk());
repatcher.repatch(ic->fastPathStart.dataLabelPtrAtOffset(ic->shapeOffset), obj->lastProperty());
/* Patch loads. */
uint32_t index = obj->dynamicSlotIndex(slot);
JSC::CodeLocationLabel label = ic->fastPathStart.labelAtOffset(ic->loadStoreOffset);
repatcher.patchAddressOffsetForValueLoad(label, index * sizeof(Value));
}
/* Do load anyway... this time. */
stubs::Name(f);
}
示例4: monitor
void JS_FASTCALL
ic::GetGlobalName(VMFrame &f, ic::GetGlobalNameIC *ic)
{
JSObject &obj = f.fp()->scopeChain().global();
PropertyName *name = f.script()->getName(GET_UINT32_INDEX(f.pc()));
RecompilationMonitor monitor(f.cx);
const Shape *shape = obj.nativeLookup(f.cx, js_CheckForStringIndex(ATOM_TO_JSID(name)));
if (monitor.recompiled()) {
stubs::Name(f);
return;
}
if (!shape ||
!shape->hasDefaultGetter() ||
!shape->hasSlot())
{
if (shape)
PatchGetFallback(f, ic);
stubs::Name(f);
return;
}
uint32_t slot = shape->slot();
/* Patch shape guard. */
Repatcher repatcher(f.chunk());
repatcher.repatch(ic->fastPathStart.dataLabelPtrAtOffset(ic->shapeOffset), obj.lastProperty());
/* Patch loads. */
uint32_t index = obj.dynamicSlotIndex(slot);
JSC::CodeLocationLabel label = ic->fastPathStart.labelAtOffset(ic->loadStoreOffset);
repatcher.patchAddressOffsetForValueLoad(label, index * sizeof(Value));
/* Do load anyway... this time. */
stubs::Name(f);
}