/[pcre]/code/trunk/doc/html/pcrejit.html
ViewVC logotype

Diff of /code/trunk/doc/html/pcrejit.html

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 974 by ph10, Sat Apr 14 16:16:58 2012 UTC revision 975 by ph10, Sat Jun 2 11:03:06 2012 UTC
# Line 104  this to free the study data: Line 104  this to free the study data:
104        pcre_free(study_ptr);        pcre_free(study_ptr);
105    #endif    #endif
106  </pre>  </pre>
107  PCRE_STUDY_JIT_COMPILE requests the JIT compiler to generate code for complete  PCRE_STUDY_JIT_COMPILE requests the JIT compiler to generate code for complete
108  matches. If you want to run partial matches using the PCRE_PARTIAL_HARD or  matches. If you want to run partial matches using the PCRE_PARTIAL_HARD or
109  PCRE_PARTIAL_SOFT options of <b>pcre_exec()</b>, you should set one or both of  PCRE_PARTIAL_SOFT options of <b>pcre_exec()</b>, you should set one or both of
110  the following options in addition to, or instead of, PCRE_STUDY_JIT_COMPILE  the following options in addition to, or instead of, PCRE_STUDY_JIT_COMPILE
# Line 129  If JIT support is not available, PCRE_ST Line 129  If JIT support is not available, PCRE_ST
129  no JIT data is created. Otherwise, the compiled pattern is passed to the JIT  no JIT data is created. Otherwise, the compiled pattern is passed to the JIT
130  compiler, which turns it into machine code that executes much faster than the  compiler, which turns it into machine code that executes much faster than the
131  normal interpretive code. When <b>pcre_exec()</b> is passed a <b>pcre_extra</b>  normal interpretive code. When <b>pcre_exec()</b> is passed a <b>pcre_extra</b>
132  block containing a pointer to JIT code of the appropriate mode (normal or  block containing a pointer to JIT code of the appropriate mode (normal or
133  hard/soft partial), it obeys that code instead of running the interpreter. The  hard/soft partial), it obeys that code instead of running the interpreter. The
134  result is identical, but the compiled JIT code runs much faster.  result is identical, but the compiled JIT code runs much faster.
135  </P>  </P>
# Line 169  The unsupported pattern items are: Line 169  The unsupported pattern items are:
169  <pre>  <pre>
170    \C             match a single byte; not supported in UTF-8 mode    \C             match a single byte; not supported in UTF-8 mode
171    (?Cn)          callouts    (?Cn)          callouts
172    (*COMMIT)      )    (*PRUNE)       )
173    (*MARK)        )    (*SKIP)        ) backtracking control verbs
   (*PRUNE)       ) the backtracking control verbs  
   (*SKIP)        )  
174    (*THEN)        )    (*THEN)        )
175  </pre>  </pre>
176  Support for some of these may be added in future.  Support for some of these may be added in future.
# Line 250  two options: Line 248  two options:
248    (2) If <i>callback</i> is NULL and <i>data</i> is not NULL, <i>data</i> must be    (2) If <i>callback</i> is NULL and <i>data</i> is not NULL, <i>data</i> must be
249        a valid JIT stack, the result of calling <b>pcre_jit_stack_alloc()</b>.        a valid JIT stack, the result of calling <b>pcre_jit_stack_alloc()</b>.
250    
251    (3) If <i>callback</i> is not NULL, it must point to a function that is    (3) If <i>callback</i> is not NULL, it must point to a function that is
252        called with <i>data</i> as an argument at the start of matching, in        called with <i>data</i> as an argument at the start of matching, in
253        order to set up a JIT stack. If the return from the callback        order to set up a JIT stack. If the return from the callback
254        function is NULL, the internal 32K stack is used; otherwise the        function is NULL, the internal 32K stack is used; otherwise the
255        return value must be a valid JIT stack, the result of calling        return value must be a valid JIT stack, the result of calling
256        <b>pcre_jit_stack_alloc()</b>.        <b>pcre_jit_stack_alloc()</b>.
257  </pre>  </pre>
258  A callback function is obeyed whenever JIT code is about to be run; it is not  A callback function is obeyed whenever JIT code is about to be run; it is not
259  obeyed when <b>pcre_exec()</b> is called with options that are incompatible for  obeyed when <b>pcre_exec()</b> is called with options that are incompatible for
260  JIT execution. A callback function can therefore be used to determine whether a  JIT execution. A callback function can therefore be used to determine whether a
261  match operation was executed by JIT or by the interpreter.  match operation was executed by JIT or by the interpreter.
262  </P>  </P>
# Line 266  match operation was executed by JIT or b Line 264  match operation was executed by JIT or b
264  You may safely use the same JIT stack for more than one pattern (either by  You may safely use the same JIT stack for more than one pattern (either by
265  assigning directly or by callback), as long as the patterns are all matched  assigning directly or by callback), as long as the patterns are all matched
266  sequentially in the same thread. In a multithread application, if you do not  sequentially in the same thread. In a multithread application, if you do not
267  specify a JIT stack, or if you assign or pass back NULL from a callback, that  specify a JIT stack, or if you assign or pass back NULL from a callback, that
268  is thread-safe, because each thread has its own machine stack. However, if you  is thread-safe, because each thread has its own machine stack. However, if you
269  assign or pass back a non-NULL JIT stack, this must be a different stack for  assign or pass back a non-NULL JIT stack, this must be a different stack for
270  each thread so that the application is thread-safe.  each thread so that the application is thread-safe.
271  </P>  </P>
272  <P>  <P>
# Line 415  Cambridge CB2 3QH, England. Line 413  Cambridge CB2 3QH, England.
413  </P>  </P>
414  <br><a name="SEC13" href="#TOC1">REVISION</a><br>  <br><a name="SEC13" href="#TOC1">REVISION</a><br>
415  <P>  <P>
416  Last updated: 14 April 2012  Last updated: 04 May 2012
417  <br>  <br>
418  Copyright &copy; 1997-2012 University of Cambridge.  Copyright &copy; 1997-2012 University of Cambridge.
419  <br>  <br>

Legend:
Removed from v.974  
changed lines
  Added in v.975

  ViewVC Help
Powered by ViewVC 1.1.5