[gnome-sdk-images] Update to moz31 + the patches used in jhbuild



commit 6f51daf6c11d467e31ba3e610370f01ac6982e5b
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Dec 12 17:54:59 2016 +0100

    Update to moz31 + the patches used in jhbuild

 mozjs31-1021171.patch      |  245 ++++++++++++++++++++++++++++++++++++++++++++
 mozjs31-1037470.patch      |   31 ++++++
 mozjs31-1046176.patch      |   31 ++++++
 mozjs31-1119228.patch      |   65 ++++++++++++
 mozjs31-install-name.patch |   11 ++
 org.gnome.Sdk.json.in      |   35 ++++--
 6 files changed, 406 insertions(+), 12 deletions(-)
---
diff --git a/mozjs31-1021171.patch b/mozjs31-1021171.patch
new file mode 100644
index 0000000..b322e44
--- /dev/null
+++ b/mozjs31-1021171.patch
@@ -0,0 +1,245 @@
+# Based on
+# HG changeset patch
+# User Trevor Saunders <trev saunders gmail com>
+# Date 1402083090 14400
+# Node ID fc756706366d983e5d70345cab419fbf72db3d36
+# Parent  78c20dbe259e808fb58d65731efd4f05e8921820
+bug 1021171 - don't return nulllptr in functions returning bool r=bz,waldo
+
+diff --git a/js/src/builtin/TypedObject.cpp b/js/src/builtin/TypedObject.cpp
+--- a/js/src/builtin/TypedObject.cpp
++++ b/js/src/builtin/TypedObject.cpp
+@@ -705,35 +705,35 @@ ArrayMetaTypeDescr::construct(JSContext 
+ 
+     // Construct a canonical string `new ArrayType(<elementType>)`:
+     StringBuffer contents(cx);
+     contents.append("new ArrayType(");
+     contents.append(&elementType->stringRepr());
+     contents.append(")");
+     RootedAtom stringRepr(cx, contents.finishAtom());
+     if (!stringRepr)
+-        return nullptr;
++        return false;
+ 
+     // Extract ArrayType.prototype
+     RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal));
+     if (!arrayTypePrototype)
+-        return nullptr;
++        return false;
+ 
+     // Create the instance of ArrayType
+     Rooted<UnsizedArrayTypeDescr *> obj(cx);
+     obj = create<UnsizedArrayTypeDescr>(cx, arrayTypePrototype, elementType,
+                                         stringRepr, 0);
+     if (!obj)
+         return false;
+ 
+     // Add `length` property, which is undefined for an unsized array.
+     if (!JSObject::defineProperty(cx, obj, cx->names().length,
+                                   UndefinedHandleValue, nullptr, nullptr,
+                                   JSPROP_READONLY | JSPROP_PERMANENT))
+-        return nullptr;
++        return false;
+ 
+     args.rval().setObject(*obj);
+     return true;
+ }
+ 
+ /*static*/ bool
+ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
+ {
+@@ -757,30 +757,30 @@ UnsizedArrayTypeDescr::dimension(JSConte
+     int32_t length = args[0].toInt32();
+     Rooted<SizedTypeDescr*> elementType(cx, &unsizedTypeDescr->elementType());
+ 
+     // Compute the size.
+     CheckedInt32 size = CheckedInt32(elementType->size()) * length;
+     if (!size.isValid()) {
+         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr,
+                              JSMSG_TYPEDOBJECT_TOO_BIG);
+-        return nullptr;
++        return false;
+     }
+ 
+     // Construct a canonical string `new ArrayType(<elementType>).dimension(N)`:
+     StringBuffer contents(cx);
+     contents.append("new ArrayType(");
+     contents.append(&elementType->stringRepr());
+     contents.append(").dimension(");
+     if (!NumberValueToStringBuffer(cx, NumberValue(length), contents))
+         return false;
+     contents.append(")");
+     RootedAtom stringRepr(cx, contents.finishAtom());
+     if (!stringRepr)
+-        return nullptr;
++        return false;
+ 
+     // Create the sized type object.
+     Rooted<SizedArrayTypeDescr*> obj(cx);
+     obj = ArrayMetaTypeDescr::create<SizedArrayTypeDescr>(cx, unsizedTypeDescr,
+                                                           elementType,
+                                                           stringRepr, size.value());
+     if (!obj)
+         return false;
+@@ -788,25 +788,25 @@ UnsizedArrayTypeDescr::dimension(JSConte
+     obj->initReservedSlot(JS_DESCR_SLOT_SIZED_ARRAY_LENGTH,
+                           Int32Value(length));
+ 
+     // Add `length` property.
+     RootedValue lengthVal(cx, Int32Value(length));
+     if (!JSObject::defineProperty(cx, obj, cx->names().length,
+                                   lengthVal, nullptr, nullptr,
+                                   JSPROP_READONLY | JSPROP_PERMANENT))
+-        return nullptr;
++        return false;
+ 
+     // Add `unsized` property, which is a link from the sized
+     // array to the unsized array.
+     RootedValue unsizedTypeDescrValue(cx, ObjectValue(*unsizedTypeDescr));
+     if (!JSObject::defineProperty(cx, obj, cx->names().unsized,
+                                   unsizedTypeDescrValue, nullptr, nullptr,
+                                   JSPROP_READONLY | JSPROP_PERMANENT))
+-        return nullptr;
++        return false;
+ 
+     args.rval().setObject(*obj);
+     return true;
+ }
+ 
+ bool
+ js::IsTypedObjectArray(JSObject &obj)
+ {
+@@ -1248,17 +1248,17 @@ DefineSimpleTypeDescr(JSContext *cx,
+     if (!JS_DefineFunctions(cx, descr, T::typeObjectMethods))
+         return false;
+ 
+     // Create the typed prototype for the scalar type. This winds up
+     // not being user accessible, but we still create one for consistency.
+     Rooted<TypedProto*> proto(cx);
+     proto = NewObjectWithProto<TypedProto>(cx, objProto, nullptr, TenuredObject);
+     if (!proto)
+-        return nullptr;
++        return false;
+     proto->initTypeDescrSlot(*descr);
+     descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto));
+ 
+     RootedValue descrValue(cx, ObjectValue(*descr));
+     if (!JSObject::defineProperty(cx, module, className,
+                                   descrValue, nullptr, nullptr, 0))
+     {
+         return false;
+@@ -1353,66 +1353,66 @@ GlobalObject::initTypedObjectModule(JSCo
+     if (!JS_DefineFunctions(cx, module, TypedObjectMethods))
+         return false;
+ 
+     // uint8, uint16, any, etc
+ 
+ #define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_)                       \
+     if (!DefineSimpleTypeDescr<ScalarTypeDescr>(cx, global, module, constant_,      \
+                                             cx->names().name_))                 \
+-        return nullptr;
++        return false;
+     JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE)
+ #undef BINARYDATA_SCALAR_DEFINE
+ 
+ #define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_)                    \
+     if (!DefineSimpleTypeDescr<ReferenceTypeDescr>(cx, global, module, constant_,   \
+                                                cx->names().name_))              \
+-        return nullptr;
++        return false;
+     JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE)
+ #undef BINARYDATA_REFERENCE_DEFINE
+ 
+     // ArrayType.
+ 
+     RootedObject arrayType(cx);
+     arrayType = DefineMetaTypeDescr<ArrayMetaTypeDescr>(
+         cx, global, module, TypedObjectModuleObject::ArrayTypePrototype);
+     if (!arrayType)
+-        return nullptr;
++        return false;
+ 
+     RootedValue arrayTypeValue(cx, ObjectValue(*arrayType));
+     if (!JSObject::defineProperty(cx, module, cx->names().ArrayType,
+                                   arrayTypeValue,
+                                   nullptr, nullptr,
+                                   JSPROP_READONLY | JSPROP_PERMANENT))
+-        return nullptr;
++        return false;
+ 
+     // StructType.
+ 
+     RootedObject structType(cx);
+     structType = DefineMetaTypeDescr<StructMetaTypeDescr>(
+         cx, global, module, TypedObjectModuleObject::StructTypePrototype);
+     if (!structType)
+-        return nullptr;
++        return false;
+ 
+     RootedValue structTypeValue(cx, ObjectValue(*structType));
+     if (!JSObject::defineProperty(cx, module, cx->names().StructType,
+                                   structTypeValue,
+                                   nullptr, nullptr,
+                                   JSPROP_READONLY | JSPROP_PERMANENT))
+-        return nullptr;
++        return false;
+ 
+     // Everything is setup, install module on the global object:
+     RootedValue moduleValue(cx, ObjectValue(*module));
+     global->setConstructor(JSProto_TypedObject, moduleValue);
+     if (!JSObject::defineProperty(cx, global, cx->names().TypedObject,
+                                   moduleValue,
+                                   nullptr, nullptr,
+                                   0))
+     {
+-        return nullptr;
++        return false;
+     }
+ 
+     return module;
+ }
+ 
+ JSObject *
+ js_InitTypedObjectModuleObject(JSContext *cx, HandleObject obj)
+ {
+@@ -2444,17 +2444,17 @@ TypedObject::constructUnsized(JSContext 
+     }
+ 
+     // Length constructor.
+     if (args[0].isInt32()) {
+         int32_t length = args[0].toInt32();
+         if (length < 0) {
+             JS_ReportErrorNumber(cx, js_GetErrorMessage,
+                                  nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS);
+-            return nullptr;
++            return false;
+         }
+         Rooted<TypedObject*> obj(cx, createZeroed(cx, callee, length));
+         if (!obj)
+             return false;
+         args.rval().setObject(*obj);
+         return true;
+     }
+ 
+diff --git a/js/src/frontend/BytecodeCompiler.cpp b/js/src/frontend/BytecodeCompiler.cpp
+--- a/js/src/frontend/BytecodeCompiler.cpp
++++ b/js/src/frontend/BytecodeCompiler.cpp
+@@ -539,17 +539,17 @@ CompileFunctionBody(JSContext *cx, Mutab
+ 
+     MaybeCallSourceHandler(cx, options, srcBuf);
+ 
+     if (!CheckLength(cx, srcBuf))
+         return false;
+ 
+     RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options));
+     if (!sourceObject)
+-        return nullptr;
++        return false;
+     ScriptSource *ss = sourceObject->source();
+ 
+     SourceCompressionTask sct(cx);
+     JS_ASSERT(!options.sourceIsLazy);
+     if (!cx->compartment()->options().discardSource()) {
+         if (!ss->setSourceCopy(cx, srcBuf, true, &sct))
+             return false;
+     }
diff --git a/mozjs31-1037470.patch b/mozjs31-1037470.patch
new file mode 100644
index 0000000..e2db356
--- /dev/null
+++ b/mozjs31-1037470.patch
@@ -0,0 +1,31 @@
+
+# HG changeset patch
+# User Martin Stransky <stransky redhat com>
+# Date 1405081680 14400
+# Node ID 46229cdd48f4bafbb5660d1a533449deff0c6bd3
+# Parent  c274ab1b4086c248d1e0a21f33b38043c4f1f184
+Bug 1037470 - Fix debug build bustage with Ion disabled. r=jandem
+
+diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp
+--- a/js/src/vm/Debugger.cpp
++++ b/js/src/vm/Debugger.cpp
+@@ -4108,17 +4108,17 @@ static const JSFunctionSpec DebuggerSour
+ 
+ 
+ /*** Debugger.Frame ******************************************************************************/
+ 
+ static void
+ UpdateFrameIterPc(FrameIter &iter)
+ {
+     if (iter.abstractFramePtr().isRematerializedFrame()) {
+-#ifdef DEBUG
++#if defined(DEBUG) && defined(JS_ION)
+         // Rematerialized frames don't need their pc updated. The reason we
+         // need to update pc is because we might get the same Debugger.Frame
+         // object for multiple re-entries into debugger code from debuggee
+         // code. This reentrancy is not possible with rematerialized frames,
+         // because when returning to debuggee code, we would have bailed out
+         // to baseline.
+         //
+         // We walk the stack to assert that it doesn't need updating.
+
diff --git a/mozjs31-1046176.patch b/mozjs31-1046176.patch
new file mode 100644
index 0000000..0b979df
--- /dev/null
+++ b/mozjs31-1046176.patch
@@ -0,0 +1,31 @@
+
+# HG changeset patch
+# User Jan de Mooij <jdemooij mozilla com>
+# Date 1406735301 -7200
+# Node ID f578233e4d2c3159d1cdf27a331a6b4ca68252b6
+# Parent  569dda025a066f3c6e77bdaebd14158dfc7518be
+Bug 1046176 - Fix inlined UnsafeSetReservedSlot post barrier. r=nbp
+
+diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp
+--- a/js/src/jit/MCallOptimize.cpp
++++ b/js/src/jit/MCallOptimize.cpp
+@@ -1789,17 +1789,17 @@ IonBuilder::inlineUnsafeSetReservedSlot(
+ 
+     callInfo.setImplicitlyUsedUnchecked();
+ 
+     MStoreFixedSlot *store = MStoreFixedSlot::New(alloc(), callInfo.getArg(0), slot, callInfo.getArg(2));
+     current->add(store);
+     current->push(store);
+ 
+     if (NeedsPostBarrier(info(), callInfo.getArg(2)))
+-        current->add(MPostWriteBarrier::New(alloc(), callInfo.thisArg(), callInfo.getArg(2)));
++        current->add(MPostWriteBarrier::New(alloc(), callInfo.getArg(0), callInfo.getArg(2)));
+ 
+     return InliningStatus_Inlined;
+ }
+ 
+ IonBuilder::InliningStatus
+ IonBuilder::inlineUnsafeGetReservedSlot(CallInfo &callInfo)
+ {
+     if (callInfo.argc() != 2 || callInfo.constructing())
+
diff --git a/mozjs31-1119228.patch b/mozjs31-1119228.patch
new file mode 100644
index 0000000..85c0d64
--- /dev/null
+++ b/mozjs31-1119228.patch
@@ -0,0 +1,65 @@
+# Backport of
+# HG changeset patch
+# User Ehsan Akhgari <ehsan mozilla com>
+# Date 1420727118 18000
+# Node ID bcacb5692ad902fc0ec6ebea2ad382a8a3fd5183
+# Parent  48f8a884901ba9753d3bddab08f25c60e1915601
+Bug 1119228 - Fix a fatal warning in PossiblyFail; r=jandem
+
+Recent clang emits the following warning (which is treated as an error) on this code:
+error: implicit conversion of nullptr constant to 'bool' [-Werror,-Wnull-conversion]
+
+
+diff --git a/js/public/Utility.h b/js/public/Utility.h
+--- a/js/public/Utility.h
++++ b/js/public/Utility.h
+@@ -83,19 +83,28 @@ static MOZ_NEVER_INLINE void js_failedAl
+ #  define JS_OOM_POSSIBLY_FAIL() \
+     do \
+     { \
+         if (++OOM_counter > OOM_maxAllocations) { \
+             JS_OOM_CALL_BP_FUNC();\
+             return nullptr; \
+         } \
+     } while (0)
++#  define JS_OOM_POSSIBLY_FAIL_BOOL() \
++    do \
++    { \
++        if (++OOM_counter > OOM_maxAllocations) { \
++            JS_OOM_CALL_BP_FUNC();\
++            return false; \
++        } \
++    } while (0)
+ 
+ # else
+ #  define JS_OOM_POSSIBLY_FAIL() do {} while(0)
++#  define JS_OOM_POSSIBLY_FAIL_BOOL() do {} while(0)
+ # endif /* DEBUG || JS_OOM_BREAKPOINT */
+ 
+ static inline void* js_malloc(size_t bytes)
+ {
+     JS_OOM_POSSIBLY_FAIL();
+     return malloc(bytes);
+ }
+
+--- a/js/src/jsgcinlines.h
++++ b/js/src/jsgcinlines.h
+@@ -403,17 +403,17 @@
+     }
+     return nullptr;
+ }
+ #endif /* JSGC_GENERATIONAL */
+
+ static inline bool
+ PossiblyFail()
+ {
+-    JS_OOM_POSSIBLY_FAIL();
++    JS_OOM_POSSIBLY_FAIL_BOOL();
+     return true;
+ }
+
+ template <AllowGC allowGC>
+ static inline bool
+ CheckAllocatorState(ThreadSafeContext *cx, AllocKind kind)
+ {
+     if (!cx->isJSContext())
diff --git a/mozjs31-install-name.patch b/mozjs31-install-name.patch
new file mode 100644
index 0000000..1de7f4c
--- /dev/null
+++ b/mozjs31-install-name.patch
@@ -0,0 +1,11 @@
+--- a/config/rules.mk  2016-11-09 23:51:17.000000000 -0800
++++ b/config/rules.mk  2016-11-09 23:54:23.000000000 -0800
+@@ -442,7 +442,7 @@
+ ifdef IS_COMPONENT
+ EXTRA_DSO_LDOPTS      += -bundle
+ else
+-EXTRA_DSO_LDOPTS      += -dynamiclib -install_name @executable_path/$(SHARED_LIBRARY) 
-compatibility_version 1 -current_version 1 -single_module
++EXTRA_DSO_LDOPTS      += -dynamiclib -install_name $(abspath $(prefix))/lib/$(SHARED_LIBRARY) 
-compatibility_version 1 -current_version 1 -single_module
+ endif
+ endif
+ endif
diff --git a/org.gnome.Sdk.json.in b/org.gnome.Sdk.json.in
index 37850cd..19f8df9 100644
--- a/org.gnome.Sdk.json.in
+++ b/org.gnome.Sdk.json.in
@@ -558,7 +558,7 @@
             ]
         },
         {
-            "name": "mozjs24",
+            "name": "mozjs31",
             "build-options" : {
                 "arch" : {
                     "i386" : {
@@ -573,31 +573,42 @@
                    }
                 }
             },
-            "config-opts": [  "--disable-static",
-                              "--with-system-nspr",
-                              "--enable-threadsafe",
-                              "--enable-readline",
-                              "--enable-xterm-updates"],
+            "config-opts": [  "--with-system-nspr",
+                              "--with-system-zlib",
+                              "--enable-system-ffi",
+                              "--with-system-icu"],
             "subdir": "js/src",
             "sources": [
                 {
                     "type": "archive",
-                    "url": "http://ftp.mozilla.org/pub/mozilla.org/js/mozjs-24.2.0.tar.bz2";,
-                    "sha256": "e62f3f331ddd90df1e238c09d61a505c516fe9fd8c5c95336611d191d18437d8"
+                    "url": "https://people.mozilla.org/~sstangl/mozjs-31.5.0.tar.bz2";,
+                    "sha256": "4d63976b88c4e2135f1bd6d1f85285fe299713cde4baf2fe1b2f4058286611e1"
                 },
                 {
                     "type": "patch",
-                    "path": "mozjs-perl-fix.patch"
+                    "path": "mozjs31-1021171.patch"
                 },
                 {
                     "type": "patch",
-                    "path": "mozjs-double-conversion-aarch64.patch"
+                    "path": "mozjs31-1037470.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "mozjs31-1046176.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "mozjs31-1119228.patch"
+                },
+                {
+                    "type": "patch",
+                    "path": "mozjs31-install-name.patch"
                 },
                 {
                     "type": "shell",
                     "commands": [
-                        "cp -f /usr/share/gnu-config/config.sub ./js/src/build/autoconf/",
-                        "cp -f /usr/share/gnu-config/config.guess ./js/src/build/autoconf/"
+                        "cp -f /usr/share/gnu-config/config.sub ./build/autoconf/",
+                        "cp -f /usr/share/gnu-config/config.guess ./build/autoconf/"
                     ]
                 }
             ]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]