|
version 1.1, 2012/02/21 23:05:52
|
version 1.1.1.2, 2012/02/21 23:50:25
|
|
Line 14 man page, in case the conversion went wrong.
|
Line 14 man page, in case the conversion went wrong.
|
| <br> |
<br> |
| <ul> |
<ul> |
| <li><a name="TOC1" href="#SEC1">PCRE JUST-IN-TIME COMPILER SUPPORT</a> |
<li><a name="TOC1" href="#SEC1">PCRE JUST-IN-TIME COMPILER SUPPORT</a> |
| <li><a name="TOC2" href="#SEC2">AVAILABILITY OF JIT SUPPORT</a> | <li><a name="TOC2" href="#SEC2">8-BIT and 16-BIT SUPPORT</a> |
| <li><a name="TOC3" href="#SEC3">SIMPLE USE OF JIT</a> | <li><a name="TOC3" href="#SEC3">AVAILABILITY OF JIT SUPPORT</a> |
| <li><a name="TOC4" href="#SEC4">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a> | <li><a name="TOC4" href="#SEC4">SIMPLE USE OF JIT</a> |
| <li><a name="TOC5" href="#SEC5">RETURN VALUES FROM JIT EXECUTION</a> | <li><a name="TOC5" href="#SEC5">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a> |
| <li><a name="TOC6" href="#SEC6">SAVING AND RESTORING COMPILED PATTERNS</a> | <li><a name="TOC6" href="#SEC6">RETURN VALUES FROM JIT EXECUTION</a> |
| <li><a name="TOC7" href="#SEC7">CONTROLLING THE JIT STACK</a> | <li><a name="TOC7" href="#SEC7">SAVING AND RESTORING COMPILED PATTERNS</a> |
| <li><a name="TOC8" href="#SEC8">JIT STACK FAQ</a> | <li><a name="TOC8" href="#SEC8">CONTROLLING THE JIT STACK</a> |
| <li><a name="TOC9" href="#SEC9">EXAMPLE CODE</a> | <li><a name="TOC9" href="#SEC9">JIT STACK FAQ</a> |
| <li><a name="TOC10" href="#SEC10">SEE ALSO</a> | <li><a name="TOC10" href="#SEC10">EXAMPLE CODE</a> |
| <li><a name="TOC11" href="#SEC11">AUTHOR</a> | <li><a name="TOC11" href="#SEC11">SEE ALSO</a> |
| <li><a name="TOC12" href="#SEC12">REVISION</a> | <li><a name="TOC12" href="#SEC12">AUTHOR</a> |
| | <li><a name="TOC13" href="#SEC13">REVISION</a> |
| </ul> |
</ul> |
| <br><a name="SEC1" href="#TOC1">PCRE JUST-IN-TIME COMPILER SUPPORT</a><br> |
<br><a name="SEC1" href="#TOC1">PCRE JUST-IN-TIME COMPILER SUPPORT</a><br> |
| <P> |
<P> |
| Just-in-time compiling is a heavyweight optimization that can greatly speed up |
Just-in-time compiling is a heavyweight optimization that can greatly speed up |
| pattern matching. However, it comes at the cost of extra processing before the |
pattern matching. However, it comes at the cost of extra processing before the |
| match is performed. Therefore, it is of most benefit when the same pattern is |
match is performed. Therefore, it is of most benefit when the same pattern is |
| going to be matched many times. This does not necessarily mean many calls of | going to be matched many times. This does not necessarily mean many calls of a |
| \fPpcre_exec()\fP; if the pattern is not anchored, matching attempts may take | matching function; if the pattern is not anchored, matching attempts may take |
| place many times at various positions in the subject, even for a single call to | place many times at various positions in the subject, even for a single call. |
| <b>pcre_exec()</b>. If the subject string is very long, it may still pay to use | Therefore, if the subject string is very long, it may still pay to use JIT for |
| JIT for one-off matches. | one-off matches. |
| </P> |
</P> |
| <P> |
<P> |
| JIT support applies only to the traditional matching function, | JIT support applies only to the traditional Perl-compatible matching function. |
| <b>pcre_exec()</b>. It does not apply when <b>pcre_dfa_exec()</b> is being used. | It does not apply when the DFA matching function is being used. The code for |
| The code for this support was written by Zoltan Herczeg. | this support was written by Zoltan Herczeg. |
| </P> |
</P> |
| <br><a name="SEC2" href="#TOC1">AVAILABILITY OF JIT SUPPORT</a><br> | <br><a name="SEC2" href="#TOC1">8-BIT and 16-BIT SUPPORT</a><br> |
| <P> |
<P> |
| |
JIT support is available for both the 8-bit and 16-bit PCRE libraries. To keep |
| |
this documentation simple, only the 8-bit interface is described in what |
| |
follows. If you are using the 16-bit library, substitute the 16-bit functions |
| |
and 16-bit structures (for example, <i>pcre16_jit_stack</i> instead of |
| |
<i>pcre_jit_stack</i>). |
| |
</P> |
| |
<br><a name="SEC3" href="#TOC1">AVAILABILITY OF JIT SUPPORT</a><br> |
| |
<P> |
| JIT support is an optional feature of PCRE. The "configure" option --enable-jit |
JIT support is an optional feature of PCRE. The "configure" option --enable-jit |
| (or equivalent CMake option) must be set when PCRE is built if you want to use |
(or equivalent CMake option) must be set when PCRE is built if you want to use |
| JIT. The support is limited to the following hardware platforms: |
JIT. The support is limited to the following hardware platforms: |
|
Line 51 JIT. The support is limited to the following hardware
|
Line 60 JIT. The support is limited to the following hardware
|
| ARM v5, v7, and Thumb2 |
ARM v5, v7, and Thumb2 |
| Intel x86 32-bit and 64-bit |
Intel x86 32-bit and 64-bit |
| MIPS 32-bit |
MIPS 32-bit |
| Power PC 32-bit and 64-bit (experimental) | Power PC 32-bit and 64-bit |
| </pre> |
</pre> |
| The Power PC support is designated as experimental because it has not been |
The Power PC support is designated as experimental because it has not been |
| fully tested. If --enable-jit is set on an unsupported platform, compilation |
fully tested. If --enable-jit is set on an unsupported platform, compilation |
|
Line 70 than 8.20, but you want to use JIT when it is availabl
|
Line 79 than 8.20, but you want to use JIT when it is availabl
|
| the values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such |
the values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such |
| as PCRE_CONFIG_JIT, for compile-time control of your code. |
as PCRE_CONFIG_JIT, for compile-time control of your code. |
| </P> |
</P> |
| <br><a name="SEC3" href="#TOC1">SIMPLE USE OF JIT</a><br> | <br><a name="SEC4" href="#TOC1">SIMPLE USE OF JIT</a><br> |
| <P> |
<P> |
| You have to do two things to make use of the JIT support in the simplest way: |
You have to do two things to make use of the JIT support in the simplest way: |
| <pre> |
<pre> |
|
Line 128 JIT compiler was not able to handle the pattern.
|
Line 137 JIT compiler was not able to handle the pattern.
|
| Once a pattern has been studied, with or without JIT, it can be used as many |
Once a pattern has been studied, with or without JIT, it can be used as many |
| times as you like for matching different subject strings. |
times as you like for matching different subject strings. |
| </P> |
</P> |
| <br><a name="SEC4" href="#TOC1">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a><br> | <br><a name="SEC5" href="#TOC1">UNSUPPORTED OPTIONS AND PATTERN ITEMS</a><br> |
| <P> |
<P> |
| The only <b>pcre_exec()</b> options that are supported for JIT execution are |
The only <b>pcre_exec()</b> options that are supported for JIT execution are |
| PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and |
PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and |
|
Line 148 The unsupported pattern items are:
|
Line 157 The unsupported pattern items are:
|
| </pre> |
</pre> |
| Support for some of these may be added in future. |
Support for some of these may be added in future. |
| </P> |
</P> |
| <br><a name="SEC5" href="#TOC1">RETURN VALUES FROM JIT EXECUTION</a><br> | <br><a name="SEC6" href="#TOC1">RETURN VALUES FROM JIT EXECUTION</a><br> |
| <P> |
<P> |
| When a pattern is matched using JIT execution, the return values are the same |
When a pattern is matched using JIT execution, the return values are the same |
| as those given by the interpretive <b>pcre_exec()</b> code, with the addition of |
as those given by the interpretive <b>pcre_exec()</b> code, with the addition of |
|
Line 166 when JIT is not used, but the details of exactly what
|
Line 175 when JIT is not used, but the details of exactly what
|
| same. The PCRE_ERROR_RECURSIONLIMIT error code is never returned by JIT |
same. The PCRE_ERROR_RECURSIONLIMIT error code is never returned by JIT |
| execution. |
execution. |
| </P> |
</P> |
| <br><a name="SEC6" href="#TOC1">SAVING AND RESTORING COMPILED PATTERNS</a><br> | <br><a name="SEC7" href="#TOC1">SAVING AND RESTORING COMPILED PATTERNS</a><br> |
| <P> |
<P> |
| The code that is generated by the JIT compiler is architecture-specific, and is |
The code that is generated by the JIT compiler is architecture-specific, and is |
| also position dependent. For those reasons it cannot be saved (in a file or |
also position dependent. For those reasons it cannot be saved (in a file or |
|
Line 179 restored pattern, and thereby recreate the JIT data, b
|
Line 188 restored pattern, and thereby recreate the JIT data, b
|
| compilation uses significant resources, it is probably not worth doing this; |
compilation uses significant resources, it is probably not worth doing this; |
| you might as well recompile the original pattern. |
you might as well recompile the original pattern. |
| <a name="stackcontrol"></a></P> |
<a name="stackcontrol"></a></P> |
| <br><a name="SEC7" href="#TOC1">CONTROLLING THE JIT STACK</a><br> | <br><a name="SEC8" href="#TOC1">CONTROLLING THE JIT STACK</a><br> |
| <P> |
<P> |
| When the compiled JIT code runs, it needs a block of memory to use as a stack. |
When the compiled JIT code runs, it needs a block of memory to use as a stack. |
| By default, it uses 32K on the machine stack. However, some large or |
By default, it uses 32K on the machine stack. However, some large or |
|
Line 256 and <b>pcre_assign_jit_stack()</b> does nothing unless
|
Line 265 and <b>pcre_assign_jit_stack()</b> does nothing unless
|
| is non-NULL and points to a <b>pcre_extra</b> block that is the result of a |
is non-NULL and points to a <b>pcre_extra</b> block that is the result of a |
| successful study with PCRE_STUDY_JIT_COMPILE. |
successful study with PCRE_STUDY_JIT_COMPILE. |
| <a name="stackfaq"></a></P> |
<a name="stackfaq"></a></P> |
| <br><a name="SEC8" href="#TOC1">JIT STACK FAQ</a><br> | <br><a name="SEC9" href="#TOC1">JIT STACK FAQ</a><br> |
| <P> |
<P> |
| (1) Why do we need JIT stacks? |
(1) Why do we need JIT stacks? |
| <br> |
<br> |
|
Line 334 stack handling?
|
Line 343 stack handling?
|
| No, thanks to Windows. If POSIX threads were used everywhere, we could throw |
No, thanks to Windows. If POSIX threads were used everywhere, we could throw |
| out this complicated API. |
out this complicated API. |
| </P> |
</P> |
| <br><a name="SEC9" href="#TOC1">EXAMPLE CODE</a><br> | <br><a name="SEC10" href="#TOC1">EXAMPLE CODE</a><br> |
| <P> |
<P> |
| This is a single-threaded example that specifies a JIT stack without using a |
This is a single-threaded example that specifies a JIT stack without using a |
| callback. |
callback. |
|
Line 359 callback.
|
Line 368 callback.
|
| |
|
| </PRE> |
</PRE> |
| </P> |
</P> |
| <br><a name="SEC10" href="#TOC1">SEE ALSO</a><br> | <br><a name="SEC11" href="#TOC1">SEE ALSO</a><br> |
| <P> |
<P> |
| <b>pcreapi</b>(3) |
<b>pcreapi</b>(3) |
| </P> |
</P> |
| <br><a name="SEC11" href="#TOC1">AUTHOR</a><br> | <br><a name="SEC12" href="#TOC1">AUTHOR</a><br> |
| <P> |
<P> |
| Philip Hazel (FAQ by Zoltan Herczeg) |
Philip Hazel (FAQ by Zoltan Herczeg) |
| <br> |
<br> |
|
Line 372 University Computing Service
|
Line 381 University Computing Service
|
| Cambridge CB2 3QH, England. |
Cambridge CB2 3QH, England. |
| <br> |
<br> |
| </P> |
</P> |
| <br><a name="SEC12" href="#TOC1">REVISION</a><br> | <br><a name="SEC13" href="#TOC1">REVISION</a><br> |
| <P> |
<P> |
| Last updated: 26 November 2011 | Last updated: 08 January 2012 |
| <br> |
<br> |
| Copyright © 1997-2011 University of Cambridge. | Copyright © 1997-2012 University of Cambridge. |
| <br> |
<br> |
| <p> |
<p> |
| Return to the <a href="index.html">PCRE index page</a>. |
Return to the <a href="index.html">PCRE index page</a>. |