Ignore:
Timestamp:
Jun 28, 2008, 3:21:20 PM (17 years ago)
Author:
Darin Adler
Message:

2008-06-28 Darin Adler <Darin Adler>

Reviewed by Oliver.

  • pcre/pcre_compile.cpp: (jsRegExpCompile): Compile in the string if REGEXP_HISTOGRAM is on.
  • pcre/pcre_exec.cpp: (jsRegExpExecute): Add hook to time execution. (Histogram::~Histogram): Print a sorted list of what took time. (Histogram::add): Accumulate records of what took time. (HistogramTimeLogger::~HistogramTimeLogger): Hook that calls Histogram::add at the right moment and creates the global histogram object.
  • pcre/pcre_internal.h: Define REGEXP_HISTOGRAM.
  • pcre/pcre_tables.cpp: Added missing include of "config.h". Not needed any more, but an omissions an earlier version of this patch detected.
  • pcre/pcre_ucp_searchfuncs.cpp: Ditto.
  • pcre/pcre_xclass.cpp: Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/pcre/pcre_compile.cpp

    r34560 r34858  
    25652565   
    25662566    size_t size = length + sizeof(JSRegExp);
     2567#if REGEXP_HISTOGRAM
     2568    size_t stringOffset = (size + sizeof(UChar) - 1) / sizeof(UChar) * sizeof(UChar);
     2569    size = stringOffset + patternLength * sizeof(UChar);
     2570#endif
    25672571    JSRegExp* re = reinterpret_cast<JSRegExp*>(new char[size]);
    25682572   
     
    26652669    }
    26662670   
     2671#if REGEXP_HISTOGRAM
     2672    re->stringOffset = stringOffset;
     2673    re->stringLength = patternLength;
     2674    memcpy(reinterpret_cast<char*>(re) + stringOffset, pattern, patternLength * 2);
     2675#endif
     2676
    26672677    if (numSubpatterns)
    26682678        *numSubpatterns = re->topBracket;
Note: See TracChangeset for help on using the changeset viewer.