diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
commit | 46651ce6fe013220ed397add242004d764fc0153 (patch) | |
tree | 6e5299f990f88e60174a1d3ae6e48eedd2688b2b /doc/src/sgml/html/jit-extensibility.html | |
parent | Initial commit. (diff) | |
download | postgresql-14-46651ce6fe013220ed397add242004d764fc0153.tar.xz postgresql-14-46651ce6fe013220ed397add242004d764fc0153.zip |
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'doc/src/sgml/html/jit-extensibility.html')
-rw-r--r-- | doc/src/sgml/html/jit-extensibility.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/doc/src/sgml/html/jit-extensibility.html b/doc/src/sgml/html/jit-extensibility.html new file mode 100644 index 0000000..f33c957 --- /dev/null +++ b/doc/src/sgml/html/jit-extensibility.html @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>32.4. Extensibility</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="jit-configuration.html" title="32.3. Configuration" /><link rel="next" href="regress.html" title="Chapter 33. Regression Tests" /></head><body id="docContent" class="container-fluid col-10"><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">32.4. Extensibility</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="jit-configuration.html" title="32.3. Configuration">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="jit.html" title="Chapter 32. Just-in-Time Compilation (JIT)">Up</a></td><th width="60%" align="center">Chapter 32. Just-in-Time Compilation (<acronym xmlns="http://www.w3.org/1999/xhtml" class="acronym">JIT</acronym>)</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 14.5 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="regress.html" title="Chapter 33. Regression Tests">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="JIT-EXTENSIBILITY"><div class="titlepage"><div><div><h2 class="title" style="clear: both">32.4. Extensibility</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="jit-extensibility.html#JIT-EXTENSIBILITY-BITCODE">32.4.1. Inlining Support for Extensions</a></span></dt><dt><span class="sect2"><a href="jit-extensibility.html#JIT-PLUGGABLE">32.4.2. Pluggable <acronym class="acronym">JIT</acronym> Providers</a></span></dt></dl></div><div class="sect2" id="JIT-EXTENSIBILITY-BITCODE"><div class="titlepage"><div><div><h3 class="title">32.4.1. Inlining Support for Extensions</h3></div></div></div><p> + <span class="productname">PostgreSQL</span>'s <acronym class="acronym">JIT</acronym> + implementation can inline the bodies of functions + of types <code class="literal">C</code> and <code class="literal">internal</code>, 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 <a class="link" href="extend-pgxs.html" title="38.18. Extension Building Infrastructure">PGXS</a> to build an extension + against a server that has been compiled with LLVM JIT support, the + relevant files will be built and installed automatically. + </p><p> + The relevant files have to be installed into + <code class="filename">$pkglibdir/bitcode/$extension/</code> and a summary of them + into <code class="filename">$pkglibdir/bitcode/$extension.index.bc</code>, where + <code class="literal">$pkglibdir</code> is the directory returned by + <code class="literal">pg_config --pkglibdir</code> and <code class="literal">$extension</code> + is the base name of the extension's shared library. + + </p><div class="note"><h3 class="title">Note</h3><p> + For functions built into <span class="productname">PostgreSQL</span> itself, + the bitcode is installed into + <code class="literal">$pkglibdir/bitcode/postgres</code>. + </p></div><p> + </p></div><div class="sect2" id="JIT-PLUGGABLE"><div class="titlepage"><div><div><h3 class="title">32.4.2. Pluggable <acronym class="acronym">JIT</acronym> Providers</h3></div></div></div><p> + <span class="productname">PostgreSQL</span> provides a <acronym class="acronym">JIT</acronym> + implementation based on <span class="productname">LLVM</span>. The interface to + the <acronym class="acronym">JIT</acronym> provider is pluggable and the provider can be + changed without recompiling (although currently, the build process only + provides inlining support data for <span class="productname">LLVM</span>). + The active provider is chosen via the setting + <a class="xref" href="runtime-config-client.html#GUC-JIT-PROVIDER">jit_provider</a>. + </p><div class="sect3" id="id-1.6.19.8.3.3"><div class="titlepage"><div><div><h4 class="title">32.4.2.1. <acronym class="acronym">JIT</acronym> Provider Interface</h4></div></div></div><p> + A <acronym class="acronym">JIT</acronym> 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 <acronym class="acronym">JIT</acronym> provider + callbacks and to indicate that the library is actually a + <acronym class="acronym">JIT</acronym> provider, it needs to provide a C function named + <code class="function">_PG_jit_provider_init</code>. This function is passed a + struct that needs to be filled with the callback function pointers for + individual actions: +</p><pre class="programlisting"> +struct JitProviderCallbacks +{ + JitProviderResetAfterErrorCB reset_after_error; + JitProviderReleaseContextCB release_context; + JitProviderCompileExprCB compile_expr; +}; + +extern void _PG_jit_provider_init(JitProviderCallbacks *cb); +</pre><p> + </p></div></div></div><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navfooter"><hr></hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="jit-configuration.html" title="32.3. Configuration">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="jit.html" title="Chapter 32. Just-in-Time Compilation (JIT)">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="regress.html" title="Chapter 33. Regression Tests">Next</a></td></tr><tr><td width="40%" align="left" valign="top">32.3. Configuration </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 14.5 Documentation">Home</a></td><td width="40%" align="right" valign="top"> Chapter 33. Regression Tests</td></tr></table></div></body></html>
\ No newline at end of file |