--- embedaddon/pcre/doc/html/pcrejit.html 2012/02/21 23:05:52 1.1.1.1 +++ embedaddon/pcre/doc/html/pcrejit.html 2012/02/21 23:50:25 1.1.1.2 @@ -14,36 +14,45 @@ man page, in case the conversion went wrong.

PCRE JUST-IN-TIME COMPILER SUPPORT

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 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 -\fPpcre_exec()\fP; 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 -pcre_exec(). If the subject string is very long, it may still pay to use -JIT for one-off matches. +going to be matched many times. This does not necessarily mean many calls of a +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. +Therefore, if the subject string is very long, it may still pay to use JIT for +one-off matches.

-JIT support applies only to the traditional matching function, -pcre_exec(). It does not apply when pcre_dfa_exec() is being used. -The code for this support was written by Zoltan Herczeg. +JIT support applies only to the traditional Perl-compatible matching function. +It does not apply when the DFA matching function is being used. The code for +this support was written by Zoltan Herczeg.

-
AVAILABILITY OF JIT SUPPORT
+
8-BIT and 16-BIT SUPPORT

+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, pcre16_jit_stack instead of +pcre_jit_stack). +

+
AVAILABILITY OF JIT SUPPORT
+

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 JIT. The support is limited to the following hardware platforms: @@ -51,7 +60,7 @@ JIT. The support is limited to the following hardware ARM v5, v7, and Thumb2 Intel x86 32-bit and 64-bit MIPS 32-bit - Power PC 32-bit and 64-bit (experimental) + Power PC 32-bit and 64-bit 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 @@ -70,7 +79,7 @@ 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 as PCRE_CONFIG_JIT, for compile-time control of your code.

-
SIMPLE USE OF JIT
+
SIMPLE USE OF JIT

You have to do two things to make use of the JIT support in the simplest way:

@@ -128,7 +137,7 @@ 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
 times as you like for matching different subject strings.
 

-
UNSUPPORTED OPTIONS AND PATTERN ITEMS
+
UNSUPPORTED OPTIONS AND PATTERN ITEMS

The only pcre_exec() options that are supported for JIT execution are PCRE_NO_UTF8_CHECK, PCRE_NOTBOL, PCRE_NOTEOL, PCRE_NOTEMPTY, and @@ -148,7 +157,7 @@ The unsupported pattern items are:

Support for some of these may be added in future.

-
RETURN VALUES FROM JIT EXECUTION
+
RETURN VALUES FROM JIT EXECUTION

When a pattern is matched using JIT execution, the return values are the same as those given by the interpretive pcre_exec() code, with the addition of @@ -166,7 +175,7 @@ when JIT is not used, but the details of exactly what same. The PCRE_ERROR_RECURSIONLIMIT error code is never returned by JIT execution.

-
SAVING AND RESTORING COMPILED PATTERNS
+
SAVING AND RESTORING COMPILED PATTERNS

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 @@ -179,7 +188,7 @@ restored pattern, and thereby recreate the JIT data, b compilation uses significant resources, it is probably not worth doing this; you might as well recompile the original pattern.

-
CONTROLLING THE JIT STACK
+
CONTROLLING THE JIT 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 @@ -256,7 +265,7 @@ and pcre_assign_jit_stack() does nothing unless is non-NULL and points to a pcre_extra block that is the result of a successful study with PCRE_STUDY_JIT_COMPILE.

-
JIT STACK FAQ
+
JIT STACK FAQ

(1) Why do we need JIT stacks?
@@ -334,7 +343,7 @@ stack handling? No, thanks to Windows. If POSIX threads were used everywhere, we could throw out this complicated API.

-
EXAMPLE CODE
+
EXAMPLE CODE

This is a single-threaded example that specifies a JIT stack without using a callback. @@ -359,11 +368,11 @@ callback.

-
SEE ALSO
+
SEE ALSO

pcreapi(3)

-
AUTHOR
+
AUTHOR

Philip Hazel (FAQ by Zoltan Herczeg)
@@ -372,11 +381,11 @@ University Computing Service Cambridge CB2 3QH, England.

-
REVISION
+
REVISION

-Last updated: 26 November 2011 +Last updated: 08 January 2012
-Copyright © 1997-2011 University of Cambridge. +Copyright © 1997-2012 University of Cambridge.

Return to the PCRE index page.