Changeset 55322 in webkit for trunk/JavaScriptCore/runtime/RegExp.cpp
- Timestamp:
- Feb 26, 2010, 4:19:13 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/RegExp.cpp
r54801 r55322 41 41 #else 42 42 43 #if ENABLE(WREC)44 #include "JIT.h"45 #include "WRECGenerator.h"46 #endif47 43 #include <pcre/pcre.h> 48 44 … … 50 46 51 47 namespace JSC { 52 53 #if ENABLE(WREC)54 using namespace WREC;55 #endif56 48 57 49 inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern) … … 165 157 #else 166 158 167 void RegExp::compile(JSGlobalData* globalData)159 void RegExp::compile(JSGlobalData*) 168 160 { 169 161 m_regExp = 0; 170 #if ENABLE(WREC)171 m_wrecFunction = Generator::compileRegExp(globalData, m_pattern, &m_numSubpatterns, &m_constructionError, m_executablePool, ignoreCase(), multiline());172 if (m_wrecFunction || m_constructionError)173 return;174 // Fall through to non-WREC case.175 #else176 UNUSED_PARAM(globalData);177 #endif178 179 162 JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase; 180 163 JSRegExpMultilineOption multilineOption = multiline() ? JSRegExpMultiline : JSRegExpSingleLine; … … 192 175 return -1; 193 176 194 #if ENABLE(WREC)195 if (m_wrecFunction) {196 int offsetVectorSize = (m_numSubpatterns + 1) * 2;197 int* offsetVector;198 Vector<int, 32> nonReturnedOvector;199 if (ovector) {200 ovector->resize(offsetVectorSize);201 offsetVector = ovector->data();202 } else {203 nonReturnedOvector.resize(offsetVectorSize);204 offsetVector = nonReturnedOvector.data();205 }206 ASSERT(offsetVector);207 for (int j = 0; j < offsetVectorSize; ++j)208 offsetVector[j] = -1;209 210 int result = m_wrecFunction(s.data(), startOffset, s.size(), offsetVector);211 212 if (result < 0) {213 #ifndef NDEBUG214 // TODO: define up a symbol, rather than magic -1215 if (result != -1)216 fprintf(stderr, "jsRegExpExecute failed with result %d\n", result);217 #endif218 if (ovector)219 ovector->clear();220 }221 return result;222 } else223 #endif224 177 if (m_regExp) { 225 178 // Set up the offset vector for the result.
Note:
See TracChangeset
for help on using the changeset viewer.