LLVM 23.0.0git
EPCGenericJITLinkMemoryManager.h
Go to the documentation of this file.
1//===- EPCGenericJITLinkMemoryManager.h - EPC-based mem manager -*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Implements JITLinkMemoryManager by making remove calls via
10// ExecutorProcessControl::callWrapperAsync.
11//
12// This simplifies the implementaton of new ExecutorProcessControl instances,
13// as this implementation will always work (at the cost of some performance
14// overhead for the calls).
15//
16//===----------------------------------------------------------------------===//
17
18#ifndef LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
19#define LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
20
25
26namespace llvm {
27namespace orc {
28
31public:
32 /// Symbol addresses for memory management implementation.
40
41 /// Create an EPCGenericJITLinkMemoryManager instance from a given set of
42 /// function addrs.
45
46 /// Create an EPCGenericJITLinkMemoryManager using the given implementation
47 /// symbol names. These will be looked up in the given JITDylib.
51
52 /// Create an EPCGenericJITLinkMemoryManager using the given implementation
53 /// symbol names. These will be looked up in the given ExecutionSession's
54 /// Bootstrap JITDylib.
58
59 void allocate(const jitlink::JITLinkDylib *JD, jitlink::LinkGraph &G,
60 OnAllocatedFunction OnAllocated) override;
61
62 // Use overloads from base class.
63 using JITLinkMemoryManager::allocate;
64
65 void deallocate(std::vector<FinalizedAlloc> Allocs,
66 OnDeallocatedFunction OnDeallocated) override;
67
68 // Use overloads from base class.
69 using JITLinkMemoryManager::deallocate;
70
71private:
72 class InFlightAlloc;
73
74 void completeAllocation(ExecutorAddr AllocAddr, jitlink::BasicLayout BL,
75 OnAllocatedFunction OnAllocated);
76
78 SymbolAddrs SAs;
79};
80
81namespace shared {
82
83/// FIXME: This specialization should be moved into TargetProcessControlTypes.h
84/// (or wherever those types get merged to) once ORC depends on JITLink.
85template <>
87 jitlink::JITLinkMemoryManager::FinalizedAlloc> {
88public:
92
93 static bool
99
108};
109
110} // end namespace shared
111} // end namespace orc
112} // end namespace llvm
113
114#endif // LLVM_EXECUTIONENGINE_ORC_EPCGENERICJITLINKMEMORYMANAGER_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_ABI
Definition Compiler.h:213
#define G(x, y, z)
Definition MD5.cpp:55
Tagged union holding either a T or a Error.
Definition Error.h:485
EPCGenericJITLinkMemoryManager(ExecutorProcessControl &EPC, SymbolAddrs SAs)
Create an EPCGenericJITLinkMemoryManager instance from a given set of function addrs.
An ExecutionSession represents a running JIT program.
Definition Core.h:1355
Represents an address in the executor process.
ExecutorProcessControl supports interaction with a JIT target process.
Represents a JIT'd dynamic library.
Definition Core.h:919
A utility class for serializing to a blob from a variadic list.
Input char buffer with underflow check.
Output char buffer with overflow check.
Specialize to describe how to serialize/deserialize to/from the given concrete type.
const SimpleExecutorMemoryManagerSymbolNames orc_rt_SimpleNativeMemoryMapSPSSymbols
Default symbol names for the ORC runtime's SimpleNativeMemoryMap SPS interface.
This is an optimization pass for GlobalISel generic memory operations.
Symbol addresses for memory management implementation.
Symbol names for memory management implementation.
Definition OrcRTBridge.h:70