/[pcre]/code/trunk/pcretest.c
ViewVC logotype

Diff of /code/trunk/pcretest.c

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

revision 922 by ph10, Mon Feb 20 18:44:42 2012 UTC revision 923 by ph10, Tue Feb 21 13:25:05 2012 UTC
# Line 674  static int use_pcre16 = 0; Line 674  static int use_pcre16 = 0;
674  static int use_pcre16 = 1;  static int use_pcre16 = 1;
675  #endif  #endif
676    
677    /* JIT study options for -s+n and /S+n where '1' <= n <= '7'. */
678    
679    static int jit_study_bits[] =
680      {
681      PCRE_STUDY_JIT_COMPILE,
682      PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE,
683      PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE,
684      PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE,
685      PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE,
686      PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE + PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE,
687      PCRE_STUDY_JIT_COMPILE + PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE +
688        PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
689    };
690    
691  /* Textual explanations for runtime error codes */  /* Textual explanations for runtime error codes */
692    
693  static const char *errtexts[] = {  static const char *errtexts[] = {
# Line 2133  printf("  -S <n>   set stack size to <n> Line 2147  printf("  -S <n>   set stack size to <n>
2147  printf("  -s       force each pattern to be studied at basic level\n"  printf("  -s       force each pattern to be studied at basic level\n"
2148         "  -s+      force each pattern to be studied, using JIT if available\n"         "  -s+      force each pattern to be studied, using JIT if available\n"
2149         "  -s++     ditto, verifying when JIT was actually used\n"         "  -s++     ditto, verifying when JIT was actually used\n"
2150           "  -s+n     force each pattern to be studied, using JIT if available,\n"
2151           "             where 1 <= n <= 7 selects JIT options\n"
2152           "  -s++n    ditto, verifying when JIT was actually used\n"
2153         "  -t       time compilation and execution\n");         "  -t       time compilation and execution\n");
2154  printf("  -t <n>   time compilation and execution, repeating <n> times\n");  printf("  -t <n>   time compilation and execution, repeating <n> times\n");
2155  printf("  -tm      time execution (matching) only\n");  printf("  -tm      time execution (matching) only\n");
# Line 2244  while (argc > 1 && argv[op][0] == '-') Line 2261  while (argc > 1 && argv[op][0] == '-')
2261      {      {
2262      arg += 3;      arg += 3;
2263      if (*arg == '+') { arg++; verify_jit = TRUE; }      if (*arg == '+') { arg++; verify_jit = TRUE; }
   
     if (*arg != 0) goto BAD_ARG;  
   
2264      force_study = 1;      force_study = 1;
2265      force_study_options = PCRE_STUDY_JIT_COMPILE      if (*arg == 0)
2266                          | PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE        force_study_options = jit_study_bits[6];
2267                          | PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE;      else if (*arg >= '1' && *arg <= '7')
2268          force_study_options = jit_study_bits[*arg - '1'];
2269        else goto BAD_ARG;
2270      }      }
2271    else if (strcmp(arg, "-16") == 0)    else if (strcmp(arg, "-16") == 0)
2272      {      {
# Line 2785  while (!done) Line 2801  while (!done)
2801              verify_jit = TRUE;              verify_jit = TRUE;
2802              pp++;              pp++;
2803              }              }
2804            study_options |= PCRE_STUDY_JIT_COMPILE            if (*pp >= '1' && *pp <= '7')
2805                          | PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE              study_options |= jit_study_bits[*pp++ - '1'];
2806                          | PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE;            else
2807                study_options |= jit_study_bits[6];
2808            }            }
2809          }          }
2810        else        else
# Line 4208  while (!done) Line 4225  while (!done)
4225            PCHARSV(bptr, use_offsets[0], use_offsets[1] - use_offsets[0],            PCHARSV(bptr, use_offsets[0], use_offsets[1] - use_offsets[0],
4226              outfile);              outfile);
4227            }            }
4228            if (verify_jit && jit_was_used) fprintf(outfile, " (JIT)");
4229          fprintf(outfile, "\n");          fprintf(outfile, "\n");
4230          break;  /* Out of the /g loop */          break;  /* Out of the /g loop */
4231          }          }

Legend:
Removed from v.922  
changed lines
  Added in v.923

  ViewVC Help
Powered by ViewVC 1.1.5