gooderp18绿色标准版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

51 lines
5.9KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!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>31.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 V1.79.1" /><link rel="prev" href="jit-configuration.html" title="31.3. Configuration" /><link rel="next" href="regress.html" title="Chapter 32. Regression Tests" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">31.4. Extensibility</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="jit-configuration.html" title="31.3. Configuration">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="jit.html" title="Chapter 31. Just-in-Time Compilation (JIT)">Up</a></td><th width="60%" align="center">Chapter 31. 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 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="regress.html" title="Chapter 32. 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">31.4. Extensibility</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="jit-extensibility.html#JIT-EXTENSIBILITY-BITCODE">31.4.1. Inlining Support for Extensions</a></span></dt><dt><span class="sect2"><a href="jit-extensibility.html#JIT-PLUGGABLE">31.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">31.4.1. Inlining Support for Extensions</h3></div></div></div><p>
  3. <span class="productname">PostgreSQL</span>'s <acronym class="acronym">JIT</acronym>
  4. implementation can inline the bodies of functions
  5. of types <code class="literal">C</code> and <code class="literal">internal</code>, as well as
  6. operators based on such functions. To do so for functions in extensions,
  7. the definitions of those functions need to be made available.
  8. When using <a class="link" href="extend-pgxs.html" title="37.18. Extension Building Infrastructure">PGXS</a> to build an extension
  9. against a server that has been compiled with LLVM JIT support, the
  10. relevant files will be built and installed automatically.
  11. </p><p>
  12. The relevant files have to be installed into
  13. <code class="filename">$pkglibdir/bitcode/$extension/</code> and a summary of them
  14. into <code class="filename">$pkglibdir/bitcode/$extension.index.bc</code>, where
  15. <code class="literal">$pkglibdir</code> is the directory returned by
  16. <code class="literal">pg_config --pkglibdir</code> and <code class="literal">$extension</code>
  17. is the base name of the extension's shared library.
  18. </p><div class="note"><h3 class="title">Note</h3><p>
  19. For functions built into <span class="productname">PostgreSQL</span> itself,
  20. the bitcode is installed into
  21. <code class="literal">$pkglibdir/bitcode/postgres</code>.
  22. </p></div><p>
  23. </p></div><div class="sect2" id="JIT-PLUGGABLE"><div class="titlepage"><div><div><h3 class="title">31.4.2. Pluggable <acronym class="acronym">JIT</acronym> Providers</h3></div></div></div><p>
  24. <span class="productname">PostgreSQL</span> provides a <acronym class="acronym">JIT</acronym>
  25. implementation based on <span class="productname">LLVM</span>. The interface to
  26. the <acronym class="acronym">JIT</acronym> provider is pluggable and the provider can be
  27. changed without recompiling (although currently, the build process only
  28. provides inlining support data for <span class="productname">LLVM</span>).
  29. The active provider is chosen via the setting
  30. <a class="xref" href="runtime-config-client.html#GUC-JIT-PROVIDER">jit_provider</a>.
  31. </p><div class="sect3" id="id-1.6.18.8.3.3"><div class="titlepage"><div><div><h4 class="title">31.4.2.1. <acronym class="acronym">JIT</acronym> Provider Interface</h4></div></div></div><p>
  32. A <acronym class="acronym">JIT</acronym> provider is loaded by dynamically loading the
  33. named shared library. The normal library search path is used to locate
  34. the library. To provide the required <acronym class="acronym">JIT</acronym> provider
  35. callbacks and to indicate that the library is actually a
  36. <acronym class="acronym">JIT</acronym> provider, it needs to provide a C function named
  37. <code class="function">_PG_jit_provider_init</code>. This function is passed a
  38. struct that needs to be filled with the callback function pointers for
  39. individual actions:
  40. </p><pre class="programlisting">
  41. struct JitProviderCallbacks
  42. {
  43. JitProviderResetAfterErrorCB reset_after_error;
  44. JitProviderReleaseContextCB release_context;
  45. JitProviderCompileExprCB compile_expr;
  46. };
  47. extern void _PG_jit_provider_init(JitProviderCallbacks *cb);
  48. </pre><p>
  49. </p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="jit-configuration.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="jit.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="regress.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">31.3. Configuration </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 32. Regression Tests</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1