/[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 1017 by ph10, Sun Aug 26 16:30:50 2012 UTC revision 1022 by ph10, Tue Aug 28 12:28:15 2012 UTC
# Line 704  static int jit_study_bits[] = Line 704  static int jit_study_bits[] =
704      PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE      PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE
705  };  };
706    
707    #define PCRE_STUDY_ALLJIT (PCRE_STUDY_JIT_COMPILE | \
708      PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE | PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE)
709    
710  /* Textual explanations for runtime error codes */  /* Textual explanations for runtime error codes */
711    
712  static const char *errtexts[] = {  static const char *errtexts[] = {
# Line 2796  while (!done) Line 2799  while (!done)
2799    /* Look for options after final delimiter */    /* Look for options after final delimiter */
2800    
2801    options = 0;    options = 0;
2802    study_options = 0;    study_options = force_study_options;
2803    log_store = showstore;  /* default from command line */    log_store = showstore;  /* default from command line */
2804    
2805    while (*pp != 0)    while (*pp != 0)
# Line 2833  while (!done) Line 2836  while (!done)
2836  #endif  #endif
2837    
2838        case 'S':        case 'S':
2839        if (do_study == 0)        do_study = 1;
2840          for (;;)
2841          {          {
2842          do_study = 1;          switch (*pp++)
         if (*pp == '+')  
2843            {            {
2844            if (*(++pp) == '+')            case 'S':
2845              do_study = 0;
2846              no_force_study = 1;
2847              break;
2848    
2849              case '!':
2850              study_options |= PCRE_STUDY_EXTRA_NEEDED;
2851              break;
2852    
2853              case '+':
2854              if (*pp == '+')
2855              {              {
2856              verify_jit = TRUE;              verify_jit = TRUE;
2857              pp++;              pp++;
# Line 2847  while (!done) Line 2860  while (!done)
2860              study_options |= jit_study_bits[*pp++ - '1'];              study_options |= jit_study_bits[*pp++ - '1'];
2861            else            else
2862              study_options |= jit_study_bits[6];              study_options |= jit_study_bits[6];
2863              break;
2864    
2865              case '-':
2866              study_options &= ~PCRE_STUDY_ALLJIT;
2867              break;
2868    
2869              default:
2870              pp--;
2871              goto ENDLOOP;
2872            }            }
2873          }          }
2874        else        ENDLOOP:
         {  
         do_study = 0;  
         no_force_study = 1;  
         }  
2875        break;        break;
2876    
2877        case 'U': options |= PCRE_UNGREEDY; break;        case 'U': options |= PCRE_UNGREEDY; break;
# Line 3083  while (!done) Line 3101  while (!done)
3101          clock_t start_time = clock();          clock_t start_time = clock();
3102          for (i = 0; i < timeit; i++)          for (i = 0; i < timeit; i++)
3103            {            {
3104            PCRE_STUDY(extra, re, study_options | force_study_options, &error);            PCRE_STUDY(extra, re, study_options, &error);
3105            }            }
3106          time_taken = clock() - start_time;          time_taken = clock() - start_time;
3107          if (extra != NULL)          if (extra != NULL)
# Line 3094  while (!done) Line 3112  while (!done)
3112            (((double)time_taken * 1000.0) / (double)timeit) /            (((double)time_taken * 1000.0) / (double)timeit) /
3113              (double)CLOCKS_PER_SEC);              (double)CLOCKS_PER_SEC);
3114          }          }
3115        PCRE_STUDY(extra, re, study_options | force_study_options, &error);        PCRE_STUDY(extra, re, study_options, &error);
3116        if (error != NULL)        if (error != NULL)
3117          fprintf(outfile, "Failed to study: %s\n", error);          fprintf(outfile, "Failed to study: %s\n", error);
3118        else if (extra != NULL)        else if (extra != NULL)
# Line 3354  while (!done) Line 3372  while (!done)
3372    
3373          /* Show this only if the JIT was set by /S, not by -s. */          /* Show this only if the JIT was set by /S, not by -s. */
3374    
3375          if ((study_options & PCRE_STUDY_JIT_COMPILE) != 0)          if ((study_options & PCRE_STUDY_ALLJIT) != 0 &&
3376                (force_study_options & PCRE_STUDY_ALLJIT) == 0)
3377            {            {
3378            int jit;            int jit;
3379            if (new_info(re, extra, PCRE_INFO_JIT, &jit) == 0)            if (new_info(re, extra, PCRE_INFO_JIT, &jit) == 0)

Legend:
Removed from v.1017  
changed lines
  Added in v.1022

  ViewVC Help
Powered by ViewVC 1.1.5