~ubuntu-branches/ubuntu/lucid/firefox/lucid-security

« back to all changes in this revision

Viewing changes to debian/patches/fix-build-failure-without-yarr-jit2.patch

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-03-10 19:28:01 UTC
  • mfrom: (1.1.41)
  • Revision ID: package-import@ubuntu.com-20120310192801-dwmyqrirq3i9qp9m
Tags: 11.0+build1-0ubuntu0.10.04.2
* New upstream stable release (FIREFOX_11_0_BUILD1)
  - see LP: #951250 for USN information

* Rebuilt against updated gcc to fix LP: #931637
* Ensure that the crash reporter is disabled if rebuilt by Ubuntu
  derivatives, as there will be no crash symbols for those
  - update debian/rules
* Only add "Ubuntu" to the UA string when being built for Ubuntu
  - update debian/rules
* Temporarily disable ipdl tests due to build failures. These aren't
  enabled upstream, anyway
  - update debian/config/mozconfig.in
* Always set the update channel - not setting it at build-time on release
  builds breaks the extensions.checkCompatibility pref. The only things
  using it at runtime are nsBlocklistService, Test Pilot (beta + aurora)
  and the about dialog (where the channel is hidden anyway)
  - update debian/rules
  - update debian/firefox.install.in
* Fix LP: #898883 - IPC xpcshell tests hang the buildd's. Give all
  xpcshell tests an X display, as plugin-container won't work without one
  - update debian/build/testsuite.mk
* Turn on all IPC xpcshell tests again
  - update debian/build/testsute.mk
* Drop the default-apps xml file - there is already one provided by
  gnome-control-center, so ours duplicates this. We never used to install
  it for Firefox 3.6
  - remove debian/firefox.xml.in
  - update debian/firefox-gnome-support.install.in
  - update debian/rules
* Ship Test Pilot as a distribution addon, like upstream. This means
  that the addon manager can update it. It does also mean that it will
  remain installed in users profiles if they try the beta or aurora
  builds, but the Feedback button is disabled on release builds
  - update debian/firefox.install.in
  - fixes LP: #913357
* Drop patches fixed upstream
  - remove debian/patches/fix-cursor-handling.patch
  - update debian/patches/series
* Call xvfb-run with "-a" in case there are other servers running on the
  builder
  - update debian/build/testsuite.mk
* Really fix LP: #898883 - IPC xpcshell tests hang the build. What was
  actually happening is plugin-container would fail to start because all
  available X connections had been used up by many instances of dbus-launch,
  spawned each time an xpcshell tried to talk to the session bus. Because
  we run all of the xpcshell tests with one Xvfb instance, the buses
  accumulate until the available X connections all run out. To fix this, run
  all tests requiring a display inside dbus-launch, so we create just a
  single bus for all xpcshell tests
  - update debian/build/testsuite.mk
  - update debian/control{,.in}
* Add Ligurian to locale blacklist, as we don't support this in Ubuntu
  - update debian/config/locales.blacklist
* Fix LP: #918763 - Revert the temporary investigation patch for
  bmo: #621446, as it breaks GCC4.4
  - add debian/patches/revert-bmo621446-investigation.patch
  - update debian/patches/series
* Refresh patches
  - update debian/patches/ubuntu-ua-string-changes.patch
  - update debian/patches/mozilla-kde.patch
  - update debian/patches/firefox-kde.patch
* Fix LP: #915895 - Just set autoDisableScopes to 0. Other distributions
  are already doing this, and we already made this feature pretty much
  useless by allowing extensions in the application directory, so that our
  language packs aren't disabled by default
  - update debian/vendor.js
* Drop the solid white separators from the addressbar autocomplete dropdown,
  and increase padding so that it doesn't look so bad with dark themes
  - add debian/patches/autocomplete-theme-tweak.patch
  - update debian/patches/series
* Fix LP: #926495 - Add patch based on one from bmo: #691898 to enable
  building on ppc again
  - add debian/patches/fix-build-failure-without-yarr-jit.patch
  - update debian/patches/series
* Fix LP: #926495 - Disable the SPS profiler on unsupported architectures
  - add debian/patches/no-sps-profiler-on-unsupported-archs.patch
  - update debian/patches/series
* Add a missing include in gfx/angle/src/compiler/Types.h (backported
  from Aurora)
  - add debian/patches/fix-missing-stl-include-in-angle.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Mike Hommey <mh@glandium.org>
2
 
Date: Sat, 24 Dec 2011 09:56:58 +0100
3
 
Subject: Bug 691898 - Use YARR interpreter instead of PCRE on platforms where
4
 
 YARR JIT is not supported
5
 
 
6
 
---
7
 
 js/src/Makefile.in           |   21 +++++++++++++--------
8
 
 js/src/vm/RegExpObject-inl.h |   28 ++++++----------------------
9
 
 js/src/vm/RegExpObject.cpp   |   36 ------------------------------------
10
 
 js/src/vm/RegExpObject.h     |   27 ++++++---------------------
11
 
 js/src/yarr/wtfbridge.h      |    2 --
12
 
 5 files changed, 25 insertions(+), 89 deletions(-)
13
 
 
14
 
diff --git a/js/src/Makefile.in b/js/src/Makefile.in
15
 
index fc48cbd..49f0bdc 100644
16
 
--- a/js/src/Makefile.in
17
 
+++ b/js/src/Makefile.in
18
 
@@ -416,15 +416,20 @@ CPPSRCS +=        checks.cc \
19
 
 
20
 
 ifeq (,$(filter arm% sparc %86 x86_64,$(TARGET_CPU)))
21
 
 
22
 
-VPATH +=        $(srcdir)/yarr/pcre \
23
 
+VPATH +=        $(srcdir)/assembler \
24
 
+                $(srcdir)/assembler/wtf \
25
 
+                $(srcdir)/yarr \
26
 
                $(NULL)
27
 
 
28
 
 CPPSRCS += \
29
 
-                pcre_compile.cpp \
30
 
-                pcre_exec.cpp \
31
 
-                pcre_tables.cpp \
32
 
-                pcre_xclass.cpp \
33
 
-                pcre_ucp_searchfuncs.cpp \
34
 
+                Assertions.cpp \
35
 
+                OSAllocatorOS2.cpp \
36
 
+                OSAllocatorPosix.cpp \
37
 
+                OSAllocatorWin.cpp \
38
 
+                PageBlock.cpp \
39
 
+                YarrInterpreter.cpp \
40
 
+                YarrPattern.cpp \
41
 
+                YarrSyntaxChecker.cpp \
42
 
                $(NULL)
43
 
 else
44
 
 
45
 
@@ -1015,10 +1020,10 @@ endif
46
 
 # Needed to "configure" it correctly.  Unfortunately these
47
 
 # flags wind up being applied to all code in js/src, not just
48
 
 # the code in js/src/assembler.
49
 
-CXXFLAGS += -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1
50
 
+CXXFLAGS += -DUSE_SYSTEM_MALLOC=1
51
 
 
52
 
 ifneq (,$(ENABLE_YARR_JIT)$(ENABLE_TRACEJIT)$(ENABLE_METHODJIT))
53
 
-CXXFLAGS +=  -DENABLE_JIT=1
54
 
+CXXFLAGS +=  -DENABLE_JIT=1 -DENABLE_ASSEMBLER=1
55
 
 endif
56
 
 
57
 
 INCLUDES +=    -I$(srcdir)/assembler -I$(srcdir)/yarr
58
 
diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h
59
 
index 5f7817d..91108a7 100644
60
 
--- a/js/src/vm/RegExpObject-inl.h
61
 
+++ b/js/src/vm/RegExpObject-inl.h
62
 
@@ -327,6 +327,7 @@ RegExpPrivate::create(JSContext *cx, JSString *source, RegExpFlag flags, TokenSt
63
 
     return RetType(self);
64
 
 }
65
 
 
66
 
+#if ENABLE_YARR_JIT
67
 
 /* This function should be deleted once bad Android platforms phase out. See bug 604774. */
68
 
 inline bool
69
 
 RegExpPrivateCode::isJITRuntimeEnabled(JSContext *cx)
70
 
@@ -337,12 +338,12 @@ RegExpPrivateCode::isJITRuntimeEnabled(JSContext *cx)
71
 
     return true;
72
 
 #endif
73
 
 }
74
 
+#endif
75
 
 
76
 
 inline bool
77
 
 RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts,
78
 
                            uintN *parenCount, RegExpFlag flags)
79
 
 {
80
 
-#if ENABLE_YARR_JIT
81
 
     /* Parse the pattern. */
82
 
     ErrorCode yarrError;
83
 
     YarrPattern yarrPattern(pattern, bool(flags & IgnoreCaseFlag), bool(flags & MultilineFlag),
84
 
@@ -359,7 +360,7 @@ RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *
85
 
      * case we have to bytecode compile it.
86
 
      */
87
 
 
88
 
-#ifdef JS_METHODJIT
89
 
+#if ENABLE_YARR_JIT && defined(JS_METHODJIT)
90
 
     if (isJITRuntimeEnabled(cx) && !yarrPattern.m_containsBackreferences) {
91
 
         if (!cx->compartment->ensureJaegerCompartmentExists(cx))
92
 
             return false;
93
 
@@ -371,21 +372,11 @@ RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *
94
 
     }
95
 
 #endif
96
 
 
97
 
+#if ENABLE_YARR_JIT
98
 
     codeBlock.setFallBack(true);
99
 
+#endif
100
 
     byteCode = byteCompile(yarrPattern, cx->compartment->regExpAllocator).get();
101
 
     return true;
102
 
-#else /* !defined(ENABLE_YARR_JIT) */
103
 
-    int error = 0;
104
 
-    compiled = jsRegExpCompile(pattern.chars(), pattern.length(),
105
 
-                  ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase,
106
 
-                  multiline() ? JSRegExpMultiline : JSRegExpSingleLine,
107
 
-                  parenCount, &error);
108
 
-    if (error) {
109
 
-        reportPCREError(cx, error);
110
 
-        return false;
111
 
-    }
112
 
-    return true;
113
 
-#endif
114
 
 }
115
 
 
116
 
 inline bool
117
 
@@ -431,19 +422,12 @@ RegExpPrivateCode::execute(JSContext *cx, const jschar *chars, size_t start, siz
118
 
     else
119
 
         result = JSC::Yarr::execute(codeBlock, chars, start, length, output);
120
 
 #else
121
 
-    result = jsRegExpExecute(cx, compiled, chars, length, start, output, outputCount);
122
 
+    result = JSC::Yarr::interpret(byteCode, chars, start, length, output);
123
 
 #endif
124
 
 
125
 
     if (result == -1)
126
 
         return Success_NotFound;
127
 
 
128
 
-#if !ENABLE_YARR_JIT
129
 
-    if (result < 0) {
130
 
-        reportPCREError(cx, result);
131
 
-        return Error;
132
 
-    }
133
 
-#endif
134
 
-
135
 
     JS_ASSERT(result >= 0);
136
 
     return Success;
137
 
 }
138
 
diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
139
 
index f75c6a5..7631dd5 100644
140
 
--- a/js/src/vm/RegExpObject.cpp
141
 
+++ b/js/src/vm/RegExpObject.cpp
142
 
@@ -251,7 +251,6 @@ Class js::RegExpClass = {
143
 
     NULL                     /* trace */
144
 
 };
145
 
 
146
 
-#if ENABLE_YARR_JIT
147
 
 void
148
 
 RegExpPrivateCode::reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode error)
149
 
 {
150
 
@@ -283,41 +282,6 @@ RegExpPrivateCode::reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode err
151
 
     }
152
 
 }
153
 
 
154
 
-#else /* !ENABLE_YARR_JIT */
155
 
-
156
 
-void
157
 
-RegExpPrivateCode::reportPCREError(JSContext *cx, int error)
158
 
-{
159
 
-#define REPORT(msg_) \
160
 
-    JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL, msg_); \
161
 
-    return
162
 
-    switch (error) {
163
 
-      case -2: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
164
 
-      case 0: JS_NOT_REACHED("Precondition violation: an error must have occurred."); 
165
 
-      case 1: REPORT(JSMSG_TRAILING_SLASH);
166
 
-      case 2: REPORT(JSMSG_TRAILING_SLASH); 
167
 
-      case 3: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
168
 
-      case 4: REPORT(JSMSG_BAD_QUANTIFIER);
169
 
-      case 5: REPORT(JSMSG_BAD_QUANTIFIER);
170
 
-      case 6: REPORT(JSMSG_BAD_CLASS_RANGE);
171
 
-      case 7: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
172
 
-      case 8: REPORT(JSMSG_BAD_CLASS_RANGE);
173
 
-      case 9: REPORT(JSMSG_BAD_QUANTIFIER);
174
 
-      case 10: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN);
175
 
-      case 11: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
176
 
-      case 12: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN);
177
 
-      case 13: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
178
 
-      case 14: REPORT(JSMSG_MISSING_PAREN);
179
 
-      case 15: REPORT(JSMSG_BAD_BACKREF);
180
 
-      case 16: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
181
 
-      case 17: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
182
 
-      default:
183
 
-        JS_NOT_REACHED("Precondition violation: unknown PCRE error code.");
184
 
-    }
185
 
-#undef REPORT
186
 
-}
187
 
-#endif /* ENABLE_YARR_JIT */
188
 
-
189
 
 bool
190
 
 js::ParseRegExpFlags(JSContext *cx, JSString *flagStr, RegExpFlag *flagsOut)
191
 
 {
192
 
diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
193
 
index 1449d56..279f3c0 100644
194
 
--- a/js/src/vm/RegExpObject.h
195
 
+++ b/js/src/vm/RegExpObject.h
196
 
@@ -49,8 +49,6 @@
197
 
 #include "yarr/Yarr.h"
198
 
 #if ENABLE_YARR_JIT
199
 
 #include "yarr/YarrJIT.h"
200
 
-#else
201
 
-#include "yarr/pcre/pcre.h"
202
 
 #endif
203
 
 
204
 
 namespace js {
205
 
@@ -153,48 +151,39 @@ ResetRegExpObject(JSContext *cx, AlreadyIncRefed<RegExpPrivate> rep);
206
 
 /* Abstracts away the gross |RegExpPrivate| backend details. */
207
 
 class RegExpPrivateCode
208
 
 {
209
 
-#if ENABLE_YARR_JIT
210
 
     typedef JSC::Yarr::BytecodePattern BytecodePattern;
211
 
     typedef JSC::Yarr::ErrorCode ErrorCode;
212
 
+    typedef JSC::Yarr::YarrPattern YarrPattern;
213
 
+#if ENABLE_YARR_JIT
214
 
     typedef JSC::Yarr::JSGlobalData JSGlobalData;
215
 
     typedef JSC::Yarr::YarrCodeBlock YarrCodeBlock;
216
 
-    typedef JSC::Yarr::YarrPattern YarrPattern;
217
 
 
218
 
     /* Note: Native code is valid only if |codeBlock.isFallBack() == false|. */
219
 
     YarrCodeBlock   codeBlock;
220
 
-    BytecodePattern *byteCode;
221
 
-#else
222
 
-    JSRegExp        *compiled;
223
 
 #endif
224
 
+    BytecodePattern *byteCode;
225
 
 
226
 
   public:
227
 
     RegExpPrivateCode()
228
 
       :
229
 
 #if ENABLE_YARR_JIT
230
 
         codeBlock(),
231
 
-        byteCode(NULL)
232
 
-#else
233
 
-        compiled(NULL)
234
 
 #endif
235
 
+        byteCode(NULL)
236
 
     { }
237
 
 
238
 
     ~RegExpPrivateCode() {
239
 
 #if ENABLE_YARR_JIT
240
 
         codeBlock.release();
241
 
+#endif
242
 
         if (byteCode)
243
 
             Foreground::delete_<BytecodePattern>(byteCode);
244
 
-#else
245
 
-        if (compiled)
246
 
-            jsRegExpFree(compiled);
247
 
-#endif
248
 
     }
249
 
 
250
 
 #if ENABLE_YARR_JIT
251
 
     static inline bool isJITRuntimeEnabled(JSContext *cx);
252
 
-    void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error);
253
 
-#else
254
 
-    void reportPCREError(JSContext *cx, int error);
255
 
 #endif
256
 
+    void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error);
257
 
 
258
 
     inline bool compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts, uintN *parenCount,
259
 
                         RegExpFlag flags);
260
 
@@ -205,11 +194,7 @@ class RegExpPrivateCode
261
 
                                  int *output, size_t outputCount);
262
 
 
263
 
     static size_t getOutputSize(size_t pairCount) {
264
 
-#if ENABLE_YARR_JIT
265
 
         return pairCount * 2;
266
 
-#else
267
 
-        return pairCount * 3; /* Should be x2, but PCRE has... needs. */
268
 
-#endif
269
 
     }
270
 
 };
271
 
 
272
 
diff --git a/js/src/yarr/wtfbridge.h b/js/src/yarr/wtfbridge.h
273
 
index ac41d08..fb8eb86 100644
274
 
--- a/js/src/yarr/wtfbridge.h
275
 
+++ b/js/src/yarr/wtfbridge.h
276
 
@@ -49,9 +49,7 @@
277
 
 #include "jsprvtd.h"
278
 
 #include "vm/String.h"
279
 
 #include "assembler/wtf/Platform.h"
280
 
-#if ENABLE_YARR_JIT
281
 
 #include "assembler/jit/ExecutableAllocator.h"
282
 
-#endif
283
 
 
284
 
 namespace JSC { namespace Yarr {
285
 
 
286