From 5e45211a64149b3c659b90ff2de6fa982a5a93ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:17:33 +0200 Subject: Adding upstream version 15.5. Signed-off-by: Daniel Baumann --- doc/src/sgml/html/jit-extensibility.html | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 doc/src/sgml/html/jit-extensibility.html (limited to 'doc/src/sgml/html/jit-extensibility.html') diff --git a/doc/src/sgml/html/jit-extensibility.html b/doc/src/sgml/html/jit-extensibility.html new file mode 100644 index 0000000..3c2dd01 --- /dev/null +++ b/doc/src/sgml/html/jit-extensibility.html @@ -0,0 +1,51 @@ + +32.4. Extensibility

32.4. Extensibility

32.4.1. Inlining Support for Extensions

+ PostgreSQL's JIT + implementation can inline the bodies of functions + of types C and internal, as well as + operators based on such functions. To do so for functions in extensions, + the definitions of those functions need to be made available. + When using PGXS to build an extension + against a server that has been compiled with LLVM JIT support, the + relevant files will be built and installed automatically. +

+ The relevant files have to be installed into + $pkglibdir/bitcode/$extension/ and a summary of them + into $pkglibdir/bitcode/$extension.index.bc, where + $pkglibdir is the directory returned by + pg_config --pkglibdir and $extension + is the base name of the extension's shared library. + +

Note

+ For functions built into PostgreSQL itself, + the bitcode is installed into + $pkglibdir/bitcode/postgres. +

+

32.4.2. Pluggable JIT Providers

+ PostgreSQL provides a JIT + implementation based on LLVM. The interface to + the JIT provider is pluggable and the provider can be + changed without recompiling (although currently, the build process only + provides inlining support data for LLVM). + The active provider is chosen via the setting + jit_provider. +

32.4.2.1. JIT Provider Interface

+ A JIT provider is loaded by dynamically loading the + named shared library. The normal library search path is used to locate + the library. To provide the required JIT provider + callbacks and to indicate that the library is actually a + JIT provider, it needs to provide a C function named + _PG_jit_provider_init. This function is passed a + struct that needs to be filled with the callback function pointers for + individual actions: +

+struct JitProviderCallbacks
+{
+    JitProviderResetAfterErrorCB reset_after_error;
+    JitProviderReleaseContextCB release_context;
+    JitProviderCompileExprCB compile_expr;
+};
+
+extern void _PG_jit_provider_init(JitProviderCallbacks *cb);
+

+

\ No newline at end of file -- cgit v1.2.3