本文整理汇总了C++中CCallHelpers::addLinkTask方法的典型用法代码示例。如果您正苦于以下问题:C++ CCallHelpers::addLinkTask方法的具体用法?C++ CCallHelpers::addLinkTask怎么用?C++ CCallHelpers::addLinkTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCallHelpers
的用法示例。
在下文中一共展示了CCallHelpers::addLinkTask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateImpl
CCallHelpers::JumpList generateImpl(AccessGenerationState& state, const RegisterSet& usedRegistersBySnippet, CCallHelpers& jit, std::index_sequence<ArgumentsIndex...>)
{
CCallHelpers::JumpList exceptions;
// We spill (1) the used registers by IC and (2) the used registers by Snippet.
AccessGenerationState::SpillState spillState = state.preserveLiveRegistersToStackForCall(usedRegistersBySnippet);
jit.store32(
CCallHelpers::TrustedImm32(state.callSiteIndexForExceptionHandlingOrOriginal().bits()),
CCallHelpers::tagFor(static_cast<VirtualRegister>(CallFrameSlot::argumentCount)));
jit.makeSpaceOnStackForCCall();
jit.setupArguments<FunctionType>(std::get<ArgumentsIndex>(m_arguments)...);
CCallHelpers::Call operationCall = jit.call(OperationPtrTag);
auto function = m_function;
jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
linkBuffer.link(operationCall, FunctionPtr<OperationPtrTag>(function));
});
jit.setupResults(m_result);
jit.reclaimSpaceOnStackForCCall();
CCallHelpers::Jump noException = jit.emitExceptionCheck(state.m_vm, CCallHelpers::InvertedExceptionCheck);
state.restoreLiveRegistersFromStackForCallWithThrownException(spillState);
exceptions.append(jit.jump());
noException.link(&jit);
RegisterSet dontRestore;
dontRestore.set(m_result);
state.restoreLiveRegistersFromStackForCall(spillState, dontRestore);
return exceptions;
}
示例2:
Box<CCallHelpers::JumpList> ExceptionTarget::jumps(CCallHelpers& jit)
{
Box<CCallHelpers::JumpList> result = Box<CCallHelpers::JumpList>::create();
if (m_isDefaultHandler) {
Box<CCallHelpers::Label> defaultHandler = m_defaultHandler;
jit.addLinkTask(
[=] (LinkBuffer& linkBuffer) {
linkBuffer.link(*result, linkBuffer.locationOf(*defaultHandler));
});
} else {
RefPtr<OSRExitHandle> handle = m_handle;
jit.addLinkTask(
[=] (LinkBuffer& linkBuffer) {
linkBuffer.link(*result, linkBuffer.locationOf(handle->label));
});
}
return result;
}
示例3: emitExitThunk
void OSRExitHandle::emitExitThunk(State& state, CCallHelpers& jit)
{
Profiler::Compilation* compilation = state.graph.compilation();
CCallHelpers::Label myLabel = jit.label();
label = myLabel;
jit.pushToSaveImmediateWithoutTouchingRegisters(CCallHelpers::TrustedImm32(index));
CCallHelpers::PatchableJump jump = jit.patchableJump();
RefPtr<OSRExitHandle> self = this;
VM& vm = state.vm();
jit.addLinkTask(
[self, jump, myLabel, compilation, &vm] (LinkBuffer& linkBuffer) {
self->exit.m_patchableJump = CodeLocationJump<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(jump));
linkBuffer.link(
jump.m_jump,
CodeLocationLabel<JITThunkPtrTag>(vm.getCTIStub(osrExitGenerationThunkGenerator).code()));
if (compilation)
compilation->addOSRExitSite({ linkBuffer.locationOf<JSInternalPtrTag>(myLabel) });
});
}