LLVM 20.0.0git
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::orc::TrampolinePool Class Referenceabstract

Base class for pools of compiler re-entry trampolines. More...

#include "llvm/ExecutionEngine/Orc/IndirectionUtils.h"

Inheritance diagram for llvm::orc::TrampolinePool:
Inheritance graph
[legend]

Public Types

using NotifyLandingResolvedFunction = unique_function< void(ExecutorAddr) const >
 
using ResolveLandingFunction = unique_function< void(ExecutorAddr TrampolineAddr, NotifyLandingResolvedFunction OnLandingResolved) const >
 

Public Member Functions

virtual ~TrampolinePool ()
 
Expected< ExecutorAddrgetTrampoline ()
 Get an available trampoline address.
 
void releaseTrampoline (ExecutorAddr TrampolineAddr)
 Returns the given trampoline to the pool for re-use.
 

Protected Member Functions

virtual Error grow ()=0
 

Protected Attributes

std::mutex TPMutex
 
std::vector< ExecutorAddrAvailableTrampolines
 

Detailed Description

Base class for pools of compiler re-entry trampolines.

These trampolines are callable addresses that save all register state before calling a supplied function to return the trampoline landing address, then restore all state before jumping to that address. They are used by various ORC APIs to support lazy compilation

Definition at line 63 of file IndirectionUtils.h.

Member Typedef Documentation

◆ NotifyLandingResolvedFunction

Definition at line 65 of file IndirectionUtils.h.

◆ ResolveLandingFunction

Definition at line 68 of file IndirectionUtils.h.

Constructor & Destructor Documentation

◆ ~TrampolinePool()

llvm::orc::TrampolinePool::~TrampolinePool ( )
virtualdefault

Member Function Documentation

◆ getTrampoline()

Expected< ExecutorAddr > llvm::orc::TrampolinePool::getTrampoline ( )
inline

Get an available trampoline address.

Returns an error if no trampoline can be created.

Definition at line 76 of file IndirectionUtils.h.

References assert(), AvailableTrampolines, grow(), and TPMutex.

Referenced by llvm::orc::LazyCallThroughManager::getCallThroughTrampoline().

◆ grow()

virtual Error llvm::orc::TrampolinePool::grow ( )
protectedpure virtual

Referenced by getTrampoline().

◆ releaseTrampoline()

void llvm::orc::TrampolinePool::releaseTrampoline ( ExecutorAddr  TrampolineAddr)
inline

Returns the given trampoline to the pool for re-use.

Definition at line 89 of file IndirectionUtils.h.

References AvailableTrampolines, and TPMutex.

Member Data Documentation

◆ AvailableTrampolines

std::vector<ExecutorAddr> llvm::orc::TrampolinePool::AvailableTrampolines
protected

Definition at line 98 of file IndirectionUtils.h.

Referenced by getTrampoline(), and releaseTrampoline().

◆ TPMutex

std::mutex llvm::orc::TrampolinePool::TPMutex
protected

Definition at line 97 of file IndirectionUtils.h.

Referenced by getTrampoline(), and releaseTrampoline().


The documentation for this class was generated from the following files: