本文整理汇总了C++中AsmJsFunctionInfo::IsWasmDeferredParse方法的典型用法代码示例。如果您正苦于以下问题:C++ AsmJsFunctionInfo::IsWasmDeferredParse方法的具体用法?C++ AsmJsFunctionInfo::IsWasmDeferredParse怎么用?C++ AsmJsFunctionInfo::IsWasmDeferredParse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsmJsFunctionInfo
的用法示例。
在下文中一共展示了AsmJsFunctionInfo::IsWasmDeferredParse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProfileThunk
Var CrossSite::ProfileThunk(RecyclableObject* callable, CallInfo callInfo, ...)
{
JavascriptFunction* function = JavascriptFunction::FromVar(callable);
Assert(function->GetTypeId() == TypeIds_Function);
Assert(function->GetEntryPoint() == CrossSite::ProfileThunk);
RUNTIME_ARGUMENTS(args, callInfo);
ScriptContext * scriptContext = function->GetScriptContext();
// It is not safe to access the function body if the script context is not alive.
scriptContext->VerifyAliveWithHostContext(!function->IsExternal(),
scriptContext->GetThreadContext()->GetPreviousHostScriptContext());
JavascriptMethod entryPoint;
FunctionInfo *funcInfo = function->GetFunctionInfo();
TTD_XSITE_LOG(callable->GetScriptContext(), "DefaultOrProfileThunk", callable);
#ifdef ENABLE_WASM
if (WasmScriptFunction::Is(function))
{
AsmJsFunctionInfo* asmInfo = funcInfo->GetFunctionBody()->GetAsmJsFunctionInfo();
Assert(asmInfo);
if (asmInfo->IsWasmDeferredParse())
{
entryPoint = WasmLibrary::WasmDeferredParseExternalThunk;
}
else
{
entryPoint = Js::AsmJsExternalEntryPoint;
}
} else
#endif
if (funcInfo->HasBody())
{
#if ENABLE_DEBUG_CONFIG_OPTIONS
char16 debugStringBuffer[MAX_FUNCTION_BODY_DEBUG_STRING_SIZE];
#endif
entryPoint = ScriptFunction::FromVar(function)->GetEntryPointInfo()->jsMethod;
if (funcInfo->IsDeferred() && scriptContext->IsProfiling())
{
// if the current entrypoint is deferred parse we need to update it appropriately for the profiler mode.
entryPoint = Js::ScriptContext::GetProfileModeThunk(entryPoint);
}
OUTPUT_TRACE(Js::ScriptProfilerPhase, _u("CrossSite::ProfileThunk FunctionNumber : %s, Entrypoint : 0x%08X\n"), funcInfo->GetFunctionProxy()->GetDebugNumberSet(debugStringBuffer), entryPoint);
}
else
{
entryPoint = ProfileEntryThunk;
}
return CommonThunk(function, entryPoint, args);
}
示例2: DefaultThunk
Var CrossSite::DefaultThunk(RecyclableObject* callable, CallInfo callInfo, ...)
{
JavascriptFunction* function = JavascriptFunction::FromVar(callable);
Assert(function->GetTypeId() == TypeIds_Function);
Assert(function->GetEntryPoint() == CrossSite::DefaultThunk);
RUNTIME_ARGUMENTS(args, callInfo);
// It is not safe to access the function body if the script context is not alive.
function->GetScriptContext()->VerifyAliveWithHostContext(!function->IsExternal(),
ThreadContext::GetContextForCurrentThread()->GetPreviousHostScriptContext());
JavascriptMethod entryPoint;
FunctionInfo *funcInfo = function->GetFunctionInfo();
TTD_XSITE_LOG(callable->GetScriptContext(), "DefaultOrProfileThunk", callable);
if (funcInfo->HasBody())
{
#ifdef ASMJS_PLAT
if (funcInfo->GetFunctionProxy()->IsFunctionBody() &&
funcInfo->GetFunctionBody()->GetIsAsmJsFunction())
{
#ifdef ENABLE_WASM
AsmJsFunctionInfo* asmInfo = funcInfo->GetFunctionBody()->GetAsmJsFunctionInfo();
if (asmInfo && asmInfo->IsWasmDeferredParse())
{
entryPoint = WasmLibrary::WasmDeferredParseExternalThunk;
}
else
#endif
{
entryPoint = Js::AsmJsExternalEntryPoint;
}
}
else
#endif
{
entryPoint = ScriptFunction::FromVar(function)->GetEntryPointInfo()->jsMethod;
}
}
else
{
entryPoint = funcInfo->GetOriginalEntryPoint();
}
return CommonThunk(function, entryPoint, args);
}