From owner-svn-ports-branches@freebsd.org Fri Mar 16 13:24:33 2018 Return-Path: Delivered-To: svn-ports-branches@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC9FF4EB86; Fri, 16 Mar 2018 13:24:33 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64E347E432; Fri, 16 Mar 2018 13:24:33 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BB0C247B0; Fri, 16 Mar 2018 13:24:33 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2GDOXU2008620; Fri, 16 Mar 2018 13:24:33 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2GDOXjX008618; Fri, 16 Mar 2018 13:24:33 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201803161324.w2GDOXjX008618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Fri, 16 Mar 2018 13:24:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r464683 - in branches/2018Q1/www/waterfox: . files X-SVN-Group: ports-branches X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: in branches/2018Q1/www/waterfox: . files X-SVN-Commit-Revision: 464683 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-branches@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the branches of the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 13:24:33 -0000 Author: jbeich Date: Fri Mar 16 13:24:33 2018 New Revision: 464683 URL: https://svnweb.freebsd.org/changeset/ports/464683 Log: MFH: r463842 www/waterfox: apply FF60 fix Approved by: ports-secteam blanket Added: branches/2018Q1/www/waterfox/files/patch-bug1411415 - copied unchanged from r463842, head/www/waterfox/files/patch-bug1411415 Modified: branches/2018Q1/www/waterfox/Makefile Directory Properties: branches/2018Q1/ (props changed) Modified: branches/2018Q1/www/waterfox/Makefile ============================================================================== --- branches/2018Q1/www/waterfox/Makefile Fri Mar 16 13:19:35 2018 (r464682) +++ branches/2018Q1/www/waterfox/Makefile Fri Mar 16 13:24:33 2018 (r464683) @@ -3,6 +3,7 @@ PORTNAME= waterfox DISTVERSION= 56.0.4-36 DISTVERSIONSUFFIX= -g79492ecca478 +PORTREVISION= 1 CATEGORIES= www ipv6 MAINTAINER= jbeich@FreeBSD.org Copied: branches/2018Q1/www/waterfox/files/patch-bug1411415 (from r463842, head/www/waterfox/files/patch-bug1411415) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2018Q1/www/waterfox/files/patch-bug1411415 Fri Mar 16 13:24:33 2018 (r464683, copy of r463842, head/www/waterfox/files/patch-bug1411415) @@ -0,0 +1,383 @@ +commit 627eb6ae9a72 +Author: Kannan Vijayan +Date: Mon Mar 5 19:27:02 2018 -0500 + + Bug 1411415 - r=bz r=fitzgen +--- + dom/bindings/BindingUtils.cpp | 20 +++++------ + dom/bindings/ErrorResult.h | 2 +- + dom/xslt/xpath/txXPCOMExtensionFunction.cpp | 2 +- + js/public/Value.h | 55 ++++++++++++++++++++++++++--- + js/rust/build.rs | 1 + + js/src/jit/BaselineFrameInfo.h | 4 +-- + js/src/jit/CacheIRCompiler.cpp | 2 +- + js/src/jit/RegisterSets.h | 8 ++--- + js/src/jit/RematerializedFrame.cpp | 14 ++++++-- + js/src/wasm/AsmJS.cpp | 10 +++--- + js/xpconnect/src/XPCWrappedNative.cpp | 7 ++-- + layout/style/ServoBindings.toml | 6 ++-- + xpcom/reflect/xptcall/xptcall.h | 2 +- + 13 files changed, 97 insertions(+), 36 deletions(-) + +diff --git dom/bindings/BindingUtils.cpp dom/bindings/BindingUtils.cpp +index 93069ac4a8b8..ac8c7a2229f3 100644 +--- dom/bindings/BindingUtils.cpp ++++ dom/bindings/BindingUtils.cpp +@@ -287,8 +287,8 @@ TErrorResult::ThrowJSException(JSContext* cx, JS::Handle::SetPendingJSException(JSContext* cx) + mJSException = exception; + // If JS_WrapValue failed, not much we can do about it... No matter + // what, go ahead and unroot mJSException. +- js::RemoveRawValueRoot(cx, &mJSException); ++ js::RemoveRawValueRoot(cx, &mJSException.asValueRef()); + + mResult = NS_OK; + #ifdef DEBUG +@@ -423,8 +423,8 @@ TErrorResult::ClearUnionData() + if (IsJSException()) { + JSContext* cx = dom::danger::GetJSContext(); + MOZ_ASSERT(cx); +- mJSException.setUndefined(); +- js::RemoveRawValueRoot(cx, &mJSException); ++ mJSException.asValueRef().setUndefined(); ++ js::RemoveRawValueRoot(cx, &mJSException.asValueRef()); + #ifdef DEBUG + mUnionState = HasNothing; + #endif // DEBUG +@@ -467,13 +467,13 @@ TErrorResult::operator=(TErrorResult&& aRHS) + } else if (aRHS.IsJSException()) { + JSContext* cx = dom::danger::GetJSContext(); + MOZ_ASSERT(cx); +- mJSException.setUndefined(); +- if (!js::AddRawValueRoot(cx, &mJSException, "TErrorResult::mJSException")) { ++ mJSException.asValueRef().setUndefined(); ++ if (!js::AddRawValueRoot(cx, &mJSException.asValueRef(), "TErrorResult::mJSException")) { + MOZ_CRASH("Could not root mJSException, we're about to OOM"); + } + mJSException = aRHS.mJSException; +- aRHS.mJSException.setUndefined(); +- js::RemoveRawValueRoot(cx, &aRHS.mJSException); ++ aRHS.mJSException.asValueRef().setUndefined(); ++ js::RemoveRawValueRoot(cx, &aRHS.mJSException.asValueRef()); + } else if (aRHS.IsDOMException()) { + mDOMExceptionInfo = aRHS.mDOMExceptionInfo; + aRHS.mDOMExceptionInfo = nullptr; +@@ -525,7 +525,7 @@ TErrorResult::CloneTo(TErrorResult& aRv) const + aRv.mUnionState = HasJSException; + #endif + JSContext* cx = dom::danger::GetJSContext(); +- JS::Rooted exception(cx, mJSException); ++ JS::Rooted exception(cx, mJSException.asValueRef()); + aRv.ThrowJSException(cx, exception); + } + } +diff --git dom/bindings/ErrorResult.h dom/bindings/ErrorResult.h +index 7b38226691bb..a406a2c490a5 100644 +--- dom/bindings/ErrorResult.h ++++ dom/bindings/ErrorResult.h +@@ -507,7 +507,7 @@ private: + // (and deallocated) by SetPendingDOMException. + union { + Message* mMessage; // valid when IsErrorWithMessage() +- JS::Value mJSException; // valid when IsJSException() ++ JS::UninitializedValue mJSException; // valid when IsJSException() + DOMExceptionInfo* mDOMExceptionInfo; // valid when IsDOMException() + }; + +diff --git dom/xslt/xpath/txXPCOMExtensionFunction.cpp dom/xslt/xpath/txXPCOMExtensionFunction.cpp +index e95baa0bbde8..e1387422c303 100644 +--- dom/xslt/xpath/txXPCOMExtensionFunction.cpp ++++ dom/xslt/xpath/txXPCOMExtensionFunction.cpp +@@ -322,7 +322,7 @@ public: + void trace(JSTracer* trc) { + for (uint8_t i = 0; i < mCount; ++i) { + if (mArray[i].type == nsXPTType::T_JSVAL) { +- JS::UnsafeTraceRoot(trc, &mArray[i].val.j, "txParam value"); ++ JS::UnsafeTraceRoot(trc, &mArray[i].val.j.asValueRef(), "txParam value"); + } + } + } +diff --git js/public/Value.h js/public/Value.h +index b7c4e1b8a770..96a1b703bbc1 100644 +--- js/public/Value.h ++++ js/public/Value.h +@@ -137,12 +137,16 @@ static_assert(sizeof(JSValueShiftedTag) == sizeof(uint64_t), + + #define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_CLEAR | (type))) + ++#define JSVAL_RAW64_UNDEFINED (uint64_t(JSVAL_TAG_UNDEFINED) << 32) ++ + #define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET JSVAL_TAG_OBJECT + #define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET JSVAL_TAG_INT32 + #define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET JSVAL_TAG_STRING + + #elif defined(JS_PUNBOX64) + ++#define JSVAL_RAW64_UNDEFINED (uint64_t(JSVAL_TAG_UNDEFINED) << JSVAL_TAG_SHIFT) ++ + #define JSVAL_PAYLOAD_MASK 0x00007FFFFFFFFFFFLL + #define JSVAL_TAG_MASK 0xFFFF800000000000LL + #define JSVAL_TYPE_TO_TAG(type) ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type))) +@@ -814,7 +818,7 @@ class MOZ_NON_PARAM alignas(8) Value + double asDouble; + void* asPtr; + +- layout() = default; ++ layout() : asBits(JSVAL_RAW64_UNDEFINED) {} + explicit constexpr layout(uint64_t bits) : asBits(bits) {} + explicit constexpr layout(double d) : asDouble(d) {} + } data; +@@ -840,7 +844,7 @@ class MOZ_NON_PARAM alignas(8) Value + size_t asWord; + uintptr_t asUIntPtr; + +- layout() = default; ++ layout() : asBits(JSVAL_RAW64_UNDEFINED) {} + explicit constexpr layout(uint64_t bits) : asBits(bits) {} + explicit constexpr layout(double d) : asDouble(d) {} + } data; +@@ -868,7 +872,7 @@ class MOZ_NON_PARAM alignas(8) Value + double asDouble; + void* asPtr; + +- layout() = default; ++ layout() : asBits(JSVAL_RAW64_UNDEFINED) {} + explicit constexpr layout(uint64_t bits) : asBits(bits) {} + explicit constexpr layout(double d) : asDouble(d) {} + } data; +@@ -892,7 +896,7 @@ class MOZ_NON_PARAM alignas(8) Value + size_t asWord; + uintptr_t asUIntPtr; + +- layout() = default; ++ layout() : asBits(JSVAL_RAW64_UNDEFINED) {} + explicit constexpr layout(uint64_t bits) : asBits(bits) {} + explicit constexpr layout(double d) : asDouble(d) {} + } data; +@@ -945,8 +949,51 @@ class MOZ_NON_PARAM alignas(8) Value + } + } JS_HAZ_GC_POINTER; + ++/** ++ * This is a null-constructible structure that can convert to and from ++ * a Value, allowing UninitializedValue to be stored in unions. ++ */ ++struct MOZ_NON_PARAM alignas(8) UninitializedValue ++{ ++ private: ++ uint64_t bits; ++ ++ public: ++ UninitializedValue() = default; ++ UninitializedValue(const UninitializedValue&) = default; ++ MOZ_IMPLICIT UninitializedValue(const Value& val) : bits(val.asRawBits()) {} ++ ++ inline uint64_t asRawBits() const { ++ return bits; ++ } ++ ++ inline Value& asValueRef() { ++ return *reinterpret_cast(this); ++ } ++ inline const Value& asValueRef() const { ++ return *reinterpret_cast(this); ++ } ++ ++ inline operator Value&() { ++ return asValueRef(); ++ } ++ inline operator Value const&() const { ++ return asValueRef(); ++ } ++ inline operator Value() const { ++ return asValueRef(); ++ } ++ ++ inline void operator=(Value const& other) { ++ asValueRef() = other; ++ } ++}; ++ + static_assert(sizeof(Value) == 8, "Value size must leave three tag bits, be a binary power, and is ubiquitously depended upon everywhere"); + ++static_assert(sizeof(UninitializedValue) == sizeof(Value), "Value and UninitializedValue must be the same size"); ++static_assert(alignof(UninitializedValue) == alignof(Value), "Value and UninitializedValue must have same alignment"); ++ + inline bool + IsOptimizedPlaceholderMagicValue(const Value& v) + { +diff --git js/src/jit/BaselineFrameInfo.h js/src/jit/BaselineFrameInfo.h +index 13bf0358d944..1691270acf17 100644 +--- js/src/jit/BaselineFrameInfo.h ++++ js/src/jit/BaselineFrameInfo.h +@@ -67,7 +67,7 @@ class StackValue + + union { + struct { +- Value v; ++ JS::UninitializedValue v; + } constant; + struct { + mozilla::AlignedStorage2 reg; +@@ -112,7 +112,7 @@ class StackValue + } + Value constant() const { + MOZ_ASSERT(kind_ == Constant); +- return data.constant.v; ++ return data.constant.v.asValueRef(); + } + ValueOperand reg() const { + MOZ_ASSERT(kind_ == Register); +diff --git js/src/jit/CacheIRCompiler.cpp js/src/jit/CacheIRCompiler.cpp +index 98d2dcbf1b23..35357ed7c8da 100644 +--- js/src/jit/CacheIRCompiler.cpp ++++ js/src/jit/CacheIRCompiler.cpp +@@ -925,7 +925,7 @@ CacheIRWriter::copyStubData(uint8_t* dest) const + *reinterpret_cast(destWords) = field.asInt64(); + break; + case StubField::Type::Value: +- InitGCPtr(destWords, field.asInt64()); ++ AsGCPtr(destWords)->init(Value::fromRawBits(uint64_t(field.asInt64()))); + break; + case StubField::Type::Limit: + MOZ_CRASH("Invalid type"); +diff --git js/src/jit/RegisterSets.h js/src/jit/RegisterSets.h +index b6436a801b1c..749730aac4c6 100644 +--- js/src/jit/RegisterSets.h ++++ js/src/jit/RegisterSets.h +@@ -226,13 +226,13 @@ class ConstantOrRegister + + // Space to hold either a Value or a TypedOrValueRegister. + union U { +- Value constant; ++ JS::UninitializedValue constant; + TypedOrValueRegister reg; + } data; + +- const Value& dataValue() const { ++ Value dataValue() const { + MOZ_ASSERT(constant()); +- return data.constant; ++ return data.constant.asValueRef(); + } + void setDataValue(const Value& value) { + MOZ_ASSERT(constant()); +@@ -268,7 +268,7 @@ class ConstantOrRegister + return constant_; + } + +- const Value& value() const { ++ Value value() const { + return dataValue(); + } + +diff --git js/src/jit/RematerializedFrame.cpp js/src/jit/RematerializedFrame.cpp +index f12475e5ee55..8cfb0c0d0b87 100644 +--- js/src/jit/RematerializedFrame.cpp ++++ js/src/jit/RematerializedFrame.cpp +@@ -60,9 +60,17 @@ RematerializedFrame::New(JSContext* cx, uint8_t* top, InlineFrameIterator& iter, + { + unsigned numFormals = iter.isFunctionFrame() ? iter.calleeTemplate()->nargs() : 0; + unsigned argSlots = Max(numFormals, iter.numActualArgs()); +- size_t numBytes = sizeof(RematerializedFrame) + +- (argSlots + iter.script()->nfixed()) * sizeof(Value) - +- sizeof(Value); // 1 Value included in sizeof(RematerializedFrame) ++ unsigned extraSlots = argSlots + iter.script()->nfixed(); ++ ++ // One Value slot is included in sizeof(RematerializedFrame), so we can ++ // reduce the extra slot count by one. However, if there are zero slot ++ // allocations total, then reducing the slots by one will lead to ++ // the memory allocation being smaller than sizeof(RematerializedFrame). ++ if (extraSlots > 0) ++ extraSlots -= 1; ++ ++ size_t numBytes = sizeof(RematerializedFrame) + (extraSlots * sizeof(Value)); ++ MOZ_ASSERT(numBytes >= sizeof(RematerializedFrame)); + + void* buf = cx->pod_calloc(numBytes); + if (!buf) +diff --git js/src/wasm/AsmJS.cpp js/src/wasm/AsmJS.cpp +index a5102bd66373..9fe705976ea3 100644 +--- js/src/wasm/AsmJS.cpp ++++ js/src/wasm/AsmJS.cpp +@@ -851,7 +851,7 @@ class NumLit + private: + Which which_; + union { +- Value scalar_; ++ JS::UninitializedValue scalar_; + SimdConstant simd_; + } u; + +@@ -874,7 +874,7 @@ class NumLit + + int32_t toInt32() const { + MOZ_ASSERT(which_ == Fixnum || which_ == NegativeInt || which_ == BigUnsigned); +- return u.scalar_.toInt32(); ++ return u.scalar_.asValueRef().toInt32(); + } + + uint32_t toUint32() const { +@@ -883,17 +883,17 @@ class NumLit + + double toDouble() const { + MOZ_ASSERT(which_ == Double); +- return u.scalar_.toDouble(); ++ return u.scalar_.asValueRef().toDouble(); + } + + float toFloat() const { + MOZ_ASSERT(which_ == Float); +- return float(u.scalar_.toDouble()); ++ return float(u.scalar_.asValueRef().toDouble()); + } + + Value scalarValue() const { + MOZ_ASSERT(which_ != OutOfRangeInt); +- return u.scalar_; ++ return u.scalar_.asValueRef(); + } + + bool isSimd() const +diff --git js/xpconnect/src/XPCWrappedNative.cpp js/xpconnect/src/XPCWrappedNative.cpp +index fd992eb22465..946d671ddd00 100644 +--- js/xpconnect/src/XPCWrappedNative.cpp ++++ js/xpconnect/src/XPCWrappedNative.cpp +@@ -1723,9 +1723,12 @@ CallMethodHelper::ConvertIndependentParam(uint8_t i) + // indirectly, regardless of in/out-ness. + if (type_tag == nsXPTType::T_JSVAL) { + // Root the value. +- dp->val.j.setUndefined(); +- if (!js::AddRawValueRoot(mCallContext, &dp->val.j, "XPCWrappedNative::CallMethod param")) ++ dp->val.j.asValueRef().setUndefined(); ++ if (!js::AddRawValueRoot(mCallContext, &dp->val.j.asValueRef(), ++ "XPCWrappedNative::CallMethod param")) ++ { + return false; ++ } + } + + // Flag cleanup for anything that isn't self-contained. +diff --git xpcom/reflect/xptcall/xptcall.h xpcom/reflect/xptcall/xptcall.h +index ddab2e4af127..4b387e8ee9c1 100644 +--- xpcom/reflect/xptcall/xptcall.h ++++ xpcom/reflect/xptcall/xptcall.h +@@ -39,7 +39,7 @@ struct nsXPTCMiniVariant + // Types below here are unknown to the assembly implementations, and + // therefore _must_ be passed with indirect semantics. We put them in + // the union here for type safety, so that we can avoid void* tricks. +- JS::Value j; ++ JS::UninitializedValue j; + } val; + }; +