Changeset 43837 in webkit for trunk/JavaScriptCore/yarr/RegexJIT.cpp
- Timestamp:
- May 18, 2009, 12:46:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/yarr/RegexJIT.cpp
r43038 r43837 1332 1332 generate(); 1333 1333 1334 jitObject.m_executablePool = globalData->executableAllocator.poolForSize(size()); 1335 void* code = copyCode(jitObject.m_executablePool.get()); 1336 1337 PatchBuffer patchBuffer(code); 1334 PatchBuffer patchBuffer(this, globalData->executableAllocator.poolForSize(size())); 1335 1338 1336 for (unsigned i = 0; i < m_backtrackRecords.size(); ++i) 1339 patchBuffer.patch(m_backtrackRecords[i].dataLabel, patchBuffer. trampolineAt(m_backtrackRecords[i].backtrackLocation));1340 1341 jitObject. m_jitCode = code;1337 patchBuffer.patch(m_backtrackRecords[i].dataLabel, patchBuffer.locationOf(m_backtrackRecords[i].backtrackLocation)); 1338 1339 jitObject.set(patchBuffer.finalizeCode()); 1342 1340 } 1343 1341 … … 1368 1366 JSRegExpIgnoreCaseOption ignoreCaseOption = ignoreCase ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase; 1369 1367 JSRegExpMultilineOption multilineOption = multiline ? JSRegExpMultiline : JSRegExpSingleLine; 1370 jitObject. m_pcreFallback = jsRegExpCompile(reinterpret_cast<const UChar*>(patternString.data()), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error);1368 jitObject.setFallback(jsRegExpCompile(reinterpret_cast<const UChar*>(patternString.data()), patternString.size(), ignoreCaseOption, multilineOption, &numSubpatterns, &error)); 1371 1369 } 1372 1370 } … … 1374 1372 int executeRegex(RegexCodeBlock& jitObject, const UChar* input, unsigned start, unsigned length, int* output, int outputArraySize) 1375 1373 { 1376 if ( jitObject.m_pcreFallback) {1377 int result = jsRegExpExecute(jitObject.m_pcreFallback, input, length, start, output, outputArraySize);1378 return (result < 0) ? -1 : output[0]; 1379 } else {1380 #if PLATFORM(X86) && !COMPILER(MSVC) 1381 typedef int (*RegexJITCode)(const UChar* input, unsigned start, unsigned length, int* output) __attribute__ ((regparm (3))); 1382 #else 1383 typedef int (*RegexJITCode)(const UChar* input, unsigned start, unsigned length, int* output); 1374 if (JSRegExp* fallback = jitObject.getFallback()) 1375 return (jsRegExpExecute(fallback, input, length, start, output, outputArraySize) < 0) ? -1 : output[0]; 1376 1377 return jitObject.execute(input, start, length, output); 1378 } 1379 1380 }} 1381 1384 1382 #endif 1385 return reinterpret_cast<RegexJITCode>(jitObject.m_jitCode)(input, start, length, output); 1386 } 1387 } 1388 1389 }} 1390 1391 #endif 1392 1393 1394 1395 1396 1383 1384 1385 1386 1387
Note:
See TracChangeset
for help on using the changeset viewer.