diff options
Diffstat (limited to 'JavaScriptCore/pcre')
| -rw-r--r-- | JavaScriptCore/pcre/pcre_compile.cpp | 8 | ||||
| -rw-r--r-- | JavaScriptCore/pcre/pcre_exec.cpp | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/JavaScriptCore/pcre/pcre_compile.cpp b/JavaScriptCore/pcre/pcre_compile.cpp index 2bedca6..9d472d8 100644 --- a/JavaScriptCore/pcre/pcre_compile.cpp +++ b/JavaScriptCore/pcre/pcre_compile.cpp @@ -48,6 +48,8 @@ supporting internal functions that are not used by other modules. */ #include <string.h> #include <wtf/ASCIICType.h> #include <wtf/FastMalloc.h> +#include <wtf/FixedArray.h> +#include <wtf/StdLibExtras.h> using namespace WTF; @@ -2035,8 +2037,8 @@ static int calculateCompiledPatternLength(const UChar* pattern, int patternLengt int branch_extra = 0; int lastitemlength = 0; unsigned brastackptr = 0; - int brastack[BRASTACK_SIZE]; - unsigned char bralenstack[BRASTACK_SIZE]; + FixedArray<int, BRASTACK_SIZE> brastack; + FixedArray<unsigned char, BRASTACK_SIZE> bralenstack; int bracount = 0; const UChar* ptr = (const UChar*)(pattern - 1); @@ -2589,7 +2591,7 @@ JSRegExp* jsRegExpCompile(const UChar* pattern, int patternLength, size_t stringOffset = (size + sizeof(UChar) - 1) / sizeof(UChar) * sizeof(UChar); size = stringOffset + patternLength * sizeof(UChar); #endif - JSRegExp* re = reinterpret_cast<JSRegExp*>(new char[size]); + JSRegExp* re = reinterpret_cast_ptr<JSRegExp*>(new char[size]); if (!re) return returnError(ERR13, errorPtr); diff --git a/JavaScriptCore/pcre/pcre_exec.cpp b/JavaScriptCore/pcre/pcre_exec.cpp index 8ca2eb4..f4899f2 100644 --- a/JavaScriptCore/pcre/pcre_exec.cpp +++ b/JavaScriptCore/pcre/pcre_exec.cpp @@ -88,7 +88,7 @@ public: void add(const JSRegExp*, double); private: - typedef HashMap<RefPtr<UString::Rep>, double> Map; + typedef HashMap<RefPtr<StringImpl>, double> Map; Map times; }; @@ -198,7 +198,7 @@ static void pchars(const UChar* p, int length, bool isSubject, const MatchData& length = md.endSubject - p; while (length-- > 0) { int c; - if (isprint(c = *(p++))) + if (isASCIIPrintable(c = *(p++))) printf("%c", c); else if (c < 256) printf("\\x%02x", c); @@ -427,7 +427,7 @@ static inline void startNewGroup(MatchFrame* currentFrame) } // FIXME: "minimize" means "not greedy", we should invert the callers to ask for "greedy" to be less confusing -static inline void repeatInformationFromInstructionOffset(short instructionOffset, bool& minimize, int& minimumRepeats, int& maximumRepeats) +static inline void repeatInformationFromInstructionOffset(int instructionOffset, bool& minimize, int& minimumRepeats, int& maximumRepeats) { // Instruction offsets are based off of OP_CRSTAR, OP_STAR, OP_TYPESTAR, OP_NOTSTAR static const char minimumRepeatsFromInstructionOffset[] = { 0, 0, 1, 1, 0, 0 }; @@ -2143,7 +2143,7 @@ Histogram::~Histogram() size_t size = values.size(); printf("Regular Expressions, sorted by time spent evaluating them:\n"); for (size_t i = 0; i < size; ++i) - printf(" %f - %s\n", values[size - i - 1].second, values[size - i - 1].first.UTF8String().c_str()); + printf(" %f - %s\n", values[size - i - 1].second, values[size - i - 1].first.utf8().c_str()); } void Histogram::add(const JSRegExp* re, double elapsedTime) @@ -2157,7 +2157,7 @@ void Histogram::add(const JSRegExp* re, double elapsedTime) if (re->options & MatchAcrossMultipleLinesOption) string += " (multi-line)"; } - pair<Map::iterator, bool> result = times.add(string.rep(), elapsedTime); + pair<Map::iterator, bool> result = times.add(string.impl(), elapsedTime); if (!result.second) result.first->second += elapsedTime; } |
