LLVM  14.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]
Collaboration diagram for llvm::orc::TrampolinePool:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

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

Protected Member Functions

virtual Error grow ()=0
 

Protected Attributes

std::mutex TPMutex
 
std::vector< JITTargetAddressAvailableTrampolines
 

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 56 of file IndirectionUtils.h.

Member Typedef Documentation

◆ NotifyLandingResolvedFunction

Definition at line 59 of file IndirectionUtils.h.

◆ ResolveLandingFunction

Definition at line 63 of file IndirectionUtils.h.

Constructor & Destructor Documentation

◆ ~TrampolinePool()

llvm::orc::TrampolinePool::~TrampolinePool ( )
virtual

Definition at line 57 of file IndirectionUtils.cpp.

Member Function Documentation

◆ getTrampoline()

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

Get an available trampoline address.

Returns an error if no trampoline can be created.

Definition at line 69 of file IndirectionUtils.h.

References AvailableTrampolines, llvm::Lock, and TPMutex.

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

◆ grow()

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

◆ releaseTrampoline()

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

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

Definition at line 82 of file IndirectionUtils.h.

References AvailableTrampolines, llvm::Lock, and TPMutex.

Member Data Documentation

◆ AvailableTrampolines

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

Definition at line 91 of file IndirectionUtils.h.

Referenced by getTrampoline(), and releaseTrampoline().

◆ TPMutex

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

Definition at line 90 of file IndirectionUtils.h.

Referenced by getTrampoline(), and releaseTrampoline().


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