# HG changeset patch # User Wolfgang Rosenauer # Date 1329600090 -3600 # Node ID 5425f43ef15cb31be3924b43fc177c4c795adcf7 # Parent 5f37cb1700131eae45fe2f96a66ed6c4980de24d 11.0b3 diff -r 5f37cb170013 -r 5425f43ef15c MozillaFirefox/MozillaFirefox.spec --- a/MozillaFirefox/MozillaFirefox.spec Thu Feb 16 13:56:00 2012 +0100 +++ b/MozillaFirefox/MozillaFirefox.spec Sat Feb 18 22:21:30 2012 +0100 @@ -88,6 +88,7 @@ Patch12: mozilla-linux3.patch Patch14: mozilla-disable-neon-option.patch Patch15: mozilla-yarr-pcre.patch +Patch16: mozilla-nss-compat.patch # Firefox/browser Patch31: firefox-browser-css.patch Patch32: firefox-cross-desktop.patch @@ -216,6 +217,7 @@ %patch12 -p1 %patch14 -p1 #%patch15 -p1 +%patch16 -p1 # %patch31 -p1 %patch32 -p1 diff -r 5f37cb170013 -r 5425f43ef15c MozillaFirefox/mozilla-nss-compat.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MozillaFirefox/mozilla-nss-compat.patch Sat Feb 18 22:21:30 2012 +0100 @@ -0,0 +1,1 @@ +../mozilla-nss-compat.patch \ No newline at end of file diff -r 5f37cb170013 -r 5425f43ef15c mozilla-nss-compat.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-nss-compat.patch Sat Feb 18 22:21:30 2012 +0100 @@ -0,0 +1,50 @@ +# HG changeset patch +# Parent f241f48841a5d480f898cb7c34f3438aaa9a6c40 +# User Brian Smith +Bug 713934, Part 2, version 1: Update SetCertVerificationResult to use SSL_AuthCertificateComplete, r?honzab + +diff --git a/security/manager/ssl/src/nsNSSIOLayer.cpp b/security/manager/ssl/src/nsNSSIOLayer.cpp +--- a/security/manager/ssl/src/nsNSSIOLayer.cpp ++++ b/security/manager/ssl/src/nsNSSIOLayer.cpp +@@ -964,31 +964,31 @@ nsNSSSocketInfo::SetCertVerificationWait + + void + nsNSSSocketInfo::SetCertVerificationResult(PRErrorCode errorCode, + SSLErrorMessageType errorMessageType) + { + NS_ASSERTION(mCertVerificationState == waiting_for_cert_verification, + "Invalid state transition to cert_verification_finished"); + +- if (errorCode != 0) { +- SetCanceled(errorCode, errorMessageType); +- } else if (mFd) { +- // We haven't closed the connection already, so restart it +- SECStatus rv = SSL_RestartHandshakeAfterAuthCertificate(mFd); +- if (rv != SECSuccess) { ++ if (mFd) { ++ SECStatus rv = SSL_AuthCertificateComplete(mFd, errorCode); ++ // Only replace errorCode if there was originally no error ++ if (rv != SECSuccess && errorCode == 0) { + errorCode = PR_GetError(); ++ errorMessageType = PlainErrorMessage; + if (errorCode == 0) { +- NS_ERROR("SSL_RestartHandshakeAfterAuthCertificate didn't set error code"); ++ NS_ERROR("SSL_AuthCertificateComplete didn't set error code"); + errorCode = PR_INVALID_STATE_ERROR; + } +- SetCanceled(errorCode, PlainErrorMessage); + } +- } else { +- // If we closed the connection alreay, we don't have anything to do ++ } ++ ++ if (errorCode) { ++ SetCanceled(errorCode, errorMessageType); + } + + mCertVerificationState = after_cert_verification; + } + + nsresult nsNSSSocketInfo::GetSSLStatus(nsISSLStatus** _result) + { + NS_ENSURE_ARG_POINTER(_result); diff -r 5f37cb170013 -r 5425f43ef15c mozilla-yarr-pcre.patch --- a/mozilla-yarr-pcre.patch Thu Feb 16 13:56:00 2012 +0100 +++ b/mozilla-yarr-pcre.patch Sat Feb 18 22:21:30 2012 +0100 @@ -1,15 +1,8 @@ -From: Mike Hommey -Date: Sat, 24 Dec 2011 09:56:58 +0100 -Subject: Bug 691898 - Use YARR interpreter instead of PCRE on platforms where - YARR JIT is not supported - ---- - js/src/Makefile.in | 21 +++++++++++++-------- - js/src/vm/RegExpObject-inl.h | 28 ++++++---------------------- - js/src/vm/RegExpObject.cpp | 36 ------------------------------------ - js/src/vm/RegExpObject.h | 27 ++++++--------------------- - js/src/yarr/wtfbridge.h | 2 -- - 5 files changed, 25 insertions(+), 89 deletions(-) +# HG changeset patch +# Parent a45e9e6825a2d7e7f4f64df34ccf9fa74fcac6cb +# User Landry Breuil +Use YARR interpreter instead of PCRE on platforms where YARR JIT is not +supported diff --git a/js/src/Makefile.in b/js/src/Makefile.in --- a/js/src/Makefile.in @@ -25,8 +18,8 @@ -VPATH += $(srcdir)/yarr/pcre \ +VPATH += $(srcdir)/assembler \ -+ $(srcdir)/assembler/wtf \ -+ $(srcdir)/yarr \ ++ $(srcdir)/assembler/wtf \ ++ $(srcdir)/yarr \ $(NULL) CPPSRCS += \ @@ -35,14 +28,14 @@ - pcre_tables.cpp \ - pcre_xclass.cpp \ - pcre_ucp_searchfuncs.cpp \ -+ Assertions.cpp \ -+ OSAllocatorOS2.cpp \ -+ OSAllocatorPosix.cpp \ -+ OSAllocatorWin.cpp \ -+ PageBlock.cpp \ -+ YarrInterpreter.cpp \ -+ YarrPattern.cpp \ -+ YarrSyntaxChecker.cpp \ ++ Assertions.cpp \ ++ OSAllocatorOS2.cpp \ ++ OSAllocatorPosix.cpp \ ++ OSAllocatorWin.cpp \ ++ PageBlock.cpp \ ++ YarrInterpreter.cpp \ ++ YarrPattern.cpp \ ++ YarrSyntaxChecker.cpp \ $(NULL) else @@ -74,308 +67,6 @@ # Build a standalone test program that exercises the assembler # sources a bit. TESTMAIN_OBJS = \ -diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h ---- a/js/src/vm/RegExpObject-inl.h -+++ b/js/src/vm/RegExpObject-inl.h -@@ -362,49 +362,50 @@ detail::RegExpPrivate::create(JSContext - return RetType(NULL); - - if (!cacheInsert(cx, sourceAtom, RegExpPrivateCache_ExecCapable, priv)) - return RetType(NULL); - - 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) - { - #if defined(ANDROID) && defined(JS_METHODJIT) - return cx->methodJitEnabled; - #else - 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), - &yarrError); - if (yarrError) { - reportYarrError(cx, ts, yarrError); - return false; - } - *parenCount = yarrPattern.m_numSubpatterns; - - /* - * The YARR JIT compiler attempts to compile the parsed pattern. If - * it cannot, it informs us via |codeBlock.isFallBack()|, in which - * 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) { - js_ReportOutOfMemory(cx); - return false; - } - - JSGlobalData globalData(execAlloc); -@@ -415,31 +416,21 @@ detail::RegExpPrivateCode::compile(JSCon - #endif - - WTF::BumpPointerAllocator *bumpAlloc = cx->threadData()->getOrCreateBumpPointerAllocator(cx); - if (!bumpAlloc) { - js_ReportOutOfMemory(cx); - 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 - detail::RegExpPrivate::compile(JSContext *cx, TokenStream *ts) - { - if (!sticky()) - return code.compile(cx, *source, ts, &parenCount, getFlags()); - -@@ -471,29 +462,22 @@ detail::RegExpPrivateCode::execute(JSCon - int result; - #if ENABLE_YARR_JIT - (void) cx; /* Unused. */ - if (codeBlock.isFallBack()) - result = JSC::Yarr::interpret(byteCode, chars, start, length, output); - 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; - } - - inline void - detail::RegExpPrivate::incref(JSContext *cx) - { - ++refCount; -diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp ---- a/js/src/vm/RegExpObject.cpp -+++ b/js/src/vm/RegExpObject.cpp -@@ -387,17 +387,16 @@ Class js::RegExpClass = { - NULL, /* checkAccess */ - NULL, /* call */ - NULL, /* construct */ - js_XDRRegExpObject, - NULL, /* hasInstance */ - regexp_trace - }; - --#if ENABLE_YARR_JIT - void - RegExpPrivateCode::reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode error) - { - switch (error) { - case JSC::Yarr::NoError: - JS_NOT_REACHED("Called reportYarrError with value for no error"); - return; - #define COMPILE_EMSG(__code, __msg) \ -@@ -419,52 +418,16 @@ RegExpPrivateCode::reportYarrError(JSCon - COMPILE_EMSG(QuantifierTooLarge, JSMSG_BAD_QUANTIFIER); - COMPILE_EMSG(EscapeUnterminated, JSMSG_TRAILING_SLASH); - #undef COMPILE_EMSG - default: - JS_NOT_REACHED("Unknown Yarr error code"); - } - } - --#else /* !ENABLE_YARR_JIT */ -- --void --RegExpPrivateCode::reportPCREError(JSContext *cx, int error) --{ --#define REPORT(msg_) \ -- JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL, msg_); \ -- return -- switch (error) { -- case -2: REPORT(JSMSG_REGEXP_TOO_COMPLEX); -- case 0: JS_NOT_REACHED("Precondition violation: an error must have occurred."); -- case 1: REPORT(JSMSG_TRAILING_SLASH); -- case 2: REPORT(JSMSG_TRAILING_SLASH); -- case 3: REPORT(JSMSG_REGEXP_TOO_COMPLEX); -- case 4: REPORT(JSMSG_BAD_QUANTIFIER); -- case 5: REPORT(JSMSG_BAD_QUANTIFIER); -- case 6: REPORT(JSMSG_BAD_CLASS_RANGE); -- case 7: REPORT(JSMSG_REGEXP_TOO_COMPLEX); -- case 8: REPORT(JSMSG_BAD_CLASS_RANGE); -- case 9: REPORT(JSMSG_BAD_QUANTIFIER); -- case 10: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN); -- case 11: REPORT(JSMSG_REGEXP_TOO_COMPLEX); -- case 12: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN); -- case 13: REPORT(JSMSG_REGEXP_TOO_COMPLEX); -- case 14: REPORT(JSMSG_MISSING_PAREN); -- case 15: REPORT(JSMSG_BAD_BACKREF); -- case 16: REPORT(JSMSG_REGEXP_TOO_COMPLEX); -- case 17: REPORT(JSMSG_REGEXP_TOO_COMPLEX); -- default: -- JS_NOT_REACHED("Precondition violation: unknown PCRE error code."); -- } --#undef REPORT --} -- --#endif /* ENABLE_YARR_JIT */ -- - bool - js::ParseRegExpFlags(JSContext *cx, JSString *flagStr, RegExpFlag *flagsOut) - { - size_t n = flagStr->length(); - const jschar *s = flagStr->getChars(cx); - if (!s) - return false; - -diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h ---- a/js/src/vm/RegExpObject.h -+++ b/js/src/vm/RegExpObject.h -@@ -45,18 +45,16 @@ - #include "jsobj.h" - - #include "js/TemplateLib.h" - - #include "yarr/Yarr.h" - #if ENABLE_YARR_JIT - #include "yarr/YarrJIT.h" - #include "yarr/YarrSyntaxChecker.h" --#else --#include "yarr/pcre/pcre.h" - #endif - - namespace js { - - enum RegExpRunStatus - { - RegExpRunStatus_Error, - RegExpRunStatus_Success, -@@ -235,50 +233,43 @@ class RegExpObjectBuilder - - namespace detail { - - 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; -+#endif - BytecodePattern *byteCode; --#else -- JSRegExp *compiled; --#endif - - public: - RegExpPrivateCode() - : - #if ENABLE_YARR_JIT - codeBlock(), -+#endif - byteCode(NULL) --#else -- compiled(NULL) --#endif - { } - - ~RegExpPrivateCode() { - #if ENABLE_YARR_JIT - codeBlock.release(); -+#endif - if (byteCode) - Foreground::delete_(byteCode); --#else -- if (compiled) -- jsRegExpFree(compiled); --#endif - } - - static bool checkSyntax(JSContext *cx, TokenStream *tokenStream, JSLinearString *source) { - #if ENABLE_YARR_JIT - ErrorCode error = JSC::Yarr::checkSyntax(*source); - if (error == JSC::Yarr::NoError) - return true; - -@@ -286,27 +277,21 @@ class RegExpPrivateCode - return false; - #else - # error "Syntax checking not implemented for !ENABLE_YARR_JIT" - #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 -+ 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, - RegExpFlag flags); - - - inline RegExpRunStatus execute(JSContext *cx, const jschar *chars, size_t length, size_t start, - int *output, size_t outputCount); diff --git a/js/src/yarr/wtfbridge.h b/js/src/yarr/wtfbridge.h --- a/js/src/yarr/wtfbridge.h +++ b/js/src/yarr/wtfbridge.h diff -r 5f37cb170013 -r 5425f43ef15c series --- a/series Thu Feb 16 13:56:00 2012 +0100 +++ b/series Sat Feb 18 22:21:30 2012 +0100 @@ -17,6 +17,7 @@ mozilla-sle11.patch mozilla-linux3.patch mozilla-disable-neon-option.patch +mozilla-nss-compat.patch #mozilla-yarr-pcre.patch # Firefox patches