LLVM 22.0.0git
OrcABISupport.h
Go to the documentation of this file.
1//===- OrcABISupport.h - ABI support code -----------------------*- 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// ABI specific code for Orc, e.g. callback assembly.
10//
11// ABI classes should be part of the JIT *target* process, not the host
12// process (except where you're doing hosted JITing and the two are one and the
13// same).
14//
15//===----------------------------------------------------------------------===//
16
17#ifndef LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
18#define LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
19
22#include "llvm/Support/Error.h"
25#include <cstdint>
26
27namespace llvm {
28namespace orc {
29
33 unsigned NumStubs = 0;
34};
35
36template <typename ORCABI>
38getIndirectStubsBlockSizes(unsigned MinStubs, unsigned RoundToMultipleOf = 0) {
39 assert(
40 (RoundToMultipleOf == 0 || (RoundToMultipleOf % ORCABI::StubSize == 0)) &&
41 "RoundToMultipleOf is not a multiple of stub size");
42 uint64_t StubBytes = MinStubs * ORCABI::StubSize;
43 if (RoundToMultipleOf)
44 StubBytes = alignTo(StubBytes, RoundToMultipleOf);
45 unsigned NumStubs = StubBytes / ORCABI::StubSize;
46 uint64_t PointerBytes = NumStubs * ORCABI::PointerSize;
47 return {StubBytes, PointerBytes, NumStubs};
48}
49
50/// Generic ORC ABI support.
51///
52/// This class can be substituted as the target architecture support class for
53/// ORC templates that require one (e.g. IndirectStubsManagers). It does not
54/// support lazy JITing however, and any attempt to use that functionality
55/// will result in execution of an llvm_unreachable.
57public:
58 static constexpr unsigned PointerSize = sizeof(uintptr_t);
59 static constexpr unsigned TrampolineSize = 1;
60 static constexpr unsigned StubSize = 1;
61 static constexpr unsigned StubToPointerMaxDisplacement = 1;
62 static constexpr unsigned ResolverCodeSize = 1;
63
64 static void writeResolverCode(char *ResolveWorkingMem,
65 ExecutorAddr ResolverTargetAddr,
66 ExecutorAddr ReentryFnAddr,
67 ExecutorAddr ReentryCtxAddr) {
68 llvm_unreachable("writeResolverCode is not supported by the generic host "
69 "support class");
70 }
71
72 static void writeTrampolines(char *TrampolineBlockWorkingMem,
73 ExecutorAddr TrampolineBlockTargetAddr,
74 ExecutorAddr ResolverAddr,
75 unsigned NumTrampolines) {
76 llvm_unreachable("writeTrampolines is not supported by the generic host "
77 "support class");
78 }
79
80 static void writeIndirectStubsBlock(char *StubsBlockWorkingMem,
81 ExecutorAddr StubsBlockTargetAddress,
82 ExecutorAddr PointersBlockTargetAddress,
83 unsigned NumStubs) {
85 "writeIndirectStubsBlock is not supported by the generic host "
86 "support class");
87 }
88};
89
91public:
92 static constexpr unsigned PointerSize = 8;
93 static constexpr unsigned TrampolineSize = 12;
94 static constexpr unsigned StubSize = 8;
95 static constexpr unsigned StubToPointerMaxDisplacement = 1U << 27;
96 static constexpr unsigned ResolverCodeSize = 0x120;
97
98 /// Write the resolver code into the given memory. The user is
99 /// responsible for allocating the memory and setting permissions.
100 ///
101 /// ReentryFnAddr should be the address of a function whose signature matches
102 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
103 /// argument of writeResolverCode will be passed as the second argument to
104 /// the function at ReentryFnAddr.
105 LLVM_ABI static void writeResolverCode(char *ResolverWorkingMem,
106 ExecutorAddr ResolverTargetAddress,
107 ExecutorAddr ReentryFnAddr,
108 ExecutorAddr RentryCtxAddr);
109
110 /// Write the requested number of trampolines into the given memory,
111 /// which must be big enough to hold 1 pointer, plus NumTrampolines
112 /// trampolines.
113 LLVM_ABI static void
114 writeTrampolines(char *TrampolineBlockWorkingMem,
115 ExecutorAddr TrampolineBlockTargetAddress,
116 ExecutorAddr ResolverAddr, unsigned NumTrampolines);
117
118 /// Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
119 /// Stubs will be written as if linked at StubsBlockTargetAddress, with the
120 /// Nth stub using the Nth pointer in memory starting at
121 /// PointersBlockTargetAddress.
123 char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress,
124 ExecutorAddr PointersBlockTargetAddress, unsigned MinStubs);
125};
126
127/// X86_64 code that's common to all ABIs.
128///
129/// X86_64 supports lazy JITing.
131public:
132 static constexpr unsigned PointerSize = 8;
133 static constexpr unsigned TrampolineSize = 8;
134 static constexpr unsigned StubSize = 8;
135 static constexpr unsigned StubToPointerMaxDisplacement = 1 << 31;
136
137 /// Write the requested number of trampolines into the given memory,
138 /// which must be big enough to hold 1 pointer, plus NumTrampolines
139 /// trampolines.
140 LLVM_ABI static void
141 writeTrampolines(char *TrampolineBlockWorkingMem,
142 ExecutorAddr TrampolineBlockTargetAddress,
143 ExecutorAddr ResolverAddr, unsigned NumTrampolines);
144
145 /// Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
146 /// Stubs will be written as if linked at StubsBlockTargetAddress, with the
147 /// Nth stub using the Nth pointer in memory starting at
148 /// PointersBlockTargetAddress.
150 char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress,
151 ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs);
152};
153
154/// X86_64 support for SysV ABI (Linux, MacOSX).
155///
156/// X86_64_SysV supports lazy JITing.
158public:
159 static constexpr unsigned ResolverCodeSize = 0x6C;
160
161 /// Write the resolver code into the given memory. The user is
162 /// responsible for allocating the memory and setting permissions.
163 ///
164 /// ReentryFnAddr should be the address of a function whose signature matches
165 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
166 /// argument of writeResolverCode will be passed as the second argument to
167 /// the function at ReentryFnAddr.
168 LLVM_ABI static void writeResolverCode(char *ResolverWorkingMem,
169 ExecutorAddr ResolverTargetAddress,
170 ExecutorAddr ReentryFnAddr,
171 ExecutorAddr ReentryCtxAddr);
172};
173
174/// X86_64 support for Win32.
175///
176/// X86_64_Win32 supports lazy JITing.
178public:
179 static constexpr unsigned ResolverCodeSize = 0x74;
180
181 /// Write the resolver code into the given memory. The user is
182 /// responsible for allocating the memory and setting permissions.
183 ///
184 /// ReentryFnAddr should be the address of a function whose signature matches
185 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
186 /// argument of writeResolverCode will be passed as the second argument to
187 /// the function at ReentryFnAddr.
188 LLVM_ABI static void writeResolverCode(char *ResolverWorkingMem,
189 ExecutorAddr ResolverTargetAddress,
190 ExecutorAddr ReentryFnAddr,
191 ExecutorAddr ReentryCtxAddr);
192};
193
194/// I386 support.
195///
196/// I386 supports lazy JITing.
197class OrcI386 {
198public:
199 static constexpr unsigned PointerSize = 4;
200 static constexpr unsigned TrampolineSize = 8;
201 static constexpr unsigned StubSize = 8;
202 static constexpr unsigned StubToPointerMaxDisplacement = 1 << 31;
203 static constexpr unsigned ResolverCodeSize = 0x4a;
204
205 /// Write the resolver code into the given memory. The user is
206 /// responsible for allocating the memory and setting permissions.
207 ///
208 /// ReentryFnAddr should be the address of a function whose signature matches
209 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
210 /// argument of writeResolverCode will be passed as the second argument to
211 /// the function at ReentryFnAddr.
212 LLVM_ABI static void writeResolverCode(char *ResolverWorkingMem,
213 ExecutorAddr ResolverTargetAddress,
214 ExecutorAddr ReentryFnAddr,
215 ExecutorAddr ReentryCtxAddr);
216
217 /// Write the requested number of trampolines into the given memory,
218 /// which must be big enough to hold 1 pointer, plus NumTrampolines
219 /// trampolines.
220 LLVM_ABI static void
221 writeTrampolines(char *TrampolineBlockWorkingMem,
222 ExecutorAddr TrampolineBlockTargetAddress,
223 ExecutorAddr ResolverAddr, unsigned NumTrampolines);
224
225 /// Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
226 /// Stubs will be written as if linked at StubsBlockTargetAddress, with the
227 /// Nth stub using the Nth pointer in memory starting at
228 /// PointersBlockTargetAddress.
230 char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress,
231 ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs);
232};
233
234// @brief Mips32 support.
235//
236// Mips32 supports lazy JITing.
238public:
239 static constexpr unsigned PointerSize = 4;
240 static constexpr unsigned TrampolineSize = 20;
241 static constexpr unsigned StubSize = 8;
242 static constexpr unsigned StubToPointerMaxDisplacement = 1 << 31;
243 static constexpr unsigned ResolverCodeSize = 0xfc;
244
245 /// Write the requested number of trampolines into the given memory,
246 /// which must be big enough to hold 1 pointer, plus NumTrampolines
247 /// trampolines.
248 LLVM_ABI static void
249 writeTrampolines(char *TrampolineBlockWorkingMem,
250 ExecutorAddr TrampolineBlockTargetAddress,
251 ExecutorAddr ResolverAddr, unsigned NumTrampolines);
252
253 /// Write the resolver code into the given memory. The user is
254 /// responsible for allocating the memory and setting permissions.
255 ///
256 /// ReentryFnAddr should be the address of a function whose signature matches
257 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
258 /// argument of writeResolverCode will be passed as the second argument to
259 /// the function at ReentryFnAddr.
260 LLVM_ABI static void
261 writeResolverCode(char *ResolverBlockWorkingMem,
262 ExecutorAddr ResolverBlockTargetAddress,
263 ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr,
264 bool isBigEndian);
265 /// Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
266 /// Stubs will be written as if linked at StubsBlockTargetAddress, with the
267 /// Nth stub using the Nth pointer in memory starting at
268 /// PointersBlockTargetAddress.
270 char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress,
271 ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs);
272};
273
275public:
276 static void writeResolverCode(char *ResolverWorkingMem,
277 ExecutorAddr ResolverTargetAddress,
278 ExecutorAddr ReentryFnAddr,
279 ExecutorAddr ReentryCtxAddr) {
280 OrcMips32_Base::writeResolverCode(ResolverWorkingMem, ResolverTargetAddress,
281 ReentryFnAddr, ReentryCtxAddr, false);
282 }
283};
284
286public:
287 static void writeResolverCode(char *ResolverWorkingMem,
288 ExecutorAddr ResolverTargetAddress,
289 ExecutorAddr ReentryFnAddr,
290 ExecutorAddr ReentryCtxAddr) {
291 OrcMips32_Base::writeResolverCode(ResolverWorkingMem, ResolverTargetAddress,
292 ReentryFnAddr, ReentryCtxAddr, true);
293 }
294};
295
296// @brief Mips64 support.
297//
298// Mips64 supports lazy JITing.
300public:
301 static constexpr unsigned PointerSize = 8;
302 static constexpr unsigned TrampolineSize = 40;
303 static constexpr unsigned StubSize = 32;
304 static constexpr unsigned StubToPointerMaxDisplacement = 1 << 31;
305 static constexpr unsigned ResolverCodeSize = 0x120;
306
307 /// Write the resolver code into the given memory. The user is
308 /// responsible for allocating the memory and setting permissions.
309 ///
310 /// ReentryFnAddr should be the address of a function whose signature matches
311 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
312 /// argument of writeResolverCode will be passed as the second argument to
313 /// the function at ReentryFnAddr.
314 LLVM_ABI static void writeResolverCode(char *ResolverWorkingMem,
315 ExecutorAddr ResolverTargetAddress,
316 ExecutorAddr ReentryFnAddr,
317 ExecutorAddr ReentryCtxAddr);
318
319 /// Write the requested number of trampolines into the given memory,
320 /// which must be big enough to hold 1 pointer, plus NumTrampolines
321 /// trampolines.
322 LLVM_ABI static void
323 writeTrampolines(char *TrampolineBlockWorkingMem,
324 ExecutorAddr TrampolineBlockTargetAddress,
325 ExecutorAddr ResolverFnAddr, unsigned NumTrampolines);
326 /// Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
327 /// Stubs will be written as if linked at StubsBlockTargetAddress, with the
328 /// Nth stub using the Nth pointer in memory starting at
329 /// PointersBlockTargetAddress.
331 char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress,
332 ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs);
333};
334
335// @brief riscv64 support.
336//
337// RISC-V 64 supports lazy JITing.
339public:
340 static constexpr unsigned PointerSize = 8;
341 static constexpr unsigned TrampolineSize = 16;
342 static constexpr unsigned StubSize = 16;
343 static constexpr unsigned StubToPointerMaxDisplacement = 1 << 31;
344 static constexpr unsigned ResolverCodeSize = 0x148;
345
346 /// Write the resolver code into the given memory. The user is
347 /// responsible for allocating the memory and setting permissions.
348 ///
349 /// ReentryFnAddr should be the address of a function whose signature matches
350 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
351 /// argument of writeResolverCode will be passed as the second argument to
352 /// the function at ReentryFnAddr.
353 LLVM_ABI static void writeResolverCode(char *ResolverWorkingMem,
354 ExecutorAddr ResolverTargetAddress,
355 ExecutorAddr ReentryFnAddr,
356 ExecutorAddr ReentryCtxAddr);
357
358 /// Write the requested number of trampolines into the given memory,
359 /// which must be big enough to hold 1 pointer, plus NumTrampolines
360 /// trampolines.
361 LLVM_ABI static void
362 writeTrampolines(char *TrampolineBlockWorkingMem,
363 ExecutorAddr TrampolineBlockTargetAddress,
364 ExecutorAddr ResolverFnAddr, unsigned NumTrampolines);
365 /// Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
366 /// Stubs will be written as if linked at StubsBlockTargetAddress, with the
367 /// Nth stub using the Nth pointer in memory starting at
368 /// PointersBlockTargetAddress.
370 char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress,
371 ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs);
372};
373
374// @brief loongarch64 support.
375//
376// LoongArch 64 supports lazy JITing.
378public:
379 static constexpr unsigned PointerSize = 8;
380 static constexpr unsigned TrampolineSize = 16;
381 static constexpr unsigned StubSize = 16;
382 static constexpr unsigned StubToPointerMaxDisplacement = 1 << 31;
383 static constexpr unsigned ResolverCodeSize = 0xc8;
384
385 /// Write the resolver code into the given memory. The user is
386 /// responsible for allocating the memory and setting permissions.
387 ///
388 /// ReentryFnAddr should be the address of a function whose signature matches
389 /// void* (*)(void *TrampolineAddr, void *ReentryCtxAddr). The ReentryCtxAddr
390 /// argument of writeResolverCode will be passed as the second argument to
391 /// the function at ReentryFnAddr.
392 LLVM_ABI static void writeResolverCode(char *ResolverWorkingMem,
393 ExecutorAddr ResolverTargetAddress,
394 ExecutorAddr ReentryFnAddr,
395 ExecutorAddr ReentryCtxAddr);
396
397 /// Write the requested number of trampolines into the given memory,
398 /// which must be big enough to hold 1 pointer, plus NumTrampolines
399 /// trampolines.
400 LLVM_ABI static void
401 writeTrampolines(char *TrampolineBlockWorkingMem,
402 ExecutorAddr TrampolineBlockTargetAddress,
403 ExecutorAddr ResolverFnAddr, unsigned NumTrampolines);
404
405 /// Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
406 /// Stubs will be written as if linked at StubsBlockTargetAddress, with the
407 /// Nth stub using the Nth pointer in memory starting at
408 /// PointersBlockTargetAddress.
410 char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress,
411 ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs);
412};
413
414} // end namespace orc
415} // end namespace llvm
416
417#endif // LLVM_EXECUTIONENGINE_ORC_ORCABISUPPORT_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static std::optional< bool > isBigEndian(const SmallDenseMap< int64_t, int64_t, 8 > &MemOffset2Idx, int64_t LowestIdx)
Given a map from byte offsets in memory to indices in a load/store, determine if that map corresponds...
#define LLVM_ABI
Definition: Compiler.h:213
Represents an address in the executor process.
static constexpr unsigned PointerSize
Definition: OrcABISupport.h:92
static constexpr unsigned StubToPointerMaxDisplacement
Definition: OrcABISupport.h:95
static constexpr unsigned ResolverCodeSize
Definition: OrcABISupport.h:96
static LLVM_ABI void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr RentryCtxAddr)
Write the resolver code into the given memory.
static LLVM_ABI void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddress, ExecutorAddr ResolverAddr, unsigned NumTrampolines)
Write the requested number of trampolines into the given memory, which must be big enough to hold 1 p...
static constexpr unsigned TrampolineSize
Definition: OrcABISupport.h:93
static constexpr unsigned StubSize
Definition: OrcABISupport.h:94
static LLVM_ABI void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned MinStubs)
Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
Generic ORC ABI support.
Definition: OrcABISupport.h:56
static void writeResolverCode(char *ResolveWorkingMem, ExecutorAddr ResolverTargetAddr, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
Definition: OrcABISupport.h:64
static constexpr unsigned StubSize
Definition: OrcABISupport.h:60
static constexpr unsigned PointerSize
Definition: OrcABISupport.h:58
static constexpr unsigned StubToPointerMaxDisplacement
Definition: OrcABISupport.h:61
static constexpr unsigned ResolverCodeSize
Definition: OrcABISupport.h:62
static void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs)
Definition: OrcABISupport.h:80
static constexpr unsigned TrampolineSize
Definition: OrcABISupport.h:59
static void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddr, ExecutorAddr ResolverAddr, unsigned NumTrampolines)
Definition: OrcABISupport.h:72
I386 support.
static LLVM_ABI void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
Write the resolver code into the given memory.
static LLVM_ABI void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddress, ExecutorAddr ResolverAddr, unsigned NumTrampolines)
Write the requested number of trampolines into the given memory, which must be big enough to hold 1 p...
static LLVM_ABI void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs)
Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
static constexpr unsigned PointerSize
static constexpr unsigned ResolverCodeSize
static constexpr unsigned StubToPointerMaxDisplacement
static constexpr unsigned StubSize
static constexpr unsigned TrampolineSize
static constexpr unsigned ResolverCodeSize
static constexpr unsigned StubSize
static constexpr unsigned PointerSize
static constexpr unsigned TrampolineSize
static LLVM_ABI void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
Write the resolver code into the given memory.
static LLVM_ABI void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs)
Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
static LLVM_ABI void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddress, ExecutorAddr ResolverFnAddr, unsigned NumTrampolines)
Write the requested number of trampolines into the given memory, which must be big enough to hold 1 p...
static constexpr unsigned StubToPointerMaxDisplacement
static void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
static void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
static constexpr unsigned StubSize
static LLVM_ABI void writeResolverCode(char *ResolverBlockWorkingMem, ExecutorAddr ResolverBlockTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr, bool isBigEndian)
Write the resolver code into the given memory.
static LLVM_ABI void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs)
Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
static constexpr unsigned StubToPointerMaxDisplacement
static constexpr unsigned PointerSize
static constexpr unsigned TrampolineSize
static LLVM_ABI void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddress, ExecutorAddr ResolverAddr, unsigned NumTrampolines)
Write the requested number of trampolines into the given memory, which must be big enough to hold 1 p...
static constexpr unsigned ResolverCodeSize
static LLVM_ABI void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs)
Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
static constexpr unsigned StubToPointerMaxDisplacement
static constexpr unsigned PointerSize
static constexpr unsigned ResolverCodeSize
static LLVM_ABI void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddress, ExecutorAddr ResolverFnAddr, unsigned NumTrampolines)
Write the requested number of trampolines into the given memory, which must be big enough to hold 1 p...
static constexpr unsigned StubSize
static LLVM_ABI void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
Write the resolver code into the given memory.
static constexpr unsigned TrampolineSize
static constexpr unsigned StubToPointerMaxDisplacement
static constexpr unsigned StubSize
static constexpr unsigned TrampolineSize
static constexpr unsigned ResolverCodeSize
static LLVM_ABI void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs)
Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
static LLVM_ABI void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddress, ExecutorAddr ResolverFnAddr, unsigned NumTrampolines)
Write the requested number of trampolines into the given memory, which must be big enough to hold 1 p...
static constexpr unsigned PointerSize
static LLVM_ABI void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
Write the resolver code into the given memory.
X86_64 code that's common to all ABIs.
static constexpr unsigned PointerSize
static constexpr unsigned StubSize
static LLVM_ABI void writeIndirectStubsBlock(char *StubsBlockWorkingMem, ExecutorAddr StubsBlockTargetAddress, ExecutorAddr PointersBlockTargetAddress, unsigned NumStubs)
Write NumStubs indirect stubs to working memory at StubsBlockWorkingMem.
static LLVM_ABI void writeTrampolines(char *TrampolineBlockWorkingMem, ExecutorAddr TrampolineBlockTargetAddress, ExecutorAddr ResolverAddr, unsigned NumTrampolines)
Write the requested number of trampolines into the given memory, which must be big enough to hold 1 p...
static constexpr unsigned StubToPointerMaxDisplacement
static constexpr unsigned TrampolineSize
X86_64 support for SysV ABI (Linux, MacOSX).
static constexpr unsigned ResolverCodeSize
static LLVM_ABI void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
Write the resolver code into the given memory.
X86_64 support for Win32.
static constexpr unsigned ResolverCodeSize
static LLVM_ABI void writeResolverCode(char *ResolverWorkingMem, ExecutorAddr ResolverTargetAddress, ExecutorAddr ReentryFnAddr, ExecutorAddr ReentryCtxAddr)
Write the resolver code into the given memory.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
IndirectStubsAllocationSizes getIndirectStubsBlockSizes(unsigned MinStubs, unsigned RoundToMultipleOf=0)
Definition: OrcABISupport.h:38
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition: Alignment.h:155