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
87 lines
2.6 KiB
Plaintext
87 lines
2.6 KiB
Plaintext
$OpenBSD: patch-js_src_vm_RegExpObject_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.h.orig Thu Feb 2 00:39:11 2012
|
|
+++ js/src/vm/RegExpObject.h Tue Feb 14 18:53:18 2012
|
|
@@ -50,8 +50,6 @@
|
|
#if ENABLE_YARR_JIT
|
|
#include "yarr/YarrJIT.h"
|
|
#include "yarr/YarrSyntaxChecker.h"
|
|
-#else
|
|
-#include "yarr/pcre/pcre.h"
|
|
#endif
|
|
|
|
namespace js {
|
|
@@ -240,40 +238,33 @@ static const jschar GreedyStarChars[] = {'.', '*'};
|
|
/* Abstracts away the gross |RegExpPrivate| backend details. */
|
|
class RegExpPrivateCode
|
|
{
|
|
-#if ENABLE_YARR_JIT
|
|
typedef JSC::Yarr::BytecodePattern BytecodePattern;
|
|
typedef JSC::Yarr::ErrorCode ErrorCode;
|
|
+ typedef JSC::Yarr::YarrPattern YarrPattern;
|
|
+#if ENABLE_YARR_JIT
|
|
typedef JSC::Yarr::JSGlobalData JSGlobalData;
|
|
typedef JSC::Yarr::YarrCodeBlock YarrCodeBlock;
|
|
- typedef JSC::Yarr::YarrPattern YarrPattern;
|
|
|
|
/* Note: Native code is valid only if |codeBlock.isFallBack() == false|. */
|
|
YarrCodeBlock codeBlock;
|
|
- BytecodePattern *byteCode;
|
|
-#else
|
|
- JSRegExp *compiled;
|
|
#endif
|
|
+ BytecodePattern *byteCode;
|
|
|
|
public:
|
|
RegExpPrivateCode()
|
|
:
|
|
#if ENABLE_YARR_JIT
|
|
codeBlock(),
|
|
- byteCode(NULL)
|
|
-#else
|
|
- compiled(NULL)
|
|
#endif
|
|
+ byteCode(NULL)
|
|
{ }
|
|
|
|
~RegExpPrivateCode() {
|
|
#if ENABLE_YARR_JIT
|
|
codeBlock.release();
|
|
+#endif
|
|
if (byteCode)
|
|
Foreground::delete_<BytecodePattern>(byteCode);
|
|
-#else
|
|
- if (compiled)
|
|
- jsRegExpFree(compiled);
|
|
-#endif
|
|
}
|
|
|
|
static bool checkSyntax(JSContext *cx, TokenStream *tokenStream, JSLinearString *source) {
|
|
@@ -285,23 +276,17 @@ class RegExpPrivateCode
|
|
reportYarrError(cx, tokenStream, error);
|
|
return false;
|
|
#else
|
|
-# error "Syntax checking not implemented for !ENABLE_YARR_JIT"
|
|
+ return true; /* XXX !*/
|
|
#endif
|
|
}
|
|
|
|
#if ENABLE_YARR_JIT
|
|
static inline bool isJITRuntimeEnabled(JSContext *cx);
|
|
- static void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error);
|
|
-#else
|
|
- static void reportPCREError(JSContext *cx, int error);
|
|
#endif
|
|
+ static void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error);
|
|
|
|
static size_t getOutputSize(size_t pairCount) {
|
|
-#if ENABLE_YARR_JIT
|
|
return pairCount * 2;
|
|
-#else
|
|
- return pairCount * 3; /* Should be x2, but PCRE has... needs. */
|
|
-#endif
|
|
}
|
|
|
|
inline bool compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts, uintN *parenCount,
|