From 91f135ec8da3141b350ab3eb96fc06e5d08b2cb3 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Thu, 17 Apr 2014 01:13:38 +0100 Subject: [PATCH 01/32] Bug 991134 - Output an additional failure line for loadfailed: null failures to make bug 789751 and bug 720452 TBPL starable; r=dbaron --- layout/tools/reftest/reftest.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index 07df84c3815..8a4d61f6e35 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -1687,6 +1687,11 @@ function RecordResult(testRunTime, errorMsg, scriptResults) function LoadFailed(why) { ++gTestResults.FailedLoad; + // Once bug 896840 is fixed, this can go away, but for now it will give log + // output that is TBPL starable for bug 789751 and bug 720452. + if (!why) { + gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | load failed with unknown reason\n"); + } gDumpLog("REFTEST TEST-UNEXPECTED-FAIL | " + gURLs[0]["url" + gState].spec + " | load failed: " + why + "\n"); FlushTestLog(); From b8bdc45d8448a3ff59c1b52aa3fc0bf23b8488b4 Mon Sep 17 00:00:00 2001 From: John Daggett Date: Thu, 17 Apr 2014 09:15:18 +0900 Subject: [PATCH 02/32] Bug 997006 - rename text-combine-horizontal to text-combine-upright. r=dholbert --- layout/style/nsCSSParser.cpp | 16 ++++++++-------- layout/style/nsCSSPropList.h | 10 +++++----- layout/style/nsCSSProps.cpp | 8 ++++---- layout/style/nsCSSProps.h | 2 +- layout/style/nsCSSValue.cpp | 8 ++++---- layout/style/nsComputedDOMStyle.cpp | 12 ++++++------ layout/style/nsComputedDOMStyle.h | 2 +- layout/style/nsComputedDOMStylePropertyList.h | 2 +- layout/style/nsRuleNode.cpp | 10 +++++----- layout/style/nsStyleConsts.h | 10 +++++----- layout/style/nsStyleStruct.cpp | 6 +++--- layout/style/nsStyleStruct.h | 2 +- layout/style/test/property_database.js | 4 ++-- layout/style/test/test_computed_style_prefs.html | 2 +- 14 files changed, 47 insertions(+), 47 deletions(-) diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 5f5a0c82e16..9e90e336b27 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -738,7 +738,7 @@ protected: bool ParseTextAlignLast(nsCSSValue& aValue); bool ParseTextDecoration(); bool ParseTextDecorationLine(nsCSSValue& aValue); - bool ParseTextCombineHorizontal(nsCSSValue& aValue); + bool ParseTextCombineUpright(nsCSSValue& aValue); bool ParseTextOverflow(nsCSSValue& aValue); bool ParseTouchAction(nsCSSValue& aValue); @@ -9322,8 +9322,8 @@ CSSParserImpl::ParseSingleValueProperty(nsCSSValue& aValue, return ParseTextAlignLast(aValue); case eCSSProperty_text_decoration_line: return ParseTextDecorationLine(aValue); - case eCSSProperty_text_combine_horizontal: - return ParseTextCombineHorizontal(aValue); + case eCSSProperty_text_combine_upright: + return ParseTextCombineUpright(aValue); case eCSSProperty_text_overflow: return ParseTextOverflow(aValue); case eCSSProperty_touch_action: @@ -12433,16 +12433,16 @@ CSSParserImpl::ParseTouchAction(nsCSSValue& aValue) } bool -CSSParserImpl::ParseTextCombineHorizontal(nsCSSValue& aValue) +CSSParserImpl::ParseTextCombineUpright(nsCSSValue& aValue) { if (!ParseVariant(aValue, VARIANT_HK, - nsCSSProps::kTextCombineHorizontalKTable)) { + nsCSSProps::kTextCombineUprightKTable)) { return false; } // if 'digits', need to check for an explicit number [2, 3, 4] if (eCSSUnit_Enumerated == aValue.GetUnit() && - aValue.GetIntValue() == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) { + aValue.GetIntValue() == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) { if (!GetToken(true)) { return true; } @@ -12451,11 +12451,11 @@ CSSParserImpl::ParseTextCombineHorizontal(nsCSSValue& aValue) case 2: // already set, nothing to do break; case 3: - aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3, + aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3, eCSSUnit_Enumerated); break; case 4: - aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_4, + aValue.SetIntValue(NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_4, eCSSUnit_Enumerated); break; default: diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index 3e30371cc4a..b78ac87fdb6 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -3011,15 +3011,15 @@ CSS_PROP_SHORTHAND( CSS_PROPERTY_PARSE_FUNCTION, "") CSS_PROP_TEXT( - text-combine-horizontal, - text_combine_horizontal, - TextCombineHorizontal, + text-combine-upright, + text_combine_upright, + TextCombineUpright, CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_PARSER_FUNCTION, "layout.css.vertical-text.enabled", 0, - kTextCombineHorizontalKTable, - offsetof(nsStyleText, mTextCombineHorizontal), + kTextCombineUprightKTable, + offsetof(nsStyleText, mTextCombineUpright), eStyleAnimType_EnumU8) CSS_PROP_TEXTRESET( -moz-text-decoration-color, diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 8231a8f6453..886407141b6 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -1570,10 +1570,10 @@ KTableValue nsCSSProps::kTextAlignLastKTable[] = { eCSSKeyword_UNKNOWN,-1 }; -const KTableValue nsCSSProps::kTextCombineHorizontalKTable[] = { - eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_HORIZ_NONE, - eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_HORIZ_ALL, - eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2, // w/o number ==> 2 +const KTableValue nsCSSProps::kTextCombineUprightKTable[] = { + eCSSKeyword_none, NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE, + eCSSKeyword_all, NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL, + eCSSKeyword_digits, NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2, // w/o number ==> 2 eCSSKeyword_UNKNOWN,-1 }; diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h index 5af9eca2b93..84d90baa03d 100644 --- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -618,7 +618,7 @@ public: // "layout.css.text-align-true-value.enabled" changes: static KTableValue kTextAlignKTable[]; static KTableValue kTextAlignLastKTable[]; - static const KTableValue kTextCombineHorizontalKTable[]; + static const KTableValue kTextCombineUprightKTable[]; static const KTableValue kTextDecorationLineKTable[]; static const KTableValue kTextDecorationStyleKTable[]; static const KTableValue kTextOrientationKTable[]; diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index f5d62dc576d..e0a72032834 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -953,13 +953,13 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult, switch(aProperty) { - case eCSSProperty_text_combine_horizontal: - if (intValue <= NS_STYLE_TEXT_COMBINE_HORIZ_ALL) { + case eCSSProperty_text_combine_upright: + if (intValue <= NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL) { AppendASCIItoUTF16(nsCSSProps::LookupPropertyValue(aProperty, intValue), aResult); - } else if (intValue == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) { + } else if (intValue == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) { aResult.AppendLiteral("digits 2"); - } else if (intValue == NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3) { + } else if (intValue == NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3) { aResult.AppendLiteral("digits 3"); } else { aResult.AppendLiteral("digits 4"); diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index b2837c3d79e..dcf90381c5e 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -3125,18 +3125,18 @@ nsComputedDOMStyle::DoGetTextAlignLast() } CSSValue* -nsComputedDOMStyle::DoGetTextCombineHorizontal() +nsComputedDOMStyle::DoGetTextCombineUpright() { nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue; - uint8_t tch = StyleText()->mTextCombineHorizontal; + uint8_t tch = StyleText()->mTextCombineUpright; - if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_ALL) { + if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL) { val->SetIdent( nsCSSProps::ValueToKeywordEnum(tch, - nsCSSProps::kTextCombineHorizontalKTable)); - } else if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2) { + nsCSSProps::kTextCombineUprightKTable)); + } else if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2) { val->SetString(NS_LITERAL_STRING("digits 2")); - } else if (tch <= NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3) { + } else if (tch <= NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3) { val->SetString(NS_LITERAL_STRING("digits 3")); } else { val->SetString(NS_LITERAL_STRING("digits 4")); diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index 778c091a35f..f4a3a8de174 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -376,7 +376,7 @@ private: mozilla::dom::CSSValue* DoGetLineHeight(); mozilla::dom::CSSValue* DoGetTextAlign(); mozilla::dom::CSSValue* DoGetTextAlignLast(); - mozilla::dom::CSSValue* DoGetTextCombineHorizontal(); + mozilla::dom::CSSValue* DoGetTextCombineUpright(); mozilla::dom::CSSValue* DoGetTextDecoration(); mozilla::dom::CSSValue* DoGetTextDecorationColor(); mozilla::dom::CSSValue* DoGetTextDecorationLine(); diff --git a/layout/style/nsComputedDOMStylePropertyList.h b/layout/style/nsComputedDOMStylePropertyList.h index 7251e1c92b7..e83473a4dc8 100644 --- a/layout/style/nsComputedDOMStylePropertyList.h +++ b/layout/style/nsComputedDOMStylePropertyList.h @@ -195,7 +195,7 @@ COMPUTED_STYLE_PROP(right, Right) //// COMPUTED_STYLE_PROP(size, Size) COMPUTED_STYLE_PROP(table_layout, TableLayout) COMPUTED_STYLE_PROP(text_align, TextAlign) -COMPUTED_STYLE_PROP(text_combine_horizontal, TextCombineHorizontal) +COMPUTED_STYLE_PROP(text_combine_upright, TextCombineUpright) COMPUTED_STYLE_PROP(text_decoration, TextDecoration) COMPUTED_STYLE_PROP(text_indent, TextIndent) COMPUTED_STYLE_PROP(text_orientation, TextOrientation) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index ee6dcc40a16..9f1e295ffc6 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -4261,13 +4261,13 @@ nsRuleNode::ComputeTextData(void* aStartStruct, parentText->mTextOrientation, NS_STYLE_TEXT_ORIENTATION_AUTO, 0, 0, 0, 0); - // text-combine-horizontal: enum, inherit, initial - SetDiscrete(*aRuleData->ValueForTextCombineHorizontal(), - text->mTextCombineHorizontal, + // text-combine-upright: enum, inherit, initial + SetDiscrete(*aRuleData->ValueForTextCombineUpright(), + text->mTextCombineUpright, canStoreInRuleTree, SETDSC_ENUMERATED | SETDSC_UNSET_INHERIT, - parentText->mTextCombineHorizontal, - NS_STYLE_TEXT_COMBINE_HORIZ_NONE, 0, 0, 0, 0); + parentText->mTextCombineUpright, + NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE, 0, 0, 0, 0); COMPUTE_END_INHERITED(Text, text) } diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index e4d23d6a9dc..e2de9998afe 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -843,11 +843,11 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) { #define NS_STYLE_TEXT_ORIENTATION_SIDEWAYS 2 // See nsStyleText -#define NS_STYLE_TEXT_COMBINE_HORIZ_NONE 0 -#define NS_STYLE_TEXT_COMBINE_HORIZ_ALL 1 -#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_2 2 -#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_3 3 -#define NS_STYLE_TEXT_COMBINE_HORIZ_DIGITS_4 4 +#define NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE 0 +#define NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL 1 +#define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2 2 +#define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_3 3 +#define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_4 4 // See nsStyleText #define NS_STYLE_LINE_HEIGHT_BLOCK_HEIGHT 0 diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 3b8004fa84a..12592d5472a 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -3058,7 +3058,7 @@ nsStyleText::nsStyleText(void) mHyphens = NS_STYLE_HYPHENS_MANUAL; mTextSizeAdjust = NS_STYLE_TEXT_SIZE_ADJUST_AUTO; mTextOrientation = NS_STYLE_TEXT_ORIENTATION_AUTO; - mTextCombineHorizontal = NS_STYLE_TEXT_COMBINE_HORIZ_NONE; + mTextCombineUpright = NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE; mControlCharacterVisibility = NS_STYLE_CONTROL_CHARACTER_VISIBILITY_HIDDEN; mLetterSpacing.SetNormalValue(); @@ -3082,7 +3082,7 @@ nsStyleText::nsStyleText(const nsStyleText& aSource) mHyphens(aSource.mHyphens), mTextSizeAdjust(aSource.mTextSizeAdjust), mTextOrientation(aSource.mTextOrientation), - mTextCombineHorizontal(aSource.mTextCombineHorizontal), + mTextCombineUpright(aSource.mTextCombineUpright), mControlCharacterVisibility(aSource.mControlCharacterVisibility), mTabSize(aSource.mTabSize), mWordSpacing(aSource.mWordSpacing), @@ -3107,7 +3107,7 @@ nsChangeHint nsStyleText::CalcDifference(const nsStyleText& aOther) const return NS_STYLE_HINT_FRAMECHANGE; } - if (mTextCombineHorizontal != aOther.mTextCombineHorizontal || + if (mTextCombineUpright != aOther.mTextCombineUpright || mControlCharacterVisibility != aOther.mControlCharacterVisibility) { return nsChangeHint_ReconstructFrame; } diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 013d5a5a1c7..df7287e69de 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -1526,7 +1526,7 @@ struct nsStyleText { uint8_t mHyphens; // [inherited] see nsStyleConsts.h uint8_t mTextSizeAdjust; // [inherited] see nsStyleConsts.h uint8_t mTextOrientation; // [inherited] see nsStyleConsts.h - uint8_t mTextCombineHorizontal; // [inherited] see nsStyleConsts.h + uint8_t mTextCombineUpright; // [inherited] see nsStyleConsts.h uint8_t mControlCharacterVisibility; // [inherited] see nsStyleConsts.h int32_t mTabSize; // [inherited] see nsStyleConsts.h diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 7abea943840..b5ba594a87f 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -4398,8 +4398,8 @@ if (SpecialPowers.getBoolPref("layout.css.vertical-text.enabled")) { other_values: [ "upright", "sideways" ], invalid_values: [ "none", "3em" ] }, - "text-combine-horizontal": { - domProp: "textCombineHorizontal", + "text-combine-upright": { + domProp: "textCombineUpright", inherited: true, type: CSS_TYPE_LONGHAND, initial_values: [ "none" ], diff --git a/layout/style/test/test_computed_style_prefs.html b/layout/style/test/test_computed_style_prefs.html index 12b64c8163c..f34002a2f10 100644 --- a/layout/style/test/test_computed_style_prefs.html +++ b/layout/style/test/test_computed_style_prefs.html @@ -68,7 +68,7 @@ function step() { // ---- var gProps = { - "layout.css.vertical-text.enabled": ["text-combine-horizontal", "text-orientation", "writing-mode"], + "layout.css.vertical-text.enabled": ["text-combine-upright", "text-orientation", "writing-mode"], "layout.css.font-features.enabled": ["font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"], "layout.css.image-orientation.enabled": ["image-orientation"], "layout.css.mix-blend-mode.enabled": ["mix-blend-mode"], From 2a86d08969aed2fff00eeb96e08064648c41e6d0 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Thu, 17 Apr 2014 12:45:25 +1200 Subject: [PATCH 03/32] Bug 996929 - Implement OptimizeSourceSurface for all Moz2D backends. r=Bas --- gfx/2d/DrawTargetCG.cpp | 6 +++++- gfx/2d/DrawTargetD2D.cpp | 23 +++++++++++++++++++++-- gfx/2d/DrawTargetD2D1.cpp | 28 ++++++++++++++++++++++++++++ gfx/2d/DrawTargetD2D1.h | 2 +- gfx/2d/DrawTargetSkia.cpp | 11 +---------- 5 files changed, 56 insertions(+), 14 deletions(-) diff --git a/gfx/2d/DrawTargetCG.cpp b/gfx/2d/DrawTargetCG.cpp index 33215ff4231..a0aa1a165bd 100644 --- a/gfx/2d/DrawTargetCG.cpp +++ b/gfx/2d/DrawTargetCG.cpp @@ -229,7 +229,11 @@ GetRetainedImageFromSourceSurface(SourceSurface *aSurface) TemporaryRef DrawTargetCG::OptimizeSourceSurface(SourceSurface *aSurface) const { - return nullptr; + if (aSurface->GetType() == SurfaceType::COREGRAPHICS_IMAGE || + aSurface->GetType() == SurfaceType::COREGRAPHICS_CGCONTEXT) { + return aSurface; + } + return aSurface->GetDataSurface(); } class UnboundnessFixer diff --git a/gfx/2d/DrawTargetD2D.cpp b/gfx/2d/DrawTargetD2D.cpp index 8c198992355..837257976d2 100644 --- a/gfx/2d/DrawTargetD2D.cpp +++ b/gfx/2d/DrawTargetD2D.cpp @@ -1204,8 +1204,27 @@ DrawTargetD2D::CreateSourceSurfaceFromData(unsigned char *aData, TemporaryRef DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const { - // Unsupported! - return nullptr; + if (aSurface->GetType() == SurfaceType::D2D1_BITMAP || + aSurface->GetType() == SurfaceType::D2D1_DRAWTARGET) { + return aSurface; + } + + RefPtr data = aSurface->GetDataSurface(); + + DataSourceSurface::MappedSurface map; + if (!data->Map(DataSourceSurface::MapType::READ, &map)) { + return nullptr; + } + + RefPtr newSurf = new SourceSurfaceD2D(); + bool success = newSurf->InitFromData(map.mData, data->GetSize(), map.mStride, data->GetFormat(), mRT); + + data->Unmap(); + + if (!success) { + return nullptr; + } + return newSurf; } TemporaryRef diff --git a/gfx/2d/DrawTargetD2D1.cpp b/gfx/2d/DrawTargetD2D1.cpp index 67e90b7290f..6ec80386601 100644 --- a/gfx/2d/DrawTargetD2D1.cpp +++ b/gfx/2d/DrawTargetD2D1.cpp @@ -921,6 +921,34 @@ DrawTargetD2D1::GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTrans return image; } +TemporaryRef +DrawTargetD2D1::OptimizeSourceSurface(SourceSurface* aSurface) const +{ + if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) { + return aSurface; + } + + RefPtr data = aSurface->GetDataSurface(); + + DataSourceSurface::MappedSurface map; + if (!data->Map(DataSourceSurface::MapType::READ, &map)) { + return nullptr; + } + + RefPtr bitmap; + HRESULT hr = mDC->CreateBitmap(D2DIntSize(data->GetSize()), map.mData, map.mStride, + D2D1::BitmapProperties1(D2D1_BITMAP_OPTIONS_NONE, D2DPixelFormat(data->GetFormat())), + byRef(bitmap)); + + data->Unmap(); + + if (!bitmap) { + return nullptr; + } + + return new SourceSurfaceD2D1(bitmap.get(), mDC, data->GetFormat(), data->GetSize()); +} + void DrawTargetD2D1::PushD2DLayer(ID2D1DeviceContext *aDC, ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform) { diff --git a/gfx/2d/DrawTargetD2D1.h b/gfx/2d/DrawTargetD2D1.h index c2105054e1e..b6df8423fb2 100644 --- a/gfx/2d/DrawTargetD2D1.h +++ b/gfx/2d/DrawTargetD2D1.h @@ -104,7 +104,7 @@ public: const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const; - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const { return nullptr; } + virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const; virtual TemporaryRef CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { return nullptr; } diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp index 88b48a8028f..3a7ff49462f 100644 --- a/gfx/2d/DrawTargetSkia.cpp +++ b/gfx/2d/DrawTargetSkia.cpp @@ -602,16 +602,7 @@ DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const return aSurface; } - if (aSurface->GetType() != SurfaceType::DATA) { - return nullptr; - } - - RefPtr data = aSurface->GetDataSurface(); - RefPtr surface = CreateSourceSurfaceFromData(data->GetData(), - data->GetSize(), - data->Stride(), - data->GetFormat()); - return data.forget(); + return aSurface->GetDataSurface(); } TemporaryRef From ccd9122f9260a840849bb151805ff79a4abf33f9 Mon Sep 17 00:00:00 2001 From: Ethan Tseng Date: Wed, 16 Apr 2014 21:07:17 +0800 Subject: [PATCH 04/32] Bug 877193 - Reduce memory usage for RTSP streaming. r=sworkman --- content/media/RtspMediaResource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/media/RtspMediaResource.cpp b/content/media/RtspMediaResource.cpp index 9ad0e504421..add23c2c184 100644 --- a/content/media/RtspMediaResource.cpp +++ b/content/media/RtspMediaResource.cpp @@ -37,7 +37,7 @@ namespace mozilla { * Even though the ring buffer is divided into fixed size slots, it still can * store the data which size is larger than one slot size. * */ -#define BUFFER_SLOT_NUM 8192 +#define BUFFER_SLOT_NUM 512 #define BUFFER_SLOT_DEFAULT_SIZE 256 #define BUFFER_SLOT_MAX_SIZE 8192 #define BUFFER_SLOT_INVALID -1 From ef3f3c16243023f7fccaf68d7e3b51fbe6dbfc74 Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Thu, 17 Apr 2014 00:11:28 +1000 Subject: [PATCH 05/32] Bug 898963 - Odinmonkey (ARM): Optimize asm.js FFI calls to Ion functions, trim regs saved, inline activation and deactivation. r=luke --- js/src/jit/AsmJS.cpp | 218 +++++++++++++++++++-------- js/src/jit/AsmJSModule.cpp | 22 --- js/src/jit/arm/Assembler-arm.h | 17 ++- js/src/jit/shared/Assembler-shared.h | 2 - js/src/jit/x64/Assembler-x64.h | 14 ++ js/src/jit/x86/Assembler-x86.h | 14 ++ js/src/jscntxt.h | 4 + js/src/vm/Runtime.h | 3 + js/src/vm/Stack.cpp | 3 + js/src/vm/Stack.h | 10 ++ 10 files changed, 223 insertions(+), 84 deletions(-) diff --git a/js/src/jit/AsmJS.cpp b/js/src/jit/AsmJS.cpp index 6ff73406b19..972339957c1 100644 --- a/js/src/jit/AsmJS.cpp +++ b/js/src/jit/AsmJS.cpp @@ -6024,15 +6024,20 @@ StackArgBytes(const VectorT &argTypes) return iter.stackBytesConsumedSoFar(); } +static unsigned +StackDecrementForCall(MacroAssembler &masm, unsigned bytesToPush) +{ + // Include extra padding so that, after pushing the bytesToPush, + // the stack is aligned for a call instruction. + unsigned alreadyPushed = AlignmentAtPrologue + masm.framePushed(); + return AlignBytes(alreadyPushed + bytesToPush, StackAlignment) - alreadyPushed; +} + template static unsigned StackDecrementForCall(MacroAssembler &masm, const VectorT &argTypes, unsigned extraBytes = 0) { - // Include extra padding so that, after pushing the arguments and - // extraBytes, the stack is aligned for a call instruction. - unsigned argBytes = StackArgBytes(argTypes); - unsigned alreadyPushed = AlignmentAtPrologue + masm.framePushed(); - return AlignBytes(alreadyPushed + extraBytes + argBytes, StackAlignment) - alreadyPushed; + return StackDecrementForCall(masm, StackArgBytes(argTypes) + extraBytes); } static const unsigned FramePushedAfterSave = NonVolatileRegs.gprs().size() * sizeof(intptr_t) + @@ -6452,11 +6457,8 @@ GenerateOOLConvert(ModuleCompiler &m, RetType retType, Label *throwLabel) MIRTypeVector callArgTypes(m.cx()); callArgTypes.infallibleAppend(typeArray, ArrayLength(typeArray)); - // Reserve space for a call to InvokeFromAsmJS_* and an array of values - // passed to this FFI call. - unsigned arraySize = sizeof(Value); - unsigned stackDec = StackDecrementForCall(masm, callArgTypes, arraySize); - masm.reserveStack(stackDec); + // The stack is assumed to be aligned. The frame is allocated by GenerateFFIIonExit and + // the stack usage here needs to kept in sync with GenerateFFIIonExit. // Store value unsigned offsetToArgv = StackArgBytes(callArgTypes); @@ -6504,8 +6506,6 @@ GenerateOOLConvert(ModuleCompiler &m, RetType retType, Label *throwLabel) default: MOZ_ASSUME_UNREACHABLE("Unsupported convert type"); } - - masm.freeStack(stackDec); } static void @@ -6517,29 +6517,57 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit m.setIonExitOffset(exitIndex); masm.setFramePushed(0); - RegisterSet restoreSet = RegisterSet::Intersect(RegisterSet::All(), - RegisterSet::Not(RegisterSet::Volatile())); -#if defined(JS_CODEGEN_ARM) - masm.Push(lr); +#if defined(JS_CODEGEN_X64) + masm.Push(HeapReg); +#elif defined(JS_CODEGEN_ARM) + // The lr register holds the return address and needs to be saved. The GlobalReg + // (r10) and HeapReg (r11) also need to be restored before returning to asm.js code. + // The NANReg also needs to be restored, but is a constant and is reloaded before + // returning to asm.js code. + masm.PushRegsInMask(RegisterSet(GeneralRegisterSet((1<cx(); + // Activation *act = cx->mainThread().activation(); + // act.active_ = true; + // act.prevIonTop_ = cx->mainThread().ionTop; + // act.prevJitJSContext_ = cx->mainThread().jitJSContext; + // cx->mainThread().jitJSContext = cx; + // On the ARM store8() uses the secondScratchReg (lr) as a temp. + size_t offsetOfActivation = offsetof(JSRuntime, mainThread) + + PerThreadData::offsetOfActivation(); + size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop); + size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) + + offsetof(PerThreadData, jitJSContext); + masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg3); + masm.loadPtr(Address(reg3, JSContext::offsetOfRuntime()), reg0); + masm.loadPtr(Address(reg0, offsetOfActivation), reg1); + masm.store8(Imm32(1), Address(reg1, JitActivation::offsetOfActiveUint8())); + masm.loadPtr(Address(reg0, offsetOfIonTop), reg2); + masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevIonTop())); + masm.loadPtr(Address(reg0, offsetOfJitJSContext), reg2); + masm.storePtr(reg2, Address(reg1, JitActivation::offsetOfPrevJitJSContext())); + masm.storePtr(reg3, Address(reg0, offsetOfJitJSContext)); + } // 2. Call -#if defined(JS_CODEGEN_ARM) && defined(DEBUG) - // ARM still needs to push, before stack is aligned - masm.Push(scratch); + AssertStackAlignment(masm); +#if defined(JS_CODEGEN_ARM) + masm.ma_callIonNoPush(callee); + // The return address has been popped from the stack, so adjust the stack + // without changing the frame-pushed counter to keep the stack aligned. + masm.subPtr(Imm32(4), sp); +#else + masm.callIon(callee); #endif AssertStackAlignment(masm); -#if defined(JS_CODEGEN_ARM) && defined(DEBUG) - masm.freeStack(sizeof(size_t)); -#endif - masm.callIon(scratch); - masm.freeStack(stackDec - extraBytes); - masm.push(JSReturnReg_Type); - masm.push(JSReturnReg_Data); - LoadAsmJSActivationIntoRegister(masm, callee); - masm.setupUnalignedABICall(1, scratch); - masm.passABIArg(callee); - masm.callWithABI(AsmJSImm_DisableActivationFromAsmJS); - masm.pop(JSReturnReg_Data); - masm.pop(JSReturnReg_Type); + { + // Disable Activation. + // + // This sequence needs three registers, and must preserve the JSReturnReg_Data and + // JSReturnReg_Type, so there are five live registers. + JS_ASSERT(JSReturnReg_Data == AsmJSIonExitRegReturnData); + JS_ASSERT(JSReturnReg_Type == AsmJSIonExitRegReturnType); + Register reg0 = AsmJSIonExitRegD0; + Register reg1 = AsmJSIonExitRegD1; + Register reg2 = AsmJSIonExitRegD2; + + LoadAsmJSActivationIntoRegister(masm, reg0); + + // The following is inlined: + // JSContext *cx = activation->cx(); + // Activation *act = cx->mainThread().activation(); + // act.active_ = false; + // cx->mainThread().ionTop = prevIonTop_; + // cx->mainThread().jitJSContext = prevJitJSContext_; + // On the ARM store8() uses the secondScratchReg (lr) as a temp. + size_t offsetOfActivation = offsetof(JSRuntime, mainThread) + + PerThreadData::offsetOfActivation(); + size_t offsetOfIonTop = offsetof(JSRuntime, mainThread) + offsetof(PerThreadData, ionTop); + size_t offsetOfJitJSContext = offsetof(JSRuntime, mainThread) + + offsetof(PerThreadData, jitJSContext); + masm.loadPtr(Address(reg0, AsmJSActivation::offsetOfContext()), reg0); + masm.loadPtr(Address(reg0, JSContext::offsetOfRuntime()), reg0); + masm.loadPtr(Address(reg0, offsetOfActivation), reg1); + masm.store8(Imm32(0), Address(reg1, JitActivation::offsetOfActiveUint8())); + masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevIonTop()), reg2); + masm.storePtr(reg2, Address(reg0, offsetOfIonTop)); + masm.loadPtr(Address(reg1, JitActivation::offsetOfPrevJitJSContext()), reg2); + masm.storePtr(reg2, Address(reg0, offsetOfJitJSContext)); + } #ifdef DEBUG masm.branchTestMagicValue(Assembler::Equal, JSReturnOperand, JS_ION_ERROR, throwLabel); @@ -6645,8 +6733,20 @@ GenerateFFIIonExit(ModuleCompiler &m, const ModuleCompiler::ExitDescriptor &exit } masm.bind(&done); - masm.PopRegsInMask(restoreSet); + masm.freeStack(stackDec); +#if defined(JS_CODEGEN_ARM) + masm.ma_vimm(GenericNaN(), NANReg); + masm.PopRegsInMask(RegisterSet(GeneralRegisterSet((1<cx(); - Activation *act = cx->mainThread().activation(); - JS_ASSERT(act->isJit()); - act->asJit()->setActive(cx); -} - -static void -DisableActivationFromAsmJS(AsmJSActivation *activation) -{ - JSContext *cx = activation->cx(); - Activation *act = cx->mainThread().activation(); - JS_ASSERT(act->isJit()); - act->asJit()->setActive(cx, false); -} - namespace js { // Defined in AsmJS.cpp: @@ -242,10 +224,6 @@ AddressOf(AsmJSImmKind kind, ExclusiveContext *cx) return RedirectCall(FuncCast(CoerceInPlace_ToNumber), Args_General2); case AsmJSImm_ToInt32: return RedirectCall(FuncCast(js::ToInt32), Args_Int_Double); - case AsmJSImm_EnableActivationFromAsmJS: - return RedirectCall(FuncCast(EnableActivationFromAsmJS), Args_General1); - case AsmJSImm_DisableActivationFromAsmJS: - return RedirectCall(FuncCast(DisableActivationFromAsmJS), Args_General1); #if defined(JS_CODEGEN_ARM) case AsmJSImm_aeabi_idivmod: return RedirectCall(FuncCast(__aeabi_idivmod), Args_General2); diff --git a/js/src/jit/arm/Assembler-arm.h b/js/src/jit/arm/Assembler-arm.h index 454f9536a21..091b2af4125 100644 --- a/js/src/jit/arm/Assembler-arm.h +++ b/js/src/jit/arm/Assembler-arm.h @@ -80,7 +80,6 @@ class ABIArgGenerator uint32_t stackBytesConsumedSoFar() const { return stackOffset_; } static const Register NonArgReturnVolatileReg0; static const Register NonArgReturnVolatileReg1; - }; static MOZ_CONSTEXPR_VAR Register PreBarrierReg = r1; @@ -98,6 +97,22 @@ static MOZ_CONSTEXPR_VAR FloatRegister ScratchFloatReg = { FloatRegisters::d15 } static MOZ_CONSTEXPR_VAR FloatRegister NANReg = { FloatRegisters::d14 }; +// Registers used in the GenerateFFIIonExit Enable Activation block. +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = r4; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = r0; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = r1; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = r2; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = r3; + +// Registers used in the GenerateFFIIonExit Disable Activation block. +// None of these may be the second scratch register (lr). +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = r2; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = r3; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = r0; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = r1; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = r4; + + static MOZ_CONSTEXPR_VAR FloatRegister d0 = {FloatRegisters::d0}; static MOZ_CONSTEXPR_VAR FloatRegister d1 = {FloatRegisters::d1}; static MOZ_CONSTEXPR_VAR FloatRegister d2 = {FloatRegisters::d2}; diff --git a/js/src/jit/shared/Assembler-shared.h b/js/src/jit/shared/Assembler-shared.h index d9e1770d8fa..b4e53333375 100644 --- a/js/src/jit/shared/Assembler-shared.h +++ b/js/src/jit/shared/Assembler-shared.h @@ -690,8 +690,6 @@ enum AsmJSImmKind AsmJSImm_CoerceInPlace_ToInt32, AsmJSImm_CoerceInPlace_ToNumber, AsmJSImm_ToInt32, - AsmJSImm_EnableActivationFromAsmJS, - AsmJSImm_DisableActivationFromAsmJS, #if defined(JS_CODEGEN_ARM) AsmJSImm_aeabi_idivmod, AsmJSImm_aeabi_uidivmod, diff --git a/js/src/jit/x64/Assembler-x64.h b/js/src/jit/x64/Assembler-x64.h index d77de0b1476..f198a59fcf3 100644 --- a/js/src/jit/x64/Assembler-x64.h +++ b/js/src/jit/x64/Assembler-x64.h @@ -136,6 +136,20 @@ static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_temp0 = rbx; static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_temp1 = rcx; static MOZ_CONSTEXPR_VAR Register ForkJoinGetSliceReg_output = rsi; +// Registers used in the GenerateFFIIonExit Enable Activation block. +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = r10; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = rax; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = rdi; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = rbx; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = rsi; + +// Registers used in the GenerateFFIIonExit Disable Activation block. +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = ecx; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = ecx; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = rax; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = rdi; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = rbx; + class ABIArgGenerator { #if defined(XP_WIN) diff --git a/js/src/jit/x86/Assembler-x86.h b/js/src/jit/x86/Assembler-x86.h index 2cc3e0e7174..0dc09f9e53b 100644 --- a/js/src/jit/x86/Assembler-x86.h +++ b/js/src/jit/x86/Assembler-x86.h @@ -87,6 +87,20 @@ class ABIArgGenerator static MOZ_CONSTEXPR_VAR Register OsrFrameReg = edx; static MOZ_CONSTEXPR_VAR Register PreBarrierReg = edx; +// Registers used in the GenerateFFIIonExit Enable Activation block. +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegCallee = ecx; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE0 = edi; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE1 = eax; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE2 = ebx; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegE3 = edx; + +// Registers used in the GenerateFFIIonExit Disable Activation block. +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnData = edx; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegReturnType = ecx; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD0 = edi; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD1 = eax; +static MOZ_CONSTEXPR_VAR Register AsmJSIonExitRegD2 = esi; + // GCC stack is aligned on 16 bytes, but we don't maintain the invariant in // jitted code. #if defined(__GNUC__) diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index 6438e032d45..3e8ac11b9c2 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -408,6 +408,10 @@ struct JSContext : public js::ExclusiveContext, JSRuntime *runtime() const { return runtime_; } js::PerThreadData &mainThread() const { return runtime()->mainThread; } + static size_t offsetOfRuntime() { + return offsetof(JSContext, runtime_); + } + friend class js::ExclusiveContext; friend class JS::AutoSaveExceptionState; diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index 18639de0459..921c0a27117 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -583,6 +583,9 @@ class PerThreadData : public PerThreadDataFriendFields static unsigned offsetOfAsmJSActivationStackReadOnly() { return offsetof(PerThreadData, asmJSActivationStack_); } + static unsigned offsetOfActivation() { + return offsetof(PerThreadData, activation_); + } js::AsmJSActivation *asmJSActivationStackFromAnyThread() const { return asmJSActivationStack_; diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp index 118694ac5f8..200d1924963 100644 --- a/js/src/vm/Stack.cpp +++ b/js/src/vm/Stack.cpp @@ -1516,6 +1516,9 @@ jit::JitActivation::~JitActivation() } } +// setActive() is inlined in GenerateFFIIonExit() with explicit masm instructions so +// changes to the logic here need to be reflected in GenerateFFIIonExit() in the enable +// and disable activation instruction sequences. void jit::JitActivation::setActive(JSContext *cx, bool active) { diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h index 3a0201c056b..3b325e26316 100644 --- a/js/src/vm/Stack.h +++ b/js/src/vm/Stack.h @@ -1335,6 +1335,16 @@ class JitActivation : public Activation bool firstFrameIsConstructing() const { return firstFrameIsConstructing_; } + static size_t offsetOfPrevIonTop() { + return offsetof(JitActivation, prevIonTop_); + } + static size_t offsetOfPrevJitJSContext() { + return offsetof(JitActivation, prevJitJSContext_); + } + static size_t offsetOfActiveUint8() { + JS_ASSERT(sizeof(bool) == 1); + return offsetof(JitActivation, active_); + } #ifdef CHECK_OSIPOINT_REGISTERS void setCheckRegs(bool check) { From 9977d8ee22797cbb038d2084e9a5063e6b86eb65 Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Wed, 26 Mar 2014 00:29:10 +1100 Subject: [PATCH 06/32] Bug 898963 - Odinmonkey (ARM): Refactor GenerateFFIInterpreterExit. r=luke --- js/src/jit/AsmJS.cpp | 59 +++----------------------------------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/js/src/jit/AsmJS.cpp b/js/src/jit/AsmJS.cpp index 972339957c1..a196590a891 100644 --- a/js/src/jit/AsmJS.cpp +++ b/js/src/jit/AsmJS.cpp @@ -6305,8 +6305,10 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript masm.align(CodeAlignment); m.setInterpExitOffset(exitIndex); masm.setFramePushed(0); +#if defined(JS_CODEGEN_ARM) + masm.Push(lr); +#endif -#if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) MIRType typeArray[] = { MIRType_Pointer, // cx MIRType_Pointer, // exitDatum MIRType_Int32, // argc @@ -6321,7 +6323,7 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript masm.reserveStack(stackDec); // Fill the argument array. - unsigned offsetToCallerStackArgs = NativeFrameSize + masm.framePushed(); + unsigned offsetToCallerStackArgs = AlignmentAtPrologue + masm.framePushed(); unsigned offsetToArgv = StackArgBytes(invokeArgTypes); Register scratch = ABIArgGenerator::NonArgReturnVolatileReg0; FillArgumentArray(m, exit.sig().args(), offsetToArgv, offsetToCallerStackArgs, scratch); @@ -6392,59 +6394,6 @@ GenerateFFIInterpreterExit(ModuleCompiler &m, const ModuleCompiler::ExitDescript // registers to restore. masm.freeStack(stackDec); masm.ret(); -#else - const unsigned arrayLength = Max(1, exit.sig().args().length()); - const unsigned arraySize = arrayLength * sizeof(Value); - const unsigned reserveSize = AlignBytes(arraySize, StackAlignment) + - ShadowStackSpace; - const unsigned callerArgsOffset = reserveSize + NativeFrameSize + sizeof(int32_t); - masm.setFramePushed(0); - masm.Push(lr); - masm.reserveStack(reserveSize + sizeof(int32_t)); - - // Store arguments - FillArgumentArray(m, exit.sig().args(), ShadowStackSpace, callerArgsOffset, IntArgReg0); - - // argument 0: cx - Register activation = IntArgReg3; - LoadAsmJSActivationIntoRegister(masm, activation); - - LoadJSContextFromActivation(masm, activation, IntArgReg0); - - // argument 1: exitIndex - masm.mov(ImmWord(exitIndex), IntArgReg1); - - // argument 2: argc - masm.mov(ImmWord(exit.sig().args().length()), IntArgReg2); - - // argument 3: argv - Address argv(StackPointer, ShadowStackSpace); - masm.lea(Operand(argv), IntArgReg3); - - AssertStackAlignment(masm); - switch (exit.sig().retType().which()) { - case RetType::Void: - masm.call(AsmJSImm_InvokeFromAsmJS_Ignore); - masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel); - break; - case RetType::Signed: - masm.call(AsmJSImm_InvokeFromAsmJS_ToInt32); - masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel); - masm.unboxInt32(argv, ReturnReg); - break; - case RetType::Double: - masm.call(AsmJSImm_InvokeFromAsmJS_ToNumber); - masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel); - masm.loadDouble(argv, ReturnFloatReg); - break; - case RetType::Float: - MOZ_ASSUME_UNREACHABLE("Float32 shouldn't be returned from a FFI"); - break; - } - - masm.freeStack(reserveSize + sizeof(int32_t)); - masm.ret(); -#endif } static void From ddbaf239ccff82b0230ecb25f99e3381afec95a9 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Wed, 16 Apr 2014 20:56:20 -0400 Subject: [PATCH 07/32] Bug 957666 - Send back a huge retry reconnection time in delayedServerEvents.sjs. r=ehsan --- content/base/test/delayedServerEvents.sjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/base/test/delayedServerEvents.sjs b/content/base/test/delayedServerEvents.sjs index 9491af2e79d..c2d2f5dd9c1 100644 --- a/content/base/test/delayedServerEvents.sjs +++ b/content/base/test/delayedServerEvents.sjs @@ -1,7 +1,7 @@ // this will take strings_to_send.length*500 ms = 5 sec var timer = null; -var strings_to_send = ["data\r\n\nda", "ta", ":", "de", "layed1\n\n", +var strings_to_send = ["retry:999999999\ndata\r\n\nda", "ta", ":", "de", "layed1\n\n", "", "", "data:delayed2\n\n", "", ""]; From f63d8ff6557a505dfcdf4567ed0eccbb0d09150d Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 16 Apr 2014 20:56:20 -0400 Subject: [PATCH 08/32] Bug 992185 - Download location preference field not initializing properly. r=gavin --- browser/components/preferences/in-content/main.xul | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/browser/components/preferences/in-content/main.xul b/browser/components/preferences/in-content/main.xul index be7d4fd52fa..e22df5003f3 100644 --- a/browser/components/preferences/in-content/main.xul +++ b/browser/components/preferences/in-content/main.xul @@ -34,14 +34,14 @@ + + - -