3d95990410
- Fixes MFSA 2012-12->19 - see http://www.mozilla.org/en-US/firefox/11.0/releasenotes/ - complete patchset for #691898, still fixes build on ppc (and hopefully commited in firefox 14...) - add patchset from #706955, workarounds #669050 (xpcshell hangs during make install and chokes on CSPUtils.csm, threads related..) - remove obsolete/commited patches
81 lines
2.7 KiB
Plaintext
81 lines
2.7 KiB
Plaintext
$OpenBSD: patch-js_src_vm_RegExpObject-inl_h,v 1.2 2012/03/16 21:31:24 landry Exp $
|
|
https://bug691898.bugzilla.mozilla.org/attachment.cgi?id=588391
|
|
use yarr interpreter on ppc
|
|
--- js/src/vm/RegExpObject-inl.h.orig Thu Feb 2 00:39:11 2012
|
|
+++ js/src/vm/RegExpObject-inl.h Tue Feb 14 18:49:53 2012
|
|
@@ -367,6 +367,7 @@ detail::RegExpPrivate::create(JSContext *cx, JSLinearS
|
|
return RetType(priv);
|
|
}
|
|
|
|
+#if ENABLE_YARR_JIT
|
|
/* This function should be deleted once bad Android platforms phase out. See bug 604774. */
|
|
inline bool
|
|
detail::RegExpPrivateCode::isJITRuntimeEnabled(JSContext *cx)
|
|
@@ -377,12 +378,12 @@ detail::RegExpPrivateCode::isJITRuntimeEnabled(JSConte
|
|
return true;
|
|
#endif
|
|
}
|
|
+#endif
|
|
|
|
inline bool
|
|
detail::RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts,
|
|
uintN *parenCount, RegExpFlag flags)
|
|
{
|
|
-#if ENABLE_YARR_JIT
|
|
/* Parse the pattern. */
|
|
ErrorCode yarrError;
|
|
YarrPattern yarrPattern(pattern, bool(flags & IgnoreCaseFlag), bool(flags & MultilineFlag),
|
|
@@ -399,7 +400,7 @@ detail::RegExpPrivateCode::compile(JSContext *cx, JSLi
|
|
* case we have to bytecode compile it.
|
|
*/
|
|
|
|
-#ifdef JS_METHODJIT
|
|
+#if ENABLE_YARR_JIT && defined(JS_METHODJIT)
|
|
if (isJITRuntimeEnabled(cx) && !yarrPattern.m_containsBackreferences) {
|
|
JSC::ExecutableAllocator *execAlloc = cx->threadData()->getOrCreateExecutableAllocator(cx);
|
|
if (!execAlloc) {
|
|
@@ -420,21 +421,11 @@ detail::RegExpPrivateCode::compile(JSContext *cx, JSLi
|
|
return false;
|
|
}
|
|
|
|
+#if ENABLE_YARR_JIT
|
|
codeBlock.setFallBack(true);
|
|
+#endif
|
|
byteCode = byteCompile(yarrPattern, bumpAlloc).get();
|
|
return true;
|
|
-#else /* !defined(ENABLE_YARR_JIT) */
|
|
- int error = 0;
|
|
- compiled = jsRegExpCompile(pattern.chars(), pattern.length(),
|
|
- ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase,
|
|
- multiline() ? JSRegExpMultiline : JSRegExpSingleLine,
|
|
- parenCount, &error);
|
|
- if (error) {
|
|
- reportPCREError(cx, error);
|
|
- return false;
|
|
- }
|
|
- return true;
|
|
-#endif
|
|
}
|
|
|
|
inline bool
|
|
@@ -476,18 +467,11 @@ detail::RegExpPrivateCode::execute(JSContext *cx, cons
|
|
else
|
|
result = JSC::Yarr::execute(codeBlock, chars, start, length, output);
|
|
#else
|
|
- result = jsRegExpExecute(cx, compiled, chars, length, start, output, outputCount);
|
|
+ result = JSC::Yarr::interpret(byteCode, chars, start, length, output);
|
|
#endif
|
|
|
|
if (result == -1)
|
|
return RegExpRunStatus_Success_NotFound;
|
|
-
|
|
-#if !ENABLE_YARR_JIT
|
|
- if (result < 0) {
|
|
- reportPCREError(cx, result);
|
|
- return RegExpRunStatus_Error;
|
|
- }
|
|
-#endif
|
|
|
|
JS_ASSERT(result >= 0);
|
|
return RegExpRunStatus_Success;
|