LLVM 22.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
24
25namespace llvm {
26namespace orc {
27
30public:
31 /// Function addresses for memory access.
39
40 /// Create an EPCGenericJITLinkMemoryManager instance from a given set of
41 /// function addrs.
44
45 void allocate(const jitlink::JITLinkDylib *JD, jitlink::LinkGraph &G,
46 OnAllocatedFunction OnAllocated) override;
47
48 // Use overloads from base class.
49 using JITLinkMemoryManager::allocate;
50
51 void deallocate(std::vector<FinalizedAlloc> Allocs,
52 OnDeallocatedFunction OnDeallocated) override;
53
54 // Use overloads from base class.
55 using JITLinkMemoryManager::deallocate;
56
57private:
58 class InFlightAlloc;
59
60 void completeAllocation(ExecutorAddr AllocAddr, jitlink::BasicLayout BL,
61 OnAllocatedFunction OnAllocated);
62
64 SymbolAddrs SAs;
65};
66
67namespace shared {
68
69/// FIXME: This specialization should be moved into TargetProcessControlTypes.h
70/// (or wherever those types get merged to) once ORC depends on JITLink.
71template <>
95
96} // end namespace shared
97} // end namespace orc
98} // end namespace llvm
99
100#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:56
EPCGenericJITLinkMemoryManager(ExecutorProcessControl &EPC, SymbolAddrs SAs)
Create an EPCGenericJITLinkMemoryManager instance from a given set of function addrs.
Represents an address in the executor process.
ExecutorProcessControl supports interaction with a JIT target process.
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.
This is an optimization pass for GlobalISel generic memory operations.