From 40a4aca24a6026ee0939f2849110c3b9285cd777 Mon Sep 17 00:00:00 2001 From: Gabriel Luong Date: Fri, 16 Feb 2018 10:32:26 -0500 Subject: [PATCH 01/48] Bug 1438002 - Add title tooltips to the inspector sidebar tabs. r=Honza --- devtools/client/shared/components/tabs/Tabs.js | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/client/shared/components/tabs/Tabs.js b/devtools/client/shared/components/tabs/Tabs.js index 03cef3fec673..83aa049d6e6e 100644 --- a/devtools/client/shared/components/tabs/Tabs.js +++ b/devtools/client/shared/components/tabs/Tabs.js @@ -303,6 +303,7 @@ define(function (require, exports, module) { dom.a({ id: id ? id + "-tab" : "tab-" + index, tabIndex: isTabSelected ? 0 : -1, + title, "aria-controls": id ? id + "-panel" : "panel-" + index, "aria-selected": isTabSelected, role: "tab", From 76af6943e70c0bb86d734c4b5ef85d1f6c39d314 Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Fri, 16 Feb 2018 08:39:51 -0700 Subject: [PATCH 02/48] Bug 1433163 - Increase android reftest test chunks; r=jmaher --- taskcluster/ci/test/reftest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taskcluster/ci/test/reftest.yml b/taskcluster/ci/test/reftest.yml index 8ddd983d88aa..333f151eecc9 100644 --- a/taskcluster/ci/test/reftest.yml +++ b/taskcluster/ci/test/reftest.yml @@ -98,8 +98,8 @@ reftest: virtualization: virtual-with-gpu chunks: by-test-platform: - android-4.3-arm7-api-16/debug: 48 - android.*: 24 + android-4.3-arm7-api-16/debug: 56 + android.*: 28 macosx64.*/opt: 1 macosx64.*/debug: 2 windows10-64.*/opt: 1 From 2f1b4e91af8215eb3a4818fe585d145552154212 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Fri, 16 Feb 2018 16:26:29 +0100 Subject: [PATCH 03/48] Bug 1425580 part 11 - Devirtualize LNode print/dump methods. r=nbp --HG-- extra : rebase_source : bd06c75bc1fa0b9d58986a74097eee5367f7db25 --- js/src/jit/CodeGenerator.cpp | 4 +- js/src/jit/LIR.cpp | 16 ++++++ js/src/jit/LIR.h | 12 ++-- js/src/jit/arm/LIR-arm.h | 6 +- js/src/jit/arm64/LIR-arm64.h | 4 +- js/src/jit/none/LIR-none.h | 2 +- js/src/jit/shared/LIR-shared.h | 80 +++++++++++++------------- js/src/jit/x64/LIR-x64.h | 6 +- js/src/jit/x86-shared/LIR-x86-shared.h | 8 +-- js/src/jit/x86/LIR-x86.h | 6 +- 10 files changed, 82 insertions(+), 62 deletions(-) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 3e0365c1578e..f6de5d086bb4 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -5346,7 +5346,7 @@ struct ScriptCountBlockState { // Prefix stream of assembly instructions with their LIR instruction // name and any associated high level info. - if (const char* extra = ins->extraName()) + if (const char* extra = ins->getExtraName()) printer.printf("[%s:%s]\n", ins->opName(), extra); else printer.printf("[%s]\n", ins->opName()); @@ -5681,7 +5681,7 @@ CodeGenerator::generateBody() #ifdef JS_JITSPEW JitSpewStart(JitSpew_Codegen, "instruction %s", iter->opName()); - if (const char* extra = iter->extraName()) + if (const char* extra = iter->getExtraName()) JitSpewCont(JitSpew_Codegen, ":%s", extra); JitSpewFin(JitSpew_Codegen); #endif diff --git a/js/src/jit/LIR.cpp b/js/src/jit/LIR.cpp index 3806090f939a..310b466101f9 100644 --- a/js/src/jit/LIR.cpp +++ b/js/src/jit/LIR.cpp @@ -484,6 +484,11 @@ LDefinition::dump() const void LNode::printOperands(GenericPrinter& out) { + if (isMoveGroup()) { + toMoveGroup()->printOperands(out); + return; + } + size_t numOperands = isPhi() ? toPhi()->numOperands() : toInstruction()->numOperands(); for (size_t i = 0; i < numOperands; i++) { @@ -596,6 +601,17 @@ LNode::dump() out.finish(); } +const char* +LNode::getExtraName() const +{ + switch (op()) { + default: MOZ_CRASH("Unexpected LIR op"); +# define LIROP(x) case LNode::LOp_##x: return to##x()->extraName(); + LIR_OPCODE_LIST(LIROP) +# undef LIROP + } +} + void LInstruction::initSafepoint(TempAllocator& alloc) { diff --git a/js/src/jit/LIR.h b/js/src/jit/LIR.h index 86600f2abdef..2ff4421d7d28 100644 --- a/js/src/jit/LIR.h +++ b/js/src/jit/LIR.h @@ -710,10 +710,14 @@ class LNode // Hook for opcodes to add extra high level detail about what code will be // emitted for the op. - virtual const char* extraName() const { + private: + const char* extraName() const { return nullptr; } + public: + const char* getExtraName() const; + virtual Opcode op() const = 0; bool isInstruction() const { @@ -766,11 +770,11 @@ class LNode // output register will be restored to its original value when bailing out. inline bool recoversInput() const; - virtual void dump(GenericPrinter& out); + void dump(GenericPrinter& out); void dump(); static void printName(GenericPrinter& out, Opcode op); - virtual void printName(GenericPrinter& out); - virtual void printOperands(GenericPrinter& out); + void printName(GenericPrinter& out); + void printOperands(GenericPrinter& out); public: // Opcode testing and casts. diff --git a/js/src/jit/arm/LIR-arm.h b/js/src/jit/arm/LIR-arm.h index ef99d890392e..91ad699a09be 100644 --- a/js/src/jit/arm/LIR-arm.h +++ b/js/src/jit/arm/LIR-arm.h @@ -27,7 +27,7 @@ class LBoxFloatingPoint : public LInstructionHelper<2, 1, 1> MIRType type() const { return type_; } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(type_); } }; @@ -46,7 +46,7 @@ class LUnbox : public LInstructionHelper<1, 2, 0> const LAllocation* type() { return getOperand(1); } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(mir()->type()); } }; @@ -73,7 +73,7 @@ class LUnboxFloatingPoint : public LInstructionHelper<1, 2, 0> MIRType type() const { return type_; } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(type_); } }; diff --git a/js/src/jit/arm64/LIR-arm64.h b/js/src/jit/arm64/LIR-arm64.h index 313c3cb25fdb..7cfb784c042a 100644 --- a/js/src/jit/arm64/LIR-arm64.h +++ b/js/src/jit/arm64/LIR-arm64.h @@ -33,7 +33,7 @@ class LUnbox : public LUnboxBase : LUnboxBase(input) { } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(mir()->type()); } }; @@ -53,7 +53,7 @@ class LUnboxFloatingPoint : public LUnboxBase MIRType type() const { return type_; } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(type_); } }; diff --git a/js/src/jit/none/LIR-none.h b/js/src/jit/none/LIR-none.h index 1ff5329cb60a..617ee493488a 100644 --- a/js/src/jit/none/LIR-none.h +++ b/js/src/jit/none/LIR-none.h @@ -56,7 +56,7 @@ class LUnbox : public LInstructionHelper<1, 2, 0> MUnbox* mir() const { MOZ_CRASH(); } const LAllocation* payload() { MOZ_CRASH(); } const LAllocation* type() { MOZ_CRASH(); } - const char* extraName() const override { MOZ_CRASH(); } + const char* extraName() const { MOZ_CRASH(); } }; class LDivI : public LBinaryMath<1> { diff --git a/js/src/jit/shared/LIR-shared.h b/js/src/jit/shared/LIR-shared.h index b6166a7cc329..212645226928 100644 --- a/js/src/jit/shared/LIR-shared.h +++ b/js/src/jit/shared/LIR-shared.h @@ -33,7 +33,7 @@ class LBox : public LInstructionHelper MIRType type() const { return type_; } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(type_); } }; @@ -119,7 +119,7 @@ class LMoveGroup : public LInstructionHelper<0, 0, 0> return new(alloc) LMoveGroup(alloc); } - void printOperands(GenericPrinter& out) override; + void printOperands(GenericPrinter& out); // Add a move which takes place simultaneously with all others in the group. bool add(LAllocation from, LAllocation to, LDefinition::Type type); @@ -509,7 +509,7 @@ public: MSimdBinaryComp::Operation operation() const { return mir_->toSimdBinaryComp()->operation(); } - const char* extraName() const override { + const char* extraName() const { return MSimdBinaryComp::OperationName(operation()); } }; @@ -565,7 +565,7 @@ class LSimdBinaryArith : public LInstructionHelper<1, 2, 1> MSimdBinaryArith::Operation operation() const { return this->mir_->toSimdBinaryArith()->operation(); } - const char* extraName() const override { + const char* extraName() const { return MSimdBinaryArith::OperationName(operation()); } }; @@ -625,7 +625,7 @@ class LSimdBinarySaturating : public LInstructionHelper<1, 2, 0> MIRType type() const { return mir_->type(); } - const char* extraName() const override { + const char* extraName() const { return MSimdBinarySaturating::OperationName(operation()); } }; @@ -688,7 +688,7 @@ class LSimdBinaryBitwise : public LInstructionHelper<1, 2, 0> MSimdBinaryBitwise::Operation operation() const { return mir_->toSimdBinaryBitwise()->operation(); } - const char* extraName() const override { + const char* extraName() const { return MSimdBinaryBitwise::OperationName(operation()); } MIRType type() const { @@ -720,7 +720,7 @@ class LSimdShift : public LInstructionHelper<1, 2, 1> MSimdShift::Operation operation() const { return mir_->toSimdShift()->operation(); } - const char* extraName() const override { + const char* extraName() const { return MSimdShift::OperationName(operation()); } MSimdShift* mir() const { @@ -849,7 +849,7 @@ class LPointer : public LInstructionHelper<1, 0, 0> Kind kind() const { return kind_; } - const char* extraName() const override { + const char* extraName() const { return kind_ == GC_THING ? "GC_THING" : "NON_GC_THING"; } @@ -1016,7 +1016,7 @@ class LNewArray : public LInstructionHelper<1, 0, 1> setTemp(0, temp); } - const char* extraName() const override { + const char* extraName() const { return mir()->isVMCall() ? "VMCall" : nullptr; } @@ -1141,7 +1141,7 @@ class LNewObject : public LInstructionHelper<1, 0, 1> setTemp(0, temp); } - const char* extraName() const override { + const char* extraName() const { return mir()->isVMCall() ? "VMCall" : nullptr; } @@ -2477,7 +2477,7 @@ class LTestVAndBranch : public LControlInstructionHelper<2, BOX_PIECES, 3> setTemp(2, temp2); } - const char* extraName() const override { + const char* extraName() const { return mir()->operandMightEmulateUndefined() ? "MightEmulateUndefined" : nullptr; } @@ -2534,7 +2534,7 @@ class LObjectGroupDispatch : public LInstructionHelper<0, 1, 1> public: LIR_HEADER(ObjectGroupDispatch); - const char* extraName() const override { + const char* extraName() const { return mir()->hasFallback() ? "HasFallback" : "NoFallback"; } @@ -2579,7 +2579,7 @@ class LCompare : public LInstructionHelper<1, 2, 0> MCompare* mir() { return mir_->toCompare(); } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } }; @@ -2607,7 +2607,7 @@ class LCompareI64 : public LInstructionHelper<1, 2 * INT64_PIECES, 0> MCompare* mir() { return mir_->toCompare(); } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } }; @@ -2649,7 +2649,7 @@ class LCompareI64AndBranch : public LControlInstructionHelper<2, 2 * INT64_PIECE MCompare* cmpMir() const { return cmpMir_; } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } }; @@ -2695,7 +2695,7 @@ class LCompareAndBranch : public LControlInstructionHelper<2, 2, 0> MCompare* cmpMir() const { return cmpMir_; } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } }; @@ -3339,7 +3339,7 @@ class LBitOpI : public LInstructionHelper<1, 2, 0> : op_(op) { } - const char* extraName() const override { + const char* extraName() const { if (bitop() == JSOP_URSH && mir_->toUrsh()->bailoutsDisabled()) return "ursh:BailoutsDisabled"; return CodeName[op_]; @@ -3364,7 +3364,7 @@ class LBitOpI64 : public LInstructionHelper : op_(op) { } - const char* extraName() const override { + const char* extraName() const { return CodeName[op_]; } @@ -3392,7 +3392,7 @@ class LBitOpV : public LCallInstructionHelper<1, 2 * BOX_PIECES, 0> return jsop_; } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } @@ -3421,7 +3421,7 @@ class LShiftI : public LBinaryMath<0> return mir_->toInstruction(); } - const char* extraName() const override { + const char* extraName() const { return CodeName[op_]; } }; @@ -3448,7 +3448,7 @@ class LShiftI64 : public LInstructionHelper return mir_->toInstruction(); } - const char* extraName() const override { + const char* extraName() const { return CodeName[op_]; } }; @@ -3541,7 +3541,7 @@ class LMinMaxBase : public LInstructionHelper<1, 2, 0> MMinMax* mir() const { return mir_->toMinMax(); } - const char* extraName() const override { + const char* extraName() const { return mir()->isMax() ? "Max" : "Min"; } }; @@ -3907,7 +3907,7 @@ class LMathFunctionD : public LCallInstructionHelper<1, 1, 1> MMathFunction* mir() const { return mir_->toMathFunction(); } - const char* extraName() const override { + const char* extraName() const { return MMathFunction::FunctionName(mir()->function()); } }; @@ -3927,7 +3927,7 @@ class LMathFunctionF : public LCallInstructionHelper<1, 1, 1> MMathFunction* mir() const { return mir_->toMathFunction(); } - const char* extraName() const override { + const char* extraName() const { return MMathFunction::FunctionName(mir()->function()); } }; @@ -3944,7 +3944,7 @@ class LAddI : public LBinaryMath<0> : recoversInput_(false) { } - const char* extraName() const override { + const char* extraName() const { return snapshot() ? "OverflowCheck" : nullptr; } @@ -3981,7 +3981,7 @@ class LSubI : public LBinaryMath<0> : recoversInput_(false) { } - const char* extraName() const override { + const char* extraName() const { return snapshot() ? "OverflowCheck" : nullptr; } @@ -4052,7 +4052,7 @@ class LMathD : public LBinaryMath<0> return jsop_; } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } }; @@ -4073,7 +4073,7 @@ class LMathF: public LBinaryMath<0> return jsop_; } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } }; @@ -4116,7 +4116,7 @@ class LBinaryV : public LCallInstructionHelper return jsop_; } - const char* extraName() const override { + const char* extraName() const { return CodeName[jsop_]; } @@ -4447,7 +4447,7 @@ class LValueToInt32 : public LInstructionHelper<1, BOX_PIECES, 2> setTemp(1, temp1); } - const char* extraName() const override { + const char* extraName() const { return mode() == NORMAL ? "Normal" : "Truncate"; } @@ -5665,7 +5665,7 @@ class LLoadElementV : public LInstructionHelper setOperand(1, index); } - const char* extraName() const override { + const char* extraName() const { return mir()->needsHoleCheck() ? "HoleCheck" : nullptr; } @@ -5724,7 +5724,7 @@ class LLoadElementHole : public LInstructionHelper setOperand(2, initLength); } - const char* extraName() const override { + const char* extraName() const { return mir()->needsHoleCheck() ? "HoleCheck" : nullptr; } @@ -5756,7 +5756,7 @@ class LLoadElementT : public LInstructionHelper<1, 2, 0> setOperand(1, index); } - const char* extraName() const override { + const char* extraName() const { return mir()->needsHoleCheck() ? "HoleCheck" : (mir()->loadDoubles() ? "Doubles" : nullptr); } @@ -5888,7 +5888,7 @@ class LStoreElementV : public LInstructionHelper<0, 2 + BOX_PIECES, 0> setBoxOperand(Value, value); } - const char* extraName() const override { + const char* extraName() const { return mir()->needsHoleCheck() ? "HoleCheck" : nullptr; } @@ -5920,7 +5920,7 @@ class LStoreElementT : public LInstructionHelper<0, 3, 0> setOperand(2, value); } - const char* extraName() const override { + const char* extraName() const { return mir()->needsHoleCheck() ? "HoleCheck" : nullptr; } @@ -6114,7 +6114,7 @@ class LArrayPopShiftV : public LInstructionHelper setTemp(1, temp1); } - const char* extraName() const override { + const char* extraName() const { return mir()->mode() == MArrayPopShift::Pop ? "Pop" : "Shift"; } @@ -6143,7 +6143,7 @@ class LArrayPopShiftT : public LInstructionHelper<1, 1, 2> setTemp(1, temp1); } - const char* extraName() const override { + const char* extraName() const { return mir()->mode() == MArrayPopShift::Pop ? "Pop" : "Shift"; } @@ -6939,7 +6939,7 @@ class LGetPropertyPolymorphicV : public LInstructionHelper const MGetPropertyPolymorphic* mir() const { return mir_->toGetPropertyPolymorphic(); } - virtual const char* extraName() const override { + virtual const char* extraName() const { return PropertyNameToExtraName(mir()->name()); } }; @@ -6964,7 +6964,7 @@ class LGetPropertyPolymorphicT : public LInstructionHelper<1, 1, 1> const MGetPropertyPolymorphic* mir() const { return mir_->toGetPropertyPolymorphic(); } - virtual const char* extraName() const override { + virtual const char* extraName() const { return PropertyNameToExtraName(mir()->name()); } }; @@ -7029,7 +7029,7 @@ class LSetPropertyPolymorphicT : public LInstructionHelper<0, 2, 1> const MSetPropertyPolymorphic* mir() const { return mir_->toSetPropertyPolymorphic(); } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(valueType_); } }; diff --git a/js/src/jit/x64/LIR-x64.h b/js/src/jit/x64/LIR-x64.h index 7d86d1496903..ff80f02def0d 100644 --- a/js/src/jit/x64/LIR-x64.h +++ b/js/src/jit/x64/LIR-x64.h @@ -34,7 +34,7 @@ class LUnbox : public LUnboxBase { : LUnboxBase(input) { } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(mir()->type()); } }; @@ -53,7 +53,7 @@ class LUnboxFloatingPoint : public LUnboxBase { MIRType type() const { return type_; } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(type_); } }; @@ -135,7 +135,7 @@ class LUDivOrModI64 : public LBinaryMath<1> return getTemp(0); } - const char* extraName() const override { + const char* extraName() const { return mir()->isTruncated() ? "Truncated" : nullptr; } diff --git a/js/src/jit/x86-shared/LIR-x86-shared.h b/js/src/jit/x86-shared/LIR-x86-shared.h index 4b76e2b07a14..7c4f1d92423b 100644 --- a/js/src/jit/x86-shared/LIR-x86-shared.h +++ b/js/src/jit/x86-shared/LIR-x86-shared.h @@ -21,7 +21,7 @@ class LDivI : public LBinaryMath<1> setTemp(0, temp); } - const char* extraName() const override { + const char* extraName() const { if (mir()->isTruncated()) { if (mir()->canBeNegativeZero()) { return mir()->canBeNegativeOverflow() @@ -118,7 +118,7 @@ class LModI : public LBinaryMath<1> setTemp(0, temp); } - const char* extraName() const override { + const char* extraName() const { return mir()->isTruncated() ? "Truncated" : nullptr; } @@ -147,7 +147,7 @@ class LUDivOrMod : public LBinaryMath<1> return getTemp(0); } - const char* extraName() const override { + const char* extraName() const { return mir()->isTruncated() ? "Truncated" : nullptr; } @@ -341,7 +341,7 @@ class LMulI : public LBinaryMath<0, 1> setOperand(2, lhsCopy); } - const char* extraName() const override { + const char* extraName() const { return (mir()->mode() == MMul::Integer) ? "Integer" : (mir()->canBeNegativeZero() ? "CanBeNegativeZero" : nullptr); diff --git a/js/src/jit/x86/LIR-x86.h b/js/src/jit/x86/LIR-x86.h index 7248ef0fb4f3..8ed14bc350ec 100644 --- a/js/src/jit/x86/LIR-x86.h +++ b/js/src/jit/x86/LIR-x86.h @@ -28,7 +28,7 @@ class LBoxFloatingPoint : public LInstructionHelper<2, 1, 1> MIRType type() const { return type_; } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(type_); } }; @@ -47,7 +47,7 @@ class LUnbox : public LInstructionHelper<1, 2, 0> const LAllocation* type() { return getOperand(1); } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(mir()->type()); } }; @@ -74,7 +74,7 @@ class LUnboxFloatingPoint : public LInstructionHelper<1, 2, 0> MIRType type() const { return type_; } - const char* extraName() const override { + const char* extraName() const { return StringFromMIRType(type_); } }; From 6240b9f6a270ce21a81535d857e50c6ee2ce0011 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Fri, 16 Feb 2018 16:27:21 +0100 Subject: [PATCH 04/48] Bug 1425580 part 12 - Remove LNode::accept, devirtualize CodeGenerator. r=nbp --HG-- extra : rebase_source : cb70d15c07f358612348971dc9193215d9289b00 --- js/src/jit/CodeGenerator.cpp | 17 +- js/src/jit/CodeGenerator.h | 606 +++++++++--------- js/src/jit/LIR.h | 10 +- js/src/jit/arm/CodeGenerator-arm.h | 287 +++++---- js/src/jit/arm64/CodeGenerator-arm64.h | 176 ++--- .../mips-shared/CodeGenerator-mips-shared.h | 110 ++-- js/src/jit/shared/CodeGenerator-shared.h | 30 +- js/src/jit/x64/CodeGenerator-x64.h | 78 +-- .../jit/x86-shared/CodeGenerator-x86-shared.h | 239 +++---- js/src/jit/x86/CodeGenerator-x86.h | 90 +-- 10 files changed, 826 insertions(+), 817 deletions(-) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index f6de5d086bb4..4ee31f773a3a 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -15,6 +15,8 @@ #include "mozilla/MathAlgorithms.h" #include "mozilla/ScopeExit.h" +#include + #include "jslibmath.h" #include "jsmath.h" #include "jsnum.h" @@ -5713,12 +5715,20 @@ CodeGenerator::generateBody() } } -#ifdef DEBUG setElement(*iter); // needed to encode correct snapshot location. + +#ifdef DEBUG emitDebugForceBailing(*iter); #endif - iter->accept(this); + switch (iter->op()) { +#define LIROP(op) case LNode::LOp_##op: visit##op(iter->to##op()); break; + LIR_OPCODE_LIST(LIROP) +#undef LIROP + case LNode::LOp_Invalid: + default: + MOZ_CRASH("Invalid LIR op"); + } // Track the end native offset of optimizations. if (iter->mirRaw() && iter->mirRaw()->trackedOptimizations()) @@ -13234,5 +13244,8 @@ CodeGenerator::visitGetPrototypeOf(LGetPrototypeOf* lir) masm.bind(ool->rejoin()); } +static_assert(!std::is_polymorphic::value, + "CodeGenerator should not have any virtual methods"); + } // namespace jit } // namespace js diff --git a/js/src/jit/CodeGenerator.h b/js/src/jit/CodeGenerator.h index 1dfa074599a6..41ead42ff4d3 100644 --- a/js/src/jit/CodeGenerator.h +++ b/js/src/jit/CodeGenerator.h @@ -79,89 +79,89 @@ class CodeGenerator final : public CodeGeneratorSpecific MOZ_MUST_USE bool link(JSContext* cx, CompilerConstraintList* constraints); MOZ_MUST_USE bool linkSharedStubs(JSContext* cx); - void visitOsiPoint(LOsiPoint* lir) override; - void visitGoto(LGoto* lir) override; - void visitTableSwitch(LTableSwitch* ins) override; - void visitTableSwitchV(LTableSwitchV* ins) override; - void visitCloneLiteral(LCloneLiteral* lir) override; - void visitParameter(LParameter* lir) override; - void visitCallee(LCallee* lir) override; - void visitIsConstructing(LIsConstructing* lir) override; - void visitStart(LStart* lir) override; - void visitReturn(LReturn* ret) override; - void visitDefVar(LDefVar* lir) override; - void visitDefLexical(LDefLexical* lir) override; - void visitDefFun(LDefFun* lir) override; - void visitOsrEntry(LOsrEntry* lir) override; - void visitOsrEnvironmentChain(LOsrEnvironmentChain* lir) override; - void visitOsrValue(LOsrValue* lir) override; - void visitOsrReturnValue(LOsrReturnValue* lir) override; - void visitOsrArgumentsObject(LOsrArgumentsObject* lir) override; - void visitStackArgT(LStackArgT* lir) override; - void visitStackArgV(LStackArgV* lir) override; - void visitMoveGroup(LMoveGroup* group) override; - void visitValueToInt32(LValueToInt32* lir) override; - void visitValueToDouble(LValueToDouble* lir) override; - void visitValueToFloat32(LValueToFloat32* lir) override; - void visitFloat32ToDouble(LFloat32ToDouble* lir) override; - void visitDoubleToFloat32(LDoubleToFloat32* lir) override; - void visitInt32ToFloat32(LInt32ToFloat32* lir) override; - void visitInt32ToDouble(LInt32ToDouble* lir) override; + void visitOsiPoint(LOsiPoint* lir); + void visitGoto(LGoto* lir); + void visitTableSwitch(LTableSwitch* ins); + void visitTableSwitchV(LTableSwitchV* ins); + void visitCloneLiteral(LCloneLiteral* lir); + void visitParameter(LParameter* lir); + void visitCallee(LCallee* lir); + void visitIsConstructing(LIsConstructing* lir); + void visitStart(LStart* lir); + void visitReturn(LReturn* ret); + void visitDefVar(LDefVar* lir); + void visitDefLexical(LDefLexical* lir); + void visitDefFun(LDefFun* lir); + void visitOsrEntry(LOsrEntry* lir); + void visitOsrEnvironmentChain(LOsrEnvironmentChain* lir); + void visitOsrValue(LOsrValue* lir); + void visitOsrReturnValue(LOsrReturnValue* lir); + void visitOsrArgumentsObject(LOsrArgumentsObject* lir); + void visitStackArgT(LStackArgT* lir); + void visitStackArgV(LStackArgV* lir); + void visitMoveGroup(LMoveGroup* group); + void visitValueToInt32(LValueToInt32* lir); + void visitValueToDouble(LValueToDouble* lir); + void visitValueToFloat32(LValueToFloat32* lir); + void visitFloat32ToDouble(LFloat32ToDouble* lir); + void visitDoubleToFloat32(LDoubleToFloat32* lir); + void visitInt32ToFloat32(LInt32ToFloat32* lir); + void visitInt32ToDouble(LInt32ToDouble* lir); void emitOOLTestObject(Register objreg, Label* ifTruthy, Label* ifFalsy, Register scratch); - void visitTestOAndBranch(LTestOAndBranch* lir) override; - void visitTestVAndBranch(LTestVAndBranch* lir) override; - void visitFunctionDispatch(LFunctionDispatch* lir) override; - void visitObjectGroupDispatch(LObjectGroupDispatch* lir) override; - void visitBooleanToString(LBooleanToString* lir) override; + void visitTestOAndBranch(LTestOAndBranch* lir); + void visitTestVAndBranch(LTestVAndBranch* lir); + void visitFunctionDispatch(LFunctionDispatch* lir); + void visitObjectGroupDispatch(LObjectGroupDispatch* lir); + void visitBooleanToString(LBooleanToString* lir); void emitIntToString(Register input, Register output, Label* ool); - void visitIntToString(LIntToString* lir) override; - void visitDoubleToString(LDoubleToString* lir) override; - void visitValueToString(LValueToString* lir) override; - void visitValueToObject(LValueToObject* lir) override; - void visitValueToObjectOrNull(LValueToObjectOrNull* lir) override; - void visitInteger(LInteger* lir) override; - void visitInteger64(LInteger64* lir) override; - void visitRegExp(LRegExp* lir) override; - void visitRegExpMatcher(LRegExpMatcher* lir) override; + void visitIntToString(LIntToString* lir); + void visitDoubleToString(LDoubleToString* lir); + void visitValueToString(LValueToString* lir); + void visitValueToObject(LValueToObject* lir); + void visitValueToObjectOrNull(LValueToObjectOrNull* lir); + void visitInteger(LInteger* lir); + void visitInteger64(LInteger64* lir); + void visitRegExp(LRegExp* lir); + void visitRegExpMatcher(LRegExpMatcher* lir); void visitOutOfLineRegExpMatcher(OutOfLineRegExpMatcher* ool); - void visitRegExpSearcher(LRegExpSearcher* lir) override; + void visitRegExpSearcher(LRegExpSearcher* lir); void visitOutOfLineRegExpSearcher(OutOfLineRegExpSearcher* ool); - void visitRegExpTester(LRegExpTester* lir) override; + void visitRegExpTester(LRegExpTester* lir); void visitOutOfLineRegExpTester(OutOfLineRegExpTester* ool); - void visitRegExpPrototypeOptimizable(LRegExpPrototypeOptimizable* lir) override; + void visitRegExpPrototypeOptimizable(LRegExpPrototypeOptimizable* lir); void visitOutOfLineRegExpPrototypeOptimizable(OutOfLineRegExpPrototypeOptimizable* ool); - void visitRegExpInstanceOptimizable(LRegExpInstanceOptimizable* lir) override; + void visitRegExpInstanceOptimizable(LRegExpInstanceOptimizable* lir); void visitOutOfLineRegExpInstanceOptimizable(OutOfLineRegExpInstanceOptimizable* ool); - void visitGetFirstDollarIndex(LGetFirstDollarIndex* lir) override; - void visitStringReplace(LStringReplace* lir) override; + void visitGetFirstDollarIndex(LGetFirstDollarIndex* lir); + void visitStringReplace(LStringReplace* lir); void emitSharedStub(ICStub::Kind kind, LInstruction* lir); - void visitBinarySharedStub(LBinarySharedStub* lir) override; - void visitUnarySharedStub(LUnarySharedStub* lir) override; - void visitNullarySharedStub(LNullarySharedStub* lir) override; - void visitClassConstructor(LClassConstructor* lir) override; - void visitLambda(LLambda* lir) override; + void visitBinarySharedStub(LBinarySharedStub* lir); + void visitUnarySharedStub(LUnarySharedStub* lir); + void visitNullarySharedStub(LNullarySharedStub* lir); + void visitClassConstructor(LClassConstructor* lir); + void visitLambda(LLambda* lir); void visitOutOfLineLambdaArrow(OutOfLineLambdaArrow* ool); - void visitLambdaArrow(LLambdaArrow* lir) override; - void visitLambdaForSingleton(LLambdaForSingleton* lir) override; - void visitSetFunName(LSetFunName* lir) override; - void visitPointer(LPointer* lir) override; - void visitKeepAliveObject(LKeepAliveObject* lir) override; - void visitSlots(LSlots* lir) override; - void visitLoadSlotT(LLoadSlotT* lir) override; - void visitLoadSlotV(LLoadSlotV* lir) override; - void visitStoreSlotT(LStoreSlotT* lir) override; - void visitStoreSlotV(LStoreSlotV* lir) override; - void visitElements(LElements* lir) override; - void visitConvertElementsToDoubles(LConvertElementsToDoubles* lir) override; - void visitMaybeToDoubleElement(LMaybeToDoubleElement* lir) override; - void visitMaybeCopyElementsForWrite(LMaybeCopyElementsForWrite* lir) override; - void visitGuardObjectIdentity(LGuardObjectIdentity* guard) override; - void visitGuardReceiverPolymorphic(LGuardReceiverPolymorphic* lir) override; - void visitGuardUnboxedExpando(LGuardUnboxedExpando* lir) override; - void visitLoadUnboxedExpando(LLoadUnboxedExpando* lir) override; - void visitTypeBarrierV(LTypeBarrierV* lir) override; - void visitTypeBarrierO(LTypeBarrierO* lir) override; - void visitMonitorTypes(LMonitorTypes* lir) override; + void visitLambdaArrow(LLambdaArrow* lir); + void visitLambdaForSingleton(LLambdaForSingleton* lir); + void visitSetFunName(LSetFunName* lir); + void visitPointer(LPointer* lir); + void visitKeepAliveObject(LKeepAliveObject* lir); + void visitSlots(LSlots* lir); + void visitLoadSlotT(LLoadSlotT* lir); + void visitLoadSlotV(LLoadSlotV* lir); + void visitStoreSlotT(LStoreSlotT* lir); + void visitStoreSlotV(LStoreSlotV* lir); + void visitElements(LElements* lir); + void visitConvertElementsToDoubles(LConvertElementsToDoubles* lir); + void visitMaybeToDoubleElement(LMaybeToDoubleElement* lir); + void visitMaybeCopyElementsForWrite(LMaybeCopyElementsForWrite* lir); + void visitGuardObjectIdentity(LGuardObjectIdentity* guard); + void visitGuardReceiverPolymorphic(LGuardReceiverPolymorphic* lir); + void visitGuardUnboxedExpando(LGuardUnboxedExpando* lir); + void visitLoadUnboxedExpando(LLoadUnboxedExpando* lir); + void visitTypeBarrierV(LTypeBarrierV* lir); + void visitTypeBarrierO(LTypeBarrierO* lir); + void visitMonitorTypes(LMonitorTypes* lir); void emitPostWriteBarrier(const LAllocation* obj); void emitPostWriteBarrier(Register objreg); void emitPostWriteBarrierS(Address address, Register prev, Register next); @@ -169,24 +169,24 @@ class CodeGenerator final : public CodeGeneratorSpecific void visitPostWriteBarrierCommon(LPostBarrierType* lir, OutOfLineCode* ool); template void visitPostWriteBarrierCommonV(LPostBarrierType* lir, OutOfLineCode* ool); - void visitPostWriteBarrierO(LPostWriteBarrierO* lir) override; - void visitPostWriteElementBarrierO(LPostWriteElementBarrierO* lir) override; - void visitPostWriteBarrierV(LPostWriteBarrierV* lir) override; - void visitPostWriteElementBarrierV(LPostWriteElementBarrierV* lir) override; - void visitPostWriteBarrierS(LPostWriteBarrierS* lir) override; - void visitPostWriteElementBarrierS(LPostWriteElementBarrierS* lir) override; + void visitPostWriteBarrierO(LPostWriteBarrierO* lir); + void visitPostWriteElementBarrierO(LPostWriteElementBarrierO* lir); + void visitPostWriteBarrierV(LPostWriteBarrierV* lir); + void visitPostWriteElementBarrierV(LPostWriteElementBarrierV* lir); + void visitPostWriteBarrierS(LPostWriteBarrierS* lir); + void visitPostWriteElementBarrierS(LPostWriteElementBarrierS* lir); void visitOutOfLineCallPostWriteBarrier(OutOfLineCallPostWriteBarrier* ool); void visitOutOfLineCallPostWriteElementBarrier(OutOfLineCallPostWriteElementBarrier* ool); - void visitCallNative(LCallNative* call) override; + void visitCallNative(LCallNative* call); void emitCallInvokeFunction(LInstruction* call, Register callereg, bool isConstructing, bool ignoresReturnValue, uint32_t argc, uint32_t unusedStack); - void visitCallGeneric(LCallGeneric* call) override; + void visitCallGeneric(LCallGeneric* call); void emitCallInvokeFunctionShuffleNewTarget(LCallKnown *call, Register calleeReg, uint32_t numFormals, uint32_t unusedStack); - void visitCallKnown(LCallKnown* call) override; + void visitCallKnown(LCallKnown* call); template void emitApplyGeneric(T* apply); template void emitCallInvokeFunction(T* apply, Register extraStackSize); void emitAllocateSpaceForApply(Register argcreg, Register extraStackSpace, Label* end); @@ -194,243 +194,243 @@ class CodeGenerator final : public CodeGeneratorSpecific size_t argvSrcOffset, size_t argvDstOffset); void emitPopArguments(Register extraStackSize); void emitPushArguments(LApplyArgsGeneric* apply, Register extraStackSpace); - void visitApplyArgsGeneric(LApplyArgsGeneric* apply) override; + void visitApplyArgsGeneric(LApplyArgsGeneric* apply); void emitPushArguments(LApplyArrayGeneric* apply, Register extraStackSpace); - void visitApplyArrayGeneric(LApplyArrayGeneric* apply) override; - void visitBail(LBail* lir) override; - void visitUnreachable(LUnreachable* unreachable) override; - void visitEncodeSnapshot(LEncodeSnapshot* lir) override; - void visitGetDynamicName(LGetDynamicName* lir) override; - void visitCallDirectEval(LCallDirectEval* lir) override; - void visitDoubleToInt32(LDoubleToInt32* lir) override; - void visitFloat32ToInt32(LFloat32ToInt32* lir) override; + void visitApplyArrayGeneric(LApplyArrayGeneric* apply); + void visitBail(LBail* lir); + void visitUnreachable(LUnreachable* unreachable); + void visitEncodeSnapshot(LEncodeSnapshot* lir); + void visitGetDynamicName(LGetDynamicName* lir); + void visitCallDirectEval(LCallDirectEval* lir); + void visitDoubleToInt32(LDoubleToInt32* lir); + void visitFloat32ToInt32(LFloat32ToInt32* lir); void visitNewArrayCallVM(LNewArray* lir); - void visitNewArray(LNewArray* lir) override; + void visitNewArray(LNewArray* lir); void visitOutOfLineNewArray(OutOfLineNewArray* ool); - void visitNewArrayCopyOnWrite(LNewArrayCopyOnWrite* lir) override; - void visitNewArrayDynamicLength(LNewArrayDynamicLength* lir) override; - void visitNewIterator(LNewIterator* lir) override; - void visitNewTypedArray(LNewTypedArray* lir) override; - void visitNewTypedArrayDynamicLength(LNewTypedArrayDynamicLength* lir) override; + void visitNewArrayCopyOnWrite(LNewArrayCopyOnWrite* lir); + void visitNewArrayDynamicLength(LNewArrayDynamicLength* lir); + void visitNewIterator(LNewIterator* lir); + void visitNewTypedArray(LNewTypedArray* lir); + void visitNewTypedArrayDynamicLength(LNewTypedArrayDynamicLength* lir); void visitNewObjectVMCall(LNewObject* lir); - void visitNewObject(LNewObject* lir) override; + void visitNewObject(LNewObject* lir); void visitOutOfLineNewObject(OutOfLineNewObject* ool); - void visitNewTypedObject(LNewTypedObject* lir) override; - void visitSimdBox(LSimdBox* lir) override; - void visitSimdUnbox(LSimdUnbox* lir) override; - void visitNewNamedLambdaObject(LNewNamedLambdaObject* lir) override; - void visitNewCallObject(LNewCallObject* lir) override; - void visitNewSingletonCallObject(LNewSingletonCallObject* lir) override; - void visitNewStringObject(LNewStringObject* lir) override; - void visitNewDerivedTypedObject(LNewDerivedTypedObject* lir) override; - void visitInitElem(LInitElem* lir) override; - void visitInitElemGetterSetter(LInitElemGetterSetter* lir) override; - void visitMutateProto(LMutateProto* lir) override; - void visitInitPropGetterSetter(LInitPropGetterSetter* lir) override; - void visitCreateThis(LCreateThis* lir) override; - void visitCreateThisWithProto(LCreateThisWithProto* lir) override; - void visitCreateThisWithTemplate(LCreateThisWithTemplate* lir) override; - void visitCreateArgumentsObject(LCreateArgumentsObject* lir) override; - void visitGetArgumentsObjectArg(LGetArgumentsObjectArg* lir) override; - void visitSetArgumentsObjectArg(LSetArgumentsObjectArg* lir) override; - void visitReturnFromCtor(LReturnFromCtor* lir) override; - void visitComputeThis(LComputeThis* lir) override; - void visitImplicitThis(LImplicitThis* lir) override; - void visitArrayLength(LArrayLength* lir) override; - void visitSetArrayLength(LSetArrayLength* lir) override; - void visitGetNextEntryForIterator(LGetNextEntryForIterator* lir) override; - void visitTypedArrayLength(LTypedArrayLength* lir) override; - void visitTypedArrayElements(LTypedArrayElements* lir) override; - void visitSetDisjointTypedElements(LSetDisjointTypedElements* lir) override; - void visitTypedObjectElements(LTypedObjectElements* lir) override; - void visitSetTypedObjectOffset(LSetTypedObjectOffset* lir) override; - void visitTypedObjectDescr(LTypedObjectDescr* ins) override; - void visitStringLength(LStringLength* lir) override; - void visitSubstr(LSubstr* lir) override; - void visitInitializedLength(LInitializedLength* lir) override; - void visitSetInitializedLength(LSetInitializedLength* lir) override; - void visitNotO(LNotO* ins) override; - void visitNotV(LNotV* ins) override; - void visitBoundsCheck(LBoundsCheck* lir) override; - void visitBoundsCheckRange(LBoundsCheckRange* lir) override; - void visitBoundsCheckLower(LBoundsCheckLower* lir) override; - void visitSpectreMaskIndex(LSpectreMaskIndex* lir) override; - void visitLoadFixedSlotV(LLoadFixedSlotV* ins) override; - void visitLoadFixedSlotAndUnbox(LLoadFixedSlotAndUnbox* lir) override; - void visitLoadFixedSlotT(LLoadFixedSlotT* ins) override; - void visitStoreFixedSlotV(LStoreFixedSlotV* ins) override; - void visitStoreFixedSlotT(LStoreFixedSlotT* ins) override; + void visitNewTypedObject(LNewTypedObject* lir); + void visitSimdBox(LSimdBox* lir); + void visitSimdUnbox(LSimdUnbox* lir); + void visitNewNamedLambdaObject(LNewNamedLambdaObject* lir); + void visitNewCallObject(LNewCallObject* lir); + void visitNewSingletonCallObject(LNewSingletonCallObject* lir); + void visitNewStringObject(LNewStringObject* lir); + void visitNewDerivedTypedObject(LNewDerivedTypedObject* lir); + void visitInitElem(LInitElem* lir); + void visitInitElemGetterSetter(LInitElemGetterSetter* lir); + void visitMutateProto(LMutateProto* lir); + void visitInitPropGetterSetter(LInitPropGetterSetter* lir); + void visitCreateThis(LCreateThis* lir); + void visitCreateThisWithProto(LCreateThisWithProto* lir); + void visitCreateThisWithTemplate(LCreateThisWithTemplate* lir); + void visitCreateArgumentsObject(LCreateArgumentsObject* lir); + void visitGetArgumentsObjectArg(LGetArgumentsObjectArg* lir); + void visitSetArgumentsObjectArg(LSetArgumentsObjectArg* lir); + void visitReturnFromCtor(LReturnFromCtor* lir); + void visitComputeThis(LComputeThis* lir); + void visitImplicitThis(LImplicitThis* lir); + void visitArrayLength(LArrayLength* lir); + void visitSetArrayLength(LSetArrayLength* lir); + void visitGetNextEntryForIterator(LGetNextEntryForIterator* lir); + void visitTypedArrayLength(LTypedArrayLength* lir); + void visitTypedArrayElements(LTypedArrayElements* lir); + void visitSetDisjointTypedElements(LSetDisjointTypedElements* lir); + void visitTypedObjectElements(LTypedObjectElements* lir); + void visitSetTypedObjectOffset(LSetTypedObjectOffset* lir); + void visitTypedObjectDescr(LTypedObjectDescr* ins); + void visitStringLength(LStringLength* lir); + void visitSubstr(LSubstr* lir); + void visitInitializedLength(LInitializedLength* lir); + void visitSetInitializedLength(LSetInitializedLength* lir); + void visitNotO(LNotO* ins); + void visitNotV(LNotV* ins); + void visitBoundsCheck(LBoundsCheck* lir); + void visitBoundsCheckRange(LBoundsCheckRange* lir); + void visitBoundsCheckLower(LBoundsCheckLower* lir); + void visitSpectreMaskIndex(LSpectreMaskIndex* lir); + void visitLoadFixedSlotV(LLoadFixedSlotV* ins); + void visitLoadFixedSlotAndUnbox(LLoadFixedSlotAndUnbox* lir); + void visitLoadFixedSlotT(LLoadFixedSlotT* ins); + void visitStoreFixedSlotV(LStoreFixedSlotV* ins); + void visitStoreFixedSlotT(LStoreFixedSlotT* ins); void emitGetPropertyPolymorphic(LInstruction* lir, Register obj, Register scratch, const TypedOrValueRegister& output); - void visitGetPropertyPolymorphicV(LGetPropertyPolymorphicV* ins) override; - void visitGetPropertyPolymorphicT(LGetPropertyPolymorphicT* ins) override; + void visitGetPropertyPolymorphicV(LGetPropertyPolymorphicV* ins); + void visitGetPropertyPolymorphicT(LGetPropertyPolymorphicT* ins); void emitSetPropertyPolymorphic(LInstruction* lir, Register obj, Register scratch, const ConstantOrRegister& value); - void visitSetPropertyPolymorphicV(LSetPropertyPolymorphicV* ins) override; - void visitSetPropertyPolymorphicT(LSetPropertyPolymorphicT* ins) override; - void visitAbsI(LAbsI* lir) override; - void visitAtan2D(LAtan2D* lir) override; - void visitHypot(LHypot* lir) override; - void visitPowI(LPowI* lir) override; - void visitPowD(LPowD* lir) override; - void visitPowV(LPowV* lir) override; - void visitMathFunctionD(LMathFunctionD* ins) override; - void visitMathFunctionF(LMathFunctionF* ins) override; - void visitModD(LModD* ins) override; - void visitMinMaxI(LMinMaxI* lir) override; - void visitBinaryV(LBinaryV* lir) override; + void visitSetPropertyPolymorphicV(LSetPropertyPolymorphicV* ins); + void visitSetPropertyPolymorphicT(LSetPropertyPolymorphicT* ins); + void visitAbsI(LAbsI* lir); + void visitAtan2D(LAtan2D* lir); + void visitHypot(LHypot* lir); + void visitPowI(LPowI* lir); + void visitPowD(LPowD* lir); + void visitPowV(LPowV* lir); + void visitMathFunctionD(LMathFunctionD* ins); + void visitMathFunctionF(LMathFunctionF* ins); + void visitModD(LModD* ins); + void visitMinMaxI(LMinMaxI* lir); + void visitBinaryV(LBinaryV* lir); void emitCompareS(LInstruction* lir, JSOp op, Register left, Register right, Register output); - void visitCompareS(LCompareS* lir) override; - void visitCompareStrictS(LCompareStrictS* lir) override; - void visitCompareVM(LCompareVM* lir) override; - void visitIsNullOrLikeUndefinedV(LIsNullOrLikeUndefinedV* lir) override; - void visitIsNullOrLikeUndefinedT(LIsNullOrLikeUndefinedT* lir) override; - void visitIsNullOrLikeUndefinedAndBranchV(LIsNullOrLikeUndefinedAndBranchV* lir) override; - void visitIsNullOrLikeUndefinedAndBranchT(LIsNullOrLikeUndefinedAndBranchT* lir) override; + void visitCompareS(LCompareS* lir); + void visitCompareStrictS(LCompareStrictS* lir); + void visitCompareVM(LCompareVM* lir); + void visitIsNullOrLikeUndefinedV(LIsNullOrLikeUndefinedV* lir); + void visitIsNullOrLikeUndefinedT(LIsNullOrLikeUndefinedT* lir); + void visitIsNullOrLikeUndefinedAndBranchV(LIsNullOrLikeUndefinedAndBranchV* lir); + void visitIsNullOrLikeUndefinedAndBranchT(LIsNullOrLikeUndefinedAndBranchT* lir); void emitSameValue(FloatRegister left, FloatRegister right, FloatRegister temp, Register output); - void visitSameValueD(LSameValueD* lir) override; - void visitSameValueV(LSameValueV* lir) override; - void visitSameValueVM(LSameValueVM* lir) override; + void visitSameValueD(LSameValueD* lir); + void visitSameValueV(LSameValueV* lir); + void visitSameValueVM(LSameValueVM* lir); void emitConcat(LInstruction* lir, Register lhs, Register rhs, Register output); - void visitConcat(LConcat* lir) override; - void visitCharCodeAt(LCharCodeAt* lir) override; - void visitFromCharCode(LFromCharCode* lir) override; - void visitFromCodePoint(LFromCodePoint* lir) override; - void visitStringConvertCase(LStringConvertCase* lir) override; - void visitSinCos(LSinCos *lir) override; - void visitStringSplit(LStringSplit* lir) override; - void visitFunctionEnvironment(LFunctionEnvironment* lir) override; - void visitHomeObject(LHomeObject* lir) override; - void visitHomeObjectSuperBase(LHomeObjectSuperBase* lir) override; - void visitNewLexicalEnvironmentObject(LNewLexicalEnvironmentObject* lir) override; - void visitCopyLexicalEnvironmentObject(LCopyLexicalEnvironmentObject* lir) override; - void visitCallGetProperty(LCallGetProperty* lir) override; - void visitCallGetElement(LCallGetElement* lir) override; - void visitCallSetElement(LCallSetElement* lir) override; - void visitCallInitElementArray(LCallInitElementArray* lir) override; - void visitThrow(LThrow* lir) override; - void visitTypeOfV(LTypeOfV* lir) override; + void visitConcat(LConcat* lir); + void visitCharCodeAt(LCharCodeAt* lir); + void visitFromCharCode(LFromCharCode* lir); + void visitFromCodePoint(LFromCodePoint* lir); + void visitStringConvertCase(LStringConvertCase* lir); + void visitSinCos(LSinCos *lir); + void visitStringSplit(LStringSplit* lir); + void visitFunctionEnvironment(LFunctionEnvironment* lir); + void visitHomeObject(LHomeObject* lir); + void visitHomeObjectSuperBase(LHomeObjectSuperBase* lir); + void visitNewLexicalEnvironmentObject(LNewLexicalEnvironmentObject* lir); + void visitCopyLexicalEnvironmentObject(LCopyLexicalEnvironmentObject* lir); + void visitCallGetProperty(LCallGetProperty* lir); + void visitCallGetElement(LCallGetElement* lir); + void visitCallSetElement(LCallSetElement* lir); + void visitCallInitElementArray(LCallInitElementArray* lir); + void visitThrow(LThrow* lir); + void visitTypeOfV(LTypeOfV* lir); void visitOutOfLineTypeOfV(OutOfLineTypeOfV* ool); - void visitToAsync(LToAsync* lir) override; - void visitToAsyncGen(LToAsyncGen* lir) override; - void visitToAsyncIter(LToAsyncIter* lir) override; - void visitToIdV(LToIdV* lir) override; + void visitToAsync(LToAsync* lir); + void visitToAsyncGen(LToAsyncGen* lir); + void visitToAsyncIter(LToAsyncIter* lir); + void visitToIdV(LToIdV* lir); template void emitLoadElementT(LLoadElementT* lir, const T& source); - void visitLoadElementT(LLoadElementT* lir) override; - void visitLoadElementV(LLoadElementV* load) override; - void visitLoadElementHole(LLoadElementHole* lir) override; - void visitLoadUnboxedPointerV(LLoadUnboxedPointerV* lir) override; - void visitLoadUnboxedPointerT(LLoadUnboxedPointerT* lir) override; - void visitUnboxObjectOrNull(LUnboxObjectOrNull* lir) override; + void visitLoadElementT(LLoadElementT* lir); + void visitLoadElementV(LLoadElementV* load); + void visitLoadElementHole(LLoadElementHole* lir); + void visitLoadUnboxedPointerV(LLoadUnboxedPointerV* lir); + void visitLoadUnboxedPointerT(LLoadUnboxedPointerT* lir); + void visitUnboxObjectOrNull(LUnboxObjectOrNull* lir); template void visitOutOfLineSwitch(OutOfLineSwitch* ool); - void visitLoadElementFromStateV(LLoadElementFromStateV* lir) override; - void visitStoreElementT(LStoreElementT* lir) override; - void visitStoreElementV(LStoreElementV* lir) override; + void visitLoadElementFromStateV(LLoadElementFromStateV* lir); + void visitStoreElementT(LStoreElementT* lir); + void visitStoreElementV(LStoreElementV* lir); template void emitStoreElementHoleT(T* lir); template void emitStoreElementHoleV(T* lir); - void visitStoreElementHoleT(LStoreElementHoleT* lir) override; - void visitStoreElementHoleV(LStoreElementHoleV* lir) override; - void visitFallibleStoreElementV(LFallibleStoreElementV* lir) override; - void visitFallibleStoreElementT(LFallibleStoreElementT* lir) override; - void visitStoreUnboxedPointer(LStoreUnboxedPointer* lir) override; - void visitConvertUnboxedObjectToNative(LConvertUnboxedObjectToNative* lir) override; + void visitStoreElementHoleT(LStoreElementHoleT* lir); + void visitStoreElementHoleV(LStoreElementHoleV* lir); + void visitFallibleStoreElementV(LFallibleStoreElementV* lir); + void visitFallibleStoreElementT(LFallibleStoreElementT* lir); + void visitStoreUnboxedPointer(LStoreUnboxedPointer* lir); + void visitConvertUnboxedObjectToNative(LConvertUnboxedObjectToNative* lir); void emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, Register obj, Register elementsTemp, Register lengthTemp, TypedOrValueRegister out); - void visitArrayPopShiftV(LArrayPopShiftV* lir) override; - void visitArrayPopShiftT(LArrayPopShiftT* lir) override; + void visitArrayPopShiftV(LArrayPopShiftV* lir); + void visitArrayPopShiftT(LArrayPopShiftT* lir); void emitArrayPush(LInstruction* lir, const MArrayPush* mir, Register obj, const ConstantOrRegister& value, Register elementsTemp, Register length); - void visitArrayPushV(LArrayPushV* lir) override; - void visitArrayPushT(LArrayPushT* lir) override; - void visitArraySlice(LArraySlice* lir) override; - void visitArrayJoin(LArrayJoin* lir) override; - void visitLoadUnboxedScalar(LLoadUnboxedScalar* lir) override; - void visitLoadTypedArrayElementHole(LLoadTypedArrayElementHole* lir) override; - void visitStoreUnboxedScalar(LStoreUnboxedScalar* lir) override; - void visitStoreTypedArrayElementHole(LStoreTypedArrayElementHole* lir) override; - void visitAtomicIsLockFree(LAtomicIsLockFree* lir) override; - void visitGuardSharedTypedArray(LGuardSharedTypedArray* lir) override; - void visitClampIToUint8(LClampIToUint8* lir) override; - void visitClampDToUint8(LClampDToUint8* lir) override; - void visitClampVToUint8(LClampVToUint8* lir) override; - void visitGetIteratorCache(LGetIteratorCache* lir) override; - void visitIteratorMore(LIteratorMore* lir) override; - void visitIsNoIterAndBranch(LIsNoIterAndBranch* lir) override; - void visitIteratorEnd(LIteratorEnd* lir) override; - void visitArgumentsLength(LArgumentsLength* lir) override; - void visitGetFrameArgument(LGetFrameArgument* lir) override; - void visitSetFrameArgumentT(LSetFrameArgumentT* lir) override; - void visitSetFrameArgumentC(LSetFrameArgumentC* lir) override; - void visitSetFrameArgumentV(LSetFrameArgumentV* lir) override; - void visitRunOncePrologue(LRunOncePrologue* lir) override; + void visitArrayPushV(LArrayPushV* lir); + void visitArrayPushT(LArrayPushT* lir); + void visitArraySlice(LArraySlice* lir); + void visitArrayJoin(LArrayJoin* lir); + void visitLoadUnboxedScalar(LLoadUnboxedScalar* lir); + void visitLoadTypedArrayElementHole(LLoadTypedArrayElementHole* lir); + void visitStoreUnboxedScalar(LStoreUnboxedScalar* lir); + void visitStoreTypedArrayElementHole(LStoreTypedArrayElementHole* lir); + void visitAtomicIsLockFree(LAtomicIsLockFree* lir); + void visitGuardSharedTypedArray(LGuardSharedTypedArray* lir); + void visitClampIToUint8(LClampIToUint8* lir); + void visitClampDToUint8(LClampDToUint8* lir); + void visitClampVToUint8(LClampVToUint8* lir); + void visitGetIteratorCache(LGetIteratorCache* lir); + void visitIteratorMore(LIteratorMore* lir); + void visitIsNoIterAndBranch(LIsNoIterAndBranch* lir); + void visitIteratorEnd(LIteratorEnd* lir); + void visitArgumentsLength(LArgumentsLength* lir); + void visitGetFrameArgument(LGetFrameArgument* lir); + void visitSetFrameArgumentT(LSetFrameArgumentT* lir); + void visitSetFrameArgumentC(LSetFrameArgumentC* lir); + void visitSetFrameArgumentV(LSetFrameArgumentV* lir); + void visitRunOncePrologue(LRunOncePrologue* lir); void emitRest(LInstruction* lir, Register array, Register numActuals, Register temp0, Register temp1, unsigned numFormals, JSObject* templateObject, bool saveAndRestore, Register resultreg); - void visitRest(LRest* lir) override; - void visitCallSetProperty(LCallSetProperty* ins) override; - void visitCallDeleteProperty(LCallDeleteProperty* lir) override; - void visitCallDeleteElement(LCallDeleteElement* lir) override; - void visitBitNotV(LBitNotV* lir) override; - void visitBitOpV(LBitOpV* lir) override; + void visitRest(LRest* lir); + void visitCallSetProperty(LCallSetProperty* ins); + void visitCallDeleteProperty(LCallDeleteProperty* lir); + void visitCallDeleteElement(LCallDeleteElement* lir); + void visitBitNotV(LBitNotV* lir); + void visitBitOpV(LBitOpV* lir); void emitInstanceOf(LInstruction* ins, JSObject* prototypeObject); - void visitInCache(LInCache* ins) override; - void visitInArray(LInArray* ins) override; - void visitInstanceOfO(LInstanceOfO* ins) override; - void visitInstanceOfV(LInstanceOfV* ins) override; - void visitInstanceOfCache(LInstanceOfCache* ins) override; - void visitGetDOMProperty(LGetDOMProperty* lir) override; - void visitGetDOMMemberV(LGetDOMMemberV* lir) override; - void visitGetDOMMemberT(LGetDOMMemberT* lir) override; - void visitSetDOMProperty(LSetDOMProperty* lir) override; - void visitCallDOMNative(LCallDOMNative* lir) override; - void visitCallGetIntrinsicValue(LCallGetIntrinsicValue* lir) override; - void visitCallBindVar(LCallBindVar* lir) override; + void visitInCache(LInCache* ins); + void visitInArray(LInArray* ins); + void visitInstanceOfO(LInstanceOfO* ins); + void visitInstanceOfV(LInstanceOfV* ins); + void visitInstanceOfCache(LInstanceOfCache* ins); + void visitGetDOMProperty(LGetDOMProperty* lir); + void visitGetDOMMemberV(LGetDOMMemberV* lir); + void visitGetDOMMemberT(LGetDOMMemberT* lir); + void visitSetDOMProperty(LSetDOMProperty* lir); + void visitCallDOMNative(LCallDOMNative* lir); + void visitCallGetIntrinsicValue(LCallGetIntrinsicValue* lir); + void visitCallBindVar(LCallBindVar* lir); enum CallableOrConstructor { Callable, Constructor }; template void emitIsCallableOrConstructor(Register object, Register output, Label* failure); - void visitIsCallableO(LIsCallableO* lir) override; - void visitIsCallableV(LIsCallableV* lir) override; + void visitIsCallableO(LIsCallableO* lir); + void visitIsCallableV(LIsCallableV* lir); void visitOutOfLineIsCallable(OutOfLineIsCallable* ool); - void visitIsConstructor(LIsConstructor* lir) override; + void visitIsConstructor(LIsConstructor* lir); void visitOutOfLineIsConstructor(OutOfLineIsConstructor* ool); - void visitIsArrayO(LIsArrayO* lir) override; - void visitIsArrayV(LIsArrayV* lir) override; - void visitIsTypedArray(LIsTypedArray* lir) override; - void visitIsObject(LIsObject* lir) override; - void visitIsObjectAndBranch(LIsObjectAndBranch* lir) override; - void visitHasClass(LHasClass* lir) override; - void visitObjectClassToString(LObjectClassToString* lir) override; - void visitWasmParameter(LWasmParameter* lir) override; - void visitWasmParameterI64(LWasmParameterI64* lir) override; - void visitWasmReturn(LWasmReturn* ret) override; - void visitWasmReturnI64(LWasmReturnI64* ret) override; - void visitWasmReturnVoid(LWasmReturnVoid* ret) override; - void visitLexicalCheck(LLexicalCheck* ins) override; - void visitThrowRuntimeLexicalError(LThrowRuntimeLexicalError* ins) override; - void visitGlobalNameConflictsCheck(LGlobalNameConflictsCheck* ins) override; - void visitDebugger(LDebugger* ins) override; - void visitNewTarget(LNewTarget* ins) override; - void visitArrowNewTarget(LArrowNewTarget* ins) override; - void visitCheckReturn(LCheckReturn* ins) override; - void visitCheckIsObj(LCheckIsObj* ins) override; - void visitCheckIsCallable(LCheckIsCallable* ins) override; - void visitCheckObjCoercible(LCheckObjCoercible* ins) override; - void visitDebugCheckSelfHosted(LDebugCheckSelfHosted* ins) override; - void visitNaNToZero(LNaNToZero* ins) override; + void visitIsArrayO(LIsArrayO* lir); + void visitIsArrayV(LIsArrayV* lir); + void visitIsTypedArray(LIsTypedArray* lir); + void visitIsObject(LIsObject* lir); + void visitIsObjectAndBranch(LIsObjectAndBranch* lir); + void visitHasClass(LHasClass* lir); + void visitObjectClassToString(LObjectClassToString* lir); + void visitWasmParameter(LWasmParameter* lir); + void visitWasmParameterI64(LWasmParameterI64* lir); + void visitWasmReturn(LWasmReturn* ret); + void visitWasmReturnI64(LWasmReturnI64* ret); + void visitWasmReturnVoid(LWasmReturnVoid* ret); + void visitLexicalCheck(LLexicalCheck* ins); + void visitThrowRuntimeLexicalError(LThrowRuntimeLexicalError* ins); + void visitGlobalNameConflictsCheck(LGlobalNameConflictsCheck* ins); + void visitDebugger(LDebugger* ins); + void visitNewTarget(LNewTarget* ins); + void visitArrowNewTarget(LArrowNewTarget* ins); + void visitCheckReturn(LCheckReturn* ins); + void visitCheckIsObj(LCheckIsObj* ins); + void visitCheckIsCallable(LCheckIsCallable* ins); + void visitCheckObjCoercible(LCheckObjCoercible* ins); + void visitDebugCheckSelfHosted(LDebugCheckSelfHosted* ins); + void visitNaNToZero(LNaNToZero* ins); void visitOutOfLineNaNToZero(OutOfLineNaNToZero* ool); - void visitFinishBoundFunctionInit(LFinishBoundFunctionInit* lir) override; - void visitIsPackedArray(LIsPackedArray* lir) override; - void visitGetPrototypeOf(LGetPrototypeOf* lir) override; + void visitFinishBoundFunctionInit(LFinishBoundFunctionInit* lir); + void visitIsPackedArray(LIsPackedArray* lir); + void visitGetPrototypeOf(LGetPrototypeOf* lir); - void visitCheckOverRecursed(LCheckOverRecursed* lir) override; + void visitCheckOverRecursed(LCheckOverRecursed* lir); void visitCheckOverRecursedFailure(CheckOverRecursedFailure* ool); - void visitUnboxFloatingPoint(LUnboxFloatingPoint* lir) override; + void visitUnboxFloatingPoint(LUnboxFloatingPoint* lir); void visitOutOfLineUnboxFloatingPoint(OutOfLineUnboxFloatingPoint* ool); void visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool); @@ -439,36 +439,36 @@ class CodeGenerator final : public CodeGeneratorSpecific void visitOutOfLineICFallback(OutOfLineICFallback* ool); - void visitGetPropertyCacheV(LGetPropertyCacheV* ins) override; - void visitGetPropertyCacheT(LGetPropertyCacheT* ins) override; - void visitGetPropSuperCacheV(LGetPropSuperCacheV* ins) override; - void visitBindNameCache(LBindNameCache* ins) override; + void visitGetPropertyCacheV(LGetPropertyCacheV* ins); + void visitGetPropertyCacheT(LGetPropertyCacheT* ins); + void visitGetPropSuperCacheV(LGetPropSuperCacheV* ins); + void visitBindNameCache(LBindNameCache* ins); void visitCallSetProperty(LInstruction* ins); - void visitSetPropertyCache(LSetPropertyCache* ins) override; - void visitGetNameCache(LGetNameCache* ins) override; - void visitHasOwnCache(LHasOwnCache* ins) override; + void visitSetPropertyCache(LSetPropertyCache* ins); + void visitGetNameCache(LGetNameCache* ins); + void visitHasOwnCache(LHasOwnCache* ins); - void visitAssertRangeI(LAssertRangeI* ins) override; - void visitAssertRangeD(LAssertRangeD* ins) override; - void visitAssertRangeF(LAssertRangeF* ins) override; - void visitAssertRangeV(LAssertRangeV* ins) override; + void visitAssertRangeI(LAssertRangeI* ins); + void visitAssertRangeD(LAssertRangeD* ins); + void visitAssertRangeF(LAssertRangeF* ins); + void visitAssertRangeV(LAssertRangeV* ins); - void visitAssertResultV(LAssertResultV* ins) override; - void visitAssertResultT(LAssertResultT* ins) override; + void visitAssertResultV(LAssertResultV* ins); + void visitAssertResultT(LAssertResultT* ins); void emitAssertResultV(const ValueOperand output, const TemporaryTypeSet* typeset); void emitAssertObjectOrStringResult(Register input, MIRType type, const TemporaryTypeSet* typeset); - void visitInterruptCheck(LInterruptCheck* lir) override; + void visitInterruptCheck(LInterruptCheck* lir); void visitOutOfLineInterruptCheckImplicit(OutOfLineInterruptCheckImplicit* ins); - void visitWasmTrap(LWasmTrap* lir) override; - void visitWasmLoadTls(LWasmLoadTls* ins) override; - void visitWasmBoundsCheck(LWasmBoundsCheck* ins) override; - void visitWasmAlignmentCheck(LWasmAlignmentCheck* ins) override; - void visitRecompileCheck(LRecompileCheck* ins) override; - void visitRotate(LRotate* ins) override; + void visitWasmTrap(LWasmTrap* lir); + void visitWasmLoadTls(LWasmLoadTls* ins); + void visitWasmBoundsCheck(LWasmBoundsCheck* ins); + void visitWasmAlignmentCheck(LWasmAlignmentCheck* ins); + void visitRecompileCheck(LRecompileCheck* ins); + void visitRotate(LRotate* ins); - void visitRandom(LRandom* ins) override; - void visitSignExtendInt32(LSignExtendInt32* ins) override; + void visitRandom(LRandom* ins); + void visitSignExtendInt32(LSignExtendInt32* ins); #ifdef DEBUG void emitDebugForceBailing(LInstruction* lir); diff --git a/js/src/jit/LIR.h b/js/src/jit/LIR.h index 2ff4421d7d28..6811909708aa 100644 --- a/js/src/jit/LIR.h +++ b/js/src/jit/LIR.h @@ -787,15 +787,9 @@ class LNode LIR_OPCODE_LIST(LIROP) # undef LIROP - virtual void accept(LElementVisitor* visitor) = 0; - #define LIR_HEADER(opcode) \ Opcode op() const override { \ return LInstruction::LOp_##opcode; \ - } \ - void accept(LElementVisitor* visitor) override { \ - visitor->setElement(this); \ - visitor->visit##opcode(this); \ } }; @@ -914,7 +908,6 @@ class LElementVisitor return ins_; } - public: void setElement(LNode* ins) { ins_ = ins; if (ins->mirRaw()) { @@ -930,8 +923,7 @@ class LElementVisitor lastNotInlinedPC_(nullptr) {} - public: -#define VISIT_INS(op) virtual void visit##op(L##op*) { MOZ_CRASH("NYI: " #op); } +#define VISIT_INS(op) void visit##op(L##op*) { MOZ_CRASH("NYI: " #op); } LIR_OPCODE_LIST(VISIT_INS) #undef VISIT_INS }; diff --git a/js/src/jit/arm/CodeGenerator-arm.h b/js/src/jit/arm/CodeGenerator-arm.h index 38851fbff92e..bcda27d5ec6e 100644 --- a/js/src/jit/arm/CodeGenerator-arm.h +++ b/js/src/jit/arm/CodeGenerator-arm.h @@ -13,9 +13,12 @@ namespace js { namespace jit { +class CodeGeneratorARM; class OutOfLineBailout; class OutOfLineTableSwitch; +using OutOfLineWasmTruncateCheck = OutOfLineWasmTruncateCheckBase; + class CodeGeneratorARM : public CodeGeneratorShared { friend class MoveResolverARM; @@ -107,89 +110,89 @@ class CodeGeneratorARM : public CodeGeneratorShared public: // Instruction visitors. - virtual void visitMinMaxD(LMinMaxD* ins) override; - virtual void visitMinMaxF(LMinMaxF* ins) override; - virtual void visitAbsD(LAbsD* ins) override; - virtual void visitAbsF(LAbsF* ins) override; - virtual void visitSqrtD(LSqrtD* ins) override; - virtual void visitSqrtF(LSqrtF* ins) override; - virtual void visitAddI(LAddI* ins) override; - virtual void visitSubI(LSubI* ins) override; - virtual void visitBitNotI(LBitNotI* ins) override; - virtual void visitBitOpI(LBitOpI* ins) override; + void visitMinMaxD(LMinMaxD* ins); + void visitMinMaxF(LMinMaxF* ins); + void visitAbsD(LAbsD* ins); + void visitAbsF(LAbsF* ins); + void visitSqrtD(LSqrtD* ins); + void visitSqrtF(LSqrtF* ins); + void visitAddI(LAddI* ins); + void visitSubI(LSubI* ins); + void visitBitNotI(LBitNotI* ins); + void visitBitOpI(LBitOpI* ins); - virtual void visitMulI(LMulI* ins) override; + void visitMulI(LMulI* ins); - virtual void visitDivI(LDivI* ins) override; - virtual void visitSoftDivI(LSoftDivI* ins) override; - virtual void visitDivPowTwoI(LDivPowTwoI* ins) override; - virtual void visitModI(LModI* ins) override; - virtual void visitSoftModI(LSoftModI* ins) override; - virtual void visitModPowTwoI(LModPowTwoI* ins) override; - virtual void visitModMaskI(LModMaskI* ins) override; - virtual void visitPowHalfD(LPowHalfD* ins) override; - virtual void visitShiftI(LShiftI* ins) override; - virtual void visitShiftI64(LShiftI64* ins) override; - virtual void visitUrshD(LUrshD* ins) override; + void visitDivI(LDivI* ins); + void visitSoftDivI(LSoftDivI* ins); + void visitDivPowTwoI(LDivPowTwoI* ins); + void visitModI(LModI* ins); + void visitSoftModI(LSoftModI* ins); + void visitModPowTwoI(LModPowTwoI* ins); + void visitModMaskI(LModMaskI* ins); + void visitPowHalfD(LPowHalfD* ins); + void visitShiftI(LShiftI* ins); + void visitShiftI64(LShiftI64* ins); + void visitUrshD(LUrshD* ins); - virtual void visitClzI(LClzI* ins) override; - virtual void visitCtzI(LCtzI* ins) override; - virtual void visitPopcntI(LPopcntI* ins) override; + void visitClzI(LClzI* ins); + void visitCtzI(LCtzI* ins); + void visitPopcntI(LPopcntI* ins); - virtual void visitTestIAndBranch(LTestIAndBranch* test) override; - virtual void visitCompare(LCompare* comp) override; - virtual void visitCompareAndBranch(LCompareAndBranch* comp) override; - virtual void visitTestDAndBranch(LTestDAndBranch* test) override; - virtual void visitTestFAndBranch(LTestFAndBranch* test) override; - virtual void visitCompareD(LCompareD* comp) override; - virtual void visitCompareF(LCompareF* comp) override; - virtual void visitCompareDAndBranch(LCompareDAndBranch* comp) override; - virtual void visitCompareFAndBranch(LCompareFAndBranch* comp) override; - virtual void visitCompareB(LCompareB* lir) override; - virtual void visitCompareBAndBranch(LCompareBAndBranch* lir) override; - virtual void visitCompareBitwise(LCompareBitwise* lir) override; - virtual void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir) override; - virtual void visitBitAndAndBranch(LBitAndAndBranch* baab) override; - virtual void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir) override; - virtual void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir) override; - virtual void visitNotI(LNotI* ins) override; - virtual void visitNotD(LNotD* ins) override; - virtual void visitNotF(LNotF* ins) override; + void visitTestIAndBranch(LTestIAndBranch* test); + void visitCompare(LCompare* comp); + void visitCompareAndBranch(LCompareAndBranch* comp); + void visitTestDAndBranch(LTestDAndBranch* test); + void visitTestFAndBranch(LTestFAndBranch* test); + void visitCompareD(LCompareD* comp); + void visitCompareF(LCompareF* comp); + void visitCompareDAndBranch(LCompareDAndBranch* comp); + void visitCompareFAndBranch(LCompareFAndBranch* comp); + void visitCompareB(LCompareB* lir); + void visitCompareBAndBranch(LCompareBAndBranch* lir); + void visitCompareBitwise(LCompareBitwise* lir); + void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir); + void visitBitAndAndBranch(LBitAndAndBranch* baab); + void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir); + void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir); + void visitNotI(LNotI* ins); + void visitNotD(LNotD* ins); + void visitNotF(LNotF* ins); - virtual void visitMathD(LMathD* math) override; - virtual void visitMathF(LMathF* math) override; - virtual void visitFloor(LFloor* lir) override; - virtual void visitFloorF(LFloorF* lir) override; - virtual void visitCeil(LCeil* lir) override; - virtual void visitCeilF(LCeilF* lir) override; - virtual void visitRound(LRound* lir) override; - virtual void visitRoundF(LRoundF* lir) override; - virtual void visitTruncateDToInt32(LTruncateDToInt32* ins) override; - virtual void visitTruncateFToInt32(LTruncateFToInt32* ins) override; + void visitMathD(LMathD* math); + void visitMathF(LMathF* math); + void visitFloor(LFloor* lir); + void visitFloorF(LFloorF* lir); + void visitCeil(LCeil* lir); + void visitCeilF(LCeilF* lir); + void visitRound(LRound* lir); + void visitRoundF(LRoundF* lir); + void visitTruncateDToInt32(LTruncateDToInt32* ins); + void visitTruncateFToInt32(LTruncateFToInt32* ins); - virtual void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir) override; - virtual void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir) override; - virtual void visitSignExtendInt64(LSignExtendInt64* ins) override; - virtual void visitAddI64(LAddI64* lir) override; - virtual void visitSubI64(LSubI64* lir) override; - virtual void visitMulI64(LMulI64* lir) override; - virtual void visitDivOrModI64(LDivOrModI64* lir) override; - virtual void visitUDivOrModI64(LUDivOrModI64* lir) override; - virtual void visitCompareI64(LCompareI64* lir) override; - virtual void visitCompareI64AndBranch(LCompareI64AndBranch* lir) override; - virtual void visitBitOpI64(LBitOpI64* lir) override; - virtual void visitRotateI64(LRotateI64* lir) override; - virtual void visitWasmStackArgI64(LWasmStackArgI64* lir) override; - virtual void visitWasmSelectI64(LWasmSelectI64* lir) override; - virtual void visitWasmReinterpretFromI64(LWasmReinterpretFromI64* lir) override; - virtual void visitWasmReinterpretToI64(LWasmReinterpretToI64* lir) override; - virtual void visitPopcntI64(LPopcntI64* ins) override; - virtual void visitClzI64(LClzI64* ins) override; - virtual void visitCtzI64(LCtzI64* ins) override; - virtual void visitNotI64(LNotI64* ins) override; - virtual void visitWasmTruncateToInt64(LWasmTruncateToInt64* ins) override; - virtual void visitInt64ToFloatingPointCall(LInt64ToFloatingPointCall* lir) override; - virtual void visitTestI64AndBranch(LTestI64AndBranch* lir) override; + void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir); + void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir); + void visitSignExtendInt64(LSignExtendInt64* ins); + void visitAddI64(LAddI64* lir); + void visitSubI64(LSubI64* lir); + void visitMulI64(LMulI64* lir); + void visitDivOrModI64(LDivOrModI64* lir); + void visitUDivOrModI64(LUDivOrModI64* lir); + void visitCompareI64(LCompareI64* lir); + void visitCompareI64AndBranch(LCompareI64AndBranch* lir); + void visitBitOpI64(LBitOpI64* lir); + void visitRotateI64(LRotateI64* lir); + void visitWasmStackArgI64(LWasmStackArgI64* lir); + void visitWasmSelectI64(LWasmSelectI64* lir); + void visitWasmReinterpretFromI64(LWasmReinterpretFromI64* lir); + void visitWasmReinterpretToI64(LWasmReinterpretToI64* lir); + void visitPopcntI64(LPopcntI64* ins); + void visitClzI64(LClzI64* ins); + void visitCtzI64(LCtzI64* ins); + void visitNotI64(LNotI64* ins); + void visitWasmTruncateToInt64(LWasmTruncateToInt64* ins); + void visitInt64ToFloatingPointCall(LInt64ToFloatingPointCall* lir); + void visitTestI64AndBranch(LTestI64AndBranch* lir); // Out of line visitors. void visitOutOfLineBailout(OutOfLineBailout* ool); @@ -214,50 +217,50 @@ class CodeGeneratorARM : public CodeGeneratorShared CodeGeneratorARM(MIRGenerator* gen, LIRGraph* graph, MacroAssembler* masm); public: - void visitBox(LBox* box) override; - void visitBoxFloatingPoint(LBoxFloatingPoint* box) override; - void visitUnbox(LUnbox* unbox) override; - void visitValue(LValue* value) override; - void visitDouble(LDouble* ins) override; - void visitFloat32(LFloat32* ins) override; + void visitBox(LBox* box); + void visitBoxFloatingPoint(LBoxFloatingPoint* box); + void visitUnbox(LUnbox* unbox); + void visitValue(LValue* value); + void visitDouble(LDouble* ins); + void visitFloat32(LFloat32* ins); - void visitGuardShape(LGuardShape* guard) override; - void visitGuardObjectGroup(LGuardObjectGroup* guard) override; - void visitGuardClass(LGuardClass* guard) override; + void visitGuardShape(LGuardShape* guard); + void visitGuardObjectGroup(LGuardObjectGroup* guard); + void visitGuardClass(LGuardClass* guard); - void visitNegI(LNegI* lir) override; - void visitNegD(LNegD* lir) override; - void visitNegF(LNegF* lir) override; - void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins) override; - void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins) override; - void visitAtomicTypedArrayElementBinop(LAtomicTypedArrayElementBinop* lir) override; - void visitAtomicTypedArrayElementBinopForEffect(LAtomicTypedArrayElementBinopForEffect* lir) override; - void visitCompareExchangeTypedArrayElement(LCompareExchangeTypedArrayElement* lir) override; - void visitAtomicExchangeTypedArrayElement(LAtomicExchangeTypedArrayElement* lir) override; - void visitWasmSelect(LWasmSelect* ins) override; - void visitWasmReinterpret(LWasmReinterpret* ins) override; - void visitWasmLoad(LWasmLoad* ins) override; - void visitWasmLoadI64(LWasmLoadI64* ins) override; - void visitWasmUnalignedLoad(LWasmUnalignedLoad* ins) override; - void visitWasmUnalignedLoadI64(LWasmUnalignedLoadI64* ins) override; - void visitWasmAddOffset(LWasmAddOffset* ins) override; - void visitWasmStore(LWasmStore* ins) override; - void visitWasmStoreI64(LWasmStoreI64* ins) override; - void visitWasmUnalignedStore(LWasmUnalignedStore* ins) override; - void visitWasmUnalignedStoreI64(LWasmUnalignedStoreI64* ins) override; - void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins) override; - void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins) override; - void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins) override; - void visitWasmAtomicExchangeHeap(LWasmAtomicExchangeHeap* ins) override; - void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins) override; - void visitWasmAtomicBinopHeapForEffect(LWasmAtomicBinopHeapForEffect* ins) override; - void visitWasmStackArg(LWasmStackArg* ins) override; - void visitWasmTruncateToInt32(LWasmTruncateToInt32* ins) override; - void visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCheck* ool) override; - void visitCopySignD(LCopySignD* ins) override; - void visitCopySignF(LCopySignF* ins) override; + void visitNegI(LNegI* lir); + void visitNegD(LNegD* lir); + void visitNegF(LNegF* lir); + void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins); + void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins); + void visitAtomicTypedArrayElementBinop(LAtomicTypedArrayElementBinop* lir); + void visitAtomicTypedArrayElementBinopForEffect(LAtomicTypedArrayElementBinopForEffect* lir); + void visitCompareExchangeTypedArrayElement(LCompareExchangeTypedArrayElement* lir); + void visitAtomicExchangeTypedArrayElement(LAtomicExchangeTypedArrayElement* lir); + void visitWasmSelect(LWasmSelect* ins); + void visitWasmReinterpret(LWasmReinterpret* ins); + void visitWasmLoad(LWasmLoad* ins); + void visitWasmLoadI64(LWasmLoadI64* ins); + void visitWasmUnalignedLoad(LWasmUnalignedLoad* ins); + void visitWasmUnalignedLoadI64(LWasmUnalignedLoadI64* ins); + void visitWasmAddOffset(LWasmAddOffset* ins); + void visitWasmStore(LWasmStore* ins); + void visitWasmStoreI64(LWasmStoreI64* ins); + void visitWasmUnalignedStore(LWasmUnalignedStore* ins); + void visitWasmUnalignedStoreI64(LWasmUnalignedStoreI64* ins); + void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins); + void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins); + void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins); + void visitWasmAtomicExchangeHeap(LWasmAtomicExchangeHeap* ins); + void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins); + void visitWasmAtomicBinopHeapForEffect(LWasmAtomicBinopHeapForEffect* ins); + void visitWasmStackArg(LWasmStackArg* ins); + void visitWasmTruncateToInt32(LWasmTruncateToInt32* ins); + void visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCheck* ool); + void visitCopySignD(LCopySignD* ins); + void visitCopySignF(LCopySignF* ins); - void visitMemoryBarrier(LMemoryBarrier* ins) override; + void visitMemoryBarrier(LMemoryBarrier* ins); void generateInvalidateEpilogue(); @@ -274,35 +277,35 @@ class CodeGeneratorARM : public CodeGeneratorShared void atomicBinopToTypedIntArray(AtomicOp op, Scalar::Type arrayType, const S& value, const T& mem, Register flagTemp); - void visitWasmAtomicLoadI64(LWasmAtomicLoadI64* lir) override; - void visitWasmAtomicStoreI64(LWasmAtomicStoreI64* lir) override; - void visitWasmCompareExchangeI64(LWasmCompareExchangeI64* lir) override; - void visitWasmAtomicBinopI64(LWasmAtomicBinopI64* lir) override; - void visitWasmAtomicExchangeI64(LWasmAtomicExchangeI64* lir) override; + void visitWasmAtomicLoadI64(LWasmAtomicLoadI64* lir); + void visitWasmAtomicStoreI64(LWasmAtomicStoreI64* lir); + void visitWasmCompareExchangeI64(LWasmCompareExchangeI64* lir); + void visitWasmAtomicBinopI64(LWasmAtomicBinopI64* lir); + void visitWasmAtomicExchangeI64(LWasmAtomicExchangeI64* lir); protected: - void visitEffectiveAddress(LEffectiveAddress* ins) override; - void visitUDiv(LUDiv* ins) override; - void visitUMod(LUMod* ins) override; - void visitSoftUDivOrMod(LSoftUDivOrMod* ins) override; + void visitEffectiveAddress(LEffectiveAddress* ins); + void visitUDiv(LUDiv* ins); + void visitUMod(LUMod* ins); + void visitSoftUDivOrMod(LSoftUDivOrMod* ins); public: // Unimplemented SIMD instructions - void visitSimdSplatX4(LSimdSplatX4* lir) override { MOZ_CRASH("NYI"); } - void visitSimd128Int(LSimd128Int* ins) override { MOZ_CRASH("NYI"); } - void visitSimd128Float(LSimd128Float* ins) override { MOZ_CRASH("NYI"); } - void visitSimdReinterpretCast(LSimdReinterpretCast* ins) override { MOZ_CRASH("NYI"); } - void visitSimdExtractElementI(LSimdExtractElementI* ins) override { MOZ_CRASH("NYI"); } - void visitSimdExtractElementF(LSimdExtractElementF* ins) override { MOZ_CRASH("NYI"); } - void visitSimdGeneralShuffleI(LSimdGeneralShuffleI* lir) override { MOZ_CRASH("NYI"); } - void visitSimdGeneralShuffleF(LSimdGeneralShuffleF* lir) override { MOZ_CRASH("NYI"); } - void visitSimdSwizzleI(LSimdSwizzleI* lir) override { MOZ_CRASH("NYI"); } - void visitSimdSwizzleF(LSimdSwizzleF* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryCompIx4(LSimdBinaryCompIx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryCompFx4(LSimdBinaryCompFx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryArithIx4(LSimdBinaryArithIx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryArithFx4(LSimdBinaryArithFx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryBitwise(LSimdBinaryBitwise* lir) override { MOZ_CRASH("NYI"); } + void visitSimdSplatX4(LSimdSplatX4* lir) { MOZ_CRASH("NYI"); } + void visitSimd128Int(LSimd128Int* ins) { MOZ_CRASH("NYI"); } + void visitSimd128Float(LSimd128Float* ins) { MOZ_CRASH("NYI"); } + void visitSimdReinterpretCast(LSimdReinterpretCast* ins) { MOZ_CRASH("NYI"); } + void visitSimdExtractElementI(LSimdExtractElementI* ins) { MOZ_CRASH("NYI"); } + void visitSimdExtractElementF(LSimdExtractElementF* ins) { MOZ_CRASH("NYI"); } + void visitSimdGeneralShuffleI(LSimdGeneralShuffleI* lir) { MOZ_CRASH("NYI"); } + void visitSimdGeneralShuffleF(LSimdGeneralShuffleF* lir) { MOZ_CRASH("NYI"); } + void visitSimdSwizzleI(LSimdSwizzleI* lir) { MOZ_CRASH("NYI"); } + void visitSimdSwizzleF(LSimdSwizzleF* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryCompIx4(LSimdBinaryCompIx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryCompFx4(LSimdBinaryCompFx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryArithIx4(LSimdBinaryArithIx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryArithFx4(LSimdBinaryArithFx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryBitwise(LSimdBinaryBitwise* lir) { MOZ_CRASH("NYI"); } }; typedef CodeGeneratorARM CodeGeneratorSpecific; diff --git a/js/src/jit/arm64/CodeGenerator-arm64.h b/js/src/jit/arm64/CodeGenerator-arm64.h index bd623eba18ac..e3f2755a4f68 100644 --- a/js/src/jit/arm64/CodeGenerator-arm64.h +++ b/js/src/jit/arm64/CodeGenerator-arm64.h @@ -97,61 +97,61 @@ class CodeGeneratorARM64 : public CodeGeneratorShared public: // Instruction visitors. - virtual void visitMinMaxD(LMinMaxD* ins) override; - virtual void visitMinMaxF(LMinMaxF* math) override; - virtual void visitAbsD(LAbsD* ins) override; - virtual void visitAbsF(LAbsF* ins) override; - virtual void visitSqrtD(LSqrtD* ins) override; - virtual void visitSqrtF(LSqrtF* ins) override; - virtual void visitAddI(LAddI* ins) override; - virtual void visitSubI(LSubI* ins) override; - virtual void visitBitNotI(LBitNotI* ins) override; - virtual void visitBitOpI(LBitOpI* ins) override; + void visitMinMaxD(LMinMaxD* ins); + void visitMinMaxF(LMinMaxF* math); + void visitAbsD(LAbsD* ins); + void visitAbsF(LAbsF* ins); + void visitSqrtD(LSqrtD* ins); + void visitSqrtF(LSqrtF* ins); + void visitAddI(LAddI* ins); + void visitSubI(LSubI* ins); + void visitBitNotI(LBitNotI* ins); + void visitBitOpI(LBitOpI* ins); - virtual void visitMulI(LMulI* ins) override; + void visitMulI(LMulI* ins); - virtual void visitDivI(LDivI* ins) override; - virtual void visitDivPowTwoI(LDivPowTwoI* ins) override; - virtual void visitModI(LModI* ins) override; - virtual void visitModPowTwoI(LModPowTwoI* ins) override; - virtual void visitModMaskI(LModMaskI* ins) override; - virtual void visitPowHalfD(LPowHalfD* ins) override; - virtual void visitShiftI(LShiftI* ins) override; - virtual void visitUrshD(LUrshD* ins) override; + void visitDivI(LDivI* ins); + void visitDivPowTwoI(LDivPowTwoI* ins); + void visitModI(LModI* ins); + void visitModPowTwoI(LModPowTwoI* ins); + void visitModMaskI(LModMaskI* ins); + void visitPowHalfD(LPowHalfD* ins); + void visitShiftI(LShiftI* ins); + void visitUrshD(LUrshD* ins); - virtual void visitTestIAndBranch(LTestIAndBranch* test) override; - virtual void visitCompare(LCompare* comp) override; - virtual void visitCompareAndBranch(LCompareAndBranch* comp) override; - virtual void visitTestDAndBranch(LTestDAndBranch* test) override; - virtual void visitTestFAndBranch(LTestFAndBranch* test) override; - virtual void visitCompareD(LCompareD* comp) override; - virtual void visitCompareF(LCompareF* comp) override; - virtual void visitCompareDAndBranch(LCompareDAndBranch* comp) override; - virtual void visitCompareFAndBranch(LCompareFAndBranch* comp) override; - virtual void visitCompareB(LCompareB* lir) override; - virtual void visitCompareBAndBranch(LCompareBAndBranch* lir) override; - virtual void visitCompareBitwise(LCompareBitwise* lir) override; - virtual void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir) override; - virtual void visitBitAndAndBranch(LBitAndAndBranch* baab) override; - virtual void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir) override; - virtual void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir) override; - virtual void visitNotI(LNotI* ins) override; - virtual void visitNotD(LNotD* ins) override; - virtual void visitNotF(LNotF* ins) override; + void visitTestIAndBranch(LTestIAndBranch* test); + void visitCompare(LCompare* comp); + void visitCompareAndBranch(LCompareAndBranch* comp); + void visitTestDAndBranch(LTestDAndBranch* test); + void visitTestFAndBranch(LTestFAndBranch* test); + void visitCompareD(LCompareD* comp); + void visitCompareF(LCompareF* comp); + void visitCompareDAndBranch(LCompareDAndBranch* comp); + void visitCompareFAndBranch(LCompareFAndBranch* comp); + void visitCompareB(LCompareB* lir); + void visitCompareBAndBranch(LCompareBAndBranch* lir); + void visitCompareBitwise(LCompareBitwise* lir); + void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir); + void visitBitAndAndBranch(LBitAndAndBranch* baab); + void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir); + void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir); + void visitNotI(LNotI* ins); + void visitNotD(LNotD* ins); + void visitNotF(LNotF* ins); - virtual void visitMathD(LMathD* math) override; - virtual void visitMathF(LMathF* math) override; - virtual void visitFloor(LFloor* lir) override; - virtual void visitFloorF(LFloorF* lir) override; - virtual void visitCeil(LCeil* lir) override; - virtual void visitCeilF(LCeilF* lir) override; - virtual void visitRound(LRound* lir) override; - virtual void visitRoundF(LRoundF* lir) override; - virtual void visitTruncateDToInt32(LTruncateDToInt32* ins) override; - virtual void visitTruncateFToInt32(LTruncateFToInt32* ins) override; + void visitMathD(LMathD* math); + void visitMathF(LMathF* math); + void visitFloor(LFloor* lir); + void visitFloorF(LFloorF* lir); + void visitCeil(LCeil* lir); + void visitCeilF(LCeilF* lir); + void visitRound(LRound* lir); + void visitRoundF(LRoundF* lir); + void visitTruncateDToInt32(LTruncateDToInt32* ins); + void visitTruncateFToInt32(LTruncateFToInt32* ins); - virtual void visitClzI(LClzI* lir) override; - virtual void visitCtzI(LCtzI* lir) override; + void visitClzI(LClzI* lir); + void visitCtzI(LCtzI* lir); // Out of line visitors. void visitOutOfLineBailout(OutOfLineBailout* ool); void visitOutOfLineTableSwitch(OutOfLineTableSwitch* ool); @@ -173,36 +173,36 @@ class CodeGeneratorARM64 : public CodeGeneratorShared Label& done); public: - void visitBox(LBox* box) override; - void visitUnbox(LUnbox* unbox) override; - void visitValue(LValue* value) override; - void visitDouble(LDouble* ins) override; - void visitFloat32(LFloat32* ins) override; + void visitBox(LBox* box); + void visitUnbox(LUnbox* unbox); + void visitValue(LValue* value); + void visitDouble(LDouble* ins); + void visitFloat32(LFloat32* ins); - void visitLoadSlotV(LLoadSlotV* load) override; - void visitLoadSlotT(LLoadSlotT* load) override; - void visitStoreSlotT(LStoreSlotT* load) override; + void visitLoadSlotV(LLoadSlotV* load); + void visitLoadSlotT(LLoadSlotT* load); + void visitStoreSlotT(LStoreSlotT* load); - void visitLoadElementT(LLoadElementT* load) override; + void visitLoadElementT(LLoadElementT* load); - void visitGuardShape(LGuardShape* guard) override; - void visitGuardObjectGroup(LGuardObjectGroup* guard) override; - void visitGuardClass(LGuardClass* guard) override; + void visitGuardShape(LGuardShape* guard); + void visitGuardObjectGroup(LGuardObjectGroup* guard); + void visitGuardClass(LGuardClass* guard); - void visitInterruptCheck(LInterruptCheck* lir) override; + void visitInterruptCheck(LInterruptCheck* lir); - void visitNegI(LNegI* lir) override; - void visitNegD(LNegD* lir) override; - void visitNegF(LNegF* lir) override; - void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins) override; - void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins) override; - void visitCompareExchangeTypedArrayElement(LCompareExchangeTypedArrayElement* lir) override; - void visitAtomicExchangeTypedArrayElement(LAtomicExchangeTypedArrayElement* lir) override; - void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins) override; - void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins) override; - void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins) override; - void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins) override; - void visitWasmStackArg(LWasmStackArg* ins) override; + void visitNegI(LNegI* lir); + void visitNegD(LNegD* lir); + void visitNegF(LNegF* lir); + void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins); + void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins); + void visitCompareExchangeTypedArrayElement(LCompareExchangeTypedArrayElement* lir); + void visitAtomicExchangeTypedArrayElement(LAtomicExchangeTypedArrayElement* lir); + void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins); + void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins); + void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins); + void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins); + void visitWasmStackArg(LWasmStackArg* ins); void generateInvalidateEpilogue(); @@ -213,22 +213,22 @@ class CodeGeneratorARM64 : public CodeGeneratorShared MOZ_CRASH("postWasmCall"); } - void visitEffectiveAddress(LEffectiveAddress* ins) override; - void visitUDiv(LUDiv* ins) override; - void visitUMod(LUMod* ins) override; + void visitEffectiveAddress(LEffectiveAddress* ins); + void visitUDiv(LUDiv* ins); + void visitUMod(LUMod* ins); public: // Unimplemented SIMD instructions. - void visitSimdSplatX4(LSimdSplatX4* lir) override { MOZ_CRASH("NYI"); } - void visitSimd128Int(LSimd128Int* ins) override { MOZ_CRASH("NYI"); } - void visitSimd128Float(LSimd128Float* ins) override { MOZ_CRASH("NYI"); } - void visitSimdExtractElementI(LSimdExtractElementI* ins) override { MOZ_CRASH("NYI"); } - void visitSimdExtractElementF(LSimdExtractElementF* ins) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryCompIx4(LSimdBinaryCompIx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryCompFx4(LSimdBinaryCompFx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryArithIx4(LSimdBinaryArithIx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryArithFx4(LSimdBinaryArithFx4* lir) override { MOZ_CRASH("NYI"); } - void visitSimdBinaryBitwise(LSimdBinaryBitwise* lir) override { MOZ_CRASH("NYI"); } + void visitSimdSplatX4(LSimdSplatX4* lir) { MOZ_CRASH("NYI"); } + void visitSimd128Int(LSimd128Int* ins) { MOZ_CRASH("NYI"); } + void visitSimd128Float(LSimd128Float* ins) { MOZ_CRASH("NYI"); } + void visitSimdExtractElementI(LSimdExtractElementI* ins) { MOZ_CRASH("NYI"); } + void visitSimdExtractElementF(LSimdExtractElementF* ins) { MOZ_CRASH("NYI"); } + void visitSimdBinaryCompIx4(LSimdBinaryCompIx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryCompFx4(LSimdBinaryCompFx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryArithIx4(LSimdBinaryArithIx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryArithFx4(LSimdBinaryArithFx4* lir) { MOZ_CRASH("NYI"); } + void visitSimdBinaryBitwise(LSimdBinaryBitwise* lir) { MOZ_CRASH("NYI"); } }; typedef CodeGeneratorARM64 CodeGeneratorSpecific; diff --git a/js/src/jit/mips-shared/CodeGenerator-mips-shared.h b/js/src/jit/mips-shared/CodeGenerator-mips-shared.h index c437892f00b6..670e9c221b2b 100644 --- a/js/src/jit/mips-shared/CodeGenerator-mips-shared.h +++ b/js/src/jit/mips-shared/CodeGenerator-mips-shared.h @@ -126,65 +126,65 @@ class CodeGeneratorMIPSShared : public CodeGeneratorShared public: // Instruction visitors. - virtual void visitMinMaxD(LMinMaxD* ins); - virtual void visitMinMaxF(LMinMaxF* ins); - virtual void visitAbsD(LAbsD* ins); - virtual void visitAbsF(LAbsF* ins); - virtual void visitSqrtD(LSqrtD* ins); - virtual void visitSqrtF(LSqrtF* ins); - virtual void visitAddI(LAddI* ins); - virtual void visitAddI64(LAddI64* ins); - virtual void visitSubI(LSubI* ins); - virtual void visitSubI64(LSubI64* ins); - virtual void visitBitNotI(LBitNotI* ins); - virtual void visitBitOpI(LBitOpI* ins); - virtual void visitBitOpI64(LBitOpI64* ins); + void visitMinMaxD(LMinMaxD* ins); + void visitMinMaxF(LMinMaxF* ins); + void visitAbsD(LAbsD* ins); + void visitAbsF(LAbsF* ins); + void visitSqrtD(LSqrtD* ins); + void visitSqrtF(LSqrtF* ins); + void visitAddI(LAddI* ins); + void visitAddI64(LAddI64* ins); + void visitSubI(LSubI* ins); + void visitSubI64(LSubI64* ins); + void visitBitNotI(LBitNotI* ins); + void visitBitOpI(LBitOpI* ins); + void visitBitOpI64(LBitOpI64* ins); - virtual void visitMulI(LMulI* ins); - virtual void visitMulI64(LMulI64* ins); + void visitMulI(LMulI* ins); + void visitMulI64(LMulI64* ins); - virtual void visitDivI(LDivI* ins); - virtual void visitDivPowTwoI(LDivPowTwoI* ins); - virtual void visitModI(LModI* ins); - virtual void visitModPowTwoI(LModPowTwoI* ins); - virtual void visitModMaskI(LModMaskI* ins); - virtual void visitPowHalfD(LPowHalfD* ins); - virtual void visitShiftI(LShiftI* ins); - virtual void visitShiftI64(LShiftI64* ins); - virtual void visitRotateI64(LRotateI64* lir); - virtual void visitUrshD(LUrshD* ins); + void visitDivI(LDivI* ins); + void visitDivPowTwoI(LDivPowTwoI* ins); + void visitModI(LModI* ins); + void visitModPowTwoI(LModPowTwoI* ins); + void visitModMaskI(LModMaskI* ins); + void visitPowHalfD(LPowHalfD* ins); + void visitShiftI(LShiftI* ins); + void visitShiftI64(LShiftI64* ins); + void visitRotateI64(LRotateI64* lir); + void visitUrshD(LUrshD* ins); - virtual void visitClzI(LClzI* ins); - virtual void visitCtzI(LCtzI* ins); - virtual void visitPopcntI(LPopcntI* ins); - virtual void visitPopcntI64(LPopcntI64* lir); + void visitClzI(LClzI* ins); + void visitCtzI(LCtzI* ins); + void visitPopcntI(LPopcntI* ins); + void visitPopcntI64(LPopcntI64* lir); - virtual void visitTestIAndBranch(LTestIAndBranch* test); - virtual void visitCompare(LCompare* comp); - virtual void visitCompareAndBranch(LCompareAndBranch* comp); - virtual void visitTestDAndBranch(LTestDAndBranch* test); - virtual void visitTestFAndBranch(LTestFAndBranch* test); - virtual void visitCompareD(LCompareD* comp); - virtual void visitCompareF(LCompareF* comp); - virtual void visitCompareDAndBranch(LCompareDAndBranch* comp); - virtual void visitCompareFAndBranch(LCompareFAndBranch* comp); - virtual void visitBitAndAndBranch(LBitAndAndBranch* lir); - virtual void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir); - virtual void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir); - virtual void visitNotI(LNotI* ins); - virtual void visitNotD(LNotD* ins); - virtual void visitNotF(LNotF* ins); + void visitTestIAndBranch(LTestIAndBranch* test); + void visitCompare(LCompare* comp); + void visitCompareAndBranch(LCompareAndBranch* comp); + void visitTestDAndBranch(LTestDAndBranch* test); + void visitTestFAndBranch(LTestFAndBranch* test); + void visitCompareD(LCompareD* comp); + void visitCompareF(LCompareF* comp); + void visitCompareDAndBranch(LCompareDAndBranch* comp); + void visitCompareFAndBranch(LCompareFAndBranch* comp); + void visitBitAndAndBranch(LBitAndAndBranch* lir); + void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir); + void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir); + void visitNotI(LNotI* ins); + void visitNotD(LNotD* ins); + void visitNotF(LNotF* ins); - virtual void visitMathD(LMathD* math); - virtual void visitMathF(LMathF* math); - virtual void visitFloor(LFloor* lir); - virtual void visitFloorF(LFloorF* lir); - virtual void visitCeil(LCeil* lir); - virtual void visitCeilF(LCeilF* lir); - virtual void visitRound(LRound* lir); - virtual void visitRoundF(LRoundF* lir); - virtual void visitTruncateDToInt32(LTruncateDToInt32* ins); - virtual void visitTruncateFToInt32(LTruncateFToInt32* ins); + void visitMathD(LMathD* math); + void visitMathF(LMathF* math); + void visitFloor(LFloor* lir); + void visitFloorF(LFloorF* lir); + void visitCeil(LCeil* lir); + void visitCeilF(LCeilF* lir); + void visitRound(LRound* lir); + void visitRoundF(LRoundF* lir); + void visitTruncateDToInt32(LTruncateDToInt32* ins); + void visitTruncateFToInt32(LTruncateFToInt32* ins); void visitWasmTruncateToInt32(LWasmTruncateToInt32* lir); @@ -288,7 +288,7 @@ class OutOfLineBailout : public OutOfLineCodeBase frameSize_(frameSize) { } - void accept(CodeGeneratorMIPSShared* codegen); + void accept(CodeGeneratorMIPSShared* codegen) override; LSnapshot* snapshot() const { return snapshot_; diff --git a/js/src/jit/shared/CodeGenerator-shared.h b/js/src/jit/shared/CodeGenerator-shared.h index 1e265f86d26b..fd0d1a52ac8e 100644 --- a/js/src/jit/shared/CodeGenerator-shared.h +++ b/js/src/jit/shared/CodeGenerator-shared.h @@ -33,7 +33,6 @@ template class OutOfLineCallVM; class OutOfLineTruncateSlow; -class OutOfLineWasmTruncateCheck; struct PatchableBackedgeInfo { @@ -350,20 +349,20 @@ class CodeGeneratorShared : public LElementVisitor void emitTruncateFloat32(FloatRegister src, Register dest, MTruncateToInt32* mir); void emitWasmCallBase(MWasmCall* mir, bool needsBoundsCheck); - void visitWasmCall(LWasmCall* ins) override { + void visitWasmCall(LWasmCall* ins) { emitWasmCallBase(ins->mir(), ins->needsBoundsCheck()); } - void visitWasmCallVoid(LWasmCallVoid* ins) override { + void visitWasmCallVoid(LWasmCallVoid* ins) { emitWasmCallBase(ins->mir(), ins->needsBoundsCheck()); } - void visitWasmCallI64(LWasmCallI64* ins) override { + void visitWasmCallI64(LWasmCallI64* ins) { emitWasmCallBase(ins->mir(), ins->needsBoundsCheck()); } - void visitWasmLoadGlobalVar(LWasmLoadGlobalVar* ins) override; - void visitWasmStoreGlobalVar(LWasmStoreGlobalVar* ins) override; - void visitWasmLoadGlobalVarI64(LWasmLoadGlobalVarI64* ins) override; - void visitWasmStoreGlobalVarI64(LWasmStoreGlobalVarI64* ins) override; + void visitWasmLoadGlobalVar(LWasmLoadGlobalVar* ins); + void visitWasmStoreGlobalVar(LWasmStoreGlobalVar* ins); + void visitWasmLoadGlobalVarI64(LWasmLoadGlobalVarI64* ins); + void visitWasmStoreGlobalVarI64(LWasmStoreGlobalVarI64* ins); void emitPreBarrier(Register base, const LAllocation* index, int32_t offsetAdjustment); void emitPreBarrier(Address address); @@ -530,10 +529,6 @@ class CodeGeneratorShared : public LElementVisitor void visitOutOfLineTruncateSlow(OutOfLineTruncateSlow* ool); - virtual void visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCheck* ool) { - MOZ_CRASH("NYI"); - } - bool omitOverRecursedCheck() const; #ifdef JS_TRACE_LOGGING @@ -849,7 +844,8 @@ CodeGeneratorShared::visitOutOfLineCallVM(OutOfLineCallVM masm.jump(ool->rejoin()); } -class OutOfLineWasmTruncateCheck : public OutOfLineCodeBase +template +class OutOfLineWasmTruncateCheckBase : public OutOfLineCodeBase { MIRType fromType_; MIRType toType_; @@ -860,19 +856,21 @@ class OutOfLineWasmTruncateCheck : public OutOfLineCodeBase wasm::BytecodeOffset bytecodeOffset_; public: - OutOfLineWasmTruncateCheck(MWasmTruncateToInt32* mir, FloatRegister input, Register output) + OutOfLineWasmTruncateCheckBase(MWasmTruncateToInt32* mir, FloatRegister input, + Register output) : fromType_(mir->input()->type()), toType_(MIRType::Int32), input_(input), output_(output), output64_(Register64::Invalid()), flags_(mir->flags()), bytecodeOffset_(mir->bytecodeOffset()) { } - OutOfLineWasmTruncateCheck(MWasmTruncateToInt64* mir, FloatRegister input, Register64 output) + OutOfLineWasmTruncateCheckBase(MWasmTruncateToInt64* mir, FloatRegister input, + Register64 output) : fromType_(mir->input()->type()), toType_(MIRType::Int64), input_(input), output_(Register::Invalid()), output64_(output), flags_(mir->flags()), bytecodeOffset_(mir->bytecodeOffset()) { } - void accept(CodeGeneratorShared* codegen) override { + void accept(CodeGen* codegen) override { codegen->visitOutOfLineWasmTruncateCheck(this); } diff --git a/js/src/jit/x64/CodeGenerator-x64.h b/js/src/jit/x64/CodeGenerator-x64.h index bbc60449dca9..e9da6c3e4cd7 100644 --- a/js/src/jit/x64/CodeGenerator-x64.h +++ b/js/src/jit/x64/CodeGenerator-x64.h @@ -35,45 +35,45 @@ class CodeGeneratorX64 : public CodeGeneratorX86Shared CodeGeneratorX64(MIRGenerator* gen, LIRGraph* graph, MacroAssembler* masm); public: - void visitValue(LValue* value) override; - void visitBox(LBox* box) override; - void visitUnbox(LUnbox* unbox) override; - void visitCompareB(LCompareB* lir) override; - void visitCompareBAndBranch(LCompareBAndBranch* lir) override; - void visitCompareBitwise(LCompareBitwise* lir) override; - void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir) override; - void visitCompareI64(LCompareI64* lir) override; - void visitCompareI64AndBranch(LCompareI64AndBranch* lir) override; - void visitDivOrModI64(LDivOrModI64* lir) override; - void visitUDivOrModI64(LUDivOrModI64* lir) override; - void visitNotI64(LNotI64* lir) override; - void visitClzI64(LClzI64* lir) override; - void visitCtzI64(LCtzI64* lir) override; - void visitTruncateDToInt32(LTruncateDToInt32* ins) override; - void visitTruncateFToInt32(LTruncateFToInt32* ins) override; - void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir) override; - void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir) override; - void visitSignExtendInt64(LSignExtendInt64* ins) override; - void visitWasmTruncateToInt64(LWasmTruncateToInt64* lir) override; - void visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir) override; - void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins) override; - void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins) override; - void visitWasmLoad(LWasmLoad* ins) override; - void visitWasmLoadI64(LWasmLoadI64* ins) override; - void visitWasmStore(LWasmStore* ins) override; - void visitWasmStoreI64(LWasmStoreI64* ins) override; - void visitWasmSelectI64(LWasmSelectI64* ins) override; - void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins) override; - void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins) override; - void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins) override; - void visitWasmAtomicExchangeHeap(LWasmAtomicExchangeHeap* ins) override; - void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins) override; - void visitWasmAtomicBinopHeapForEffect(LWasmAtomicBinopHeapForEffect* ins) override; - void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir) override; - void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir) override; - void visitWasmReinterpretFromI64(LWasmReinterpretFromI64* lir) override; - void visitWasmReinterpretToI64(LWasmReinterpretToI64* lir) override; - void visitTestI64AndBranch(LTestI64AndBranch* lir) override; + void visitValue(LValue* value); + void visitBox(LBox* box); + void visitUnbox(LUnbox* unbox); + void visitCompareB(LCompareB* lir); + void visitCompareBAndBranch(LCompareBAndBranch* lir); + void visitCompareBitwise(LCompareBitwise* lir); + void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir); + void visitCompareI64(LCompareI64* lir); + void visitCompareI64AndBranch(LCompareI64AndBranch* lir); + void visitDivOrModI64(LDivOrModI64* lir); + void visitUDivOrModI64(LUDivOrModI64* lir); + void visitNotI64(LNotI64* lir); + void visitClzI64(LClzI64* lir); + void visitCtzI64(LCtzI64* lir); + void visitTruncateDToInt32(LTruncateDToInt32* ins); + void visitTruncateFToInt32(LTruncateFToInt32* ins); + void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir); + void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir); + void visitSignExtendInt64(LSignExtendInt64* ins); + void visitWasmTruncateToInt64(LWasmTruncateToInt64* lir); + void visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir); + void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins); + void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins); + void visitWasmLoad(LWasmLoad* ins); + void visitWasmLoadI64(LWasmLoadI64* ins); + void visitWasmStore(LWasmStore* ins); + void visitWasmStoreI64(LWasmStoreI64* ins); + void visitWasmSelectI64(LWasmSelectI64* ins); + void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins); + void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins); + void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins); + void visitWasmAtomicExchangeHeap(LWasmAtomicExchangeHeap* ins); + void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins); + void visitWasmAtomicBinopHeapForEffect(LWasmAtomicBinopHeapForEffect* ins); + void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir); + void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir); + void visitWasmReinterpretFromI64(LWasmReinterpretFromI64* lir); + void visitWasmReinterpretToI64(LWasmReinterpretToI64* lir); + void visitTestI64AndBranch(LTestI64AndBranch* lir); }; typedef CodeGeneratorX64 CodeGeneratorSpecific; diff --git a/js/src/jit/x86-shared/CodeGenerator-x86-shared.h b/js/src/jit/x86-shared/CodeGenerator-x86-shared.h index 872fb8d91481..183a284cbbdc 100644 --- a/js/src/jit/x86-shared/CodeGenerator-x86-shared.h +++ b/js/src/jit/x86-shared/CodeGenerator-x86-shared.h @@ -12,6 +12,7 @@ namespace js { namespace jit { +class CodeGeneratorX86Shared; class OutOfLineBailout; class OutOfLineUndoALUOperation; class OutOfLineLoadTypedArrayOutOfBounds; @@ -20,6 +21,8 @@ class ModOverflowCheck; class ReturnZero; class OutOfLineTableSwitch; +using OutOfLineWasmTruncateCheck = OutOfLineWasmTruncateCheckBase; + class CodeGeneratorX86Shared : public CodeGeneratorShared { friend class MoveResolverX86; @@ -185,132 +188,132 @@ class CodeGeneratorX86Shared : public CodeGeneratorShared public: // Instruction visitors. - virtual void visitDouble(LDouble* ins) override; - virtual void visitFloat32(LFloat32* ins) override; - virtual void visitMinMaxD(LMinMaxD* ins) override; - virtual void visitMinMaxF(LMinMaxF* ins) override; - virtual void visitAbsD(LAbsD* ins) override; - virtual void visitAbsF(LAbsF* ins) override; - virtual void visitClzI(LClzI* ins) override; - virtual void visitCtzI(LCtzI* ins) override; - virtual void visitPopcntI(LPopcntI* ins) override; - virtual void visitPopcntI64(LPopcntI64* lir) override; - virtual void visitSqrtD(LSqrtD* ins) override; - virtual void visitSqrtF(LSqrtF* ins) override; - virtual void visitPowHalfD(LPowHalfD* ins) override; - virtual void visitAddI(LAddI* ins) override; - virtual void visitAddI64(LAddI64* ins) override; - virtual void visitSubI(LSubI* ins) override; - virtual void visitSubI64(LSubI64* ins) override; - virtual void visitMulI(LMulI* ins) override; - virtual void visitMulI64(LMulI64* ins) override; - virtual void visitDivI(LDivI* ins) override; - virtual void visitDivPowTwoI(LDivPowTwoI* ins) override; - virtual void visitDivOrModConstantI(LDivOrModConstantI* ins) override; - virtual void visitModI(LModI* ins) override; - virtual void visitModPowTwoI(LModPowTwoI* ins) override; - virtual void visitBitNotI(LBitNotI* ins) override; - virtual void visitBitOpI(LBitOpI* ins) override; - virtual void visitBitOpI64(LBitOpI64* ins) override; - virtual void visitShiftI(LShiftI* ins) override; - virtual void visitShiftI64(LShiftI64* ins) override; - virtual void visitUrshD(LUrshD* ins) override; - virtual void visitTestIAndBranch(LTestIAndBranch* test) override; - virtual void visitTestDAndBranch(LTestDAndBranch* test) override; - virtual void visitTestFAndBranch(LTestFAndBranch* test) override; - virtual void visitCompare(LCompare* comp) override; - virtual void visitCompareAndBranch(LCompareAndBranch* comp) override; - virtual void visitCompareD(LCompareD* comp) override; - virtual void visitCompareDAndBranch(LCompareDAndBranch* comp) override; - virtual void visitCompareF(LCompareF* comp) override; - virtual void visitCompareFAndBranch(LCompareFAndBranch* comp) override; - virtual void visitBitAndAndBranch(LBitAndAndBranch* baab) override; - virtual void visitNotI(LNotI* comp) override; - virtual void visitNotD(LNotD* comp) override; - virtual void visitNotF(LNotF* comp) override; - virtual void visitMathD(LMathD* math) override; - virtual void visitMathF(LMathF* math) override; - virtual void visitFloor(LFloor* lir) override; - virtual void visitFloorF(LFloorF* lir) override; - virtual void visitCeil(LCeil* lir) override; - virtual void visitCeilF(LCeilF* lir) override; - virtual void visitRound(LRound* lir) override; - virtual void visitRoundF(LRoundF* lir) override; - virtual void visitNearbyInt(LNearbyInt* lir) override; - virtual void visitNearbyIntF(LNearbyIntF* lir) override; - virtual void visitGuardShape(LGuardShape* guard) override; - virtual void visitGuardObjectGroup(LGuardObjectGroup* guard) override; - virtual void visitGuardClass(LGuardClass* guard) override; - virtual void visitEffectiveAddress(LEffectiveAddress* ins) override; - virtual void visitUDivOrMod(LUDivOrMod* ins) override; - virtual void visitUDivOrModConstant(LUDivOrModConstant *ins) override; - virtual void visitWasmStackArg(LWasmStackArg* ins) override; - virtual void visitWasmStackArgI64(LWasmStackArgI64* ins) override; - virtual void visitWasmSelect(LWasmSelect* ins) override; - virtual void visitWasmReinterpret(LWasmReinterpret* lir) override; - virtual void visitMemoryBarrier(LMemoryBarrier* ins) override; - virtual void visitWasmAddOffset(LWasmAddOffset* lir) override; - virtual void visitWasmTruncateToInt32(LWasmTruncateToInt32* lir) override; - virtual void visitAtomicTypedArrayElementBinop(LAtomicTypedArrayElementBinop* lir) override; - virtual void visitAtomicTypedArrayElementBinopForEffect(LAtomicTypedArrayElementBinopForEffect* lir) override; - virtual void visitCompareExchangeTypedArrayElement(LCompareExchangeTypedArrayElement* lir) override; - virtual void visitAtomicExchangeTypedArrayElement(LAtomicExchangeTypedArrayElement* lir) override; - virtual void visitCopySignD(LCopySignD* lir) override; - virtual void visitCopySignF(LCopySignF* lir) override; - virtual void visitRotateI64(LRotateI64* lir) override; + void visitDouble(LDouble* ins); + void visitFloat32(LFloat32* ins); + void visitMinMaxD(LMinMaxD* ins); + void visitMinMaxF(LMinMaxF* ins); + void visitAbsD(LAbsD* ins); + void visitAbsF(LAbsF* ins); + void visitClzI(LClzI* ins); + void visitCtzI(LCtzI* ins); + void visitPopcntI(LPopcntI* ins); + void visitPopcntI64(LPopcntI64* lir); + void visitSqrtD(LSqrtD* ins); + void visitSqrtF(LSqrtF* ins); + void visitPowHalfD(LPowHalfD* ins); + void visitAddI(LAddI* ins); + void visitAddI64(LAddI64* ins); + void visitSubI(LSubI* ins); + void visitSubI64(LSubI64* ins); + void visitMulI(LMulI* ins); + void visitMulI64(LMulI64* ins); + void visitDivI(LDivI* ins); + void visitDivPowTwoI(LDivPowTwoI* ins); + void visitDivOrModConstantI(LDivOrModConstantI* ins); + void visitModI(LModI* ins); + void visitModPowTwoI(LModPowTwoI* ins); + void visitBitNotI(LBitNotI* ins); + void visitBitOpI(LBitOpI* ins); + void visitBitOpI64(LBitOpI64* ins); + void visitShiftI(LShiftI* ins); + void visitShiftI64(LShiftI64* ins); + void visitUrshD(LUrshD* ins); + void visitTestIAndBranch(LTestIAndBranch* test); + void visitTestDAndBranch(LTestDAndBranch* test); + void visitTestFAndBranch(LTestFAndBranch* test); + void visitCompare(LCompare* comp); + void visitCompareAndBranch(LCompareAndBranch* comp); + void visitCompareD(LCompareD* comp); + void visitCompareDAndBranch(LCompareDAndBranch* comp); + void visitCompareF(LCompareF* comp); + void visitCompareFAndBranch(LCompareFAndBranch* comp); + void visitBitAndAndBranch(LBitAndAndBranch* baab); + void visitNotI(LNotI* comp); + void visitNotD(LNotD* comp); + void visitNotF(LNotF* comp); + void visitMathD(LMathD* math); + void visitMathF(LMathF* math); + void visitFloor(LFloor* lir); + void visitFloorF(LFloorF* lir); + void visitCeil(LCeil* lir); + void visitCeilF(LCeilF* lir); + void visitRound(LRound* lir); + void visitRoundF(LRoundF* lir); + void visitNearbyInt(LNearbyInt* lir); + void visitNearbyIntF(LNearbyIntF* lir); + void visitGuardShape(LGuardShape* guard); + void visitGuardObjectGroup(LGuardObjectGroup* guard); + void visitGuardClass(LGuardClass* guard); + void visitEffectiveAddress(LEffectiveAddress* ins); + void visitUDivOrMod(LUDivOrMod* ins); + void visitUDivOrModConstant(LUDivOrModConstant *ins); + void visitWasmStackArg(LWasmStackArg* ins); + void visitWasmStackArgI64(LWasmStackArgI64* ins); + void visitWasmSelect(LWasmSelect* ins); + void visitWasmReinterpret(LWasmReinterpret* lir); + void visitMemoryBarrier(LMemoryBarrier* ins); + void visitWasmAddOffset(LWasmAddOffset* lir); + void visitWasmTruncateToInt32(LWasmTruncateToInt32* lir); + void visitAtomicTypedArrayElementBinop(LAtomicTypedArrayElementBinop* lir); + void visitAtomicTypedArrayElementBinopForEffect(LAtomicTypedArrayElementBinopForEffect* lir); + void visitCompareExchangeTypedArrayElement(LCompareExchangeTypedArrayElement* lir); + void visitAtomicExchangeTypedArrayElement(LAtomicExchangeTypedArrayElement* lir); + void visitCopySignD(LCopySignD* lir); + void visitCopySignF(LCopySignF* lir); + void visitRotateI64(LRotateI64* lir); void visitOutOfLineLoadTypedArrayOutOfBounds(OutOfLineLoadTypedArrayOutOfBounds* ool); - void visitNegI(LNegI* lir) override; - void visitNegD(LNegD* lir) override; - void visitNegF(LNegF* lir) override; + void visitNegI(LNegI* lir); + void visitNegD(LNegD* lir); + void visitNegF(LNegF* lir); - void visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCheck* ool) override; + void visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCheck* ool); // SIMD operators - void visitSimdValueInt32x4(LSimdValueInt32x4* lir) override; - void visitSimdValueFloat32x4(LSimdValueFloat32x4* lir) override; - void visitSimdSplatX16(LSimdSplatX16* lir) override; - void visitSimdSplatX8(LSimdSplatX8* lir) override; - void visitSimdSplatX4(LSimdSplatX4* lir) override; - void visitSimd128Int(LSimd128Int* ins) override; - void visitSimd128Float(LSimd128Float* ins) override; - void visitInt32x4ToFloat32x4(LInt32x4ToFloat32x4* ins) override; - void visitFloat32x4ToInt32x4(LFloat32x4ToInt32x4* ins) override; - void visitFloat32x4ToUint32x4(LFloat32x4ToUint32x4* ins) override; - void visitSimdReinterpretCast(LSimdReinterpretCast* lir) override; - void visitSimdExtractElementB(LSimdExtractElementB* lir) override; - void visitSimdExtractElementI(LSimdExtractElementI* lir) override; - void visitSimdExtractElementU2D(LSimdExtractElementU2D* lir) override; - void visitSimdExtractElementF(LSimdExtractElementF* lir) override; - void visitSimdInsertElementI(LSimdInsertElementI* lir) override; - void visitSimdInsertElementF(LSimdInsertElementF* lir) override; - void visitSimdSwizzleI(LSimdSwizzleI* lir) override; - void visitSimdSwizzleF(LSimdSwizzleF* lir) override; - void visitSimdShuffleX4(LSimdShuffleX4* lir) override; - void visitSimdShuffle(LSimdShuffle* lir) override; - void visitSimdUnaryArithIx16(LSimdUnaryArithIx16* lir) override; - void visitSimdUnaryArithIx8(LSimdUnaryArithIx8* lir) override; - void visitSimdUnaryArithIx4(LSimdUnaryArithIx4* lir) override; - void visitSimdUnaryArithFx4(LSimdUnaryArithFx4* lir) override; - void visitSimdBinaryCompIx16(LSimdBinaryCompIx16* lir) override; - void visitSimdBinaryCompIx8(LSimdBinaryCompIx8* lir) override; - void visitSimdBinaryCompIx4(LSimdBinaryCompIx4* lir) override; - void visitSimdBinaryCompFx4(LSimdBinaryCompFx4* lir) override; - void visitSimdBinaryArithIx16(LSimdBinaryArithIx16* lir) override; - void visitSimdBinaryArithIx8(LSimdBinaryArithIx8* lir) override; - void visitSimdBinaryArithIx4(LSimdBinaryArithIx4* lir) override; - void visitSimdBinaryArithFx4(LSimdBinaryArithFx4* lir) override; - void visitSimdBinarySaturating(LSimdBinarySaturating* lir) override; - void visitSimdBinaryBitwise(LSimdBinaryBitwise* lir) override; - void visitSimdShift(LSimdShift* lir) override; - void visitSimdSelect(LSimdSelect* ins) override; - void visitSimdAllTrue(LSimdAllTrue* ins) override; - void visitSimdAnyTrue(LSimdAnyTrue* ins) override; + void visitSimdValueInt32x4(LSimdValueInt32x4* lir); + void visitSimdValueFloat32x4(LSimdValueFloat32x4* lir); + void visitSimdSplatX16(LSimdSplatX16* lir); + void visitSimdSplatX8(LSimdSplatX8* lir); + void visitSimdSplatX4(LSimdSplatX4* lir); + void visitSimd128Int(LSimd128Int* ins); + void visitSimd128Float(LSimd128Float* ins); + void visitInt32x4ToFloat32x4(LInt32x4ToFloat32x4* ins); + void visitFloat32x4ToInt32x4(LFloat32x4ToInt32x4* ins); + void visitFloat32x4ToUint32x4(LFloat32x4ToUint32x4* ins); + void visitSimdReinterpretCast(LSimdReinterpretCast* lir); + void visitSimdExtractElementB(LSimdExtractElementB* lir); + void visitSimdExtractElementI(LSimdExtractElementI* lir); + void visitSimdExtractElementU2D(LSimdExtractElementU2D* lir); + void visitSimdExtractElementF(LSimdExtractElementF* lir); + void visitSimdInsertElementI(LSimdInsertElementI* lir); + void visitSimdInsertElementF(LSimdInsertElementF* lir); + void visitSimdSwizzleI(LSimdSwizzleI* lir); + void visitSimdSwizzleF(LSimdSwizzleF* lir); + void visitSimdShuffleX4(LSimdShuffleX4* lir); + void visitSimdShuffle(LSimdShuffle* lir); + void visitSimdUnaryArithIx16(LSimdUnaryArithIx16* lir); + void visitSimdUnaryArithIx8(LSimdUnaryArithIx8* lir); + void visitSimdUnaryArithIx4(LSimdUnaryArithIx4* lir); + void visitSimdUnaryArithFx4(LSimdUnaryArithFx4* lir); + void visitSimdBinaryCompIx16(LSimdBinaryCompIx16* lir); + void visitSimdBinaryCompIx8(LSimdBinaryCompIx8* lir); + void visitSimdBinaryCompIx4(LSimdBinaryCompIx4* lir); + void visitSimdBinaryCompFx4(LSimdBinaryCompFx4* lir); + void visitSimdBinaryArithIx16(LSimdBinaryArithIx16* lir); + void visitSimdBinaryArithIx8(LSimdBinaryArithIx8* lir); + void visitSimdBinaryArithIx4(LSimdBinaryArithIx4* lir); + void visitSimdBinaryArithFx4(LSimdBinaryArithFx4* lir); + void visitSimdBinarySaturating(LSimdBinarySaturating* lir); + void visitSimdBinaryBitwise(LSimdBinaryBitwise* lir); + void visitSimdShift(LSimdShift* lir); + void visitSimdSelect(LSimdSelect* ins); + void visitSimdAllTrue(LSimdAllTrue* ins); + void visitSimdAnyTrue(LSimdAnyTrue* ins); template void visitSimdGeneralShuffle(LSimdGeneralShuffleBase* lir, Reg temp); - void visitSimdGeneralShuffleI(LSimdGeneralShuffleI* lir) override; - void visitSimdGeneralShuffleF(LSimdGeneralShuffleF* lir) override; + void visitSimdGeneralShuffleI(LSimdGeneralShuffleI* lir); + void visitSimdGeneralShuffleF(LSimdGeneralShuffleF* lir); // Out of line visitors. void visitOutOfLineBailout(OutOfLineBailout* ool); diff --git a/js/src/jit/x86/CodeGenerator-x86.h b/js/src/jit/x86/CodeGenerator-x86.h index 1bd0348c1e81..741c15ac7faa 100644 --- a/js/src/jit/x86/CodeGenerator-x86.h +++ b/js/src/jit/x86/CodeGenerator-x86.h @@ -36,56 +36,56 @@ class CodeGeneratorX86 : public CodeGeneratorX86Shared CodeGeneratorX86(MIRGenerator* gen, LIRGraph* graph, MacroAssembler* masm); public: - void visitBox(LBox* box) override; - void visitBoxFloatingPoint(LBoxFloatingPoint* box) override; - void visitUnbox(LUnbox* unbox) override; - void visitValue(LValue* value) override; - void visitCompareB(LCompareB* lir) override; - void visitCompareBAndBranch(LCompareBAndBranch* lir) override; - void visitCompareBitwise(LCompareBitwise* lir) override; - void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir) override; - void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir) override; - void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir) override; - void visitTruncateDToInt32(LTruncateDToInt32* ins) override; - void visitTruncateFToInt32(LTruncateFToInt32* ins) override; - void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins) override; - void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins) override; - void visitWasmLoad(LWasmLoad* ins) override; - void visitWasmLoadI64(LWasmLoadI64* ins) override; - void visitWasmStore(LWasmStore* ins) override; - void visitWasmStoreI64(LWasmStoreI64* ins) override; - void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins) override; - void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins) override; - void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins) override; - void visitWasmAtomicExchangeHeap(LWasmAtomicExchangeHeap* ins) override; - void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins) override; - void visitWasmAtomicBinopHeapForEffect(LWasmAtomicBinopHeapForEffect* ins) override; + void visitBox(LBox* box); + void visitBoxFloatingPoint(LBoxFloatingPoint* box); + void visitUnbox(LUnbox* unbox); + void visitValue(LValue* value); + void visitCompareB(LCompareB* lir); + void visitCompareBAndBranch(LCompareBAndBranch* lir); + void visitCompareBitwise(LCompareBitwise* lir); + void visitCompareBitwiseAndBranch(LCompareBitwiseAndBranch* lir); + void visitWasmUint32ToDouble(LWasmUint32ToDouble* lir); + void visitWasmUint32ToFloat32(LWasmUint32ToFloat32* lir); + void visitTruncateDToInt32(LTruncateDToInt32* ins); + void visitTruncateFToInt32(LTruncateFToInt32* ins); + void visitLoadTypedArrayElementStatic(LLoadTypedArrayElementStatic* ins); + void visitStoreTypedArrayElementStatic(LStoreTypedArrayElementStatic* ins); + void visitWasmLoad(LWasmLoad* ins); + void visitWasmLoadI64(LWasmLoadI64* ins); + void visitWasmStore(LWasmStore* ins); + void visitWasmStoreI64(LWasmStoreI64* ins); + void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins); + void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins); + void visitWasmCompareExchangeHeap(LWasmCompareExchangeHeap* ins); + void visitWasmAtomicExchangeHeap(LWasmAtomicExchangeHeap* ins); + void visitWasmAtomicBinopHeap(LWasmAtomicBinopHeap* ins); + void visitWasmAtomicBinopHeapForEffect(LWasmAtomicBinopHeapForEffect* ins); - void visitWasmAtomicLoadI64(LWasmAtomicLoadI64* ins) override; - void visitWasmAtomicStoreI64(LWasmAtomicStoreI64* ins) override; - void visitWasmCompareExchangeI64(LWasmCompareExchangeI64* ins) override; - void visitWasmAtomicExchangeI64(LWasmAtomicExchangeI64* ins) override; - void visitWasmAtomicBinopI64(LWasmAtomicBinopI64* ins) override; + void visitWasmAtomicLoadI64(LWasmAtomicLoadI64* ins); + void visitWasmAtomicStoreI64(LWasmAtomicStoreI64* ins); + void visitWasmCompareExchangeI64(LWasmCompareExchangeI64* ins); + void visitWasmAtomicExchangeI64(LWasmAtomicExchangeI64* ins); + void visitWasmAtomicBinopI64(LWasmAtomicBinopI64* ins); void visitOutOfLineTruncate(OutOfLineTruncate* ool); void visitOutOfLineTruncateFloat32(OutOfLineTruncateFloat32* ool); - void visitCompareI64(LCompareI64* lir) override; - void visitCompareI64AndBranch(LCompareI64AndBranch* lir) override; - void visitDivOrModI64(LDivOrModI64* lir) override; - void visitUDivOrModI64(LUDivOrModI64* lir) override; - void visitWasmSelectI64(LWasmSelectI64* lir) override; - void visitWasmReinterpretFromI64(LWasmReinterpretFromI64* lir) override; - void visitWasmReinterpretToI64(LWasmReinterpretToI64* lir) override; - void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir) override; - void visitSignExtendInt64(LSignExtendInt64* ins) override; - void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir) override; - void visitClzI64(LClzI64* lir) override; - void visitCtzI64(LCtzI64* lir) override; - void visitNotI64(LNotI64* lir) override; - void visitWasmTruncateToInt64(LWasmTruncateToInt64* lir) override; - void visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir) override; - void visitTestI64AndBranch(LTestI64AndBranch* lir) override; + void visitCompareI64(LCompareI64* lir); + void visitCompareI64AndBranch(LCompareI64AndBranch* lir); + void visitDivOrModI64(LDivOrModI64* lir); + void visitUDivOrModI64(LUDivOrModI64* lir); + void visitWasmSelectI64(LWasmSelectI64* lir); + void visitWasmReinterpretFromI64(LWasmReinterpretFromI64* lir); + void visitWasmReinterpretToI64(LWasmReinterpretToI64* lir); + void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir); + void visitSignExtendInt64(LSignExtendInt64* ins); + void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir); + void visitClzI64(LClzI64* lir); + void visitCtzI64(LCtzI64* lir); + void visitNotI64(LNotI64* lir); + void visitWasmTruncateToInt64(LWasmTruncateToInt64* lir); + void visitInt64ToFloatingPoint(LInt64ToFloatingPoint* lir); + void visitTestI64AndBranch(LTestI64AndBranch* lir); }; typedef CodeGeneratorX86 CodeGeneratorSpecific; From a9a0f3509a07c2a39667f0897c5c30ba3cc166e2 Mon Sep 17 00:00:00 2001 From: Alex Chronopoulos Date: Fri, 16 Feb 2018 18:37:50 +0200 Subject: [PATCH 05/48] Bug 1438888 - Update cubeb from upstream to 1d53c3a. r=padenot --- media/libcubeb/README_MOZILLA | 2 +- media/libcubeb/include/cubeb.h | 5 ++++ media/libcubeb/src/cubeb.c | 14 +++++++++ media/libcubeb/src/cubeb_alsa.c | 4 ++- media/libcubeb/src/cubeb_audiotrack.c | 4 ++- media/libcubeb/src/cubeb_audiounit.cpp | 6 ++-- media/libcubeb/src/cubeb_jack.cpp | 4 ++- media/libcubeb/src/cubeb_opensl.c | 5 ++-- media/libcubeb/src/cubeb_pulse.c | 4 ++- media/libcubeb/src/cubeb_sndio.c | 4 ++- media/libcubeb/src/cubeb_wasapi.cpp | 39 ++++++++++++++++++++++++-- media/libcubeb/src/cubeb_winmm.c | 4 ++- 12 files changed, 81 insertions(+), 14 deletions(-) diff --git a/media/libcubeb/README_MOZILLA b/media/libcubeb/README_MOZILLA index 4e0c1ac801a9..e18180d14fb4 100644 --- a/media/libcubeb/README_MOZILLA +++ b/media/libcubeb/README_MOZILLA @@ -5,4 +5,4 @@ Makefile.in build files for the Mozilla build system. The cubeb git repository is: git://github.com/kinetiknz/cubeb.git -The git commit ID used was cc0d538c40b933a5d7d5c5bf5e05de7d51740486 (2018-02-02 18:06:40 +0100) +The git commit ID used was 1d53c3a3779cbeb860b16aa38cc7f51e196b9745 (2018-02-13 12:30:46 +1000) diff --git a/media/libcubeb/include/cubeb.h b/media/libcubeb/include/cubeb.h index 64f3a8d0f2e2..b7dc86260c9a 100644 --- a/media/libcubeb/include/cubeb.h +++ b/media/libcubeb/include/cubeb.h @@ -599,6 +599,11 @@ CUBEB_EXPORT int cubeb_stream_device_destroy(cubeb_stream * stream, CUBEB_EXPORT int cubeb_stream_register_device_changed_callback(cubeb_stream * stream, cubeb_device_changed_callback device_changed_callback); +/** Return the user data pointer registered with the stream with cubeb_stream_init. + @param stream the stream for which to retrieve user data pointer. + @retval user data pointer */ +CUBEB_EXPORT void * cubeb_stream_user_ptr(cubeb_stream * stream); + /** Returns enumerated devices. @param context @param devtype device type to include diff --git a/media/libcubeb/src/cubeb.c b/media/libcubeb/src/cubeb.c index 31c516cc02c0..e5a05ec81566 100644 --- a/media/libcubeb/src/cubeb.c +++ b/media/libcubeb/src/cubeb.c @@ -19,7 +19,12 @@ struct cubeb { }; struct cubeb_stream { + /* + * Note: All implementations of cubeb_stream must keep the following + * layout. + */ struct cubeb * context; + void * user_ptr; }; #if defined(USE_PULSE) @@ -478,6 +483,15 @@ int cubeb_stream_register_device_changed_callback(cubeb_stream * stream, return stream->context->ops->stream_register_device_changed_callback(stream, device_changed_callback); } +void * cubeb_stream_user_ptr(cubeb_stream * stream) +{ + if (!stream) { + return NULL; + } + + return stream->user_ptr; +} + static void log_device(cubeb_device_info * device_info) { diff --git a/media/libcubeb/src/cubeb_alsa.c b/media/libcubeb/src/cubeb_alsa.c index f77d2522a862..b38ab66cb08a 100644 --- a/media/libcubeb/src/cubeb_alsa.c +++ b/media/libcubeb/src/cubeb_alsa.c @@ -76,12 +76,14 @@ enum stream_state { }; struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr; + /**/ pthread_mutex_t mutex; snd_pcm_t * pcm; cubeb_data_callback data_callback; cubeb_state_callback state_callback; - void * user_ptr; snd_pcm_uframes_t stream_position; snd_pcm_uframes_t last_position; snd_pcm_uframes_t buffer_size; diff --git a/media/libcubeb/src/cubeb_audiotrack.c b/media/libcubeb/src/cubeb_audiotrack.c index 6b7f375cd4d5..98d0bd96ce6c 100644 --- a/media/libcubeb/src/cubeb_audiotrack.c +++ b/media/libcubeb/src/cubeb_audiotrack.c @@ -75,12 +75,14 @@ struct cubeb { }; struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr; + /**/ cubeb_stream_params params; cubeb_data_callback data_callback; cubeb_state_callback state_callback; void * instance; - void * user_ptr; /* Number of frames that have been passed to the AudioTrack callback */ long unsigned written; int draining; diff --git a/media/libcubeb/src/cubeb_audiounit.cpp b/media/libcubeb/src/cubeb_audiounit.cpp index 82974760cda8..ac71022169df 100644 --- a/media/libcubeb/src/cubeb_audiounit.cpp +++ b/media/libcubeb/src/cubeb_audiounit.cpp @@ -132,7 +132,11 @@ struct device_info { struct cubeb_stream { explicit cubeb_stream(cubeb * context); + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr = nullptr; + /**/ + cubeb_data_callback data_callback = nullptr; cubeb_state_callback state_callback = nullptr; cubeb_device_changed_callback device_changed_callback = nullptr; @@ -142,8 +146,6 @@ struct cubeb_stream { cubeb_stream_params output_stream_params = { CUBEB_SAMPLE_FLOAT32NE, 0, 0, CUBEB_LAYOUT_UNDEFINED, CUBEB_STREAM_PREF_NONE }; device_info input_device; device_info output_device; - /* User pointer of data_callback */ - void * user_ptr = nullptr; /* Format descriptions */ AudioStreamBasicDescription input_desc; AudioStreamBasicDescription output_desc; diff --git a/media/libcubeb/src/cubeb_jack.cpp b/media/libcubeb/src/cubeb_jack.cpp index f1a2d7847470..5f4128d39970 100644 --- a/media/libcubeb/src/cubeb_jack.cpp +++ b/media/libcubeb/src/cubeb_jack.cpp @@ -139,7 +139,10 @@ static struct cubeb_ops const cbjack_ops = { }; struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr; + /**/ /**< Mutex for each stream */ pthread_mutex_t mutex; @@ -149,7 +152,6 @@ struct cubeb_stream { cubeb_data_callback data_callback; cubeb_state_callback state_callback; - void * user_ptr; cubeb_stream_params in_params; cubeb_stream_params out_params; diff --git a/media/libcubeb/src/cubeb_opensl.c b/media/libcubeb/src/cubeb_opensl.c index 4eaedbb888c4..8e9d4c73f2d6 100644 --- a/media/libcubeb/src/cubeb_opensl.c +++ b/media/libcubeb/src/cubeb_opensl.c @@ -87,7 +87,10 @@ struct cubeb { #define AUDIO_STREAM_TYPE_MUSIC 3 struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr; + /**/ pthread_mutex_t mutex; SLObjectItf playerObj; SLPlayItf play; @@ -148,8 +151,6 @@ struct cubeb_stream { cubeb_data_callback data_callback; /* Store state callback. */ cubeb_state_callback state_callback; - /* User pointer for data & state callbacks*/ - void * user_ptr; cubeb_resampler * resampler; unsigned int inputrate; diff --git a/media/libcubeb/src/cubeb_pulse.c b/media/libcubeb/src/cubeb_pulse.c index 31ec534c5136..1cac5eadd45b 100644 --- a/media/libcubeb/src/cubeb_pulse.c +++ b/media/libcubeb/src/cubeb_pulse.c @@ -117,12 +117,14 @@ struct cubeb { }; struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr; + /**/ pa_stream * output_stream; pa_stream * input_stream; cubeb_data_callback data_callback; cubeb_state_callback state_callback; - void * user_ptr; pa_time_event * drain_timer; pa_sample_spec output_sample_spec; pa_sample_spec input_sample_spec; diff --git a/media/libcubeb/src/cubeb_sndio.c b/media/libcubeb/src/cubeb_sndio.c index 1699677e54fa..e5b7ab5d4719 100644 --- a/media/libcubeb/src/cubeb_sndio.c +++ b/media/libcubeb/src/cubeb_sndio.c @@ -29,7 +29,10 @@ struct cubeb { }; struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * arg; /* user arg to {data,state}_cb */ + /**/ pthread_t th; /* to run real-time audio i/o */ pthread_mutex_t mtx; /* protects hdl and pos */ struct sio_hdl *hdl; /* link us to sndio */ @@ -48,7 +51,6 @@ struct cubeb_stream { uint64_t swpos; /* number of frames produced/consumed */ cubeb_data_callback data_cb; /* cb to preapare data */ cubeb_state_callback state_cb; /* cb to notify about state changes */ - void *arg; /* user arg to {data,state}_cb */ }; static void diff --git a/media/libcubeb/src/cubeb_wasapi.cpp b/media/libcubeb/src/cubeb_wasapi.cpp index 0de14348ae4f..a7d892343866 100644 --- a/media/libcubeb/src/cubeb_wasapi.cpp +++ b/media/libcubeb/src/cubeb_wasapi.cpp @@ -189,7 +189,11 @@ class wasapi_endpoint_notification_client; typedef bool (*wasapi_refill_callback)(cubeb_stream * stm); struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context = nullptr; + void * user_ptr = nullptr; + /**/ + /* Mixer pameters. We need to convert the input stream to this samplerate/channel layout, as WASAPI does not resample nor upmix itself. */ @@ -211,7 +215,6 @@ struct cubeb_stream { case a dummy output device is opened to drive the loopback, but should not be exposed. */ bool has_dummy_output = false; - void * user_ptr = nullptr; /* Lifetime considerations: - client, render_client, audio_clock and audio_stream_volume are interface pointer to the IAudioClient. @@ -615,6 +618,8 @@ refill(cubeb_stream * stm, void * input_buffer, long input_frames_count, return out_frames; } +int wasapi_stream_reset_default_device(cubeb_stream * stm); + /* This helper grabs all the frames available from a capture client, put them in * linear_input_buffer. linear_input_buffer should be cleared before the * callback exits. This helper does not work with exclusive mode streams. */ @@ -637,6 +642,13 @@ bool get_input_buffer(cubeb_stream * stm) for (hr = stm->capture_client->GetNextPacketSize(&next); next > 0; hr = stm->capture_client->GetNextPacketSize(&next)) { + if (hr == AUDCLNT_E_DEVICE_INVALIDATED) { + // Application can recover from this error. More info + // https://msdn.microsoft.com/en-us/library/windows/desktop/dd316605(v=vs.85).aspx + LOG("Device invalidated error, reset default device"); + wasapi_stream_reset_default_device(stm); + return true; + } if (FAILED(hr)) { LOG("cannot get next packet size: %lx", hr); @@ -713,10 +725,19 @@ bool get_output_buffer(cubeb_stream * stm, void *& buffer, size_t & frame_count) XASSERT(has_output(stm)); hr = stm->output_client->GetCurrentPadding(&padding_out); + if (hr == AUDCLNT_E_DEVICE_INVALIDATED) { + // Application can recover from this error. More info + // https://msdn.microsoft.com/en-us/library/windows/desktop/dd316605(v=vs.85).aspx + LOG("Device invalidated error, reset default device"); + wasapi_stream_reset_default_device(stm); + return true; + } + if (FAILED(hr)) { LOG("Failed to get padding: %lx", hr); return false; } + XASSERT(padding_out <= stm->output_buffer_frame_count); if (stm->draining) { @@ -996,11 +1017,21 @@ wasapi_stream_render_loop(LPVOID stream) } XASSERT(stm->output_client || stm->input_client); if (stm->output_client) { - stm->output_client->Start(); + hr = stm->output_client->Start(); + if (FAILED(hr)) { + LOG("Error starting output after reconfigure, error: %lx", hr); + is_playing = false; + continue; + } LOG("Output started after reconfigure."); } if (stm->input_client) { - stm->input_client->Start(); + hr = stm->input_client->Start(); + if (FAILED(hr)) { + LOG("Error starting input after reconfiguring, error: %lx", hr); + is_playing = false; + continue; + } LOG("Input started after reconfigure."); } break; @@ -1957,6 +1988,7 @@ wasapi_stream_init(cubeb * context, cubeb_stream ** stream, *stream = stm.release(); + LOG("Stream init succesfull (%p)", *stream); return CUBEB_OK; } @@ -1986,6 +2018,7 @@ void close_wasapi_stream(cubeb_stream * stm) void wasapi_stream_destroy(cubeb_stream * stm) { XASSERT(stm); + LOG("Stream destroy (%p)", stm); // Only free stm->emergency_bailout if we could join the thread. // If we could not join the thread, stm->emergency_bailout is true diff --git a/media/libcubeb/src/cubeb_winmm.c b/media/libcubeb/src/cubeb_winmm.c index e62eed640ec6..20dff4c7a1c8 100644 --- a/media/libcubeb/src/cubeb_winmm.c +++ b/media/libcubeb/src/cubeb_winmm.c @@ -93,11 +93,13 @@ struct cubeb { }; struct cubeb_stream { + /* Note: Must match cubeb_stream layout in cubeb.c. */ cubeb * context; + void * user_ptr; + /**/ cubeb_stream_params params; cubeb_data_callback data_callback; cubeb_state_callback state_callback; - void * user_ptr; WAVEHDR buffers[NBUFS]; size_t buffer_size; int next_buffer; From 2adfc7d43cb888faee7e8a0a0559a047562c4085 Mon Sep 17 00:00:00 2001 From: Alejandro Rodriguez Date: Wed, 7 Feb 2018 22:41:52 -0500 Subject: [PATCH 06/48] Bug 1426139 - re-fetch only the relevant pref when a pref changes. r=chutten --HG-- extra : rebase_source : 9419281ab3d70fc8b3502b5948a6d0531de96b59 --- .../telemetry/TelemetryEnvironment.jsm | 76 +++++++++++-------- .../tests/unit/test_TelemetryEnvironment.js | 16 ++++ 2 files changed, 61 insertions(+), 31 deletions(-) diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm index 771dcd7cb36f..60062a687d05 100644 --- a/toolkit/components/telemetry/TelemetryEnvironment.jsm +++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm @@ -1033,43 +1033,57 @@ EnvironmentCache.prototype = { _getPrefData() { let prefData = {}; for (let [pref, policy] of this._watchedPrefs.entries()) { - let prefType = Services.prefs.getPrefType(pref); + let prefValue = this._getPrefValue(pref, policy.what); - let what = policy.what; - if (what == TelemetryEnvironment.RECORD_DEFAULTPREF_VALUE || - what == TelemetryEnvironment.RECORD_DEFAULTPREF_STATE) { - // For default prefs, make sure they exist - if (prefType == Ci.nsIPrefBranch.PREF_INVALID) { - continue; - } - } else if (!Services.prefs.prefHasUserValue(pref)) { - // For user prefs, make sure they are set + if (prefValue === undefined) { continue; } - // Check the policy for the preference and decide if we need to store its value - // or whether it changed from the default value. - let prefValue; - if (what == TelemetryEnvironment.RECORD_DEFAULTPREF_STATE) { - prefValue = ""; - } else if (what == TelemetryEnvironment.RECORD_PREF_STATE) { - prefValue = ""; - } else if (prefType == Ci.nsIPrefBranch.PREF_STRING) { - prefValue = Services.prefs.getStringPref(pref); - } else if (prefType == Ci.nsIPrefBranch.PREF_BOOL) { - prefValue = Services.prefs.getBoolPref(pref); - } else if (prefType == Ci.nsIPrefBranch.PREF_INT) { - prefValue = Services.prefs.getIntPref(pref); - } else if (prefType == Ci.nsIPrefBranch.PREF_INVALID) { - prefValue = null; - } else { - throw new Error(`Unexpected preference type ("${prefType}") for "${pref}".`); - } prefData[pref] = prefValue; } return prefData; }, + /** + * Get the value of a preference given the preference name and the policy. + * @param pref Name of the preference. + * @param what Policy of the preference. + * + * @returns The value we need to store for this preference. It can be undefined + * or null if the preference is invalid or has a value set by the user. + */ + _getPrefValue(pref, what) { + // Check the policy for the preference and decide if we need to store its value + // or whether it changed from the default value. + let prefType = Services.prefs.getPrefType(pref); + + if (what == TelemetryEnvironment.RECORD_DEFAULTPREF_VALUE || + what == TelemetryEnvironment.RECORD_DEFAULTPREF_STATE) { + // For default prefs, make sure they exist + if (prefType == Ci.nsIPrefBranch.PREF_INVALID) { + return undefined; + } + } else if (!Services.prefs.prefHasUserValue(pref)) { + // For user prefs, make sure they are set + return undefined; + } + + if (what == TelemetryEnvironment.RECORD_DEFAULTPREF_STATE) { + return ""; + } else if (what == TelemetryEnvironment.RECORD_PREF_STATE) { + return ""; + } else if (prefType == Ci.nsIPrefBranch.PREF_STRING) { + return Services.prefs.getStringPref(pref); + } else if (prefType == Ci.nsIPrefBranch.PREF_BOOL) { + return Services.prefs.getBoolPref(pref); + } else if (prefType == Ci.nsIPrefBranch.PREF_INT) { + return Services.prefs.getIntPref(pref); + } else if (prefType == Ci.nsIPrefBranch.PREF_INVALID) { + return null; + } + throw new Error(`Unexpected preference type ("${prefType}") for "${pref}".`); + }, + QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference]), /** @@ -1085,10 +1099,10 @@ EnvironmentCache.prototype = { } }, - _onPrefChanged() { + _onPrefChanged(aData) { this._log.trace("_onPrefChanged"); let oldEnvironment = Cu.cloneInto(this._currentEnvironment, myScope); - this._updateSettings(); + this._currentEnvironment.settings.userPrefs[aData] = this._getPrefValue(aData, this._watchedPrefs.get(aData).what); this._onEnvironmentChange("pref-changed", oldEnvironment); }, @@ -1175,7 +1189,7 @@ EnvironmentCache.prototype = { break; case PREF_CHANGED_TOPIC: if (this._watchedPrefs.has(aData)) { - this._onPrefChanged(); + this._onPrefChanged(aData); } break; } diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js index 5b5482235e52..a49567ef154c 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js @@ -1062,6 +1062,22 @@ add_task(async function test_prefDefaultState() { Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST], ""); }); +add_task(async function test_prefInvalid() { + const PREF_TEST_1 = "toolkit.telemetry.test.invalid1"; + const PREF_TEST_2 = "toolkit.telemetry.test.invalid2"; + + const PREFS_TO_WATCH = new Map([ + [PREF_TEST_1, {what: TelemetryEnvironment.RECORD_DEFAULTPREF_VALUE}], + [PREF_TEST_2, {what: TelemetryEnvironment.RECORD_DEFAULTPREF_STATE}], + ]); + + TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH); + + Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST_1], undefined); + Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST_2], undefined); + +}); + add_task(async function test_addonsWatch_InterestingChange() { const ADDON_INSTALL_URL = gDataRoot + "restartless.xpi"; const ADDON_ID = "tel-restartless-webext@tests.mozilla.org"; From 8902652e9cc3d2197873a36a799c992123e7fcd9 Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Thu, 15 Feb 2018 14:58:00 +0200 Subject: [PATCH 07/48] Bug 1438645 - Prevent XDR from reading past its buffer. r=nbp While XDR data is supposed to be trusted, we currently run into a corruption for some users/use-cases and so make more XDR operations fallible instead of crashing. MozReview-Commit-ID: 9FSLNWh9RxG --HG-- extra : rebase_source : 867956ead115530cb9794bf869bc80466929ed28 --- js/src/vm/JSAtom.cpp | 18 ++++++++++--- js/src/vm/Xdr.cpp | 2 ++ js/src/vm/Xdr.h | 62 +++++++++++++++++++++++++++++--------------- 3 files changed, 57 insertions(+), 25 deletions(-) diff --git a/js/src/vm/JSAtom.cpp b/js/src/vm/JSAtom.cpp index 234f13af29a3..bfbd5cf18d06 100644 --- a/js/src/vm/JSAtom.cpp +++ b/js/src/vm/JSAtom.cpp @@ -735,15 +735,25 @@ js::XDRAtom(XDRState* xdr, MutableHandleAtom atomp) JSAtom* atom; if (latin1) { const Latin1Char* chars = nullptr; - if (length) - chars = reinterpret_cast(xdr->buf.read(length)); + if (length) { + const uint8_t *ptr; + size_t nbyte = length * sizeof(Latin1Char); + if (!xdr->peekData(&ptr, nbyte)) + return false; + chars = reinterpret_cast(ptr); + } atom = AtomizeChars(cx, chars, length); } else { #if MOZ_LITTLE_ENDIAN /* Directly access the little endian chars in the XDR buffer. */ const char16_t* chars = nullptr; - if (length) - chars = reinterpret_cast(xdr->buf.read(length * sizeof(char16_t))); + if (length) { + const uint8_t *ptr; + size_t nbyte = length * sizeof(char16_t); + if (!xdr->peekData(&ptr, nbyte)) + return false; + chars = reinterpret_cast(ptr); + } atom = AtomizeChars(cx, chars, length); #else /* diff --git a/js/src/vm/Xdr.cpp b/js/src/vm/Xdr.cpp index 34c92773aded..260d148feacb 100644 --- a/js/src/vm/Xdr.cpp +++ b/js/src/vm/Xdr.cpp @@ -73,6 +73,8 @@ XDRState::codeChars(char16_t* chars, size_t nchars) mozilla::NativeEndian::copyAndSwapToLittleEndian(ptr, chars, nchars); } else { const uint8_t* ptr = buf.read(nbytes); + if (!ptr) + return fail(JS::TranscodeResult_Failure_BadDecode); mozilla::NativeEndian::copyAndSwapFromLittleEndian(chars, ptr, nchars); } return true; diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index 017a860c3bfa..dac4d2e205ec 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -61,11 +61,6 @@ class XDRBuffer : public XDRBufferBase return ptr; } - const char* readCString() { - MOZ_CRASH("Should never read in encode mode"); - return nullptr; - } - const uint8_t* read(size_t n) { MOZ_CRASH("Should never read in encode mode"); return nullptr; @@ -87,19 +82,15 @@ class XDRBuffer : public XDRBufferBase : XDRBufferBase(cx, cursor), buffer_(buffer.begin(), buffer.length()) { } - const char* readCString() { - char* ptr = reinterpret_cast(&buffer_[cursor_]); - uint8_t* end = reinterpret_cast(strchr(ptr, '\0')) + 1; - MOZ_ASSERT(buffer_.begin().get() < end); - MOZ_ASSERT(end <= buffer_.end().get()); - cursor_ = end - buffer_.begin().get(); - return ptr; - } - const uint8_t* read(size_t n) { MOZ_ASSERT(cursor_ < buffer_.length()); uint8_t* ptr = &buffer_[cursor_]; cursor_ += n; + + // Don't let buggy code read past our buffer + if (cursor_ > buffer_.length()) + return nullptr; + return ptr; } @@ -174,7 +165,7 @@ class XDRCoderBase template class XDRState : public XDRCoderBase { - public: + protected: XDRBuffer buf; private: JS::TranscodeResult resultCode_; @@ -220,6 +211,14 @@ class XDRState : public XDRCoderBase return false; } + bool peekData(const uint8_t** pptr, size_t length) { + const uint8_t* ptr = buf.read(length); + if (!ptr) + return fail(JS::TranscodeResult_Failure_BadDecode); + *pptr = ptr; + return true; + } + bool codeUint8(uint8_t* n) { if (mode == XDR_ENCODE) { uint8_t* ptr = buf.write(sizeof(*n)); @@ -227,7 +226,10 @@ class XDRState : public XDRCoderBase return fail(JS::TranscodeResult_Throw); *ptr = *n; } else { - *n = *buf.read(sizeof(*n)); + const uint8_t* ptr = buf.read(sizeof(*n)); + if (!ptr) + return fail(JS::TranscodeResult_Failure_BadDecode); + *n = *ptr; } return true; } @@ -240,6 +242,8 @@ class XDRState : public XDRCoderBase mozilla::LittleEndian::writeUint16(ptr, *n); } else { const uint8_t* ptr = buf.read(sizeof(*n)); + if (!ptr) + return fail(JS::TranscodeResult_Failure_BadDecode); *n = mozilla::LittleEndian::readUint16(ptr); } return true; @@ -253,6 +257,8 @@ class XDRState : public XDRCoderBase mozilla::LittleEndian::writeUint32(ptr, *n); } else { const uint8_t* ptr = buf.read(sizeof(*n)); + if (!ptr) + return fail(JS::TranscodeResult_Failure_BadDecode); *n = mozilla::LittleEndian::readUint32(ptr); } return true; @@ -266,6 +272,8 @@ class XDRState : public XDRCoderBase mozilla::LittleEndian::writeUint64(ptr, *n); } else { const uint8_t* ptr = buf.read(sizeof(*n)); + if (!ptr) + return fail(JS::TranscodeResult_Failure_BadDecode); *n = mozilla::LittleEndian::readUint64(ptr); } return true; @@ -328,7 +336,10 @@ class XDRState : public XDRCoderBase return fail(JS::TranscodeResult_Throw); memcpy(ptr, bytes, len); } else { - memcpy(bytes, buf.read(len), len); + const uint8_t* ptr = buf.read(len); + if (!ptr) + return fail(JS::TranscodeResult_Failure_BadDecode); + memcpy(bytes, ptr, len); } return true; } @@ -340,14 +351,23 @@ class XDRState : public XDRCoderBase * the decoding buffer. */ bool codeCString(const char** sp) { + uint64_t len64; + if (mode == XDR_ENCODE) + len64 = (uint64_t)(strlen(*sp) + 1); + if (!codeUint64(&len64)) + return false; + size_t len = (size_t) len64; + if (mode == XDR_ENCODE) { - size_t n = strlen(*sp) + 1; - uint8_t* ptr = buf.write(n); + uint8_t* ptr = buf.write(len); if (!ptr) return fail(JS::TranscodeResult_Throw); - memcpy(ptr, *sp, n); + memcpy(ptr, *sp, len); } else { - *sp = buf.readCString(); + const uint8_t* ptr = buf.read(len); + if (!ptr || ptr[len] != '\0') + return fail(JS::TranscodeResult_Failure_BadDecode); + *sp = reinterpret_cast(ptr); } return true; } From 20e22d7760cdf5edd01d306f4c6573ed833f3bc6 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Thu, 15 Feb 2018 09:40:00 +0200 Subject: [PATCH 08/48] Bug 1438583 - Shutdown test node server during --verify at the right time, r=gbrown --HG-- extra : rebase_source : 0cb93100220aff81dd9ed81c910a582ebe6213fc --- testing/xpcshell/runxpcshelltests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/xpcshell/runxpcshelltests.py b/testing/xpcshell/runxpcshelltests.py index 93bb26de3a80..eb33eb1af448 100755 --- a/testing/xpcshell/runxpcshelltests.py +++ b/testing/xpcshell/runxpcshelltests.py @@ -1368,7 +1368,6 @@ class XPCShellTests(object): status = self.runTestList(tests_queue, sequential_tests, testClass, mobileArgs, **kwargs) - self.shutdownNode() else: # # Test verification: Run each test many times, in various configurations, @@ -1438,7 +1437,8 @@ class XPCShellTests(object): self.log.info(':::') self.log.info('::: Test verification %s' % finalResult) self.log.info(':::') - self.shutdownNode() + + self.shutdownNode() return status From f5653229eff197012398a38e13b44b3c18bd5c0b Mon Sep 17 00:00:00 2001 From: Matthew Gaudet Date: Wed, 31 Jan 2018 09:47:22 -0500 Subject: [PATCH 09/48] Bug 1434717: Part 1: Implement GuardIsInt32 r=tcampbell --- js/src/jit/CacheIR.h | 7 +++++++ js/src/jit/CacheIRCompiler.cpp | 23 +++++++++++++++++++++++ js/src/jit/CacheIRCompiler.h | 1 + 3 files changed, 31 insertions(+) diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h index e874b3c97d86..66c1c601a311 100644 --- a/js/src/jit/CacheIR.h +++ b/js/src/jit/CacheIR.h @@ -171,6 +171,7 @@ extern const char* CacheKindNames[]; _(GuardIsString) \ _(GuardIsSymbol) \ _(GuardIsNumber) \ + _(GuardIsInt32) \ _(GuardIsInt32Index) \ _(GuardType) \ _(GuardShape) \ @@ -523,6 +524,12 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter writeOpWithOperandId(CacheOp::GuardIsSymbol, val); return SymbolOperandId(val.id()); } + Int32OperandId guardIsInt32(ValOperandId val) { + Int32OperandId res(nextOperandId_++); + writeOpWithOperandId(CacheOp::GuardIsInt32, val); + writeOperandId(res); + return res; + } Int32OperandId guardIsInt32Index(ValOperandId val) { Int32OperandId res(nextOperandId_++); writeOpWithOperandId(CacheOp::GuardIsInt32Index, val); diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index ba86e9a2871e..6769eda5703a 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -1311,6 +1311,29 @@ CacheIRCompiler::emitGuardIsSymbol() return true; } +bool +CacheIRCompiler::emitGuardIsInt32() +{ + ValOperandId inputId = reader.valOperandId(); + Register output = allocator.defineRegister(masm, reader.int32OperandId()); + + if (allocator.knownType(inputId) == JSVAL_TYPE_INT32) { + Register input = allocator.useRegister(masm, Int32OperandId(inputId.id())); + masm.move32(input, output); + return true; + } + ValueOperand input = allocator.useValueRegister(masm, inputId); + + FailurePath* failure; + if (!addFailurePath(&failure)) + return false; + + Label notInt32, done; + masm.branchTestInt32(Assembler::NotEqual, input, failure->label()); + masm.unboxInt32(input, output); + return true; +} + bool CacheIRCompiler::emitGuardIsInt32Index() { diff --git a/js/src/jit/CacheIRCompiler.h b/js/src/jit/CacheIRCompiler.h index 2e84e58882c9..9c68347bc920 100644 --- a/js/src/jit/CacheIRCompiler.h +++ b/js/src/jit/CacheIRCompiler.h @@ -21,6 +21,7 @@ namespace jit { _(GuardIsString) \ _(GuardIsSymbol) \ _(GuardIsNumber) \ + _(GuardIsInt32) \ _(GuardIsInt32Index) \ _(GuardType) \ _(GuardClass) \ From eedee90f1cc0d17e3229adca8c3175da7e82c0c9 Mon Sep 17 00:00:00 2001 From: Matthew Gaudet Date: Wed, 31 Jan 2018 16:02:25 -0500 Subject: [PATCH 10/48] Bug 1434717: Part 2: Implement CacheIR IC for unary arithmetic operators r=tcampbell This provides a CacheIR implementation of the IC for JSOP_BITNOT and JSOP_NEG. However this commit does not connect the IC, as that requires more work to the shared IC system. --- js/src/jit-test/tests/cacheir/unaryarith.js | 23 +++++++++ js/src/jit/BaselineCacheIRCompiler.cpp | 1 + js/src/jit/CacheIR.cpp | 53 +++++++++++++++++++++ js/src/jit/CacheIR.h | 28 ++++++++++- js/src/jit/CacheIRCompiler.cpp | 27 +++++++++++ js/src/jit/CacheIRCompiler.h | 2 + js/src/jit/CodeGenerator.cpp | 1 + js/src/jit/IonCacheIRCompiler.cpp | 1 + js/src/jit/IonIC.cpp | 1 + 9 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 js/src/jit-test/tests/cacheir/unaryarith.js diff --git a/js/src/jit-test/tests/cacheir/unaryarith.js b/js/src/jit-test/tests/cacheir/unaryarith.js new file mode 100644 index 000000000000..96413a4e720f --- /dev/null +++ b/js/src/jit-test/tests/cacheir/unaryarith.js @@ -0,0 +1,23 @@ +function warmup(fun, input, output) { + for (var i = 0; i < 30; i++) { + var y = fun(input); + assertEq(y, output) + } +} + +var fun1 = (x) => { return -x; } +var fun2 = (x) => { return -x; } + +var fun3 = (x) => { return ~x; } +var fun4 = (x) => { return ~x; } + +warmup(fun1, 1, -1); +warmup(fun1, 0, -0); + +warmup(fun2, 3, -3); +warmup(fun2, 1.2, -1.2); + +warmup(fun3, -1, 0); +warmup(fun4, 1.2, -2); +warmup(fun4, 3, -4) + diff --git a/js/src/jit/BaselineCacheIRCompiler.cpp b/js/src/jit/BaselineCacheIRCompiler.cpp index b774635297e6..0ea0c25a5cbb 100644 --- a/js/src/jit/BaselineCacheIRCompiler.cpp +++ b/js/src/jit/BaselineCacheIRCompiler.cpp @@ -2105,6 +2105,7 @@ BaselineCacheIRCompiler::init(CacheKind kind) case CacheKind::TypeOf: case CacheKind::GetIterator: case CacheKind::ToBool: + case CacheKind::UnaryArith: MOZ_ASSERT(numInputs == 1); allocator.initInputLocation(0, R0); break; diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index 96fe6172b66e..d10e7c32c15a 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -4683,4 +4683,57 @@ GetIntrinsicIRGenerator::tryAttachStub() writer.returnFromIC(); trackAttached("GetIntrinsic"); return true; +} +UnaryArithIRGenerator::UnaryArithIRGenerator(JSContext* cx, HandleScript script, jsbytecode* pc, ICState::Mode mode, + JSOp op, HandleValue val, HandleValue res) + : IRGenerator(cx, script, pc, CacheKind::UnaryArith, mode), + op_(op), + val_(val), + res_(res) +{ } + +void +UnaryArithIRGenerator::trackAttached(const char* name) +{ +#ifdef JS_CACHEIR_SPEW + if (const CacheIRSpewer::Guard& sp = CacheIRSpewer::Guard(*this, name)) { + sp.valueProperty("val", val_); + } +#endif +} + +bool +UnaryArithIRGenerator::tryAttachStub() +{ + if (tryAttachInt32()) + return true; + + trackAttached(IRGenerator::NotAttached); + return false; +} + +bool +UnaryArithIRGenerator::tryAttachInt32() +{ + if (!val_.isInt32() || !res_.isInt32()) + return false; + + ValOperandId valId(writer.setInputOperandId(0)); + + Int32OperandId intId = writer.guardIsInt32(valId); + switch (op_) { + case JSOP_BITNOT: + writer.int32NotResult(intId); + trackAttached("UnaryArith.Int32Not"); + break; + case JSOP_NEG: + writer.int32NegationResult(intId); + trackAttached("UnaryArith.Int32Neg"); + break; + default: + MOZ_CRASH("Unexected OP"); + } + + writer.returnFromIC(); + return true; } \ No newline at end of file diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h index 66c1c601a311..568d24f68301 100644 --- a/js/src/jit/CacheIR.h +++ b/js/src/jit/CacheIR.h @@ -153,7 +153,8 @@ class TypedOperandId : public OperandId _(GetIterator) \ _(Compare) \ _(ToBool) \ - _(Call) + _(Call) \ + _(UnaryArith) enum class CacheKind : uint8_t { @@ -273,6 +274,8 @@ extern const char* CacheKindNames[]; _(LoadStringResult) \ _(LoadInstanceOfObjectResult) \ _(LoadTypeOfObjectResult) \ + _(Int32NotResult) \ + _(Int32NegationResult) \ _(LoadInt32TruthyResult) \ _(LoadDoubleTruthyResult) \ _(LoadStringTruthyResult) \ @@ -906,6 +909,12 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter buffer_.writeByte(uint32_t(hasOwn)); } + void int32NotResult(Int32OperandId id) { + writeOpWithOperandId(CacheOp::Int32NotResult, id); + } + void int32NegationResult(Int32OperandId id) { + writeOpWithOperandId(CacheOp::Int32NegationResult, id); + } void loadBooleanResult(bool val) { writeOp(CacheOp::LoadBooleanResult); buffer_.writeByte(uint32_t(val)); @@ -1660,6 +1669,23 @@ class MOZ_RAII GetIntrinsicIRGenerator : public IRGenerator bool tryAttachStub(); }; +class MOZ_RAII UnaryArithIRGenerator : public IRGenerator +{ + JSOp op_; + HandleValue val_; + HandleValue res_; + + bool tryAttachInt32(); + + void trackAttached(const char* name); + + public: + UnaryArithIRGenerator(JSContext* cx, HandleScript, jsbytecode* pc, ICState::Mode mode, + JSOp op, HandleValue val, HandleValue res); + + bool tryAttachStub(); +}; + } // namespace jit } // namespace js diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index 6769eda5703a..518833f34672 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -1802,6 +1802,33 @@ CacheIRCompiler::emitLoadInt32ArrayLengthResult() return true; } +bool +CacheIRCompiler::emitInt32NegationResult() +{ + AutoOutputRegister output(*this); + Register val = allocator.useRegister(masm, reader.int32OperandId()); + + FailurePath* failure; + if (!addFailurePath(&failure)) + return false; + + // Guard against 0 and MIN_INT, both result in a double. + masm.branchTest32(Assembler::Zero, val, Imm32(0x7fffffff), failure->label()); + masm.neg32(val); + masm.tagValue(JSVAL_TYPE_INT32, val, output.valueReg()); + return true; +} + +bool +CacheIRCompiler::emitInt32NotResult() +{ + AutoOutputRegister output(*this); + Register val = allocator.useRegister(masm, reader.int32OperandId()); + masm.not32(val); + masm.tagValue(JSVAL_TYPE_INT32, val, output.valueReg()); + return true; +} + bool CacheIRCompiler::emitLoadArgumentsObjectLengthResult() { diff --git a/js/src/jit/CacheIRCompiler.h b/js/src/jit/CacheIRCompiler.h index 9c68347bc920..23900e1fb24e 100644 --- a/js/src/jit/CacheIRCompiler.h +++ b/js/src/jit/CacheIRCompiler.h @@ -45,6 +45,8 @@ namespace jit { _(LoadUndefinedResult) \ _(LoadBooleanResult) \ _(LoadInt32ArrayLengthResult) \ + _(Int32NegationResult) \ + _(Int32NotResult) \ _(LoadArgumentsObjectLengthResult) \ _(LoadFunctionLengthResult) \ _(LoadStringLengthResult) \ diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 4ee31f773a3a..2862e4c1f182 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -357,6 +357,7 @@ CodeGenerator::visitOutOfLineICFallback(OutOfLineICFallback* ool) masm.jump(ool->rejoin()); return; } + case CacheKind::UnaryArith: case CacheKind::Call: case CacheKind::Compare: case CacheKind::TypeOf: diff --git a/js/src/jit/IonCacheIRCompiler.cpp b/js/src/jit/IonCacheIRCompiler.cpp index d2004972923c..59eb8b6588a3 100644 --- a/js/src/jit/IonCacheIRCompiler.cpp +++ b/js/src/jit/IonCacheIRCompiler.cpp @@ -547,6 +547,7 @@ IonCacheIRCompiler::init() case CacheKind::TypeOf: case CacheKind::ToBool: case CacheKind::GetIntrinsic: + case CacheKind::UnaryArith: MOZ_CRASH("Unsupported IC"); } diff --git a/js/src/jit/IonIC.cpp b/js/src/jit/IonIC.cpp index 25738d6366d7..71004009dc00 100644 --- a/js/src/jit/IonIC.cpp +++ b/js/src/jit/IonIC.cpp @@ -65,6 +65,7 @@ IonIC::scratchRegisterForEntryJump() case CacheKind::TypeOf: case CacheKind::ToBool: case CacheKind::GetIntrinsic: + case CacheKind::UnaryArith: MOZ_CRASH("Unsupported IC"); } From 4dfd93102774eb103ff2fe8163b1ff5d4b0890b7 Mon Sep 17 00:00:00 2001 From: Matthew Gaudet Date: Wed, 31 Jan 2018 16:36:46 -0500 Subject: [PATCH 11/48] Bug 1434717: Part 3: Switch to using CacheIR for Baseline ICs. r=tcampbell As a side effect of this patch, UnaryArith loses it's ability to attach ICs in Ion. That support will come in a subsequent patch. --- js/src/jit/BaselineCompiler.cpp | 2 +- js/src/jit/BaselineIC.cpp | 84 ++++++++++++++++ js/src/jit/BaselineIC.h | 38 +++++++ js/src/jit/BaselineICList.h | 2 + js/src/jit/BaselineInspector.cpp | 2 - js/src/jit/CodeGenerator.cpp | 5 - js/src/jit/IonBuilder.cpp | 20 +--- js/src/jit/SharedIC.cpp | 138 -------------------------- js/src/jit/SharedIC.h | 88 ---------------- js/src/jit/SharedICList.h | 4 - js/src/jit/arm/SharedIC-arm.cpp | 28 ------ js/src/jit/arm64/SharedIC-arm64.cpp | 31 ------ js/src/jit/mips32/SharedIC-mips32.cpp | 29 ------ js/src/jit/mips64/SharedIC-mips64.cpp | 32 ------ js/src/jit/none/Trampoline-none.cpp | 1 - js/src/jit/x64/SharedIC-x64.cpp | 28 ------ js/src/jit/x86/SharedIC-x86.cpp | 26 ----- 17 files changed, 128 insertions(+), 430 deletions(-) diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp index e1bf07adf224..6a550b6c529e 100644 --- a/js/src/jit/BaselineCompiler.cpp +++ b/js/src/jit/BaselineCompiler.cpp @@ -1930,7 +1930,7 @@ BaselineCompiler::emitUnaryArith() frame.popRegsAndSync(1); // Call IC - ICUnaryArith_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::Baseline); + ICUnaryArith_Fallback::Compiler stubCompiler(cx); if (!emitOpIC(stubCompiler.getStub(&stubSpace_))) return false; diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index 244f6d3dff97..e374e42e6925 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -4533,5 +4533,89 @@ ICRest_Fallback::Compiler::generateStubCode(MacroAssembler& masm) return tailCallVM(DoRestFallbackInfo, masm); } +// +// UnaryArith_Fallback +// + +static bool +DoUnaryArithFallback(JSContext* cx, BaselineFrame* frame, ICUnaryArith_Fallback* stub, + HandleValue val, MutableHandleValue res) +{ + // This fallback stub may trigger debug mode toggling. + DebugModeOSRVolatileStub debug_stub(ICStubEngine::Baseline, frame, stub); + + RootedScript script(cx, frame->script()); + jsbytecode* pc = stub->icEntry()->pc(script); + JSOp op = JSOp(*pc); + FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName[op]); + + switch (op) { + case JSOP_BITNOT: { + int32_t result; + if (!BitNot(cx, val, &result)) + return false; + res.setInt32(result); + break; + } + case JSOP_NEG: + if (!NegOperation(cx, val, res)) + return false; + break; + default: + MOZ_CRASH("Unexpected op"); + } + + // Check if debug mode toggling made the stub invalid. + if (debug_stub.invalid()) + return true; + + if (res.isDouble()) + stub->setSawDoubleResult(); + + if (stub->state().maybeTransition()) + stub->discardStubs(cx); + + if (stub->state().canAttachStub()) { + UnaryArithIRGenerator gen(cx, script, pc, stub->state().mode(), + op, val, res); + if (gen.tryAttachStub()) { + bool attached = false; + ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(), + BaselineCacheIRStubKind::Regular, + ICStubEngine::Baseline, script, stub, &attached); + if (newStub) { + JitSpew(JitSpew_BaselineIC, " Attached (shared) CacheIR stub for %s", CodeName[op]); + } + } + } + + return true; +} + +typedef bool (*DoUnaryArithFallbackFn)(JSContext*, BaselineFrame*, ICUnaryArith_Fallback*, + HandleValue, MutableHandleValue); +static const VMFunction DoUnaryArithFallbackInfo = + FunctionInfo(DoUnaryArithFallback, "DoUnaryArithFallback", TailCall, + PopValues(1)); + +bool +ICUnaryArith_Fallback::Compiler::generateStubCode(MacroAssembler& masm) +{ + MOZ_ASSERT(R0 == JSReturnOperand); + + // Restore the tail call register. + EmitRestoreTailCallReg(masm); + + // Ensure stack is fully synced for the expression decompiler. + masm.pushValue(R0); + + // Push arguments. + masm.pushValue(R0); + masm.push(ICStubReg); + pushStubPayload(masm, R0.scratchReg()); + + return tailCallVM(DoUnaryArithFallbackInfo, masm); +} + } // namespace jit } // namespace js diff --git a/js/src/jit/BaselineIC.h b/js/src/jit/BaselineIC.h index ebfba8a315a0..96337c2097ae 100644 --- a/js/src/jit/BaselineIC.h +++ b/js/src/jit/BaselineIC.h @@ -1460,6 +1460,44 @@ class ICRetSub_Resume : public ICStub }; }; +// UnaryArith +// JSOP_BITNOT +// JSOP_NEG + +class ICUnaryArith_Fallback : public ICFallbackStub +{ + friend class ICStubSpace; + + explicit ICUnaryArith_Fallback(JitCode* stubCode) + : ICFallbackStub(UnaryArith_Fallback, stubCode) + { + extra_ = 0; + } + + public: + bool sawDoubleResult() { + return extra_; + } + void setSawDoubleResult() { + extra_ = 1; + } + + // Compiler for this stub kind. + class Compiler : public ICStubCompiler { + protected: + MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; + + public: + explicit Compiler(JSContext* cx) + : ICStubCompiler(cx, ICStub::UnaryArith_Fallback, Engine::Baseline) + {} + + ICStub* getStub(ICStubSpace* space) override { + return newStub(space, getStubCode()); + } + }; +}; + inline bool IsCacheableDOMProxy(JSObject* obj) { diff --git a/js/src/jit/BaselineICList.h b/js/src/jit/BaselineICList.h index 5b8a70205b8b..e33f09d39db8 100644 --- a/js/src/jit/BaselineICList.h +++ b/js/src/jit/BaselineICList.h @@ -34,6 +34,8 @@ namespace jit { \ _(ToNumber_Fallback) \ \ + _(UnaryArith_Fallback) \ + \ _(Call_Fallback) \ _(Call_Scripted) \ _(Call_AnyScripted) \ diff --git a/js/src/jit/BaselineInspector.cpp b/js/src/jit/BaselineInspector.cpp index f7028e73f5bb..dc583f65a709 100644 --- a/js/src/jit/BaselineInspector.cpp +++ b/js/src/jit/BaselineInspector.cpp @@ -334,11 +334,9 @@ BaselineInspector::expectedResultType(jsbytecode* pc) return MIRType::Double; return MIRType::Int32; case ICStub::BinaryArith_BooleanWithInt32: - case ICStub::UnaryArith_Int32: case ICStub::BinaryArith_DoubleWithInt32: return MIRType::Int32; case ICStub::BinaryArith_Double: - case ICStub::UnaryArith_Double: return MIRType::Double; case ICStub::BinaryArith_StringConcat: case ICStub::BinaryArith_StringObjectConcat: diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 2862e4c1f182..45cbe2bd26c4 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -9946,11 +9946,6 @@ CodeGenerator::linkSharedStubs(JSContext* cx) stub = stubCompiler.getStub(&stubSpace_); break; } - case ICStub::Kind::UnaryArith_Fallback: { - ICUnaryArith_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::IonSharedIC); - stub = stubCompiler.getStub(&stubSpace_); - break; - } case ICStub::Kind::Compare_Fallback: { ICCompare_Fallback::Compiler stubCompiler(cx, ICStubCompiler::Engine::IonSharedIC); stub = stubCompiler.getStub(&stubSpace_); diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 22c547d5e41e..910b884eb838 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -3281,10 +3281,6 @@ IonBuilder::jsop_bitnot() return Ok(); } - MOZ_TRY(arithTrySharedStub(&emitted, JSOP_BITNOT, nullptr, input)); - if (emitted) - return Ok(); - // Not possible to optimize. Do a slow vm call. MBitNot* ins = MBitNot::New(alloc(), input); @@ -3547,22 +3543,12 @@ IonBuilder::arithTrySharedStub(bool* emitted, JSOp op, if (actualOp == JSOP_POS) return Ok(); - // FIXME: The JSOP_BITNOT path doesn't track optimizations yet. - if (actualOp != JSOP_BITNOT) { - trackOptimizationAttempt(TrackedStrategy::BinaryArith_SharedCache); - trackOptimizationSuccess(); - } + // JSOP_NEG and JSOP_BITNOT can't be handled here right now. + if (actualOp == JSOP_NEG || actualOp == JSOP_BITNOT) + return Ok(); MInstruction* stub = nullptr; switch (actualOp) { - case JSOP_NEG: - case JSOP_BITNOT: - MOZ_ASSERT_IF(op == JSOP_MUL, - left->maybeConstantValue() && left->maybeConstantValue()->toInt32() == -1); - MOZ_ASSERT_IF(op != JSOP_MUL, !left); - - stub = MUnarySharedStub::New(alloc(), right); - break; case JSOP_ADD: case JSOP_SUB: case JSOP_MUL: diff --git a/js/src/jit/SharedIC.cpp b/js/src/jit/SharedIC.cpp index 21b4daf7e32b..a27cc623f173 100644 --- a/js/src/jit/SharedIC.cpp +++ b/js/src/jit/SharedIC.cpp @@ -1233,144 +1233,6 @@ ICBinaryArith_DoubleWithInt32::Compiler::generateStubCode(MacroAssembler& masm) return true; } -// -// UnaryArith_Fallback -// - -static bool -DoUnaryArithFallback(JSContext* cx, void* payload, ICUnaryArith_Fallback* stub_, - HandleValue val, MutableHandleValue res) -{ - SharedStubInfo info(cx, payload, stub_->icEntry()); - ICStubCompiler::Engine engine = info.engine(); - - // This fallback stub may trigger debug mode toggling. - DebugModeOSRVolatileStub stub(engine, info.maybeFrame(), stub_); - - jsbytecode* pc = info.pc(); - JSOp op = JSOp(*pc); - FallbackICSpew(cx, stub, "UnaryArith(%s)", CodeName[op]); - - switch (op) { - case JSOP_BITNOT: { - int32_t result; - if (!BitNot(cx, val, &result)) - return false; - res.setInt32(result); - break; - } - case JSOP_NEG: - if (!NegOperation(cx, val, res)) - return false; - break; - default: - MOZ_CRASH("Unexpected op"); - } - - // Check if debug mode toggling made the stub invalid. - if (stub.invalid()) - return true; - - if (res.isDouble()) - stub->setSawDoubleResult(); - - if (stub->numOptimizedStubs() >= ICUnaryArith_Fallback::MAX_OPTIMIZED_STUBS) { - // TODO: Discard/replace stubs. - return true; - } - - if (val.isInt32() && res.isInt32()) { - JitSpew(JitSpew_BaselineIC, " Generating %s(Int32 => Int32) stub", CodeName[op]); - ICUnaryArith_Int32::Compiler compiler(cx, op, engine); - ICStub* int32Stub = compiler.getStub(compiler.getStubSpace(info.outerScript(cx))); - if (!int32Stub) - return false; - stub->addNewStub(int32Stub); - return true; - } - - if (val.isNumber() && res.isNumber() && cx->runtime()->jitSupportsFloatingPoint) { - JitSpew(JitSpew_BaselineIC, " Generating %s(Number => Number) stub", CodeName[op]); - - // Unlink int32 stubs, the double stub handles both cases and TI specializes for both. - stub->unlinkStubsWithKind(cx, ICStub::UnaryArith_Int32); - - ICUnaryArith_Double::Compiler compiler(cx, op, engine); - ICStub* doubleStub = compiler.getStub(compiler.getStubSpace(info.outerScript(cx))); - if (!doubleStub) - return false; - stub->addNewStub(doubleStub); - return true; - } - - return true; -} - -typedef bool (*DoUnaryArithFallbackFn)(JSContext*, void*, ICUnaryArith_Fallback*, - HandleValue, MutableHandleValue); -static const VMFunction DoUnaryArithFallbackInfo = - FunctionInfo(DoUnaryArithFallback, "DoUnaryArithFallback", TailCall, - PopValues(1)); - -bool -ICUnaryArith_Fallback::Compiler::generateStubCode(MacroAssembler& masm) -{ - MOZ_ASSERT(R0 == JSReturnOperand); - - // Restore the tail call register. - EmitRestoreTailCallReg(masm); - - // Ensure stack is fully synced for the expression decompiler. - masm.pushValue(R0); - - // Push arguments. - masm.pushValue(R0); - masm.push(ICStubReg); - pushStubPayload(masm, R0.scratchReg()); - - return tailCallVM(DoUnaryArithFallbackInfo, masm); -} - -bool -ICUnaryArith_Double::Compiler::generateStubCode(MacroAssembler& masm) -{ - Label failure; - masm.ensureDouble(R0, FloatReg0, &failure); - - MOZ_ASSERT(op == JSOP_NEG || op == JSOP_BITNOT); - - if (op == JSOP_NEG) { - masm.negateDouble(FloatReg0); - masm.boxDouble(FloatReg0, R0, FloatReg0); - } else { - // Truncate the double to an int32. - Register scratchReg = R1.scratchReg(); - - Label doneTruncate; - Label truncateABICall; - masm.branchTruncateDoubleMaybeModUint32(FloatReg0, scratchReg, &truncateABICall); - masm.jump(&doneTruncate); - - masm.bind(&truncateABICall); - masm.setupUnalignedABICall(scratchReg); - masm.passABIArg(FloatReg0, MoveOp::DOUBLE); - masm.callWithABI(BitwiseCast(JS::ToInt32), - MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther); - masm.storeCallInt32Result(scratchReg); - - masm.bind(&doneTruncate); - masm.not32(scratchReg); - masm.tagValue(JSVAL_TYPE_INT32, scratchReg, R0); - } - - EmitReturnFromIC(masm); - - // Failure case - jump to next stub - masm.bind(&failure); - EmitStubGuardFailure(masm); - return true; -} - // // Compare_Fallback // diff --git a/js/src/jit/SharedIC.h b/js/src/jit/SharedIC.h index 048f57b4746d..f996c3675544 100644 --- a/js/src/jit/SharedIC.h +++ b/js/src/jit/SharedIC.h @@ -1915,94 +1915,6 @@ class ICBinaryArith_DoubleWithInt32 : public ICStub }; }; -// UnaryArith -// JSOP_BITNOT -// JSOP_NEG - -class ICUnaryArith_Fallback : public ICFallbackStub -{ - friend class ICStubSpace; - - explicit ICUnaryArith_Fallback(JitCode* stubCode) - : ICFallbackStub(UnaryArith_Fallback, stubCode) - { - extra_ = 0; - } - - public: - static const uint32_t MAX_OPTIMIZED_STUBS = 8; - - bool sawDoubleResult() { - return extra_; - } - void setSawDoubleResult() { - extra_ = 1; - } - - // Compiler for this stub kind. - class Compiler : public ICStubCompiler { - protected: - MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; - - public: - explicit Compiler(JSContext* cx, Engine engine) - : ICStubCompiler(cx, ICStub::UnaryArith_Fallback, engine) - {} - - ICStub* getStub(ICStubSpace* space) override { - return newStub(space, getStubCode()); - } - }; -}; - -class ICUnaryArith_Int32 : public ICStub -{ - friend class ICStubSpace; - - explicit ICUnaryArith_Int32(JitCode* stubCode) - : ICStub(UnaryArith_Int32, stubCode) - {} - - public: - class Compiler : public ICMultiStubCompiler { - protected: - MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; - - public: - Compiler(JSContext* cx, JSOp op, Engine engine) - : ICMultiStubCompiler(cx, ICStub::UnaryArith_Int32, op, engine) - {} - - ICStub* getStub(ICStubSpace* space) override { - return newStub(space, getStubCode()); - } - }; -}; - -class ICUnaryArith_Double : public ICStub -{ - friend class ICStubSpace; - - explicit ICUnaryArith_Double(JitCode* stubCode) - : ICStub(UnaryArith_Double, stubCode) - {} - - public: - class Compiler : public ICMultiStubCompiler { - protected: - MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override; - - public: - Compiler(JSContext* cx, JSOp op, Engine engine) - : ICMultiStubCompiler(cx, ICStub::UnaryArith_Double, op, engine) - {} - - ICStub* getStub(ICStubSpace* space) override { - return newStub(space, getStubCode()); - } - }; -}; - // Compare // JSOP_LT // JSOP_LE diff --git a/js/src/jit/SharedICList.h b/js/src/jit/SharedICList.h index b86274d70799..4de19fd9140e 100644 --- a/js/src/jit/SharedICList.h +++ b/js/src/jit/SharedICList.h @@ -20,10 +20,6 @@ namespace jit { _(BinaryArith_BooleanWithInt32) \ _(BinaryArith_DoubleWithInt32) \ \ - _(UnaryArith_Fallback) \ - _(UnaryArith_Int32) \ - _(UnaryArith_Double) \ - \ _(Compare_Fallback) \ _(Compare_Int32) \ _(Compare_Double) \ diff --git a/js/src/jit/arm/SharedIC-arm.cpp b/js/src/jit/arm/SharedIC-arm.cpp index 0c6ab8e06dce..ee2c19b87df9 100644 --- a/js/src/jit/arm/SharedIC-arm.cpp +++ b/js/src/jit/arm/SharedIC-arm.cpp @@ -186,33 +186,5 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) return true; } -bool -ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) -{ - Label failure; - masm.branchTestInt32(Assembler::NotEqual, R0, &failure); - - switch (op) { - case JSOP_BITNOT: - masm.ma_mvn(R0.payloadReg(), R0.payloadReg()); - break; - case JSOP_NEG: - // Guard against 0 and MIN_INT, both result in a double. - masm.branchTest32(Assembler::Zero, R0.payloadReg(), Imm32(0x7fffffff), &failure); - - // Compile -x as 0 - x. - masm.as_rsb(R0.payloadReg(), R0.payloadReg(), Imm8(0)); - break; - default: - MOZ_CRASH("Unexpected op"); - } - - EmitReturnFromIC(masm); - - masm.bind(&failure); - EmitStubGuardFailure(masm); - return true; -} - } // namespace jit } // namespace js diff --git a/js/src/jit/arm64/SharedIC-arm64.cpp b/js/src/jit/arm64/SharedIC-arm64.cpp index a7670d31932a..0c59369cdcc8 100644 --- a/js/src/jit/arm64/SharedIC-arm64.cpp +++ b/js/src/jit/arm64/SharedIC-arm64.cpp @@ -185,36 +185,5 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) return true; } -bool -ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) -{ - Label failure; - masm.branchTestInt32(Assembler::NotEqual, R0, &failure); - - switch (op) { - case JSOP_BITNOT: - masm.Mvn(ARMRegister(R1.valueReg(), 32), ARMRegister(R0.valueReg(), 32)); - masm.movePayload(R1.valueReg(), R0.valueReg()); - break; - case JSOP_NEG: - // Guard against 0 and MIN_INT, both result in a double. - masm.branchTest32(Assembler::Zero, R0.valueReg(), Imm32(0x7fffffff), &failure); - - // Compile -x as 0 - x. - masm.Sub(ARMRegister(R1.valueReg(), 32), wzr, ARMRegister(R0.valueReg(), 32)); - masm.movePayload(R1.valueReg(), R0.valueReg()); - break; - default: - MOZ_CRASH("Unexpected op"); - } - - EmitReturnFromIC(masm); - - masm.bind(&failure); - EmitStubGuardFailure(masm); - return true; - -} - } // namespace jit } // namespace js diff --git a/js/src/jit/mips32/SharedIC-mips32.cpp b/js/src/jit/mips32/SharedIC-mips32.cpp index 15c47f89fbc2..94a77fd85b98 100644 --- a/js/src/jit/mips32/SharedIC-mips32.cpp +++ b/js/src/jit/mips32/SharedIC-mips32.cpp @@ -144,34 +144,5 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) return true; } -bool -ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) -{ - Label failure; - masm.branchTestInt32(Assembler::NotEqual, R0, &failure); - - switch (op) { - case JSOP_BITNOT: - masm.not32(R0.payloadReg()); - break; - case JSOP_NEG: - // Guard against 0 and MIN_INT, both result in a double. - masm.branchTest32(Assembler::Zero, R0.payloadReg(), Imm32(INT32_MAX), &failure); - - masm.neg32(R0.payloadReg()); - break; - default: - MOZ_CRASH("Unexpected op"); - return false; - } - - EmitReturnFromIC(masm); - - masm.bind(&failure); - EmitStubGuardFailure(masm); - return true; -} - - } // namespace jit } // namespace js diff --git a/js/src/jit/mips64/SharedIC-mips64.cpp b/js/src/jit/mips64/SharedIC-mips64.cpp index f7e61f39f4da..1e73a92fe2d5 100644 --- a/js/src/jit/mips64/SharedIC-mips64.cpp +++ b/js/src/jit/mips64/SharedIC-mips64.cpp @@ -155,37 +155,5 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) return true; } -bool -ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) -{ - Label failure; - masm.branchTestInt32(Assembler::NotEqual, R0, &failure); - - switch (op) { - case JSOP_BITNOT: - masm.not32(R0.valueReg()); - masm.tagValue(JSVAL_TYPE_INT32, R0.valueReg(), R0); - break; - case JSOP_NEG: - masm.unboxInt32(R0, ExtractTemp0); - // Guard against 0 and MIN_INT, both result in a double. - masm.branchTest32(Assembler::Zero, ExtractTemp0, Imm32(INT32_MAX), &failure); - - masm.neg32(ExtractTemp0); - masm.tagValue(JSVAL_TYPE_INT32, ExtractTemp0, R0); - break; - default: - MOZ_CRASH("Unexpected op"); - return false; - } - - EmitReturnFromIC(masm); - - masm.bind(&failure); - EmitStubGuardFailure(masm); - return true; -} - - } // namespace jit } // namespace js diff --git a/js/src/jit/none/Trampoline-none.cpp b/js/src/jit/none/Trampoline-none.cpp index caba07d0856b..d2c3c790f596 100644 --- a/js/src/jit/none/Trampoline-none.cpp +++ b/js/src/jit/none/Trampoline-none.cpp @@ -45,4 +45,3 @@ BailoutFrameInfo::BailoutFrameInfo(const JitActivationIterator& iter, Invalidati bool ICCompare_Int32::Compiler::generateStubCode(MacroAssembler&) { MOZ_CRASH(); } bool ICCompare_Double::Compiler::generateStubCode(MacroAssembler&) { MOZ_CRASH(); } bool ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler&) { MOZ_CRASH(); } -bool ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler&) { MOZ_CRASH(); } diff --git a/js/src/jit/x64/SharedIC-x64.cpp b/js/src/jit/x64/SharedIC-x64.cpp index 4ebd4d7b6016..d513a5c5cbd9 100644 --- a/js/src/jit/x64/SharedIC-x64.cpp +++ b/js/src/jit/x64/SharedIC-x64.cpp @@ -202,33 +202,5 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) return true; } -bool -ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) -{ - Label failure; - masm.branchTestInt32(Assembler::NotEqual, R0, &failure); - - switch (op) { - case JSOP_BITNOT: - masm.notl(R0.valueReg()); - break; - case JSOP_NEG: - // Guard against 0 and MIN_INT, both result in a double. - masm.branchTest32(Assembler::Zero, R0.valueReg(), Imm32(0x7fffffff), &failure); - masm.negl(R0.valueReg()); - break; - default: - MOZ_CRASH("Unexpected op"); - } - - masm.tagValue(JSVAL_TYPE_INT32, R0.valueReg(), R0); - - EmitReturnFromIC(masm); - - masm.bind(&failure); - EmitStubGuardFailure(masm); - return true; -} - } // namespace jit } // namespace js diff --git a/js/src/jit/x86/SharedIC-x86.cpp b/js/src/jit/x86/SharedIC-x86.cpp index ae9d2cdd6244..3e36c2873ae1 100644 --- a/js/src/jit/x86/SharedIC-x86.cpp +++ b/js/src/jit/x86/SharedIC-x86.cpp @@ -212,31 +212,5 @@ ICBinaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) return true; } -bool -ICUnaryArith_Int32::Compiler::generateStubCode(MacroAssembler& masm) -{ - Label failure; - masm.branchTestInt32(Assembler::NotEqual, R0, &failure); - - switch (op) { - case JSOP_BITNOT: - masm.notl(R0.payloadReg()); - break; - case JSOP_NEG: - // Guard against 0 and MIN_INT, both result in a double. - masm.branchTest32(Assembler::Zero, R0.payloadReg(), Imm32(0x7fffffff), &failure); - masm.negl(R0.payloadReg()); - break; - default: - MOZ_CRASH("Unexpected op"); - } - - EmitReturnFromIC(masm); - - masm.bind(&failure); - EmitStubGuardFailure(masm); - return true; -} - } // namespace jit } // namespace js From efea62ee0d43ec299fcb4eb91c8b1e5fdf8bf491 Mon Sep 17 00:00:00 2001 From: Matthew Gaudet Date: Wed, 7 Feb 2018 14:22:48 -0500 Subject: [PATCH 12/48] Bug 1434717: Part 6: Implement UnaryArith IC for doubles r=tcampbell --- js/src/jit/CacheIR.cpp | 29 ++++++++++++++++ js/src/jit/CacheIR.h | 14 ++++++++ js/src/jit/CacheIRCompiler.cpp | 60 ++++++++++++++++++++++++++++++++++ js/src/jit/CacheIRCompiler.h | 2 ++ 4 files changed, 105 insertions(+) diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp index d10e7c32c15a..d053cc4ee045 100644 --- a/js/src/jit/CacheIR.cpp +++ b/js/src/jit/CacheIR.cpp @@ -4707,6 +4707,8 @@ UnaryArithIRGenerator::tryAttachStub() { if (tryAttachInt32()) return true; + if (tryAttachNumber()) + return true; trackAttached(IRGenerator::NotAttached); return false; @@ -4734,6 +4736,33 @@ UnaryArithIRGenerator::tryAttachInt32() MOZ_CRASH("Unexected OP"); } + writer.returnFromIC(); + return true; +} + +bool +UnaryArithIRGenerator::tryAttachNumber() +{ + if (!val_.isNumber() || !res_.isNumber() || !cx_->runtime()->jitSupportsFloatingPoint) + return false; + + ValOperandId valId(writer.setInputOperandId(0)); + writer.guardType(valId, JSVAL_TYPE_DOUBLE); + Int32OperandId truncatedId; + switch (op_) { + case JSOP_BITNOT: + truncatedId = writer.truncateDoubleToUInt32(valId); + writer.int32NotResult(truncatedId); + trackAttached("UnaryArith.DoubleNot"); + break; + case JSOP_NEG: + writer.doubleNegationResult(valId); + trackAttached("UnaryArith.DoubleNeg"); + break; + default: + MOZ_CRASH("Unexpected OP"); + } + writer.returnFromIC(); return true; } \ No newline at end of file diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h index 568d24f68301..893ec0fcdf98 100644 --- a/js/src/jit/CacheIR.h +++ b/js/src/jit/CacheIR.h @@ -209,6 +209,8 @@ extern const char* CacheKindNames[]; _(LoadEnclosingEnvironment) \ _(LoadWrapperTarget) \ \ + _(TruncateDoubleToUInt32) \ + \ _(MegamorphicLoadSlotResult) \ _(MegamorphicLoadSlotByValueResult) \ _(MegamorphicStoreSlot) \ @@ -276,6 +278,7 @@ extern const char* CacheKindNames[]; _(LoadTypeOfObjectResult) \ _(Int32NotResult) \ _(Int32NegationResult) \ + _(DoubleNegationResult) \ _(LoadInt32TruthyResult) \ _(LoadDoubleTruthyResult) \ _(LoadStringTruthyResult) \ @@ -725,6 +728,13 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter return res; } + Int32OperandId truncateDoubleToUInt32(ValOperandId val) { + Int32OperandId res(nextOperandId_++); + writeOpWithOperandId(CacheOp::TruncateDoubleToUInt32, val); + writeOperandId(res); + return res; + } + ValOperandId loadDOMExpandoValue(ObjOperandId obj) { ValOperandId res(nextOperandId_++); writeOpWithOperandId(CacheOp::LoadDOMExpandoValue, obj); @@ -915,6 +925,9 @@ class MOZ_RAII CacheIRWriter : public JS::CustomAutoRooter void int32NegationResult(Int32OperandId id) { writeOpWithOperandId(CacheOp::Int32NegationResult, id); } + void doubleNegationResult(ValOperandId val) { + writeOpWithOperandId(CacheOp::DoubleNegationResult, val); + } void loadBooleanResult(bool val) { writeOp(CacheOp::LoadBooleanResult); buffer_.writeByte(uint32_t(val)); @@ -1676,6 +1689,7 @@ class MOZ_RAII UnaryArithIRGenerator : public IRGenerator HandleValue res_; bool tryAttachInt32(); + bool tryAttachNumber(); void trackAttached(const char* name); diff --git a/js/src/jit/CacheIRCompiler.cpp b/js/src/jit/CacheIRCompiler.cpp index 518833f34672..bf5e5366ae71 100644 --- a/js/src/jit/CacheIRCompiler.cpp +++ b/js/src/jit/CacheIRCompiler.cpp @@ -18,6 +18,7 @@ using namespace js; using namespace js::jit; using mozilla::Maybe; +using mozilla::BitwiseCast; ValueOperand CacheRegisterAllocator::useValueRegister(MacroAssembler& masm, ValOperandId op) @@ -1829,6 +1830,65 @@ CacheIRCompiler::emitInt32NotResult() return true; } +bool +CacheIRCompiler::emitDoubleNegationResult() +{ + AutoOutputRegister output(*this); + ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId()); + + FailurePath* failure; + if (!addFailurePath(&failure)) + return false; + + // If we're compiling a Baseline IC, FloatReg0 is always available. + Label failurePopReg, done; + if (mode_ != Mode::Baseline) + masm.push(FloatReg0); + + masm.ensureDouble(val, FloatReg0, (mode_ != Mode::Baseline) ? &failurePopReg : failure->label()); + masm.negateDouble(FloatReg0); + masm.boxDouble(FloatReg0, output.valueReg(), FloatReg0); + + if (mode_ != Mode::Baseline) { + masm.pop(FloatReg0); + masm.jump(&done); + + masm.bind(&failurePopReg); + masm.pop(FloatReg0); + masm.jump(failure->label()); + } + + masm.bind(&done); + return true; +} + +bool +CacheIRCompiler::emitTruncateDoubleToUInt32() +{ + ValueOperand val = allocator.useValueRegister(masm, reader.valOperandId()); + Register res = allocator.defineRegister(masm, reader.int32OperandId()); + + Label doneTruncate, truncateABICall; + if (mode_ != Mode::Baseline) + masm.push(FloatReg0); + + masm.unboxDouble(val, FloatReg0); + masm.branchTruncateDoubleMaybeModUint32(FloatReg0, res, &truncateABICall); + masm.jump(&doneTruncate); + + masm.bind(&truncateABICall); + masm.setupUnalignedABICall(res); + masm.passABIArg(FloatReg0, MoveOp::DOUBLE); + masm.callWithABI(BitwiseCast(JS::ToInt32), + MoveOp::GENERAL, CheckUnsafeCallWithABI::DontCheckOther); + masm.storeCallInt32Result(res); + + masm.bind(&doneTruncate); + if (mode_ != Mode::Baseline) + masm.pop(FloatReg0); + return true; +} + bool CacheIRCompiler::emitLoadArgumentsObjectLengthResult() { diff --git a/js/src/jit/CacheIRCompiler.h b/js/src/jit/CacheIRCompiler.h index 23900e1fb24e..7c0bac2a17cd 100644 --- a/js/src/jit/CacheIRCompiler.h +++ b/js/src/jit/CacheIRCompiler.h @@ -47,6 +47,8 @@ namespace jit { _(LoadInt32ArrayLengthResult) \ _(Int32NegationResult) \ _(Int32NotResult) \ + _(DoubleNegationResult) \ + _(TruncateDoubleToUInt32) \ _(LoadArgumentsObjectLengthResult) \ _(LoadFunctionLengthResult) \ _(LoadStringLengthResult) \ From 5d3a51198210c4b6a8f670fdb967c8e4cd4eb1c5 Mon Sep 17 00:00:00 2001 From: Matthew Gaudet Date: Thu, 1 Feb 2018 11:09:16 -0500 Subject: [PATCH 13/48] Bug 1434717: Part 4: Remove UnaryShared IC support r=tcampbell It appears this also removes dead remnents of a previous caching story for getprop. --- js/src/jit/CodeGenerator.cpp | 18 ------------------ js/src/jit/CodeGenerator.h | 1 - js/src/jit/Lowering.cpp | 11 ----------- js/src/jit/Lowering.h | 1 - js/src/jit/MIR.h | 15 --------------- js/src/jit/MOpcodes.h | 1 - js/src/jit/shared/LIR-shared.h | 16 ---------------- js/src/jit/shared/LOpcodes-shared.h | 1 - js/src/jit/shared/Lowering-shared-inl.h | 2 +- 9 files changed, 1 insertion(+), 65 deletions(-) diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 45cbe2bd26c4..e94f029ad069 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -2737,24 +2737,6 @@ CodeGenerator::visitBinarySharedStub(LBinarySharedStub* lir) } } -void -CodeGenerator::visitUnarySharedStub(LUnarySharedStub* lir) -{ - JSOp jsop = JSOp(*lir->mir()->resumePoint()->pc()); - switch (jsop) { - case JSOP_BITNOT: - case JSOP_NEG: - emitSharedStub(ICStub::Kind::UnaryArith_Fallback, lir); - break; - case JSOP_CALLPROP: - case JSOP_GETPROP: - case JSOP_LENGTH: - emitSharedStub(ICStub::Kind::GetProp_Fallback, lir); - break; - default: - MOZ_CRASH("Unsupported jsop in shared stubs."); - } -} void CodeGenerator::visitNullarySharedStub(LNullarySharedStub* lir) diff --git a/js/src/jit/CodeGenerator.h b/js/src/jit/CodeGenerator.h index 41ead42ff4d3..5bd480887939 100644 --- a/js/src/jit/CodeGenerator.h +++ b/js/src/jit/CodeGenerator.h @@ -136,7 +136,6 @@ class CodeGenerator final : public CodeGeneratorSpecific void visitStringReplace(LStringReplace* lir); void emitSharedStub(ICStub::Kind kind, LInstruction* lir); void visitBinarySharedStub(LBinarySharedStub* lir); - void visitUnarySharedStub(LUnarySharedStub* lir); void visitNullarySharedStub(LNullarySharedStub* lir); void visitClassConstructor(LClassConstructor* lir); void visitLambda(LLambda* lir); diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index cb4b6a891ecc..d48356a3e84a 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -2531,17 +2531,6 @@ LIRGenerator::visitBinarySharedStub(MBinarySharedStub* ins) assignSafepoint(lir, ins); } -void -LIRGenerator::visitUnarySharedStub(MUnarySharedStub* ins) -{ - MDefinition* input = ins->getOperand(0); - MOZ_ASSERT(ins->type() == MIRType::Value); - - LUnarySharedStub* lir = new(alloc()) LUnarySharedStub(useBoxFixedAtStart(input, R0)); - defineSharedStubReturn(lir, ins); - assignSafepoint(lir, ins); -} - void LIRGenerator::visitNullarySharedStub(MNullarySharedStub* ins) { diff --git a/js/src/jit/Lowering.h b/js/src/jit/Lowering.h index 54b649a4f129..bf04992b7a5b 100644 --- a/js/src/jit/Lowering.h +++ b/js/src/jit/Lowering.h @@ -187,7 +187,6 @@ class LIRGenerator : public LIRGeneratorSpecific void visitGetFirstDollarIndex(MGetFirstDollarIndex* ins) override; void visitStringReplace(MStringReplace* ins) override; void visitBinarySharedStub(MBinarySharedStub* ins) override; - void visitUnarySharedStub(MUnarySharedStub* ins) override; void visitNullarySharedStub(MNullarySharedStub* ins) override; void visitClassConstructor(MClassConstructor* ins) override; void visitLambda(MLambda* ins) override; diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index 2e765246c5a4..cc66367d44d0 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -8231,21 +8231,6 @@ class MBinarySharedStub TRIVIAL_NEW_WRAPPERS }; -class MUnarySharedStub - : public MUnaryInstruction, - public BoxPolicy<0>::Data -{ - explicit MUnarySharedStub(MDefinition* input) - : MUnaryInstruction(classOpcode, input) - { - setResultType(MIRType::Value); - } - - public: - INSTRUCTION_HEADER(UnarySharedStub) - TRIVIAL_NEW_WRAPPERS -}; - class MNullarySharedStub : public MNullaryInstruction { diff --git a/js/src/jit/MOpcodes.h b/js/src/jit/MOpcodes.h index f0f601cdb285..dc2c8a80089a 100644 --- a/js/src/jit/MOpcodes.h +++ b/js/src/jit/MOpcodes.h @@ -54,7 +54,6 @@ namespace jit { _(OsrArgumentsObject) \ _(ReturnFromCtor) \ _(BinarySharedStub) \ - _(UnarySharedStub) \ _(NullarySharedStub) \ _(CheckOverRecursed) \ _(DefVar) \ diff --git a/js/src/jit/shared/LIR-shared.h b/js/src/jit/shared/LIR-shared.h index 212645226928..ceac10ac20e3 100644 --- a/js/src/jit/shared/LIR-shared.h +++ b/js/src/jit/shared/LIR-shared.h @@ -5114,22 +5114,6 @@ class LBinarySharedStub : public LCallInstructionHelper -{ - public: - LIR_HEADER(UnarySharedStub) - - explicit LUnarySharedStub(const LBoxAllocation& input) { - setBoxOperand(Input, input); - } - - const MUnarySharedStub* mir() const { - return mir_->toUnarySharedStub(); - } - - static const size_t Input = 0; -}; - class LNullarySharedStub : public LCallInstructionHelper { public: diff --git a/js/src/jit/shared/LOpcodes-shared.h b/js/src/jit/shared/LOpcodes-shared.h index edac14985537..31abcf50e8a7 100644 --- a/js/src/jit/shared/LOpcodes-shared.h +++ b/js/src/jit/shared/LOpcodes-shared.h @@ -244,7 +244,6 @@ _(StringReplace) \ _(Substr) \ _(BinarySharedStub) \ - _(UnarySharedStub) \ _(NullarySharedStub) \ _(ClassConstructor) \ _(Lambda) \ diff --git a/js/src/jit/shared/Lowering-shared-inl.h b/js/src/jit/shared/Lowering-shared-inl.h index 021fab88ba46..a8fc76c412a2 100644 --- a/js/src/jit/shared/Lowering-shared-inl.h +++ b/js/src/jit/shared/Lowering-shared-inl.h @@ -210,7 +210,7 @@ LIRGeneratorShared::defineSharedStubReturn(LInstruction* lir, MDefinition* mir) { lir->setMir(mir); - MOZ_ASSERT(lir->isBinarySharedStub() || lir->isUnarySharedStub() || lir->isNullarySharedStub()); + MOZ_ASSERT(lir->isBinarySharedStub() || lir->isNullarySharedStub()); MOZ_ASSERT(mir->type() == MIRType::Value); uint32_t vreg = getVirtualRegister(); From 0e8fb739c756f07202b09a9a5f81dd079a52d10d Mon Sep 17 00:00:00 2001 From: Matthew Gaudet Date: Fri, 2 Feb 2018 10:38:43 -0500 Subject: [PATCH 14/48] Bug 1434717: Part 5: Connect UnaryArith IC to IonMonkey r=tcampbell --- js/src/jit-test/tests/cacheir/unaryarith.js | 28 ++++++++----- js/src/jit/CodeGenerator.cpp | 33 ++++++++++++++- js/src/jit/CodeGenerator.h | 1 + js/src/jit/IonBuilder.cpp | 14 +++++-- js/src/jit/IonCacheIRCompiler.cpp | 14 ++++++- js/src/jit/IonIC.cpp | 45 ++++++++++++++++++++- js/src/jit/IonIC.h | 29 +++++++++++++ js/src/jit/Lowering.cpp | 11 +++++ js/src/jit/Lowering.h | 1 + js/src/jit/MIR.h | 15 +++++++ js/src/jit/MOpcodes.h | 1 + js/src/jit/shared/LIR-shared.h | 20 +++++++++ js/src/jit/shared/LOpcodes-shared.h | 1 + 13 files changed, 195 insertions(+), 18 deletions(-) diff --git a/js/src/jit-test/tests/cacheir/unaryarith.js b/js/src/jit-test/tests/cacheir/unaryarith.js index 96413a4e720f..46e7d0a573d3 100644 --- a/js/src/jit-test/tests/cacheir/unaryarith.js +++ b/js/src/jit-test/tests/cacheir/unaryarith.js @@ -1,7 +1,14 @@ -function warmup(fun, input, output) { - for (var i = 0; i < 30; i++) { - var y = fun(input); - assertEq(y, output) +setJitCompilerOption('ion.forceinlineCaches', 1); + +function warmup(fun, input_array, output_array) { + assertEq(output_array.length, input_array.length); + for (var index = 0; index < input_array.length; index++) { + input = input_array[index]; + output = output_array[index]; + for (var i = 0; i < 30; i++) { + var y = fun(input); + assertEq(y, output) + } } } @@ -11,13 +18,12 @@ var fun2 = (x) => { return -x; } var fun3 = (x) => { return ~x; } var fun4 = (x) => { return ~x; } -warmup(fun1, 1, -1); -warmup(fun1, 0, -0); +warmup(fun1, [1, 2], [-1, -2]); +warmup(fun2, [0], [-0]); -warmup(fun2, 3, -3); -warmup(fun2, 1.2, -1.2); +warmup(fun2, [3, 4], [-3, -4]); +warmup(fun1, [1.2, 1.4], [-1.2, -1.4]); -warmup(fun3, -1, 0); -warmup(fun4, 1.2, -2); -warmup(fun4, 3, -4) +warmup(fun3, [-1, 0], [0, -1]); +warmup(fun4, [-1.0, 0.0, 1.2, 3], [0, -1, -2, -4]); diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index e94f029ad069..5dab2b0ca401 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -175,12 +175,16 @@ typedef bool (*IonInICFn)(JSContext*, HandleScript, IonInIC*, HandleValue, Handl static const VMFunction IonInICInfo = FunctionInfo(IonInIC::update, "IonInIC::update"); - typedef bool (*IonInstanceOfICFn)(JSContext*, HandleScript, IonInstanceOfIC*, HandleValue lhs, HandleObject rhs, bool* res); static const VMFunction IonInstanceOfInfo = FunctionInfo(IonInstanceOfIC::update, "IonInstanceOfIC::update"); +typedef bool (*IonUnaryArithICFn)(JSContext* cx, HandleScript outerScript, IonUnaryArithIC* stub, + HandleValue val, MutableHandleValue res); +static const VMFunction IonUnaryArithICInfo = + FunctionInfo(IonUnaryArithIC::update, "IonUnaryArithIC::update"); + void CodeGenerator::visitOutOfLineICFallback(OutOfLineICFallback* ool) { @@ -357,7 +361,22 @@ CodeGenerator::visitOutOfLineICFallback(OutOfLineICFallback* ool) masm.jump(ool->rejoin()); return; } - case CacheKind::UnaryArith: + case CacheKind::UnaryArith: { + IonUnaryArithIC* unaryArithIC = ic->asUnaryArithIC(); + + saveLive(lir); + + pushArg(unaryArithIC->input()); + icInfo_[cacheInfoIndex].icOffsetForPush = pushArgWithPatch(ImmWord(-1)); + pushArg(ImmGCPtr(gen->info().script())); + callVM(IonUnaryArithICInfo, lir); + + StoreValueTo(unaryArithIC->output()).generate(this); + restoreLiveIgnore(lir, StoreValueTo(unaryArithIC->output()).clobbered()); + + masm.jump(ool->rejoin()); + return; + } case CacheKind::Call: case CacheKind::Compare: case CacheKind::TypeOf: @@ -2737,6 +2756,16 @@ CodeGenerator::visitBinarySharedStub(LBinarySharedStub* lir) } } +void +CodeGenerator::visitUnaryCache(LUnaryCache* lir) +{ + LiveRegisterSet liveRegs = lir->safepoint()->liveRegs(); + TypedOrValueRegister input = TypedOrValueRegister(ToValue(lir, LUnaryCache::Input)); + ValueOperand output = GetValueOutput(lir); + + IonUnaryArithIC ic(liveRegs, input, output); + addIC(lir, allocateIC(ic)); +} void CodeGenerator::visitNullarySharedStub(LNullarySharedStub* lir) diff --git a/js/src/jit/CodeGenerator.h b/js/src/jit/CodeGenerator.h index 5bd480887939..bc6444763145 100644 --- a/js/src/jit/CodeGenerator.h +++ b/js/src/jit/CodeGenerator.h @@ -136,6 +136,7 @@ class CodeGenerator final : public CodeGeneratorSpecific void visitStringReplace(LStringReplace* lir); void emitSharedStub(ICStub::Kind kind, LInstruction* lir); void visitBinarySharedStub(LBinarySharedStub* lir); + void visitUnaryCache(LUnaryCache* lir); void visitNullarySharedStub(LNullarySharedStub* lir); void visitClassConstructor(LClassConstructor* lir); void visitLambda(LLambda* lir); diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 910b884eb838..60d7d2937b4b 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -3281,6 +3281,10 @@ IonBuilder::jsop_bitnot() return Ok(); } + MOZ_TRY(arithTrySharedStub(&emitted, JSOP_BITNOT, nullptr, input)); + if (emitted) + return Ok(); + // Not possible to optimize. Do a slow vm call. MBitNot* ins = MBitNot::New(alloc(), input); @@ -3543,12 +3547,16 @@ IonBuilder::arithTrySharedStub(bool* emitted, JSOp op, if (actualOp == JSOP_POS) return Ok(); - // JSOP_NEG and JSOP_BITNOT can't be handled here right now. - if (actualOp == JSOP_NEG || actualOp == JSOP_BITNOT) - return Ok(); MInstruction* stub = nullptr; switch (actualOp) { + case JSOP_NEG: + case JSOP_BITNOT: + MOZ_ASSERT_IF(op == JSOP_MUL, + left->maybeConstantValue() && left->maybeConstantValue()->toInt32() == -1); + MOZ_ASSERT_IF(op != JSOP_MUL, !left); + stub = MUnaryCache::New(alloc(), right); + break; case JSOP_ADD: case JSOP_SUB: case JSOP_MUL: diff --git a/js/src/jit/IonCacheIRCompiler.cpp b/js/src/jit/IonCacheIRCompiler.cpp index 59eb8b6588a3..f1a015eca455 100644 --- a/js/src/jit/IonCacheIRCompiler.cpp +++ b/js/src/jit/IonCacheIRCompiler.cpp @@ -542,12 +542,24 @@ IonCacheIRCompiler::init() AnyRegister(ic->rhs()))); break; } + case CacheKind::UnaryArith: { + IonUnaryArithIC *ic = ic_->asUnaryArithIC(); + ValueOperand output = ic->output(); + + available.add(output); + + liveRegs_.emplace(ic->liveRegs()); + outputUnchecked_.emplace(TypedOrValueRegister(output)); + + MOZ_ASSERT(numInputs == 1); + allocator.initInputLocation(0, ic->input()); + break; + } case CacheKind::Call: case CacheKind::Compare: case CacheKind::TypeOf: case CacheKind::ToBool: case CacheKind::GetIntrinsic: - case CacheKind::UnaryArith: MOZ_CRASH("Unsupported IC"); } diff --git a/js/src/jit/IonIC.cpp b/js/src/jit/IonIC.cpp index 71004009dc00..996fdb2d7969 100644 --- a/js/src/jit/IonIC.cpp +++ b/js/src/jit/IonIC.cpp @@ -60,12 +60,13 @@ IonIC::scratchRegisterForEntryJump() return asGetIteratorIC()->temp1(); case CacheKind::InstanceOf: return asInstanceOfIC()->output(); + case CacheKind::UnaryArith: + return asUnaryArithIC()->output().scratchReg(); case CacheKind::Call: case CacheKind::Compare: case CacheKind::TypeOf: case CacheKind::ToBool: case CacheKind::GetIntrinsic: - case CacheKind::UnaryArith: MOZ_CRASH("Unsupported IC"); } @@ -506,6 +507,48 @@ IonInstanceOfIC::update(JSContext* cx, HandleScript outerScript, IonInstanceOfIC return HasInstance(cx, rhs, lhs, res); } +/* static */ bool +IonUnaryArithIC::update(JSContext* cx, HandleScript outerScript, IonUnaryArithIC* ic, + HandleValue val, MutableHandleValue res) +{ + IonScript* ionScript = outerScript->ionScript(); + RootedScript script(cx, ic->script()); + jsbytecode* pc = ic->pc(); + JSOp op = JSOp(*pc); + + switch (op) { + case JSOP_BITNOT: { + int32_t result; + if (!BitNot(cx, val, &result)) + return false; + res.setInt32(result); + break; + } + case JSOP_NEG: + if (!NegOperation(cx, val, res)) + return false; + break; + default: + MOZ_CRASH("Unexpected op"); + } + + if (ic->state().maybeTransition()) + ic->discardStubs(cx->zone()); + + if (ic->state().canAttachStub()) { + bool attached = false; + UnaryArithIRGenerator gen(cx, script, pc, ic->state().mode(), op, val, res); + + if (gen.tryAttachStub()) + ic->attachCacheIRStub(cx, gen.writerRef(), gen.cacheKind(), ionScript, &attached); + + if (!attached) + ic->state().trackNotAttached(); + } + + return true; +} + uint8_t* IonICStub::stubDataStart() { diff --git a/js/src/jit/IonIC.h b/js/src/jit/IonIC.h index 01a81a064a85..68b3d85743d5 100644 --- a/js/src/jit/IonIC.h +++ b/js/src/jit/IonIC.h @@ -65,6 +65,7 @@ class IonGetIteratorIC; class IonHasOwnIC; class IonInIC; class IonInstanceOfIC; +class IonUnaryArithIC; class IonIC { @@ -172,6 +173,10 @@ class IonIC MOZ_ASSERT(kind_ == CacheKind::InstanceOf); return (IonInstanceOfIC*)this; } + IonUnaryArithIC* asUnaryArithIC() { + MOZ_ASSERT(kind_ == CacheKind::UnaryArith); + return (IonUnaryArithIC*)this; + } void updateBaseAddress(JitCode* code, MacroAssembler& masm); @@ -475,6 +480,30 @@ class IonInstanceOfIC : public IonIC HandleValue lhs, HandleObject rhs, bool* attached); }; +class IonUnaryArithIC : public IonIC +{ + LiveRegisterSet liveRegs_; + + TypedOrValueRegister input_; + ValueOperand output_; + + public: + + IonUnaryArithIC(LiveRegisterSet liveRegs, TypedOrValueRegister input, ValueOperand output) + : IonIC(CacheKind::UnaryArith), + liveRegs_(liveRegs), + input_(input), + output_(output) + { } + + LiveRegisterSet liveRegs() const { return liveRegs_; } + TypedOrValueRegister input() const { return input_; } + ValueOperand output() const { return output_; } + + static MOZ_MUST_USE bool update(JSContext* cx, HandleScript outerScript, IonUnaryArithIC* stub, + HandleValue val, MutableHandleValue res); +}; + } // namespace jit } // namespace js diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index d48356a3e84a..8e29495e8d69 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -2531,6 +2531,17 @@ LIRGenerator::visitBinarySharedStub(MBinarySharedStub* ins) assignSafepoint(lir, ins); } +void +LIRGenerator::visitUnaryCache(MUnaryCache* ins) +{ + MDefinition* input = ins->getOperand(0); + MOZ_ASSERT(ins->type() == MIRType::Value); + + LUnaryCache* lir = new(alloc()) LUnaryCache(useBox(input)); + defineBox(lir, ins); + assignSafepoint(lir, ins); +} + void LIRGenerator::visitNullarySharedStub(MNullarySharedStub* ins) { diff --git a/js/src/jit/Lowering.h b/js/src/jit/Lowering.h index bf04992b7a5b..3fabf03c1461 100644 --- a/js/src/jit/Lowering.h +++ b/js/src/jit/Lowering.h @@ -187,6 +187,7 @@ class LIRGenerator : public LIRGeneratorSpecific void visitGetFirstDollarIndex(MGetFirstDollarIndex* ins) override; void visitStringReplace(MStringReplace* ins) override; void visitBinarySharedStub(MBinarySharedStub* ins) override; + void visitUnaryCache(MUnaryCache* ins) override; void visitNullarySharedStub(MNullarySharedStub* ins) override; void visitClassConstructor(MClassConstructor* ins) override; void visitLambda(MLambda* ins) override; diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h index cc66367d44d0..3ce0cf034e24 100644 --- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -8231,6 +8231,21 @@ class MBinarySharedStub TRIVIAL_NEW_WRAPPERS }; +class MUnaryCache + : public MUnaryInstruction, + public BoxPolicy<0>::Data +{ + explicit MUnaryCache(MDefinition* input) + : MUnaryInstruction(classOpcode, input) + { + setResultType(MIRType::Value); + } + + public: + INSTRUCTION_HEADER(UnaryCache) + TRIVIAL_NEW_WRAPPERS +}; + class MNullarySharedStub : public MNullaryInstruction { diff --git a/js/src/jit/MOpcodes.h b/js/src/jit/MOpcodes.h index dc2c8a80089a..0aafe43ec7d5 100644 --- a/js/src/jit/MOpcodes.h +++ b/js/src/jit/MOpcodes.h @@ -54,6 +54,7 @@ namespace jit { _(OsrArgumentsObject) \ _(ReturnFromCtor) \ _(BinarySharedStub) \ + _(UnaryCache) \ _(NullarySharedStub) \ _(CheckOverRecursed) \ _(DefVar) \ diff --git a/js/src/jit/shared/LIR-shared.h b/js/src/jit/shared/LIR-shared.h index ceac10ac20e3..d29d40d6b54f 100644 --- a/js/src/jit/shared/LIR-shared.h +++ b/js/src/jit/shared/LIR-shared.h @@ -5114,6 +5114,26 @@ class LBinarySharedStub : public LCallInstructionHelper +{ + public: + LIR_HEADER(UnaryCache) + + explicit LUnaryCache(const LBoxAllocation& input) { + setBoxOperand(Input, input); + } + + const MUnaryCache* mir() const { + return mir_->toUnaryCache(); + } + + const LAllocation* input() { + return getOperand(Input); + } + + static const size_t Input = 0; +}; + class LNullarySharedStub : public LCallInstructionHelper { public: diff --git a/js/src/jit/shared/LOpcodes-shared.h b/js/src/jit/shared/LOpcodes-shared.h index 31abcf50e8a7..266905e4b35a 100644 --- a/js/src/jit/shared/LOpcodes-shared.h +++ b/js/src/jit/shared/LOpcodes-shared.h @@ -244,6 +244,7 @@ _(StringReplace) \ _(Substr) \ _(BinarySharedStub) \ + _(UnaryCache) \ _(NullarySharedStub) \ _(ClassConstructor) \ _(Lambda) \ From ae89126f895519e200af41bb63dcaa2a392be2b9 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Fri, 16 Feb 2018 12:25:30 -0500 Subject: [PATCH 15/48] Bug 1438797 -Disable on Win_CCOV Perma devtools/client/debugger/new/test/mochitest/browser_dbg-babel.js | This test exceeded the timeout threshold. r=jmaher --- devtools/client/debugger/new/test/mochitest/browser.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/client/debugger/new/test/mochitest/browser.ini b/devtools/client/debugger/new/test/mochitest/browser.ini index da788e49a088..7afecca0b874 100644 --- a/devtools/client/debugger/new/test/mochitest/browser.ini +++ b/devtools/client/debugger/new/test/mochitest/browser.ini @@ -101,6 +101,7 @@ support-files = [browser_dbg-asm.js] [browser_dbg-async-stepping.js] [browser_dbg-babel.js] +skip-if = (os == "win" && ccov) # bug 1438797 [browser_dbg-breaking.js] [browser_dbg-breaking-from-console.js] [browser_dbg-breakpoints.js] From f841577066d7351ec7a7d564352e6ab6173041b1 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 14:54:51 -0700 Subject: [PATCH 16/48] Bug 1429603: Remove code for uploading artifacts from buildbot to taskcluster; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D523 --HG-- extra : rebase_source : 947d3aab0dfae36a2a819249ac4a093a33385c5d --- taskcluster/taskgraph/transforms/task.py | 39 --- .../configs/builds/build_pool_specifics.py | 2 - .../builds/releng_base_android_64_builds.py | 2 - .../builds/releng_base_linux_32_builds.py | 1 - .../builds/releng_base_linux_64_builds.py | 1 - .../releng_base_windows_32_mingw_builds.py | 1 - .../releng_sub_android_configs/64_x86.py | 1 - .../64_x86_artifact.py | 1 - .../64_x86_old_id.py | 1 - .../releng_sub_linux_configs/32_artifact.py | 1 - .../32_debug_artifact.py | 1 - .../64_add-on-devel.py | 1 - .../releng_sub_linux_configs/64_artifact.py | 1 - .../releng_sub_linux_configs/64_asan.py | 1 - .../64_asan_and_debug.py | 1 - .../64_asan_reporter_tc.py | 1 - .../releng_sub_linux_configs/64_asan_tc.py | 1 - .../64_asan_tc_and_debug.py | 1 - .../64_debug_artifact.py | 1 - .../64_fuzzing_asan_tc.py | 1 - .../64_fuzzing_debug.py | 1 - .../64_searchfox_and_debug.py | 1 - .../64_stat_and_debug.py | 1 - .../64_stat_and_opt.py | 1 - .../releng_sub_linux_configs/64_valgrind.py | 1 - .../releng_sub_mac_configs/64_add-on-devel.py | 1 - .../releng_sub_mac_configs/64_artifact.py | 1 - .../64_debug_artifact.py | 1 - .../builds/taskcluster_base_windows.py | 1 - .../taskcluster_sub_win32/addondevel.py | 1 - .../taskcluster_sub_win64/addondevel.py | 1 - testing/mozharness/configs/routes.json | 28 -- .../configs/single_locale/dev-mozilla-beta.py | 10 - .../single_locale/dev-mozilla-release.py | 10 - .../configs/single_locale/mozilla-beta.py | 10 - .../single_locale/mozilla-beta_devedition.py | 10 - .../configs/single_locale/mozilla-esr52.py | 10 - .../configs/single_locale/mozilla-release.py | 10 - .../configs/single_locale/production.py | 1 - .../configs/single_locale/staging.py | 1 - .../configs/single_locale/win64_devedition.py | 1 - .../mozharness/mozharness/mozilla/buildbot.py | 34 --- .../mozharness/mozilla/building/buildbase.py | 251 +----------------- testing/mozharness/scripts/desktop_l10n.py | 100 ------- .../mozharness/scripts/fx_desktop_build.py | 3 - testing/mozharness/scripts/mobile_l10n.py | 73 ----- 46 files changed, 8 insertions(+), 615 deletions(-) delete mode 100644 testing/mozharness/configs/routes.json diff --git a/taskcluster/taskgraph/transforms/task.py b/taskcluster/taskgraph/transforms/task.py index 0db3638588bb..883433221888 100644 --- a/taskcluster/taskgraph/transforms/task.py +++ b/taskcluster/taskgraph/transforms/task.py @@ -11,7 +11,6 @@ complexities of worker implementations, scopes, and treeherder annotations. from __future__ import absolute_import, print_function, unicode_literals import hashlib -import json import os import re import time @@ -1710,41 +1709,3 @@ def check_run_task_caches(config, tasks): 'cache name so it is sparse aware' % task['label']) yield task - - -# Check that the v2 route templates match those used by Mozharness. This can -# go away once Mozharness builds are no longer performed in Buildbot, and the -# Mozharness code referencing routes.json is deleted. -def check_v2_routes(): - with open(os.path.join(GECKO, "testing/mozharness/configs/routes.json"), "rb") as f: - routes_json = json.load(f) - - for key in ('routes', 'nightly', 'l10n', 'nightly-l10n'): - if key == 'routes': - tc_template = V2_ROUTE_TEMPLATES - elif key == 'nightly': - tc_template = V2_NIGHTLY_TEMPLATES - elif key == 'l10n': - tc_template = V2_L10N_TEMPLATES - elif key == 'nightly-l10n': - tc_template = V2_NIGHTLY_L10N_TEMPLATES + V2_L10N_TEMPLATES - - routes = routes_json[key] - - # we use different variables than mozharness - for mh, tg in [ - ('{index}', 'index'), - ('gecko', '{trust-domain}'), - ('{build_product}', '{product}'), - ('{build_name}-{build_type}', '{job-name}'), - ('{year}.{month}.{day}.{pushdate}', '{build_date_long}'), - ('{pushid}', '{pushlog_id}'), - ('{year}.{month}.{day}', '{build_date}')]: - routes = [r.replace(mh, tg) for r in routes] - - if sorted(routes) != sorted(tc_template): - raise Exception("V2 TEMPLATES do not match Mozharness's routes.json: " - "(tc):%s vs (mh):%s" % (tc_template, routes)) - - -check_v2_routes() diff --git a/testing/mozharness/configs/builds/build_pool_specifics.py b/testing/mozharness/configs/builds/build_pool_specifics.py index 857c06e277e8..22b396e39f3a 100644 --- a/testing/mozharness/configs/builds/build_pool_specifics.py +++ b/testing/mozharness/configs/builds/build_pool_specifics.py @@ -13,7 +13,6 @@ config = { "graph_server_branch_name": "MozillaTest", 'graph_server': 'graphs.allizom.org', 'stage_server': 'upload.ffxbld.productdelivery.stage.mozaws.net', - 'taskcluster_index': 'index.garbage.staging', 'post_upload_extra': ['--bucket-prefix', 'net-mozaws-stage-delivery', '--url-prefix', 'http://ftp.stage.mozaws.net/', ], @@ -26,7 +25,6 @@ config = { 'graph_server': 'graphs.mozilla.org', # bug 1216907, set this at branch level # 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - 'taskcluster_index': 'index', }, "taskcluster": { 'graph_server': 'graphs.mozilla.org', diff --git a/testing/mozharness/configs/builds/releng_base_android_64_builds.py b/testing/mozharness/configs/builds/releng_base_android_64_builds.py index 487191ab00eb..bf0ce4d0ee42 100644 --- a/testing/mozharness/configs/builds/releng_base_android_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_android_64_builds.py @@ -61,10 +61,8 @@ config = { 'platform': 'android', 'stage_platform': 'android', 'stage_product': 'mobile', - 'publish_nightly_en_US_routes': True, 'post_upload_include_platform': True, 'enable_max_vsize': False, - 'use_package_as_marfile': True, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_base_linux_32_builds.py b/testing/mozharness/configs/builds/releng_base_linux_32_builds.py index 9c2d1249bbf9..42bdcf74e318 100644 --- a/testing/mozharness/configs/builds/releng_base_linux_32_builds.py +++ b/testing/mozharness/configs/builds/releng_base_linux_32_builds.py @@ -43,7 +43,6 @@ config = { 'base_name': 'Linux_%(branch)s', 'platform': 'linux', 'stage_platform': 'linux', - 'publish_nightly_en_US_routes': True, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_base_linux_64_builds.py b/testing/mozharness/configs/builds/releng_base_linux_64_builds.py index aa72008fef4b..5c33ba2943a5 100644 --- a/testing/mozharness/configs/builds/releng_base_linux_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_linux_64_builds.py @@ -42,7 +42,6 @@ config = { 'base_name': 'Linux_x86-64_%(branch)s', 'platform': 'linux64', 'stage_platform': 'linux64', - 'publish_nightly_en_US_routes': True, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py b/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py index cee1bfb0d206..6d89eab215e9 100755 --- a/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py +++ b/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py @@ -36,7 +36,6 @@ config = { 'base_name': 'WINNT_5.2_MINGW_%(branch)s', 'platform': 'win32-mingw32', 'stage_platform': 'win32-mingw32', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86.py b/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86.py index a0041607affd..bbb3eddd0138 100644 --- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86.py +++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86.py @@ -1,7 +1,6 @@ config = { 'base_name': 'Android 4.2 x86 %(branch)s build', 'stage_platform': 'android-x86', - 'publish_nightly_en_US_routes': False, 'build_type': 'x86-opt', 'src_mozconfig': 'mobile/android/config/mozconfigs/android-x86/nightly', 'artifact_flag_build_variant_in_try': 'x86-artifact', diff --git a/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_artifact.py b/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_artifact.py index d0136eb3b82a..a78353f2cb91 100644 --- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_artifact.py @@ -1,7 +1,6 @@ config = { 'base_name': 'Android 4.2 x86 %(branch)s Artifact build', 'stage_platform': 'android-x86', - 'publish_nightly_en_US_routes': False, 'build_type': 'x86-opt', 'src_mozconfig': 'mobile/android/config/mozconfigs/android-x86/nightly-artifact', 'tooltool_manifest_src': 'mobile/android/config/tooltool-manifests/android-x86/releng.manifest', diff --git a/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_old_id.py b/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_old_id.py index 3d02acdcf6b5..366299b9570b 100644 --- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_old_id.py +++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_x86_old_id.py @@ -1,7 +1,6 @@ config = { 'base_name': 'Android 4.2 x86 %(branch)s build OldId', 'stage_platform': 'android-x86-old-id', - 'publish_nightly_en_US_routes': False, 'build_type': 'x86-opt', 'src_mozconfig': 'mobile/android/config/mozconfigs/android-x86/nightly-old-id', 'artifact_flag_build_variant_in_try': 'x86-artifact', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_artifact.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_artifact.py index f1f4a4518cd1..f07fbd08cd3f 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_artifact.py @@ -29,7 +29,6 @@ config = { 'base_name': 'Linux_%(branch)s_Artifact_build', 'platform': 'linux', 'stage_platform': 'linux', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug_artifact.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug_artifact.py index 48e9a8f88e55..b6e8d56620ac 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/32_debug_artifact.py @@ -31,7 +31,6 @@ config = { 'base_name': 'Linux_%(branch)s_Artifact_build', 'platform': 'linux', 'stage_platform': 'linux-debug', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py index 4581e1b87f1b..1947abddb7ca 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'linux64-add-on-devel', - 'publish_nightly_en_US_routes': False, 'build_type': 'add-on-devel', 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py index be904db2ceb3..7649bcd518e4 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_artifact.py @@ -30,7 +30,6 @@ config = { 'base_name': 'Linux_x86-64_%(branch)s_Artifact_build', 'platform': 'linux64', 'stage_platform': 'linux64', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py index 0c1f5011a5d2..d88df50f402d 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'linux64-asan', - 'publish_nightly_en_US_routes': False, 'build_type': 'asan', 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py index 74320eebf50d..e141f80ce81d 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'linux64-asan-debug', - 'publish_nightly_en_US_routes': False, 'build_type': 'asan-debug', 'debug_build': True, 'platform_supports_post_upload_to_latest': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py index 043d958eea2d..2e7f74dc8b1b 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'linux64-asan-reporter', - 'publish_nightly_en_US_routes': False, 'build_type': 'asan', 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py index 0c1f5011a5d2..d88df50f402d 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'linux64-asan', - 'publish_nightly_en_US_routes': False, 'build_type': 'asan', 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py index 74320eebf50d..e141f80ce81d 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'linux64-asan-debug', - 'publish_nightly_en_US_routes': False, 'build_type': 'asan-debug', 'debug_build': True, 'platform_supports_post_upload_to_latest': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py index e7f4f42a80a6..731ef4cef80f 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_debug_artifact.py @@ -24,7 +24,6 @@ config = { 'base_name': 'Linux_x86-64_%(branch)s_Artifact_build', 'platform': 'linux64', 'stage_platform': 'linux64-debug', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py index abd1764bd67d..200aeb90f7ab 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'linux64-fuzzing-asan', - 'publish_nightly_en_US_routes': False, 'build_type': 'asan', 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py index 49c79f156c88..b58cc0facc5d 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py @@ -7,7 +7,6 @@ config = { 'check-test', ], 'stage_platform': 'linux64-fuzzing-debug', - 'publish_nightly_en_US_routes': False, 'debug_build': True, 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_searchfox_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_searchfox_and_debug.py index 01c63752fe01..901633bf086e 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_searchfox_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_searchfox_and_debug.py @@ -21,7 +21,6 @@ config = { 'base_name': 'Linux_x86-64_%(branch)s_Searchfox', 'platform': 'linux64', 'stage_platform': 'linux64-searchfox-opt', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_debug.py index eb6c2e230ae9..2705b0c6b5c1 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_debug.py @@ -21,7 +21,6 @@ config = { 'base_name': 'Linux_x86-64_%(branch)s_Static_Analysis', 'platform': 'linux64', 'stage_platform': 'linux64-st-an-opt', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_opt.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_opt.py index 7d93e4489131..fc7fd187ce25 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_opt.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_stat_and_opt.py @@ -21,7 +21,6 @@ config = { 'base_name': 'Linux_x86-64_%(branch)s_Static_Analysis', 'platform': 'linux64', 'stage_platform': 'linux64-st-an', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'DISPLAY': ':2', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py index 81824af3dd03..dfcd07dc2e83 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py @@ -9,7 +9,6 @@ config = { #'update', ], 'stage_platform': 'linux64-valgrind', - 'publish_nightly_en_US_routes': False, 'build_type': 'valgrind', 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py index 5162ffc6644e..abddfc90ec66 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py @@ -8,7 +8,6 @@ config = { # 'update', ], 'stage_platform': 'macosx64-add-on-devel', - 'publish_nightly_en_US_routes': False, 'build_type': 'add-on-devel', 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py index 6c6187dae946..c2e810021b30 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_artifact.py @@ -24,7 +24,6 @@ config = { 'base_name': 'OS X 10.7 %(branch)s_Artifact_build', 'platform': 'macosx64', 'stage_platform': 'macosx64', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'HG_SHARE_BASE_DIR': '/builds/hg-shared', diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py index 7cf414fcf5f8..b9a8a38e56fd 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_debug_artifact.py @@ -25,7 +25,6 @@ config = { 'base_name': 'OS X 10.7 %(branch)s_Artifact_build', 'platform': 'macosx64', 'stage_platform': 'macosx64-debug', - 'publish_nightly_en_US_routes': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), 'HG_SHARE_BASE_DIR': '/builds/hg-shared', diff --git a/testing/mozharness/configs/builds/taskcluster_base_windows.py b/testing/mozharness/configs/builds/taskcluster_base_windows.py index 0a6b3be7619d..763f4a4e8607 100644 --- a/testing/mozharness/configs/builds/taskcluster_base_windows.py +++ b/testing/mozharness/configs/builds/taskcluster_base_windows.py @@ -12,7 +12,6 @@ config = { 'enable_count_ctors': False, 'max_build_output_timeout': 60 * 80, - 'publish_nightly_en_US_routes': True, 'env': { 'HG_SHARE_BASE_DIR': os.path.join('y:', os.sep, 'hg-shared'), 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), diff --git a/testing/mozharness/configs/builds/taskcluster_sub_win32/addondevel.py b/testing/mozharness/configs/builds/taskcluster_sub_win32/addondevel.py index 3391e243e1ec..f3e791730fd3 100644 --- a/testing/mozharness/configs/builds/taskcluster_sub_win32/addondevel.py +++ b/testing/mozharness/configs/builds/taskcluster_sub_win32/addondevel.py @@ -3,6 +3,5 @@ config = { 'enable_signing': False, 'base_name': 'WINNT 5.2 add-on-devel %(branch)s', 'stage_platform': 'win32-add-on-devel', - 'publish_nightly_en_US_routes': False, 'mozconfig_variant': 'add-on-devel', } diff --git a/testing/mozharness/configs/builds/taskcluster_sub_win64/addondevel.py b/testing/mozharness/configs/builds/taskcluster_sub_win64/addondevel.py index 5f719bdce5db..32a7d79ec6f5 100644 --- a/testing/mozharness/configs/builds/taskcluster_sub_win64/addondevel.py +++ b/testing/mozharness/configs/builds/taskcluster_sub_win64/addondevel.py @@ -2,6 +2,5 @@ config = { 'enable_signing': False, 'base_name': 'WINNT 6.1 x86-64 add-on-devel %(branch)s', 'stage_platform': 'win64-add-on-devel', - 'publish_nightly_en_US_routes': False, 'mozconfig_variant': 'add-on-devel', } diff --git a/testing/mozharness/configs/routes.json b/testing/mozharness/configs/routes.json deleted file mode 100644 index 55515208abfa..000000000000 --- a/testing/mozharness/configs/routes.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "routes": [ - "{index}.gecko.v2.{project}.revision.{head_rev}.{build_product}.{build_name}-{build_type}", - "{index}.gecko.v2.{project}.pushdate.{year}.{month}.{day}.{pushdate}.{build_product}.{build_name}-{build_type}", - "{index}.gecko.v2.{project}.pushlog-id.{pushid}.{build_product}.{build_name}-{build_type}", - "{index}.gecko.v2.{project}.latest.{build_product}.{build_name}-{build_type}" - ], - "nightly": [ - "{index}.gecko.v2.{project}.nightly.{year}.{month}.{day}.revision.{head_rev}.{build_product}.{build_name}-{build_type}", - "{index}.gecko.v2.{project}.nightly.{year}.{month}.{day}.latest.{build_product}.{build_name}-{build_type}", - "{index}.gecko.v2.{project}.nightly.revision.{head_rev}.{build_product}.{build_name}-{build_type}", - "{index}.gecko.v2.{project}.nightly.latest.{build_product}.{build_name}-{build_type}" - ], - "l10n": [ - "{index}.gecko.v2.{project}.revision.{head_rev}.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.pushdate.{year}.{month}.{day}.{pushdate}.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.latest.{build_product}-l10n.{build_name}-{build_type}.{locale}" - ], - "nightly-l10n": [ - "{index}.gecko.v2.{project}.revision.{head_rev}.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.pushdate.{year}.{month}.{day}.{pushdate}.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.latest.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.nightly.{year}.{month}.{day}.revision.{head_rev}.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.nightly.{year}.{month}.{day}.latest.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.nightly.revision.{head_rev}.{build_product}-l10n.{build_name}-{build_type}.{locale}", - "{index}.gecko.v2.{project}.nightly.latest.{build_product}-l10n.{build_name}-{build_type}.{locale}" - ] -} diff --git a/testing/mozharness/configs/single_locale/dev-mozilla-beta.py b/testing/mozharness/configs/single_locale/dev-mozilla-beta.py index fe3777f18def..884c8f974df7 100644 --- a/testing/mozharness/configs/single_locale/dev-mozilla-beta.py +++ b/testing/mozharness/configs/single_locale/dev-mozilla-beta.py @@ -23,14 +23,4 @@ config = { # purge options 'is_automation': True, 'purge_minsize': 12, - 'default_actions': [ - "clobber", - "pull", - "clone-locales", - "list-locales", - "setup", - "repack", - "taskcluster-upload", - "summary", - ], } diff --git a/testing/mozharness/configs/single_locale/dev-mozilla-release.py b/testing/mozharness/configs/single_locale/dev-mozilla-release.py index 92368d6d1653..6cfb6a424282 100644 --- a/testing/mozharness/configs/single_locale/dev-mozilla-release.py +++ b/testing/mozharness/configs/single_locale/dev-mozilla-release.py @@ -23,14 +23,4 @@ config = { # purge options 'purge_minsize': 12, 'is_automation': True, - 'default_actions': [ - "clobber", - "pull", - "clone-locales", - "list-locales", - "setup", - "repack", - "taskcluster-upload", - "summary", - ], } diff --git a/testing/mozharness/configs/single_locale/mozilla-beta.py b/testing/mozharness/configs/single_locale/mozilla-beta.py index 3d77ddf4c374..40f46e57b62d 100644 --- a/testing/mozharness/configs/single_locale/mozilla-beta.py +++ b/testing/mozharness/configs/single_locale/mozilla-beta.py @@ -28,14 +28,4 @@ config = { # purge options 'purge_minsize': 12, 'is_automation': True, - 'default_actions': [ - "clobber", - "pull", - "clone-locales", - "list-locales", - "setup", - "repack", - "taskcluster-upload", - "summary", - ], } diff --git a/testing/mozharness/configs/single_locale/mozilla-beta_devedition.py b/testing/mozharness/configs/single_locale/mozilla-beta_devedition.py index 1fa55ddcea56..cf0fc40bccb9 100644 --- a/testing/mozharness/configs/single_locale/mozilla-beta_devedition.py +++ b/testing/mozharness/configs/single_locale/mozilla-beta_devedition.py @@ -23,14 +23,4 @@ config = { # purge options 'purge_minsize': 12, 'is_automation': True, - 'default_actions': [ - "clobber", - "pull", - "clone-locales", - "list-locales", - "setup", - "repack", - "taskcluster-upload", - "summary", - ], } diff --git a/testing/mozharness/configs/single_locale/mozilla-esr52.py b/testing/mozharness/configs/single_locale/mozilla-esr52.py index b484cbbd705a..312212b4d49f 100644 --- a/testing/mozharness/configs/single_locale/mozilla-esr52.py +++ b/testing/mozharness/configs/single_locale/mozilla-esr52.py @@ -28,14 +28,4 @@ config = { # purge options 'purge_minsize': 12, 'is_automation': True, - 'default_actions': [ - "clobber", - "pull", - "clone-locales", - "list-locales", - "setup", - "repack", - "taskcluster-upload", - "summary", - ], } diff --git a/testing/mozharness/configs/single_locale/mozilla-release.py b/testing/mozharness/configs/single_locale/mozilla-release.py index 1661e182dba9..4bef961bc2d8 100644 --- a/testing/mozharness/configs/single_locale/mozilla-release.py +++ b/testing/mozharness/configs/single_locale/mozilla-release.py @@ -28,14 +28,4 @@ config = { # purge options 'purge_minsize': 12, 'is_automation': True, - 'default_actions': [ - "clobber", - "pull", - "clone-locales", - "list-locales", - "setup", - "repack", - "taskcluster-upload", - "summary", - ], } diff --git a/testing/mozharness/configs/single_locale/production.py b/testing/mozharness/configs/single_locale/production.py index fe97fe361425..63a723219b88 100644 --- a/testing/mozharness/configs/single_locale/production.py +++ b/testing/mozharness/configs/single_locale/production.py @@ -10,5 +10,4 @@ config = { "POST_UPLOAD_CMD": "post_upload.py -b %(branch)s-l10n -p %(stage_product)s -i %(buildid)s --release-to-latest --release-to-dated", "UPLOAD_TO_TEMP": "1" }, - 'taskcluster_index': 'index', } diff --git a/testing/mozharness/configs/single_locale/staging.py b/testing/mozharness/configs/single_locale/staging.py index 82caa8dda6f2..1b10a1e83272 100644 --- a/testing/mozharness/configs/single_locale/staging.py +++ b/testing/mozharness/configs/single_locale/staging.py @@ -10,7 +10,6 @@ config = { "POST_UPLOAD_CMD": "post_upload.py -b %(branch)s-l10n -p %(stage_product)s -i %(buildid)s --release-to-latest --release-to-dated %(post_upload_extra)s", "UPLOAD_TO_TEMP": "1" }, - 'taskcluster_index': 'index.garbage.staging', 'post_upload_extra': ['--bucket-prefix', 'net-mozaws-stage-delivery', '--url-prefix', 'http://ftp.stage.mozaws.net/', ], diff --git a/testing/mozharness/configs/single_locale/win64_devedition.py b/testing/mozharness/configs/single_locale/win64_devedition.py index 8bdc65c86146..c78ee909104f 100644 --- a/testing/mozharness/configs/single_locale/win64_devedition.py +++ b/testing/mozharness/configs/single_locale/win64_devedition.py @@ -1,6 +1,5 @@ config = { "platform": "win64", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "win64", "mozconfig_variant": "l10n-mozconfig-devedition", diff --git a/testing/mozharness/mozharness/mozilla/buildbot.py b/testing/mozharness/mozharness/mozilla/buildbot.py index d150065b5ab2..aadf2ecc0a7b 100755 --- a/testing/mozharness/mozharness/mozilla/buildbot.py +++ b/testing/mozharness/mozharness/mozilla/buildbot.py @@ -145,40 +145,6 @@ class BuildbotMixin(object): contents += "%s:%s\n" % (prop, self.buildbot_properties.get(prop, "None")) return self.write_to_file(file_name, contents) - def query_build_name(self): - build_name = self.config.get('platform') - if not build_name: - self.fatal('Must specify "platform" in the mozharness config for indexing') - - return build_name - - def query_build_type(self): - if self.config.get('build_type'): - build_type = self.config['build_type'] - elif self.config.get('pgo_build'): - build_type = 'pgo' - elif self.config.get('debug_build', False): - build_type = 'debug' - else: - build_type = 'opt' - return build_type - - def buildid_to_dict(self, buildid): - """Returns an dict with the year, month, day, hour, minute, and second - as keys, as parsed from the buildid""" - buildidDict = {} - try: - # strptime is no good here because it strips leading zeros - buildidDict['year'] = buildid[0:4] - buildidDict['month'] = buildid[4:6] - buildidDict['day'] = buildid[6:8] - buildidDict['hour'] = buildid[8:10] - buildidDict['minute'] = buildid[10:12] - buildidDict['second'] = buildid[12:14] - except: - self.fatal('Could not parse buildid into YYYYMMDDHHMMSS: %s' % buildid) - return buildidDict - def query_who(self): """ looks for who triggered the build with a change. diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index ffe2ca62f28d..e9bac6a40725 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -19,7 +19,6 @@ import time import uuid import copy import glob -import shlex from itertools import chain # import the power of mozharness ;) @@ -47,7 +46,6 @@ from mozharness.mozilla.signing import SigningMixin from mozharness.mozilla.testing.errors import TinderBoxPrintRe from mozharness.mozilla.testing.unittest import tbox_print_summary from mozharness.mozilla.updates.balrog import BalrogMixin -from mozharness.mozilla.taskcluster_helper import Taskcluster from mozharness.base.python import ( PerfherderResourceOptionsMixin, VirtualenvMixin, @@ -1367,229 +1365,6 @@ or run without that action (ie: --no-{action})" self.generated_build_props = True - def _initialize_taskcluster(self): - if self.client_id and self.access_token: - # Already initialized - return - - dirs = self.query_abs_dirs() - auth = os.path.join(os.getcwd(), self.config['taskcluster_credentials_file']) - credentials = {} - execfile(auth, credentials) - self.client_id = credentials.get('taskcluster_clientId') - self.access_token = credentials.get('taskcluster_accessToken') - - # We need to create & activate the virtualenv so that we can import - # taskcluster (and its dependent modules, like requests and hawk). - # Normally we could create the virtualenv as an action, but due to some - # odd dependencies with query_build_env() being called from build(), - # which is necessary before the virtualenv can be created. - self.create_virtualenv() - self.activate_virtualenv() - - routes_file = os.path.join(dirs['abs_src_dir'], - 'testing', - 'mozharness', - 'configs', - 'routes.json') - with open(routes_file) as f: - self.routes_json = json.load(f) - - def _taskcluster_upload(self, files, templates, locale='en-US', - property_conditions=[]): - if not self.client_id or not self.access_token: - self.warning('Skipping S3 file upload: No taskcluster credentials.') - return - - dirs = self.query_abs_dirs() - repo = self._query_repo() - revision = self.query_revision() - pushinfo = self.vcs_query_pushinfo(repo, revision) - pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(pushinfo.pushdate)) - - index = self.config.get('taskcluster_index', 'index.garbage.staging') - fmt = { - 'index': index, - 'project': self.buildbot_config['properties']['branch'], - 'head_rev': revision, - 'pushdate': pushdate, - 'pushid': pushinfo.pushid, - 'year': pushdate[0:4], - 'month': pushdate[4:6], - 'day': pushdate[6:8], - 'build_product': self.config['stage_product'], - 'build_name': self.query_build_name(), - 'build_type': self.query_build_type(), - 'locale': locale, - } - fmt.update(self.buildid_to_dict(self.query_buildid())) - routes = [] - for template in templates: - routes.append(template.format(**fmt)) - self.info("Using routes: %s" % routes) - - taskid = self.buildbot_config['properties'].get('upload_to_task_id') - tc = Taskcluster( - branch=self.branch, - rank=pushinfo.pushdate, # Use pushdate as the rank - client_id=self.client_id, - access_token=self.access_token, - log_obj=self.log_obj, - # `upload_to_task_id` is used by mozci to have access to where the artifacts - # will be uploaded - task_id=taskid, - ) - - if taskid: - task = tc.get_task(taskid) - else: - task = tc.create_task(routes) - tc.claim_task(task) - - # Only those files uploaded with valid extensions are processed. - # This ensures that we get the correct packageUrl from the list. - valid_extensions = ( - '.apk', - '.dmg', - '.mar', - '.rpm', - '.tar.bz2', - '.tar.gz', - '.zip', - '.json', - ) - - for upload_file in files: - # Create an S3 artifact for each file that gets uploaded. We also - # check the uploaded file against the property conditions so that we - # can set the buildbot config with the correct URLs for package - # locations. - tc.create_artifact(task, upload_file) - if upload_file.endswith(valid_extensions): - for prop, condition in property_conditions: - if condition(upload_file): - self.set_buildbot_property(prop, tc.get_taskcluster_url(upload_file)) - break - - # Upload a file with all Buildbot properties - # This is necessary for Buildbot Bridge test jobs work properly - # until we can migrate to TaskCluster - properties_path = os.path.join( - dirs['base_work_dir'], - 'buildbot_properties.json' - ) - self._generate_properties_file(properties_path) - tc.create_artifact(task, properties_path) - - tc.report_completed(task) - - def upload_files(self): - self._initialize_taskcluster() - dirs = self.query_abs_dirs() - - if self.query_is_nightly(): - templates = self.routes_json['nightly'] - - # Nightly builds with l10n counterparts also publish to the - # 'en-US' locale. - if self.config.get('publish_nightly_en_US_routes'): - templates.extend(self.routes_json['l10n']) - else: - templates = self.routes_json['routes'] - - # Some trees may not be setting uploadFiles, so default to []. Normally - # we'd only expect to get here if the build completes successfully, - # which means we should have uploadFiles. - files = self.query_buildbot_property('uploadFiles') or [] - if not files: - self.warning('No files from the build system to upload to S3: uploadFiles property is missing or empty.') - - packageName = self.query_buildbot_property('packageFilename') - self.info('packageFilename is: %s' % packageName) - - if self.config.get('use_package_as_marfile'): - self.info('Using packageUrl for the MAR file') - self.set_buildbot_property('completeMarUrl', - self.query_buildbot_property('packageUrl'), - write_to_file=True) - - # Find the full path to the package in uploadFiles so we can - # get the size/hash of the mar - for upload_file in files: - if upload_file.endswith(packageName): - self.set_buildbot_property('completeMarSize', - self.query_filesize(upload_file), - write_to_file=True) - self.set_buildbot_property('completeMarHash', - self.query_sha512sum(upload_file), - write_to_file=True) - break - - property_conditions = [ - # key: property name, value: condition - ('symbolsUrl', lambda m: m.endswith('crashreporter-symbols.zip') or - m.endswith('crashreporter-symbols-full.zip')), - ('testsUrl', lambda m: m.endswith(('tests.tar.bz2', 'tests.zip'))), - ('robocopApkUrl', lambda m: m.endswith('apk') and 'robocop' in m), - ('jsshellUrl', lambda m: 'jsshell-' in m and m.endswith('.zip')), - # Temporarily use "TC" in MarUrl parameters. We don't want to - # override these to point to taskcluster just yet, and still - # need to use FTP. However, they can't be removed outright since - # that can affect packageUrl. See bug 1144985. - ('completeMarUrlTC', lambda m: m.endswith('.complete.mar')), - ('partialMarUrlTC', lambda m: m.endswith('.mar') and '.partial.' in m), - ('codeCoverageURL', lambda m: m.endswith('code-coverage-gcno.zip')), - ('sdkUrl', lambda m: m.endswith(('sdk.tar.bz2', 'sdk.zip'))), - ('testPackagesUrl', lambda m: m.endswith('test_packages.json')), - ('packageUrl', lambda m: m.endswith(packageName)), - ] - - # Also upload our mozharness log files - files.extend([os.path.join(self.log_obj.abs_log_dir, x) for x in self.log_obj.log_files.values()]) - - # Also upload our buildprops.json file. - files.extend([os.path.join(dirs['base_work_dir'], 'buildprops.json')]) - - self._taskcluster_upload(files, templates, - property_conditions=property_conditions) - - def _set_file_properties(self, file_name, find_dir, prop_type, - error_level=ERROR): - c = self.config - dirs = self.query_abs_dirs() - - # windows fix. even bash -c loses two single slashes. - find_dir = find_dir.replace('\\', '\\\\\\\\') - - error_msg = "Not setting props: %s{Filename, Size, Hash}" % prop_type - cmd = ["bash", "-c", - "find %s -maxdepth 1 -type f -name %s" % (find_dir, file_name)] - file_path = self.get_output_from_command(cmd, dirs['abs_work_dir']) - if not file_path: - self.error(error_msg) - self.error("Can't determine filepath with cmd: %s" % (str(cmd),)) - return - - cmd = [ - self.query_exe('openssl'), 'dgst', - '-%s' % (c.get("hash_type", "sha512"),), file_path - ] - hash_prop = self.get_output_from_command(cmd, dirs['abs_work_dir']) - if not hash_prop: - self.log("undetermined hash_prop with cmd: %s" % (str(cmd),), - level=error_level) - self.log(error_msg, level=error_level) - return - self.set_buildbot_property(prop_type + 'Filename', - os.path.split(file_path)[1], - write_to_file=True) - self.set_buildbot_property(prop_type + 'Size', - os.path.getsize(file_path), - write_to_file=True) - self.set_buildbot_property(prop_type + 'Hash', - hash_prop.strip().split(' ', 2)[1], - write_to_file=True) - def _create_mozbuild_dir(self, mozbuild_path=None): if not mozbuild_path: env = self.query_build_env() @@ -1665,7 +1440,6 @@ or run without that action (ie: --no-{action})" if not self.query_is_nightly(): self.info("Not a nightly build, skipping multi l10n.") return - self._initialize_taskcluster() dirs = self.query_abs_dirs() base_work_dir = dirs['base_work_dir'] @@ -1748,10 +1522,6 @@ or run without that action (ie: --no-{action})" upload_files_cmd, cwd=objdir, ) - files = shlex.split(output) - abs_files = [os.path.abspath(os.path.join(objdir, f)) for f in files] - self._taskcluster_upload(abs_files, self.routes_json['l10n'], - locale='multi') def postflight_build(self): """grabs properties from post build and calls ccache -s""" @@ -1917,20 +1687,15 @@ or run without that action (ie: --no-{action})" import zipfile dirs = self.query_abs_dirs() - packageName = self.query_buildbot_property('packageFilename') - # if packageName is not set because we are not running in Buildbot, - # then assume we are using MOZ_SIMPLE_PACKAGE_NAME, which means the - # package is named one of target.{tar.bz2,zip,dmg}. - if not packageName: - dist_dir = os.path.join(dirs['abs_obj_dir'], 'dist') - for ext in ['apk', 'dmg', 'tar.bz2', 'zip']: - name = 'target.' + ext - if os.path.exists(os.path.join(dist_dir, name)): - packageName = name - break - else: - self.fatal("could not determine packageName") + dist_dir = os.path.join(dirs['abs_obj_dir'], 'dist') + for ext in ['apk', 'dmg', 'tar.bz2', 'zip']: + name = 'target.' + ext + if os.path.exists(os.path.join(dist_dir, name)): + packageName = name + break + else: + self.fatal("could not determine packageName") interests = ['libxul.so', 'classes.dex', 'omni.ja'] installer = os.path.join(dirs['abs_obj_dir'], 'dist', packageName) diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index 4f71a543c287..9ac709c8a472 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -12,7 +12,6 @@ import os import glob import re import sys -import time import shlex import subprocess @@ -34,7 +33,6 @@ from mozharness.mozilla.mar import MarMixin from mozharness.mozilla.release import ReleaseMixin from mozharness.mozilla.signing import SigningMixin from mozharness.mozilla.updates.balrog import BalrogMixin -from mozharness.mozilla.taskcluster_helper import Taskcluster from mozharness.base.python import VirtualenvMixin try: @@ -198,11 +196,8 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, "clobber_file": 'CLOBBER', "appName": "Firefox", "hashType": "sha512", - "taskcluster_credentials_file": "oauth.txt", 'virtualenv_modules': [ 'requests==2.8.1', - 'PyHawk-with-a-single-extra-commit==0.1.5', - 'taskcluster==0.0.26', ], 'virtualenv_path': 'venv', }, @@ -1013,101 +1008,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, self.run_command(cmd, cwd=dirs['abs_mozilla_dir'], halt_on_failure=True, env=env) - def taskcluster_upload(self): - auth = os.path.join(os.getcwd(), self.config['taskcluster_credentials_file']) - credentials = {} - execfile(auth, credentials) - client_id = credentials.get('taskcluster_clientId') - access_token = credentials.get('taskcluster_accessToken') - if not client_id or not access_token: - self.warning('Skipping S3 file upload: No taskcluster credentials.') - return - - # We need to activate the virtualenv so that we can import taskcluster - # (and its dependent modules, like requests and hawk). Normally we - # could create the virtualenv as an action, but due to some odd - # dependencies with query_build_env() being called from build(), which - # is necessary before the virtualenv can be created. - self.create_virtualenv() - self.activate_virtualenv() - - branch = self.config['branch'] - revision = self._query_revision() - repo = self.query_l10n_repo() - if not repo: - self.fatal("Unable to determine repository for querying the push info.") - pushinfo = self.vcs_query_pushinfo(repo, revision, vcs='hg') - pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(pushinfo.pushdate)) - - routes_json = os.path.join(self.query_abs_dirs()['abs_mozilla_dir'], - 'testing/mozharness/configs/routes.json') - with open(routes_json) as f: - contents = json.load(f) - templates = contents['l10n'] - - # Release promotion creates a special task to accumulate all artifacts - # under the same task - artifacts_task = None - self.read_buildbot_config() - if "artifactsTaskId" in self.buildbot_config.get("properties", {}): - artifacts_task_id = self.buildbot_config["properties"]["artifactsTaskId"] - artifacts_tc = Taskcluster( - branch=branch, rank=pushinfo.pushdate, client_id=client_id, - access_token=access_token, log_obj=self.log_obj, - task_id=artifacts_task_id) - artifacts_task = artifacts_tc.get_task(artifacts_task_id) - artifacts_tc.claim_task(artifacts_task) - - for locale, files in self.upload_files.iteritems(): - self.info("Uploading files to S3 for locale '%s': %s" % (locale, files)) - routes = [] - for template in templates: - fmt = { - 'index': self.config.get('taskcluster_index', 'index.garbage.staging'), - 'project': branch, - 'head_rev': revision, - 'pushdate': pushdate, - 'year': pushdate[0:4], - 'month': pushdate[4:6], - 'day': pushdate[6:8], - 'build_product': self.config['stage_product'], - 'build_name': self.query_build_name(), - 'build_type': self.query_build_type(), - 'locale': locale, - } - fmt.update(self.buildid_to_dict(self._query_buildid())) - routes.append(template.format(**fmt)) - - self.info('Using routes: %s' % routes) - tc = Taskcluster(branch, - pushinfo.pushdate, # Use pushdate as the rank - client_id, - access_token, - self.log_obj, - ) - task = tc.create_task(routes) - tc.claim_task(task) - - for upload_file in files: - # Create an S3 artifact for each file that gets uploaded. We also - # check the uploaded file against the property conditions so that we - # can set the buildbot config with the correct URLs for package - # locations. - artifact_url = tc.create_artifact(task, upload_file) - if artifacts_task: - artifacts_tc.create_reference_artifact( - artifacts_task, upload_file, artifact_url) - - tc.report_completed(task) - - if artifacts_task: - if not self.query_failed_locales(): - artifacts_tc.report_completed(artifacts_task) - else: - # If some locales fail, we want to mark the artifacts - # task failed, so a retry can reuse the same task ID - artifacts_tc.report_failed(artifacts_task) - # main {{{ if __name__ == '__main__': diff --git a/testing/mozharness/scripts/fx_desktop_build.py b/testing/mozharness/scripts/fx_desktop_build.py index f64fcf694e48..3015f99d58a1 100755 --- a/testing/mozharness/scripts/fx_desktop_build.py +++ b/testing/mozharness/scripts/fx_desktop_build.py @@ -51,7 +51,6 @@ class FxDesktopBuild(BuildScript, TryToolsMixin, object): # nightly stuff "nightly_build": False, 'balrog_credentials_file': 'oauth.txt', - 'taskcluster_credentials_file': 'oauth.txt', 'periodic_clobber': 168, # hg tool stuff "tools_repo": "https://hg.mozilla.org/build/tools", @@ -87,8 +86,6 @@ class FxDesktopBuild(BuildScript, TryToolsMixin, object): 'stage_ssh_key': 'ffxbld_rsa', 'virtualenv_modules': [ 'requests==2.8.1', - 'PyHawk-with-a-single-extra-commit==0.1.5', - 'taskcluster==0.0.26', ], 'virtualenv_path': 'venv', # diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py index 0c06e8b62abc..f2c374f34692 100755 --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -41,7 +41,6 @@ from mozharness.mozilla.mock import MockMixin from mozharness.mozilla.secrets import SecretsMixin from mozharness.mozilla.updates.balrog import BalrogMixin from mozharness.base.python import VirtualenvMixin -from mozharness.mozilla.taskcluster_helper import Taskcluster # MobileSingleLocale {{{1 @@ -144,16 +143,12 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, "validate-repacks-signed", "upload-repacks", "create-virtualenv", - "taskcluster-upload", "submit-to-balrog", "summary", ], 'config': { - 'taskcluster_credentials_file': 'oauth.txt', 'virtualenv_modules': [ 'requests==2.8.1', - 'PyHawk-with-a-single-extra-commit==0.1.5', - 'taskcluster==0.0.26', ], 'virtualenv_path': 'venv', }, @@ -575,74 +570,6 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, message="Validated signatures on %d of %d " "binaries successfully.") - def taskcluster_upload(self): - auth = os.path.join(os.getcwd(), self.config['taskcluster_credentials_file']) - credentials = {} - execfile(auth, credentials) - client_id = credentials.get('taskcluster_clientId') - access_token = credentials.get('taskcluster_accessToken') - if not client_id or not access_token: - self.warning('Skipping S3 file upload: No taskcluster credentials.') - return - - self.activate_virtualenv() - - dirs = self.query_abs_dirs() - locales = self.query_locales() - make = self.query_exe("make") - upload_env = self.query_upload_env() - cwd = dirs['abs_locales_dir'] - branch = self.config['branch'] - revision = self.query_revision() - repo = self.query_l10n_repo() - pushinfo = self.vcs_query_pushinfo(repo, revision, vcs='hg') - pushdate = time.strftime('%Y%m%d%H%M%S', time.gmtime(pushinfo.pushdate)) - routes_json = os.path.join(self.query_abs_dirs()['abs_mozilla_dir'], - 'testing/mozharness/configs/routes.json') - with open(routes_json) as routes_file: - contents = json.load(routes_file) - templates = contents['l10n'] - - for locale in locales: - output = self.get_output_from_command_m( - "%s echo-variable-UPLOAD_FILES AB_CD=%s" % (make, locale), - cwd=cwd, - env=upload_env, - ) - files = shlex.split(output) - abs_files = [os.path.abspath(os.path.join(cwd, f)) for f in files] - - routes = [] - fmt = { - 'index': self.config.get('taskcluster_index', 'index.garbage.staging'), - 'project': branch, - 'head_rev': revision, - 'pushdate': pushdate, - 'year': pushdate[0:4], - 'month': pushdate[4:6], - 'day': pushdate[6:8], - 'build_product': self.config['stage_product'], - 'build_name': self.query_build_name(), - 'build_type': self.query_build_type(), - 'locale': locale, - } - for template in templates: - routes.append(template.format(**fmt)) - - self.info('Using routes: %s' % routes) - tc = Taskcluster(branch, - pushinfo.pushdate, # Use pushdate as the rank - client_id, - access_token, - self.log_obj, - ) - task = tc.create_task(routes) - tc.claim_task(task) - - for upload_file in abs_files: - tc.create_artifact(task, upload_file) - tc.report_completed(task) - def upload_repacks(self): c = self.config dirs = self.query_abs_dirs() From d3ed5206bece2a8d5f182d616ddc9402f93ff07a Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 16:42:48 -0700 Subject: [PATCH 17/48] Bug 1429603: Removed unused balrog code from mobile L10N mozharness script; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D533 --HG-- extra : rebase_source : c748e4152de2a924f5adb386499996ed55091f36 --- testing/mozharness/scripts/mobile_l10n.py | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py index f2c374f34692..93f17d02ee2d 100755 --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -15,8 +15,6 @@ import os import re import subprocess import sys -import time -import shlex try: import simplejson as json @@ -666,14 +664,12 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, return bool(self.config.get("is_release_or_beta")) def submit_to_balrog(self): - if not self.query_is_nightly() and not self.query_is_release_or_beta(): self.info("Not a nightly or release build, skipping balrog submission.") return self.checkout_tools() - dirs = self.query_abs_dirs() locales = self.query_locales() if not self.config.get('taskcluster_nightly'): balrogReady = True @@ -722,22 +718,9 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, self.set_buildbot_property("isOSUpdate", False) self.set_buildbot_property("buildid", self.query_buildid()) - if self.config.get('taskcluster_nightly'): - props_path = os.path.join(env["UPLOAD_PATH"], locale, - 'balrog_props.json') - self.generate_balrog_props(props_path) - else: - if not self.config.get("balrog_servers"): - self.info("balrog_servers not set; skipping balrog submission.") - return - - if self.query_is_nightly(): - self.submit_balrog_updates(release_type="nightly") - else: - self.submit_balrog_updates(release_type="release") - - if not self.query_is_nightly(): - self.submit_balrog_release_pusher(dirs) + props_path = os.path.join(env["UPLOAD_PATH"], locale, + 'balrog_props.json') + self.generate_balrog_props(props_path) # main {{{1 From 980166261f4b7911f83f899ee50ec67f21e66532 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 16:43:49 -0700 Subject: [PATCH 18/48] Bug 1429603: Removed unused balrog code helper methods from mozhanress; r=jlund Differential Revision: https://phabricator.services.mozilla.com/D534 --HG-- extra : rebase_source : 2cc8d3552fca1995b4b5fa70e98ce6e950644636 --- .../mozharness/mozilla/updates/balrog.py | 94 ------------------- 1 file changed, 94 deletions(-) diff --git a/testing/mozharness/mozharness/mozilla/updates/balrog.py b/testing/mozharness/mozharness/mozilla/updates/balrog.py index ec8a1d2c0792..0bf9315ce4bf 100644 --- a/testing/mozharness/mozharness/mozilla/updates/balrog.py +++ b/testing/mozharness/mozharness/mozilla/updates/balrog.py @@ -8,14 +8,6 @@ from mozharness.base.log import INFO # BalrogMixin {{{1 class BalrogMixin(object): - @staticmethod - def _query_balrog_username(server_config, product=None): - username = server_config["balrog_usernames"].get(product) - if username: - return username - else: - raise KeyError("Couldn't find balrog username.") - def query_python(self): python = sys.executable # A mock environment is a special case, the system python isn't @@ -50,92 +42,6 @@ class BalrogMixin(object): self.dump_config(props_path, balrog_props) - def submit_balrog_updates(self, release_type="nightly", product=None): - c = self.config - dirs = self.query_abs_dirs() - - if self.buildbot_config and "properties" in self.buildbot_config: - product = self.buildbot_config["properties"]["product"] - - if product is None: - self.fatal('There is no valid product information.') - - props_path = os.path.join(dirs["base_work_dir"], "balrog_props.json") - credentials_file = os.path.join( - dirs["base_work_dir"], c["balrog_credentials_file"] - ) - submitter_script = os.path.join( - dirs["abs_tools_dir"], "scripts", "updates", "balrog-submitter.py" - ) - - self.generate_balrog_props(props_path) - - cmd = [ - self.query_python(), - submitter_script, - "--build-properties", props_path, - "-t", release_type, - "--credentials-file", credentials_file, - ] - if self._log_level_at_least(INFO): - cmd.append("--verbose") - - return_codes = [] - for server in c["balrog_servers"]: - server_args = [ - "--api-root", server["balrog_api_root"], - "--username", self._query_balrog_username(server, product) - ] - if server.get("url_replacements"): - for replacement in server["url_replacements"]: - server_args.append("--url-replacement") - server_args.append(",".join(replacement)) - - self.info("Calling Balrog submission script") - return_code = self.retry( - self.run_command, attempts=5, args=(cmd + server_args,), - good_statuses=(0,), - ) - if server["ignore_failures"]: - self.info("Ignoring result, ignore_failures set to True") - else: - return_codes.append(return_code) - # return the worst (max) code - return max(return_codes) - - def submit_balrog_release_pusher(self, dirs): - product = self.buildbot_config["properties"]["product"] - cmd = [ - self.query_python(), - os.path.join(os.path.join(dirs['abs_tools_dir'], "scripts/updates/balrog-release-pusher.py")) - ] - cmd.extend(["--build-properties", os.path.join(dirs["base_work_dir"], "balrog_props.json")]) - cmd.extend(["--buildbot-configs", "https://hg.mozilla.org/build/buildbot-configs"]) - cmd.extend(["--release-config", os.path.join(dirs['build_dir'], self.config.get("release_config_file"))]) - cmd.extend(["--credentials-file", os.path.join(dirs['base_work_dir'], self.config.get("balrog_credentials_file"))]) - cmd.extend(["--release-channel", self.query_release_config()['release_channel']]) - - return_codes = [] - for server in self.config["balrog_servers"]: - - server_args = [ - "--api-root", server["balrog_api_root"], - "--username", self._query_balrog_username(server, product) - ] - - self.info("Calling Balrog release pusher script") - return_code = self.retry( - self.run_command, args=(cmd + server_args,), - kwargs={'cwd': dirs['abs_work_dir']}, - good_statuses=(0,), - ) - if server["ignore_failures"]: - self.info("Ignoring result, ignore_failures set to True") - else: - return_codes.append(return_code) - # return the worst (max) code - return max(return_codes) - def lock_balrog_rules(self, rule_ids): c = self.config dirs = self.query_abs_dirs() From 888712f23bf281f8d6eb937dc8154562f1e389a7 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 17:08:34 -0700 Subject: [PATCH 19/48] Bug 1429603: Remove overriden `upload_env` configuration from L10N mozharness configs; r=Callek These are overriden in the `tc_*.py` config files. Differential Revision: https://phabricator.services.mozilla.com/D535 --HG-- extra : rebase_source : d57bfb74a61c9d8d279769ca2dbf39e8bdd9f6e1 --- testing/mozharness/configs/single_locale/production.py | 10 ---------- testing/mozharness/configs/single_locale/staging.py | 10 ---------- testing/mozharness/configs/single_locale/try.py | 10 ---------- 3 files changed, 30 deletions(-) diff --git a/testing/mozharness/configs/single_locale/production.py b/testing/mozharness/configs/single_locale/production.py index 63a723219b88..4cc5156d4be5 100644 --- a/testing/mozharness/configs/single_locale/production.py +++ b/testing/mozharness/configs/single_locale/production.py @@ -1,13 +1,3 @@ config = { "upload_environment": "prod", - "upload_env": { - "UPLOAD_USER": "ffxbld", - # ssh_key_dir is defined per platform: it is "~/.ssh" for every platform - # except when mock is in use, in this case, ssh_key_dir is - # /home/mock_mozilla/.ssh - "UPLOAD_SSH_KEY": "%(ssh_key_dir)s/ffxbld_rsa", - "UPLOAD_HOST": "upload.ffxbld.productdelivery.prod.mozaws.net", - "POST_UPLOAD_CMD": "post_upload.py -b %(branch)s-l10n -p %(stage_product)s -i %(buildid)s --release-to-latest --release-to-dated", - "UPLOAD_TO_TEMP": "1" - }, } diff --git a/testing/mozharness/configs/single_locale/staging.py b/testing/mozharness/configs/single_locale/staging.py index 1b10a1e83272..9fb598678938 100644 --- a/testing/mozharness/configs/single_locale/staging.py +++ b/testing/mozharness/configs/single_locale/staging.py @@ -1,15 +1,5 @@ config = { "upload_environment": "stage", - "upload_env": { - "UPLOAD_USER": "ffxbld", - # ssh_key_dir is defined per platform: it is "~/.ssh" for every platform - # except when mock is in use, in this case, ssh_key_dir is - # /home/mock_mozilla/.ssh - "UPLOAD_SSH_KEY": "%(ssh_key_dir)s/ffxbld_rsa", - "UPLOAD_HOST": "upload.ffxbld.productdelivery.stage.mozaws.net", - "POST_UPLOAD_CMD": "post_upload.py -b %(branch)s-l10n -p %(stage_product)s -i %(buildid)s --release-to-latest --release-to-dated %(post_upload_extra)s", - "UPLOAD_TO_TEMP": "1" - }, 'post_upload_extra': ['--bucket-prefix', 'net-mozaws-stage-delivery', '--url-prefix', 'http://ftp.stage.mozaws.net/', ], diff --git a/testing/mozharness/configs/single_locale/try.py b/testing/mozharness/configs/single_locale/try.py index a17fe65e144b..2cd5470d1708 100644 --- a/testing/mozharness/configs/single_locale/try.py +++ b/testing/mozharness/configs/single_locale/try.py @@ -34,14 +34,4 @@ config = { }], # purge options 'is_automation': True, - "upload_env": { - "UPLOAD_USER": "trybld", - # ssh_key_dir is defined per platform: it is "~/.ssh" for every platform - # except when mock is in use, in this case, ssh_key_dir is - # /home/mock_mozilla/.ssh - "UPLOAD_SSH_KEY": "%(ssh_key_dir)s/trybld_dsa", - "UPLOAD_HOST": "upload.trybld.productdelivery.%(upload_environment)s.mozaws.net", - "POST_UPLOAD_CMD": "post_upload.py --who %(who)s --builddir %(branch)s-%(platform)s --tinderbox-builds-dir %(who)s-%(revision)s -p %(stage_product)s -i %(buildid)s --revision %(revision)s --release-to-try-builds %(post_upload_extra)s", - "UPLOAD_TO_TEMP": "1" - }, } From 1811d37925bee39bb3f583058f6d9374c4a11145 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 17:15:00 -0700 Subject: [PATCH 20/48] Bug 1429603: Remove old staging release mozharness L10N configs; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D536 --HG-- extra : rebase_source : 06acb933fde438be879660374d18a1d6157e3f43 --- ...ing_release_mozilla-beta_android_api_16.py | 89 ------------------- ..._release_mozilla-release_android_api_16.py | 89 ------------------- 2 files changed, 178 deletions(-) delete mode 100644 testing/mozharness/configs/single_locale/staging_release_mozilla-beta_android_api_16.py delete mode 100644 testing/mozharness/configs/single_locale/staging_release_mozilla-release_android_api_16.py diff --git a/testing/mozharness/configs/single_locale/staging_release_mozilla-beta_android_api_16.py b/testing/mozharness/configs/single_locale/staging_release_mozilla-beta_android_api_16.py deleted file mode 100644 index 4a0845e6586e..000000000000 --- a/testing/mozharness/configs/single_locale/staging_release_mozilla-beta_android_api_16.py +++ /dev/null @@ -1,89 +0,0 @@ -BRANCH = "mozilla-beta" -MOZ_UPDATE_CHANNEL = "beta" -MOZILLA_DIR = BRANCH -OBJDIR = "obj-firefox" -STAGE_SERVER = "ftp.stage.mozaws.net" -EN_US_BINARY_URL = "http://" + STAGE_SERVER + "/pub/mobile/candidates/%(version)s-candidates/build%(buildnum)d/android-api-16/en-US" -HG_SHARE_BASE_DIR = "/builds/hg-shared" - -config = { - "log_name": "single_locale", - "objdir": OBJDIR, - "is_automation": True, - "buildbot_json_path": "buildprops.json", - "force_clobber": True, - "clobberer_url": "https://api-pub-build.allizom.org/clobberer/lastclobber", - "locales_file": "buildbot-configs/mozilla/l10n-changesets_mobile-beta.json", - "locales_dir": "mobile/android/locales", - "locales_platform": "android", - "ignore_locales": ["en-US"], - "balrog_credentials_file": "oauth.txt", - "tools_repo": "https://hg.mozilla.org/build/tools", - "is_release_or_beta": True, - "tooltool_config": { - "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", - "output_dir": "%(abs_work_dir)s/" + MOZILLA_DIR, - }, - "repos": [{ - "repo": "https://hg.mozilla.org/%(user_repo_override)s/mozilla-beta", - "branch": "default", - "dest": MOZILLA_DIR, - }, { - "repo": "https://hg.mozilla.org/%(user_repo_override)s/buildbot-configs", - "branch": "default", - "dest": "buildbot-configs" - }, { - "repo": "https://hg.mozilla.org/%(user_repo_override)s/tools", - "branch": "default", - "dest": "tools" - }], - "hg_l10n_base": "https://hg.mozilla.org/%(user_repo_override)s/", - "hg_l10n_tag": "default", - 'vcs_share_base': HG_SHARE_BASE_DIR, - "l10n_dir": MOZILLA_DIR, - - "release_config_file": "buildbot-configs/mozilla/staging_release-fennec-mozilla-beta.py", - "repack_env": { - # so ugly, bug 951238 - "LD_LIBRARY_PATH": "/lib:/tools/gcc-4.7.2-0moz1/lib:/tools/gcc-4.7.2-0moz1/lib64", - "MOZ_PKG_VERSION": "%(version)s", - "MOZ_OBJDIR": OBJDIR, - "MOZ_UPDATE_CHANNEL": MOZ_UPDATE_CHANNEL, - }, - "base_en_us_binary_url": EN_US_BINARY_URL, - "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", - "base_post_upload_cmd": "post_upload.py -p mobile -n %(buildnum)s -v %(version)s --builddir android-api-16/%(locale)s --release-to-mobile-candidates-dir --nightly-dir=candidates %(post_upload_extra)s", - "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - - # Mock - "mock_target": "mozilla-centos6-x86_64-android", - "mock_packages": ['autoconf213', 'python', 'zip', 'mozilla-python27-mercurial', 'git', 'ccache', - 'glibc-static', 'libstdc++-static', 'perl-Test-Simple', 'perl-Config-General', - 'gtk2-devel', 'libnotify-devel', 'yasm', - 'alsa-lib-devel', 'libcurl-devel', - 'wireless-tools-devel', 'libX11-devel', - 'libXt-devel', 'mesa-libGL-devel', - 'gnome-vfs2-devel', 'GConf2-devel', 'wget', - 'mpfr', # required for system compiler - 'xorg-x11-font*', # fonts required for PGO - 'imake', # required for makedepend!?! - 'gcc45_0moz3', 'gcc454_0moz1', 'gcc472_0moz1', 'gcc473_0moz1', 'yasm', 'ccache', # <-- from releng repo - 'valgrind', 'dbus-x11', - 'pulseaudio-libs-devel', - 'gstreamer-devel', 'gstreamer-plugins-base-devel', - 'freetype-2.3.11-6.el6_1.8.x86_64', - 'freetype-devel-2.3.11-6.el6_1.8.x86_64', - 'java-1.7.0-openjdk-devel', - 'openssh-clients', - 'zlib-devel-1.2.3-27.el6.i686', - ], - "mock_files": [ - ("/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"), - ('/home/cltbld/.hgrc', '/builds/.hgrc'), - ('/builds/relengapi.tok', '/builds/relengapi.tok'), - ('/usr/local/lib/hgext', '/usr/local/lib/hgext'), - ('/builds/mozilla-fennec-geoloc-api.key', '/builds/mozilla-fennec-geoloc-api.key'), - ('/builds/adjust-sdk-beta.token', '/builds/adjust-sdk-beta.token'), - ], -} diff --git a/testing/mozharness/configs/single_locale/staging_release_mozilla-release_android_api_16.py b/testing/mozharness/configs/single_locale/staging_release_mozilla-release_android_api_16.py deleted file mode 100644 index 5e1ebeb9205e..000000000000 --- a/testing/mozharness/configs/single_locale/staging_release_mozilla-release_android_api_16.py +++ /dev/null @@ -1,89 +0,0 @@ -BRANCH = "mozilla-release" -MOZ_UPDATE_CHANNEL = "release" -MOZILLA_DIR = BRANCH -OBJDIR = "obj-firefox" -STAGE_SERVER = "dev-stage01.srv.releng.scl3.mozilla.com" -EN_US_BINARY_URL = "http://" + STAGE_SERVER + "/pub/mozilla.org/mobile/candidates/%(version)s-candidates/build%(buildnum)d/android-api-16/en-US" -HG_SHARE_BASE_DIR = "/builds/hg-shared" - -config = { - "log_name": "single_locale", - "objdir": OBJDIR, - "is_automation": True, - "buildbot_json_path": "buildprops.json", - "force_clobber": True, - "clobberer_url": "https://api-pub-build.allizom.org/clobberer/lastclobber", - "locales_file": "buildbot-configs/mozilla/l10n-changesets_mobile-release.json", - "locales_dir": "mobile/android/locales", - "locales_platform": "android", - "ignore_locales": ["en-US"], - "balrog_credentials_file": "oauth.txt", - "tools_repo": "https://hg.mozilla.org/build/tools", - "is_release_or_beta": True, - "tooltool_config": { - "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", - "output_dir": "%(abs_work_dir)s/" + MOZILLA_DIR, - }, - "repos": [{ - "repo": "https://hg.mozilla.org/%(user_repo_override)s/mozilla-release", - "branch": "default", - "dest": MOZILLA_DIR, - }, { - "repo": "https://hg.mozilla.org/%(user_repo_override)s/buildbot-configs", - "branch": "default", - "dest": "buildbot-configs" - }, { - "repo": "https://hg.mozilla.org/%(user_repo_override)s/tools", - "branch": "default", - "dest": "tools" - }], - "hg_l10n_base": "https://hg.mozilla.org/%(user_repo_override)s/", - "hg_l10n_tag": "default", - 'vcs_share_base': HG_SHARE_BASE_DIR, - "l10n_dir": MOZILLA_DIR, - - "release_config_file": "buildbot-configs/mozilla/staging_release-fennec-mozilla-release.py", - "repack_env": { - # so ugly, bug 951238 - "LD_LIBRARY_PATH": "/lib:/tools/gcc-4.7.2-0moz1/lib:/tools/gcc-4.7.2-0moz1/lib64", - "MOZ_PKG_VERSION": "%(version)s", - "MOZ_OBJDIR": OBJDIR, - "MOZ_UPDATE_CHANNEL": MOZ_UPDATE_CHANNEL, - }, - "base_en_us_binary_url": EN_US_BINARY_URL, - "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", - "base_post_upload_cmd": "post_upload.py -p mobile -n %(buildnum)s -v %(version)s --builddir android-api-16/%(locale)s --release-to-mobile-candidates-dir --nightly-dir=candidates %(post_upload_extra)s", - "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - - # Mock - "mock_target": "mozilla-centos6-x86_64-android", - "mock_packages": ['autoconf213', 'python', 'zip', 'mozilla-python27-mercurial', 'git', 'ccache', - 'glibc-static', 'libstdc++-static', 'perl-Test-Simple', 'perl-Config-General', - 'gtk2-devel', 'libnotify-devel', 'yasm', - 'alsa-lib-devel', 'libcurl-devel', - 'wireless-tools-devel', 'libX11-devel', - 'libXt-devel', 'mesa-libGL-devel', - 'gnome-vfs2-devel', 'GConf2-devel', 'wget', - 'mpfr', # required for system compiler - 'xorg-x11-font*', # fonts required for PGO - 'imake', # required for makedepend!?! - 'gcc45_0moz3', 'gcc454_0moz1', 'gcc472_0moz1', 'gcc473_0moz1', 'yasm', 'ccache', # <-- from releng repo - 'valgrind', 'dbus-x11', - 'pulseaudio-libs-devel', - 'gstreamer-devel', 'gstreamer-plugins-base-devel', - 'freetype-2.3.11-6.el6_1.8.x86_64', - 'freetype-devel-2.3.11-6.el6_1.8.x86_64', - 'java-1.7.0-openjdk-devel', - 'openssh-clients', - 'zlib-devel-1.2.3-27.el6.i686', - ], - "mock_files": [ - ("/home/cltbld/.ssh", "/home/mock_mozilla/.ssh"), - ('/home/cltbld/.hgrc', '/builds/.hgrc'), - ('/builds/relengapi.tok', '/builds/relengapi.tok'), - ('/usr/local/lib/hgext', '/usr/local/lib/hgext'), - ('/builds/mozilla-fennec-geoloc-api.key', '/builds/mozilla-fennec-geoloc-api.key'), - ('/builds/adjust-sdk.token', '/builds/adjust-sdk.token'), - ], -} From 9e956efed75aa5dae579743655382f384d77b600 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 17:26:41 -0700 Subject: [PATCH 21/48] Bug 1429603: Remove unused `post_upload_extra`, `upload_environment` and `base_post_upload_cmd` from L10N mozharness scripts; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D537 --HG-- extra : rebase_source : 8377203bdb271a1813f4393e5290a3d5c1611ed1 --- taskcluster/ci/l10n/kind.yml | 3 --- taskcluster/ci/nightly-l10n/kind.yml | 10 ---------- .../configs/single_locale/production.py | 3 --- .../mozharness/configs/single_locale/staging.py | 6 ------ testing/mozharness/scripts/desktop_l10n.py | 16 +--------------- testing/mozharness/scripts/mobile_l10n.py | 11 ----------- 6 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 testing/mozharness/configs/single_locale/production.py delete mode 100644 testing/mozharness/configs/single_locale/staging.py diff --git a/taskcluster/ci/l10n/kind.yml b/taskcluster/ci/l10n/kind.yml index b40c61bc46e9..a3d1eef15fe4 100644 --- a/taskcluster/ci/l10n/kind.yml +++ b/taskcluster/ci/l10n/kind.yml @@ -80,19 +80,16 @@ job-template: config: by-build-platform: linux-l10n: - - single_locale/production.py - single_locale/{project}.py - single_locale/linux32.py - single_locale/tc_common.py - single_locale/tc_linux32.py linux64-l10n: - - single_locale/production.py - single_locale/{project}.py - single_locale/linux64.py - single_locale/tc_common.py - single_locale/tc_linux64.py macosx64: - - single_locale/production.py - single_locale/{project}.py - single_locale/macosx64.py - single_locale/tc_common.py diff --git a/taskcluster/ci/nightly-l10n/kind.yml b/taskcluster/ci/nightly-l10n/kind.yml index 006b8c99dc30..3b7e9faeaa78 100644 --- a/taskcluster/ci/nightly-l10n/kind.yml +++ b/taskcluster/ci/nightly-l10n/kind.yml @@ -150,70 +150,60 @@ job-template: config: by-build-platform: linux-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/linux32.py - single_locale/tc_common.py - single_locale/tc_linux32.py - taskcluster_nightly.py linux64-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/linux64.py - single_locale/tc_common.py - single_locale/tc_linux64.py - taskcluster_nightly.py macosx64-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/macosx64.py - single_locale/tc_common.py - single_locale/tc_macosx64.py - taskcluster_nightly.py win32-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/win32.py - single_locale/tc_common.py - single_locale/tc_win32.py - taskcluster_nightly.py win64-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/win64.py - single_locale/tc_common.py - single_locale/tc_win64.py - taskcluster_nightly.py linux-devedition-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/linux_devedition.py - single_locale/tc_common.py - single_locale/tc_linux32.py - taskcluster_nightly.py linux64-devedition-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/linux64_devedition.py - single_locale/tc_common.py - single_locale/tc_linux64.py - taskcluster_nightly.py macosx64-devedition-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/macosx64_devedition.py - single_locale/tc_common.py - single_locale/tc_macosx64.py - taskcluster_nightly.py win32-devedition-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/win32_devedition.py - single_locale/tc_common.py - single_locale/tc_win32.py - taskcluster_nightly.py win64-devedition-nightly: - - single_locale/production.py - single_locale/{project}.py - single_locale/win64_devedition.py - single_locale/tc_common.py diff --git a/testing/mozharness/configs/single_locale/production.py b/testing/mozharness/configs/single_locale/production.py deleted file mode 100644 index 4cc5156d4be5..000000000000 --- a/testing/mozharness/configs/single_locale/production.py +++ /dev/null @@ -1,3 +0,0 @@ -config = { - "upload_environment": "prod", -} diff --git a/testing/mozharness/configs/single_locale/staging.py b/testing/mozharness/configs/single_locale/staging.py deleted file mode 100644 index 9fb598678938..000000000000 --- a/testing/mozharness/configs/single_locale/staging.py +++ /dev/null @@ -1,6 +0,0 @@ -config = { - "upload_environment": "stage", - 'post_upload_extra': ['--bucket-prefix', 'net-mozaws-stage-delivery', - '--url-prefix', 'http://ftp.stage.mozaws.net/', - ], -} diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index 9ac709c8a472..277d80eca0cc 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -57,7 +57,6 @@ configuration_tokens = ('branch', 'update_channel', 'ssh_key_dir', 'stage_product', - 'upload_environment', ) # some other values such as "%(version)s", "%(buildid)s", ... # are defined at run time and they cannot be enforced in the _pre_config_lock @@ -66,7 +65,7 @@ runtime_config_tokens = ('buildid', 'version', 'locale', 'from_buildid', 'abs_objdir', 'revision', 'to_buildid', 'en_us_binary_url', 'en_us_installer_binary_url', 'mar_tools_url', - 'post_upload_extra', 'who') + 'who') # DesktopSingleLocale {{{1 @@ -405,8 +404,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, replace_dict = { 'buildid': self._query_buildid(), 'version': self.query_version(), - 'post_upload_extra': ' '.join(config.get('post_upload_extra', [])), - 'upload_environment': config['upload_environment'], } if config['branch'] == 'try': replace_dict.update({ @@ -758,19 +755,8 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, def make_upload(self, locale): """wrapper for make upload command""" - config = self.config env = self.query_l10n_env() dirs = self.query_abs_dirs() - buildid = self._query_buildid() - replace_dict = { - 'buildid': buildid, - 'branch': config['branch'] - } - try: - env['POST_UPLOAD_CMD'] = config['base_post_upload_cmd'] % replace_dict - except KeyError: - # no base_post_upload_cmd in configuration, just skip it - pass target = ['upload', 'AB_CD=%s' % (locale)] cwd = dirs['abs_locales_dir'] parser = MakeUploadOutputParser(config=self.config, diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py index 93f17d02ee2d..078c2268708d 100755 --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -225,7 +225,6 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, # So we override the branch with something that contains the platform # name. replace_dict['branch'] = c['upload_branch'] - replace_dict['post_upload_extra'] = ' '.join(c.get('post_upload_extra', [])) upload_env = self.query_env(partial_env=c.get("upload_env"), replace_dict=replace_dict) @@ -569,27 +568,17 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, "binaries successfully.") def upload_repacks(self): - c = self.config dirs = self.query_abs_dirs() locales = self.query_locales() make = self.query_exe("make") base_package_name = self.query_base_package_name() - version = self.query_version() upload_env = self.query_upload_env() success_count = total_count = 0 - buildnum = None - if c.get('release_config_file'): - rc = self.query_release_config() - buildnum = rc['buildnum'] for locale in locales: if self.query_failure(locale): self.warning("Skipping previously failed locale %s." % locale) continue total_count += 1 - if c.get('base_post_upload_cmd'): - upload_env['POST_UPLOAD_CMD'] = c['base_post_upload_cmd'] % \ - {'version': version, 'locale': locale, 'buildnum': str(buildnum), - 'post_upload_extra': ' '.join(c.get('post_upload_extra', []))} output = self.get_output_from_command_m( # Ugly hack to avoid |make upload| stderr from showing up # as get_output_from_command errors From 548d013a81c2ad755f8634fe92d1bca22dc12b7a Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 17:37:31 -0700 Subject: [PATCH 22/48] Bug 1429603: Remove unused `ssh_key_dir` and `stage_product` from L10N mozharness configs; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D538 --HG-- extra : rebase_source : dd39506a89e2e0ded6fd9346b315cef9bce7877c --- testing/mozharness/configs/single_locale/ash_android-api-16.py | 2 -- .../mozharness/configs/single_locale/jamun_android-api-16.py | 2 -- testing/mozharness/configs/single_locale/linux.py | 2 -- testing/mozharness/configs/single_locale/linux64.py | 2 -- testing/mozharness/configs/single_locale/linux64_devedition.py | 2 -- testing/mozharness/configs/single_locale/linux_devedition.py | 2 -- testing/mozharness/configs/single_locale/macosx64.py | 2 -- testing/mozharness/configs/single_locale/macosx64_devedition.py | 2 -- .../mozharness/configs/single_locale/maple_android-api-16.py | 2 -- .../configs/single_locale/mozilla-aurora_android-api-16.py | 2 -- .../configs/single_locale/mozilla-beta_android-api-16.py | 2 -- .../configs/single_locale/mozilla-central_android-api-16.py | 2 -- .../configs/single_locale/mozilla-release_android-api-16.py | 2 -- testing/mozharness/configs/single_locale/try_android-api-16.py | 2 -- testing/mozharness/configs/single_locale/win32.py | 2 -- testing/mozharness/configs/single_locale/win32_devedition.py | 2 -- testing/mozharness/configs/single_locale/win64.py | 2 -- testing/mozharness/configs/single_locale/win64_devedition.py | 1 - testing/mozharness/scripts/desktop_l10n.py | 2 -- 19 files changed, 37 deletions(-) diff --git a/testing/mozharness/configs/single_locale/ash_android-api-16.py b/testing/mozharness/configs/single_locale/ash_android-api-16.py index c8b1887b7f99..5f3476d80f53 100644 --- a/testing/mozharness/configs/single_locale/ash_android-api-16.py +++ b/testing/mozharness/configs/single_locale/ash_android-api-16.py @@ -49,9 +49,7 @@ config = { "MOZ_UPDATE_CHANNEL": MOZ_UPDATE_CHANNEL, }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - "stage_product": "mobile", "platform": "android", "build_type": "api-16-opt", diff --git a/testing/mozharness/configs/single_locale/jamun_android-api-16.py b/testing/mozharness/configs/single_locale/jamun_android-api-16.py index 7def2c5f99b2..137f13859eff 100644 --- a/testing/mozharness/configs/single_locale/jamun_android-api-16.py +++ b/testing/mozharness/configs/single_locale/jamun_android-api-16.py @@ -46,9 +46,7 @@ config = { "MOZ_UPDATE_CHANNEL": "nightly-jamun", }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - "stage_product": "mobile", "platform": "android", "build_type": "api-16-opt", diff --git a/testing/mozharness/configs/single_locale/linux.py b/testing/mozharness/configs/single_locale/linux.py index 3ce6af3017e3..32d66d8d6ab0 100644 --- a/testing/mozharness/configs/single_locale/linux.py +++ b/testing/mozharness/configs/single_locale/linux.py @@ -1,10 +1,8 @@ config = { "platform": "linux", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "linux32", "mozconfig_variant": "l10n-mozconfig", - "ssh_key_dir": "/home/mock_mozilla/.ssh", "log_name": "single_locale", "objdir": "obj-firefox", "vcs_share_base": "/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/linux64.py b/testing/mozharness/configs/single_locale/linux64.py index fad159a11bd0..a111589c1601 100644 --- a/testing/mozharness/configs/single_locale/linux64.py +++ b/testing/mozharness/configs/single_locale/linux64.py @@ -1,10 +1,8 @@ config = { "platform": "linux64", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "linux64", "mozconfig_variant": "l10n-mozconfig", - "ssh_key_dir": "/home/mock_mozilla/.ssh", "objdir": "obj-firefox", "vcs_share_base": "/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/linux64_devedition.py b/testing/mozharness/configs/single_locale/linux64_devedition.py index 16834b0e0692..b8acfca78116 100644 --- a/testing/mozharness/configs/single_locale/linux64_devedition.py +++ b/testing/mozharness/configs/single_locale/linux64_devedition.py @@ -1,10 +1,8 @@ config = { "platform": "linux64", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "linux64", "mozconfig_variant": "l10n-mozconfig-devedition", - "ssh_key_dir": "/home/mock_mozilla/.ssh", "objdir": "obj-firefox", "vcs_share_base": "/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/linux_devedition.py b/testing/mozharness/configs/single_locale/linux_devedition.py index 405d357414ea..0b044aff5ec6 100644 --- a/testing/mozharness/configs/single_locale/linux_devedition.py +++ b/testing/mozharness/configs/single_locale/linux_devedition.py @@ -1,10 +1,8 @@ config = { "platform": "linux", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "linux32", "mozconfig_variant": "l10n-mozconfig-devedition", - "ssh_key_dir": "/home/mock_mozilla/.ssh", "objdir": "obj-firefox", "vcs_share_base": "/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/macosx64.py b/testing/mozharness/configs/single_locale/macosx64.py index f3abafcee791..705e0d91e63a 100644 --- a/testing/mozharness/configs/single_locale/macosx64.py +++ b/testing/mozharness/configs/single_locale/macosx64.py @@ -1,11 +1,9 @@ config = { # mozconfig file to use, it depends on branch and platform names "platform": "macosx64", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "macosx64", "mozconfig_variant": "l10n-mozconfig", - "ssh_key_dir": "~/.ssh", "objdir": "obj-firefox", "vcs_share_base": "/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/macosx64_devedition.py b/testing/mozharness/configs/single_locale/macosx64_devedition.py index 499c9fb14085..4aa5e67245d2 100644 --- a/testing/mozharness/configs/single_locale/macosx64_devedition.py +++ b/testing/mozharness/configs/single_locale/macosx64_devedition.py @@ -1,11 +1,9 @@ config = { # mozconfig file to use, it depends on branch and platform names "platform": "macosx64", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "macosx64", "mozconfig_variant": "l10n-mozconfig-devedition", - "ssh_key_dir": "~/.ssh", "log_name": "single_locale", "objdir": "obj-firefox", "vcs_share_base": "/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/maple_android-api-16.py b/testing/mozharness/configs/single_locale/maple_android-api-16.py index b22e12704779..546b8e4e986f 100644 --- a/testing/mozharness/configs/single_locale/maple_android-api-16.py +++ b/testing/mozharness/configs/single_locale/maple_android-api-16.py @@ -47,9 +47,7 @@ config = { "MOZ_UPDATE_CHANNEL": "nightly-maple", }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - "stage_product": "mobile", "platform": "android", "build_type": "api-16-opt", diff --git a/testing/mozharness/configs/single_locale/mozilla-aurora_android-api-16.py b/testing/mozharness/configs/single_locale/mozilla-aurora_android-api-16.py index cf94f047b4da..bc7affb87db8 100644 --- a/testing/mozharness/configs/single_locale/mozilla-aurora_android-api-16.py +++ b/testing/mozharness/configs/single_locale/mozilla-aurora_android-api-16.py @@ -53,9 +53,7 @@ config = { "MOZ_UPDATE_CHANNEL": MOZ_UPDATE_CHANNEL, }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - "stage_product": "mobile", "platform": "android", "build_type": "api-16-opt", diff --git a/testing/mozharness/configs/single_locale/mozilla-beta_android-api-16.py b/testing/mozharness/configs/single_locale/mozilla-beta_android-api-16.py index 10d6bed13e9f..ef6f3f89546e 100644 --- a/testing/mozharness/configs/single_locale/mozilla-beta_android-api-16.py +++ b/testing/mozharness/configs/single_locale/mozilla-beta_android-api-16.py @@ -8,7 +8,6 @@ HG_SHARE_BASE_DIR = "/builds/hg-shared" config = { "branch": BRANCH, - "stage_product": "mobile", "log_name": "single_locale", "objdir": OBJDIR, "is_automation": True, @@ -51,7 +50,6 @@ config = { "MOZ_UPDATE_CHANNEL": MOZ_UPDATE_CHANNEL, }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", "key_alias": "release", # Mock diff --git a/testing/mozharness/configs/single_locale/mozilla-central_android-api-16.py b/testing/mozharness/configs/single_locale/mozilla-central_android-api-16.py index 69b0503f28b0..8a14cb60247f 100644 --- a/testing/mozharness/configs/single_locale/mozilla-central_android-api-16.py +++ b/testing/mozharness/configs/single_locale/mozilla-central_android-api-16.py @@ -53,9 +53,7 @@ config = { "MOZ_UPDATE_CHANNEL": MOZ_UPDATE_CHANNEL, }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - "stage_product": "mobile", "platform": "android", "build_type": "api-16-opt", diff --git a/testing/mozharness/configs/single_locale/mozilla-release_android-api-16.py b/testing/mozharness/configs/single_locale/mozilla-release_android-api-16.py index dd7ccb56c76e..1055ad0e6a5a 100644 --- a/testing/mozharness/configs/single_locale/mozilla-release_android-api-16.py +++ b/testing/mozharness/configs/single_locale/mozilla-release_android-api-16.py @@ -8,7 +8,6 @@ HG_SHARE_BASE_DIR = "/builds/hg-shared" config = { "branch": BRANCH, - "stage_product": "mobile", "log_name": "single_locale", "objdir": OBJDIR, "is_automation": True, @@ -51,7 +50,6 @@ config = { "MOZ_UPDATE_CHANNEL": MOZ_UPDATE_CHANNEL, }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", "key_alias": "release", # Mock diff --git a/testing/mozharness/configs/single_locale/try_android-api-16.py b/testing/mozharness/configs/single_locale/try_android-api-16.py index b19ff085ad85..c6457682d7ff 100644 --- a/testing/mozharness/configs/single_locale/try_android-api-16.py +++ b/testing/mozharness/configs/single_locale/try_android-api-16.py @@ -51,9 +51,7 @@ config = { "MOZ_UPDATE_CHANNEL": "try", # XXX Invalid }, "upload_branch": "%s-android-api-16" % BRANCH, - "ssh_key_dir": "~/.ssh", "signature_verification_script": "tools/release/signing/verify-android-signature.sh", - "stage_product": "mobile", "platform": "android", # XXX Validate "build_type": "api-16-opt", # XXX Validate diff --git a/testing/mozharness/configs/single_locale/win32.py b/testing/mozharness/configs/single_locale/win32.py index 5506c53ca16b..62ddde011c7e 100644 --- a/testing/mozharness/configs/single_locale/win32.py +++ b/testing/mozharness/configs/single_locale/win32.py @@ -1,10 +1,8 @@ config = { "platform": "win32", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "win32", "mozconfig_variant": "l10n-mozconfig", - "ssh_key_dir": "~/.ssh", "log_name": "single_locale", "objdir": "obj-firefox", "vcs_share_base": "c:/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/win32_devedition.py b/testing/mozharness/configs/single_locale/win32_devedition.py index fe1ca1c5eb70..4a29c4b58219 100644 --- a/testing/mozharness/configs/single_locale/win32_devedition.py +++ b/testing/mozharness/configs/single_locale/win32_devedition.py @@ -1,10 +1,8 @@ config = { "platform": "win32", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "win32", "mozconfig_variant": "l10n-mozconfig-devedition", - "ssh_key_dir": "~/.ssh", "objdir": "obj-firefox", "vcs_share_base": "c:/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/win64.py b/testing/mozharness/configs/single_locale/win64.py index 71caf7b8cbeb..2e5a0bc1e81e 100644 --- a/testing/mozharness/configs/single_locale/win64.py +++ b/testing/mozharness/configs/single_locale/win64.py @@ -1,10 +1,8 @@ config = { "platform": "win64", - "stage_product": "firefox", "app_name": "browser", "mozconfig_platform": "win64", "mozconfig_variant": "l10n-mozconfig", - "ssh_key_dir": "~/.ssh", "objdir": "obj-firefox", "vcs_share_base": "c:/builds/hg-shared", diff --git a/testing/mozharness/configs/single_locale/win64_devedition.py b/testing/mozharness/configs/single_locale/win64_devedition.py index c78ee909104f..4df159898d42 100644 --- a/testing/mozharness/configs/single_locale/win64_devedition.py +++ b/testing/mozharness/configs/single_locale/win64_devedition.py @@ -3,7 +3,6 @@ config = { "app_name": "browser", "mozconfig_platform": "win64", "mozconfig_variant": "l10n-mozconfig-devedition", - "ssh_key_dir": "~/.ssh", "objdir": "obj-firefox", "vcs_share_base": "c:/builds/hg-shared", diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index 277d80eca0cc..8d3c0851f28a 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -55,8 +55,6 @@ FAILURE_STR = "Failed" configuration_tokens = ('branch', 'platform', 'update_channel', - 'ssh_key_dir', - 'stage_product', ) # some other values such as "%(version)s", "%(buildid)s", ... # are defined at run time and they cannot be enforced in the _pre_config_lock From b4a69b0604fe0ded530019500115a5f852cf16fb Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Wed, 31 Jan 2018 21:47:56 -0700 Subject: [PATCH 23/48] Bug 1429603: Remove support for construct `POST_UPLOAD_CMD` in mozharness builds scripts; r=jlund The upload is handled by taskcluster, which is handled by copying files around, so remove support for specifying alternative commands. Differential Revision: https://phabricator.services.mozilla.com/D540 --HG-- extra : rebase_source : 968249c0a308178b62af77d48e6aa307d4192e5a --- taskcluster/ci/build/android-stuff.yml | 5 - taskcluster/ci/build/android.yml | 13 --- .../configs/builds/branch_specifics.py | 60 ++---------- .../configs/builds/build_pool_specifics.py | 26 ------ .../builds/releng_base_android_64_builds.py | 9 -- .../builds/releng_base_linux_32_builds.py | 7 -- .../builds/releng_base_linux_64_builds.py | 7 -- .../builds/releng_base_mac_64_cross_builds.py | 7 -- .../releng_base_windows_32_mingw_builds.py | 7 -- .../64_add-on-devel.py | 1 - .../releng_sub_linux_configs/64_asan.py | 1 - .../64_asan_and_debug.py | 1 - .../64_asan_reporter_tc.py | 1 - .../releng_sub_linux_configs/64_asan_tc.py | 1 - .../64_asan_tc_and_debug.py | 1 - .../64_code_coverage.py | 1 - .../64_fuzzing_asan_tc.py | 1 - .../64_fuzzing_debug.py | 1 - .../releng_sub_linux_configs/64_valgrind.py | 1 - .../releng_sub_mac_configs/64_add-on-devel.py | 1 - .../releng_sub_mac_configs/64_devedition.py | 1 - .../64_stat_and_debug.py | 1 - .../32_devedition.py | 1 - .../32_stat_and_debug.py | 1 - .../64_devedition.py | 1 - ...platform_supports_post_upload_to_latest.py | 3 - .../mozharness/mozilla/building/buildbase.py | 91 ------------------- .../mozharness/scripts/fx_desktop_build.py | 8 -- 28 files changed, 10 insertions(+), 249 deletions(-) delete mode 100644 testing/mozharness/configs/platform_supports_post_upload_to_latest.py diff --git a/taskcluster/ci/build/android-stuff.yml b/taskcluster/ci/build/android-stuff.yml index ba11422a1adc..230fc1d270e1 100644 --- a/taskcluster/ci/build/android-stuff.yml +++ b/taskcluster/ci/build/android-stuff.yml @@ -31,7 +31,6 @@ android-test/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: android-test @@ -84,7 +83,6 @@ android-lint/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: android-lint @@ -140,7 +138,6 @@ android-checkstyle/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: android-checkstyle @@ -192,7 +189,6 @@ android-findbugs/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: android-findbugs @@ -239,7 +235,6 @@ android-geckoview-docs/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: android-geckoview-docs diff --git a/taskcluster/ci/build/android.yml b/taskcluster/ci/build/android.yml index 3db852e66b55..4e537833517e 100644 --- a/taskcluster/ci/build/android.yml +++ b/taskcluster/ci/build/android.yml @@ -32,7 +32,6 @@ android-api-16/debug: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: api-16-debug @@ -85,7 +84,6 @@ android-x86/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: x86 @@ -143,7 +141,6 @@ android-x86-nightly/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py - taskcluster_nightly.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true @@ -192,7 +189,6 @@ android-api-16/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: api-16 @@ -241,7 +237,6 @@ android-api-16-without-google-play-services/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: api-16-without-google-play-services @@ -295,7 +290,6 @@ android-api-16-nightly/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py - taskcluster_nightly.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true @@ -349,7 +343,6 @@ android-x86-old-id/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: x86-old-id @@ -406,7 +399,6 @@ android-x86-old-id-nightly/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py - taskcluster_nightly.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true @@ -456,7 +448,6 @@ android-api-16-old-id/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: api-16-old-id @@ -508,7 +499,6 @@ android-api-16-old-id-nightly/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py - taskcluster_nightly.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true @@ -558,7 +548,6 @@ android-api-16-gradle/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: api-16-gradle @@ -605,7 +594,6 @@ android-aarch64/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true custom-build-variant-cfg: aarch64 @@ -658,7 +646,6 @@ android-aarch64-nightly/opt: config: - builds/releng_base_android_64_builds.py - disable_signing.py - - platform_supports_post_upload_to_latest.py - taskcluster_nightly.py script: "mozharness/scripts/fx_desktop_build.py" secrets: true diff --git a/testing/mozharness/configs/builds/branch_specifics.py b/testing/mozharness/configs/builds/branch_specifics.py index be9942369b16..acf8d063d294 100644 --- a/testing/mozharness/configs/builds/branch_specifics.py +++ b/testing/mozharness/configs/builds/branch_specifics.py @@ -12,7 +12,6 @@ # '': { # # global config items (applies to all platforms and build types) # 'repo_path': "projects/", -# 'graph_server_branch_name': "Firefox", # # # platform config items (applies to specific platforms) # 'platform_overrides': { @@ -33,8 +32,6 @@ config = { "mozilla-central": { "repo_path": 'mozilla-central', "update_channel": "nightly", - "graph_server_branch_name": "Firefox", - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', 'platform_overrides': { 'android-api-16-old-id': { "update_channel": "nightly-old-id", @@ -49,7 +46,6 @@ config = { 'repo_path': 'releases/mozilla-release', 'update_channel': 'release', 'branch_uses_per_checkin_strategy': True, - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', 'platform_overrides': { 'linux': { 'mozconfig_variant': 'release', @@ -123,7 +119,6 @@ config = { 'repo_path': 'releases/mozilla-beta', 'update_channel': 'beta', 'branch_uses_per_checkin_strategy': True, - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', 'platform_overrides': { 'linux': { 'mozconfig_variant': 'beta', @@ -211,17 +206,9 @@ config = { 'repo_path': 'releases/mozilla-aurora', 'update_channel': 'aurora', 'branch_uses_per_checkin_strategy': True, - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', }, 'try': { 'repo_path': 'try', - 'tinderbox_build_dir': '%(who)s-%(got_revision)s', - 'to_tinderbox_dated': False, - 'include_post_upload_builddir': True, - 'release_to_try_builds': True, - 'stage_server': 'upload.trybld.productdelivery.prod.mozaws.net', - 'stage_username': 'trybld', - 'stage_ssh_key': 'trybld_dsa', 'branch_supports_uploadsymbols': False, 'use_clobberer': False, }, @@ -230,23 +217,16 @@ config = { #'fx-team': {}, #Bug 1296396 'gum': { 'branch_uses_per_checkin_strategy': True, - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', }, 'mozilla-inbound': { 'repo_path': 'integration/mozilla-inbound', - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', }, 'autoland': { 'repo_path': 'integration/autoland', - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, - 'ux': { - "graph_server_branch_name": "UX", - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', }, + 'ux': {}, 'date': { 'update_channel': 'nightly-date', - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', 'platform_overrides': { 'android-api-16-old-id': { "update_channel": "nightly-old-id", @@ -259,30 +239,17 @@ config = { 'cypress': { # bug 1164935 'branch_uses_per_checkin_strategy': True, - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', }, ### other branches that do not require anything special: - 'alder': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, - 'ash': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, - 'birch': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, + 'alder': {}, + 'ash': {}, + 'birch': {}, # 'build-system': {} - 'cedar': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, - 'elm': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, + 'cedar': {}, + 'elm': {}, 'fig': {}, - 'graphics': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, + 'graphics': {}, # 'holly': {}, 'jamun': { 'update_channel': 'beta', @@ -352,16 +319,9 @@ config = { "update_channel": "aurora", }, }, - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, - 'larch': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', }, + 'larch': {}, # 'maple': {}, - 'oak': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, - 'pine': { - 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, + 'oak': {}, + 'pine': {}, } diff --git a/testing/mozharness/configs/builds/build_pool_specifics.py b/testing/mozharness/configs/builds/build_pool_specifics.py index 22b396e39f3a..5f809311108f 100644 --- a/testing/mozharness/configs/builds/build_pool_specifics.py +++ b/testing/mozharness/configs/builds/build_pool_specifics.py @@ -2,33 +2,7 @@ # fx build factories are ported, we might deal with this differently config = { - "staging": { - # if not clobberer_url, only clobber 'abs_work_dir' - # if true: possibly clobber, clobberer - # see PurgeMixin for clobber() conditions - 'clobberer_url': 'https://api-pub-build.allizom.org/clobberer/lastclobber', - # staging we should use MozillaTest - # but in production we let the self.branch decide via - # self._query_graph_server_branch_name() - "graph_server_branch_name": "MozillaTest", - 'graph_server': 'graphs.allizom.org', - 'stage_server': 'upload.ffxbld.productdelivery.stage.mozaws.net', - 'post_upload_extra': ['--bucket-prefix', 'net-mozaws-stage-delivery', - '--url-prefix', 'http://ftp.stage.mozaws.net/', - ], - }, - "production": { - # if not clobberer_url, only clobber 'abs_work_dir' - # if true: possibly clobber, clobberer - # see PurgeMixin for clobber() conditions - 'clobberer_url': 'https://api.pub.build.mozilla.org/clobberer/lastclobber', - 'graph_server': 'graphs.mozilla.org', - # bug 1216907, set this at branch level - # 'stage_server': 'upload.ffxbld.productdelivery.prod.mozaws.net', - }, "taskcluster": { - 'graph_server': 'graphs.mozilla.org', - 'stage_server': 'ignored', # use the relengapi proxy to talk to tooltool "tooltool_servers": ['http://relengapi/tooltool/'], "tooltool_url": 'http://relengapi/tooltool/', diff --git a/testing/mozharness/configs/builds/releng_base_android_64_builds.py b/testing/mozharness/configs/builds/releng_base_android_64_builds.py index bf0ce4d0ee42..bc76ffd4d3a5 100644 --- a/testing/mozharness/configs/builds/releng_base_android_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_android_64_builds.py @@ -60,8 +60,6 @@ config = { 'base_name': 'Android 2.3 %(branch)s', 'platform': 'android', 'stage_platform': 'android', - 'stage_product': 'mobile', - 'post_upload_include_platform': True, 'enable_max_vsize': False, 'env': { 'MOZBUILD_STATE_PATH': os.path.join(os.getcwd(), '.mozbuild'), @@ -75,13 +73,6 @@ config = { 'PATH': '/usr/local/bin:/bin:/usr/bin', 'SHIP_LICENSED_FONTS': '1', }, - 'upload_env': { - # stage_server is dictated from build_pool_specifics.py - 'UPLOAD_HOST': '%(stage_server)s', - 'UPLOAD_USER': '%(stage_username)s', - 'UPLOAD_SSH_KEY': '/home/mock_mozilla/.ssh/%(stage_ssh_key)s', - 'UPLOAD_TO_TEMP': '1', - }, "check_test_env": { 'MINIDUMP_STACKWALK': '%(abs_tools_dir)s/breakpad/linux/minidump_stackwalk', 'MINIDUMP_SAVE_PATH': '%(base_work_dir)s/minidumps', diff --git a/testing/mozharness/configs/builds/releng_base_linux_32_builds.py b/testing/mozharness/configs/builds/releng_base_linux_32_builds.py index 42bdcf74e318..19ebd463a58c 100644 --- a/testing/mozharness/configs/builds/releng_base_linux_32_builds.py +++ b/testing/mozharness/configs/builds/releng_base_linux_32_builds.py @@ -59,13 +59,6 @@ config = { /tools/python27/bin:/tools/python27-mercurial/bin:/home/cltbld/bin', 'LD_LIBRARY_PATH': "/tools/gcc-4.3.3/installed/lib", }, - 'upload_env': { - # stage_server is dictated from build_pool_specifics.py - 'UPLOAD_HOST': '%(stage_server)s', - 'UPLOAD_USER': '%(stage_username)s', - 'UPLOAD_SSH_KEY': '/home/mock_mozilla/.ssh/%(stage_ssh_key)s', - 'UPLOAD_TO_TEMP': '1', - }, "check_test_env": { 'MINIDUMP_STACKWALK': '%(abs_tools_dir)s/breakpad/linux/minidump_stackwalk', 'MINIDUMP_SAVE_PATH': '%(base_work_dir)s/minidumps', diff --git a/testing/mozharness/configs/builds/releng_base_linux_64_builds.py b/testing/mozharness/configs/builds/releng_base_linux_64_builds.py index 5c33ba2943a5..45ac3f8439b8 100644 --- a/testing/mozharness/configs/builds/releng_base_linux_64_builds.py +++ b/testing/mozharness/configs/builds/releng_base_linux_64_builds.py @@ -59,13 +59,6 @@ config = { 'LD_LIBRARY_PATH': "/tools/gcc-4.3.3/installed/lib64", ## }, - 'upload_env': { - # stage_server is dictated from build_pool_specifics.py - 'UPLOAD_HOST': '%(stage_server)s', - 'UPLOAD_USER': '%(stage_username)s', - 'UPLOAD_SSH_KEY': '/home/mock_mozilla/.ssh/%(stage_ssh_key)s', - 'UPLOAD_TO_TEMP': '1', - }, "check_test_env": { 'MINIDUMP_STACKWALK': '%(abs_tools_dir)s/breakpad/linux64/minidump_stackwalk', 'MINIDUMP_SAVE_PATH': '%(base_work_dir)s/minidumps', diff --git a/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py b/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py index 1fc772d46ee0..2e312d4c874b 100644 --- a/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py +++ b/testing/mozharness/configs/builds/releng_base_mac_64_cross_builds.py @@ -48,13 +48,6 @@ config = { /tools/python27-mercurial/bin:/home/cltbld/bin', ## }, - 'upload_env': { - # stage_server is dictated from build_pool_specifics.py - 'UPLOAD_HOST': '%(stage_server)s', - 'UPLOAD_USER': '%(stage_username)s', - 'UPLOAD_SSH_KEY': '/Users/cltbld/.ssh/%(stage_ssh_key)s', - 'UPLOAD_TO_TEMP': '1', - }, "check_test_env": { 'MINIDUMP_STACKWALK': '%(abs_tools_dir)s/breakpad/linux64/minidump_stackwalk', 'MINIDUMP_SAVE_PATH': '%(base_work_dir)s/minidumps', diff --git a/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py b/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py index 6d89eab215e9..13f6a71cfc6d 100755 --- a/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py +++ b/testing/mozharness/configs/builds/releng_base_windows_32_mingw_builds.py @@ -49,13 +49,6 @@ config = { # 32 bit specific 'PATH': '/usr/local/bin:/bin:/usr/bin', }, - 'upload_env': { - # stage_server is dictated from build_pool_specifics.py - 'UPLOAD_HOST': '%(stage_server)s', - 'UPLOAD_USER': '%(stage_username)s', - 'UPLOAD_SSH_KEY': '/home/mock_mozilla/.ssh/%(stage_ssh_key)s', - 'UPLOAD_TO_TEMP': '1', - }, "check_test_env": { 'MINIDUMP_STACKWALK': '%(abs_tools_dir)s/breakpad/linux/minidump_stackwalk', 'MINIDUMP_SAVE_PATH': '%(base_work_dir)s/minidumps', diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py index 1947abddb7ca..bcf20d51fbd0 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_add-on-devel.py @@ -9,7 +9,6 @@ config = { ], 'stage_platform': 'linux64-add-on-devel', 'build_type': 'add-on-devel', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py index d88df50f402d..9790a5c2e943 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan.py @@ -9,7 +9,6 @@ config = { ], 'stage_platform': 'linux64-asan', 'build_type': 'asan', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py index e141f80ce81d..cc294eb18cec 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_and_debug.py @@ -10,7 +10,6 @@ config = { 'stage_platform': 'linux64-asan-debug', 'build_type': 'asan-debug', 'debug_build': True, - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py index 2e7f74dc8b1b..a9b551d9209a 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_reporter_tc.py @@ -9,7 +9,6 @@ config = { ], 'stage_platform': 'linux64-asan-reporter', 'build_type': 'asan', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py index d88df50f402d..9790a5c2e943 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc.py @@ -9,7 +9,6 @@ config = { ], 'stage_platform': 'linux64-asan', 'build_type': 'asan', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py index e141f80ce81d..cc294eb18cec 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_asan_tc_and_debug.py @@ -10,7 +10,6 @@ config = { 'stage_platform': 'linux64-asan-debug', 'build_type': 'asan-debug', 'debug_build': True, - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py index e4b0ef9d6c64..1c96a8f233ca 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_code_coverage.py @@ -8,7 +8,6 @@ config = { 'update', # decided by query_is_nightly() ], 'stage_platform': 'linux64-ccov', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, 'enable_count_ctors': False, #### 64 bit build specific ##### diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py index 200aeb90f7ab..14e7ea93a4e9 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_asan_tc.py @@ -9,7 +9,6 @@ config = { ], 'stage_platform': 'linux64-fuzzing-asan', 'build_type': 'asan', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py index b58cc0facc5d..148da8552f3b 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_fuzzing_debug.py @@ -8,7 +8,6 @@ config = { ], 'stage_platform': 'linux64-fuzzing-debug', 'debug_build': True, - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py index dfcd07dc2e83..44c16023f960 100644 --- a/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py +++ b/testing/mozharness/configs/builds/releng_sub_linux_configs/64_valgrind.py @@ -10,7 +10,6 @@ config = { ], 'stage_platform': 'linux64-valgrind', 'build_type': 'valgrind', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, 'perfherder_extra_options': ['valgrind'], #### 64 bit build specific ##### diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py index abddfc90ec66..e7bac5051576 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_add-on-devel.py @@ -9,7 +9,6 @@ config = { ], 'stage_platform': 'macosx64-add-on-devel', 'build_type': 'add-on-devel', - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, #### 64 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_devedition.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_devedition.py index f5b411320539..886ce324a9de 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_devedition.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_devedition.py @@ -2,6 +2,5 @@ config = { 'mozconfig_variant': 'devedition', 'force_clobber': True, 'stage_platform': 'macosx64-devedition', - 'stage_product': 'devedition', } diff --git a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py index 167eeb2099c7..a596c91a4ed9 100644 --- a/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_mac_configs/64_stat_and_debug.py @@ -11,7 +11,6 @@ config = { 'build_type': 'st-an-debug', 'tooltool_manifest_src': "browser/config/tooltool-manifests/macosx64/\ clang.manifest", - 'platform_supports_post_upload_to_latest': False, 'enable_signing': False, 'perfherder_extra_options': ['static-analysis'], #### 64 bit build specific ##### diff --git a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_devedition.py b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_devedition.py index a724bb0d44d4..e43a14ec3060 100644 --- a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_devedition.py +++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_devedition.py @@ -2,5 +2,4 @@ config = { 'mozconfig_variant': 'devedition', 'force_clobber': True, 'stage_platform': 'win32-devedition', - 'stage_product': 'devedition', } diff --git a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_stat_and_debug.py b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_stat_and_debug.py index b0fc71a377ef..2d73b8f0a77d 100644 --- a/testing/mozharness/configs/builds/releng_sub_windows_configs/32_stat_and_debug.py +++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/32_stat_and_debug.py @@ -11,7 +11,6 @@ config = { 'enable_signing': False, 'tooltool_manifest_src': "browser/config/tooltool-manifests/win32/\ releng.manifest", - 'platform_supports_post_upload_to_latest': False, 'perfherder_extra_options': ['static-analysis'], #### 32 bit build specific ##### 'env': { diff --git a/testing/mozharness/configs/builds/releng_sub_windows_configs/64_devedition.py b/testing/mozharness/configs/builds/releng_sub_windows_configs/64_devedition.py index de0ec6f46126..d797ab72ddc1 100644 --- a/testing/mozharness/configs/builds/releng_sub_windows_configs/64_devedition.py +++ b/testing/mozharness/configs/builds/releng_sub_windows_configs/64_devedition.py @@ -2,5 +2,4 @@ config = { 'mozconfig_variant': 'devedition', 'force_clobber': True, 'stage_platform': 'win64-devedition', - 'stage_product': 'devedition', } diff --git a/testing/mozharness/configs/platform_supports_post_upload_to_latest.py b/testing/mozharness/configs/platform_supports_post_upload_to_latest.py deleted file mode 100644 index 6ed654ed187d..000000000000 --- a/testing/mozharness/configs/platform_supports_post_upload_to_latest.py +++ /dev/null @@ -1,3 +0,0 @@ -config = { - 'platform_supports_post_upload_to_latest': False, -} diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index e9bac6a40725..07f2e8ba58fd 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -19,7 +19,6 @@ import time import uuid import copy import glob -from itertools import chain # import the power of mozharness ;) import sys @@ -988,18 +987,6 @@ or run without that action (ie: --no-{action})" mach_env = {} if c.get('upload_env'): mach_env.update(c['upload_env']) - if 'UPLOAD_HOST' in mach_env and 'stage_server' in c: - mach_env['UPLOAD_HOST'] = mach_env['UPLOAD_HOST'] % { - 'stage_server': c['stage_server'] - } - if 'UPLOAD_USER' in mach_env and 'stage_username' in c: - mach_env['UPLOAD_USER'] = mach_env['UPLOAD_USER'] % { - 'stage_username': c['stage_username'] - } - if 'UPLOAD_SSH_KEY' in mach_env and 'stage_ssh_key' in c: - mach_env['UPLOAD_SSH_KEY'] = mach_env['UPLOAD_SSH_KEY'] % { - 'stage_ssh_key': c['stage_ssh_key'] - } # this prevents taskcluster from overwriting the target files with # the multilocale files. Put everything from the en-US build in a @@ -1008,13 +995,6 @@ or run without that action (ie: --no-{action})" if 'UPLOAD_PATH' in mach_env: mach_env['UPLOAD_PATH'] = os.path.join(mach_env['UPLOAD_PATH'], 'en-US') - - # _query_post_upload_cmd returns a list (a cmd list), for env sake here - # let's make it a string - if c.get('is_automation'): - pst_up_cmd = ' '.join([str(i) for i in self._query_post_upload_cmd(multiLocale)]) - mach_env['POST_UPLOAD_CMD'] = pst_up_cmd - return mach_env def _compile_against_pgo(self): @@ -1042,65 +1022,6 @@ or run without that action (ie: --no-{action})" check_test_env[env_var] = env_value % dirs return check_test_env - def _query_post_upload_cmd(self, multiLocale): - c = self.config - post_upload_cmd = ["post_upload.py"] - buildid = self.query_buildid() - revision = self.query_revision() - platform = self.stage_platform - who = self.query_who() - if c.get('pgo_build'): - platform += '-pgo' - - if c.get('tinderbox_build_dir'): - # TODO find out if we should fail here like we are - if not who and not revision: - self.fatal("post upload failed. --tinderbox-builds-dir could " - "not be determined. 'who' and/or 'revision' unknown") - # branches like try will use 'tinderbox_build_dir - tinderbox_build_dir = c['tinderbox_build_dir'] % { - 'who': who, - 'got_revision': revision - } - else: - # the default - tinderbox_build_dir = "%s-%s" % (self.branch, platform) - - if who and self.branch == 'try': - post_upload_cmd.extend(["--who", who]) - if c.get('include_post_upload_builddir'): - post_upload_cmd.extend( - ["--builddir", "%s-%s" % (self.branch, platform)] - ) - elif multiLocale: - # Android builds with multilocale enabled upload the en-US builds - # to an en-US subdirectory, and the multilocale builds to the - # top-level directory. - post_upload_cmd.extend( - ["--builddir", "en-US"] - ) - - post_upload_cmd.extend(["--tinderbox-builds-dir", tinderbox_build_dir]) - post_upload_cmd.extend(["-p", c['stage_product']]) - post_upload_cmd.extend(['-i', buildid]) - if revision: - post_upload_cmd.extend(['--revision', revision]) - if c.get('to_tinderbox_dated'): - post_upload_cmd.append('--release-to-tinderbox-dated-builds') - if c.get('release_to_try_builds'): - post_upload_cmd.append('--release-to-try-builds') - if self.query_is_nightly(): - if c.get('post_upload_include_platform'): - post_upload_cmd.extend(['-b', '%s-%s' % (self.branch, platform)]) - else: - post_upload_cmd.extend(['-b', self.branch]) - post_upload_cmd.append('--release-to-dated') - if c['platform_supports_post_upload_to_latest']: - post_upload_cmd.append('--release-to-latest') - post_upload_cmd.extend(c.get('post_upload_extra', [])) - - return post_upload_cmd - def _rm_old_package(self): """rm the old package.""" c = self.config @@ -1252,18 +1173,6 @@ or run without that action (ie: --no-{action})" self.get_output_from_command(cmd, cwd=dirs['abs_src_dir'], throw_exception=True) - def _generate_properties_file(self, path): - # TODO it would be better to grab all the properties that were - # persisted to file rather than use whats in the buildbot_properties - # live object so we become less action dependant. - all_current_props = dict( - chain(self.buildbot_config['properties'].items(), - self.buildbot_properties.items()) - ) - # graph_server_post.py expects a file with 'properties' key - graph_props = dict(properties=all_current_props) - self.dump_config(path, graph_props) - def _query_props_set_by_mach(self, console_output=True, error_level=FATAL): mach_properties_path = os.path.join( self.query_abs_dirs()['abs_obj_dir'], 'dist', 'mach_build_properties.json' diff --git a/testing/mozharness/scripts/fx_desktop_build.py b/testing/mozharness/scripts/fx_desktop_build.py index 3015f99d58a1..e7b989e3384b 100755 --- a/testing/mozharness/scripts/fx_desktop_build.py +++ b/testing/mozharness/scripts/fx_desktop_build.py @@ -68,22 +68,14 @@ class FxDesktopBuild(BuildScript, TryToolsMixin, object): "%(objdir)s/dist/thunderbird*", "%(objdir)s/dist/install/sea/*.exe" ], - 'stage_product': 'firefox', - 'platform_supports_post_upload_to_latest': True, 'build_resources_path': '%(abs_obj_dir)s/.mozbuild/build_resources.json', 'nightly_promotion_branches': ['mozilla-central', 'mozilla-aurora'], # try will overwrite these 'clone_with_purge': False, 'clone_by_revision': False, - 'tinderbox_build_dir': None, - 'to_tinderbox_dated': True, - 'release_to_try_builds': False, - 'include_post_upload_builddir': False, 'use_clobberer': True, - 'stage_username': 'ffxbld', - 'stage_ssh_key': 'ffxbld_rsa', 'virtualenv_modules': [ 'requests==2.8.1', ], From 2dca8b7740ec3c19049eab54bb451decd25f7f47 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 11 Feb 2018 16:47:08 -0700 Subject: [PATCH 24/48] Bug 1429603: Simplify generation of balrog properties in mozharness; r=jlund Differential Revision: https://phabricator.services.mozilla.com/D575 --HG-- extra : rebase_source : 745f87dc835fb1908198cfae944bfde5e17127a7 --- .../mozharness/mozilla/updates/balrog.py | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/testing/mozharness/mozharness/mozilla/updates/balrog.py b/testing/mozharness/mozharness/mozilla/updates/balrog.py index 0bf9315ce4bf..07efb921522c 100644 --- a/testing/mozharness/mozharness/mozilla/updates/balrog.py +++ b/testing/mozharness/mozharness/mozilla/updates/balrog.py @@ -1,4 +1,3 @@ -from itertools import chain import os import sys @@ -27,20 +26,19 @@ class BalrogMixin(object): else: buildbot_properties = [] - balrog_props = dict(properties=dict(chain( - buildbot_properties, - self.buildbot_properties.items(), - ))) + balrog_props = {} + balrog_props.update(buildbot_properties) + balrog_props.update(self.buildbot_properties) if self.config.get('stage_platform'): - balrog_props['properties']['stage_platform'] = self.config['stage_platform'] + balrog_props['stage_platform'] = self.config['stage_platform'] if self.config.get('platform'): - balrog_props['properties']['platform'] = self.config['platform'] + balrog_props['platform'] = self.config['platform'] if self.config.get('balrog_platform'): - balrog_props["properties"]["platform"] = self.config['balrog_platform'] - if "branch" not in balrog_props["properties"]: - balrog_props["properties"]["branch"] = self.branch + balrog_props["platform"] = self.config['balrog_platform'] + if "branch" not in balrog_props: + balrog_props["branch"] = self.branch - self.dump_config(props_path, balrog_props) + self.dump_config(props_path, {"properties": balrog_props}) def lock_balrog_rules(self, rule_ids): c = self.config From 2b592ef22478b15a2be1aab586f4f977bfda00fa Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 11 Feb 2018 16:50:47 -0700 Subject: [PATCH 25/48] Bug 1429603: Stop looking at properties from buildbot when generating balrog properties in mozharness; r=jlund Note that this still looks at "buildbot properties" set by mozharness itself. Differential Revision: https://phabricator.services.mozilla.com/D576 --HG-- extra : rebase_source : 7e4771d4f1ffdf0959068462ead1b9b2e1154c64 --- testing/mozharness/mozharness/mozilla/updates/balrog.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/testing/mozharness/mozharness/mozilla/updates/balrog.py b/testing/mozharness/mozharness/mozilla/updates/balrog.py index 07efb921522c..01d8c6dbfd5c 100644 --- a/testing/mozharness/mozharness/mozilla/updates/balrog.py +++ b/testing/mozharness/mozharness/mozilla/updates/balrog.py @@ -15,19 +15,12 @@ class BalrogMixin(object): python = 'python2.7' return python - def generate_balrog_props(self, props_path): self.set_buildbot_property( "hashType", self.config.get("hash_type", "sha512"), write_to_file=True ) - if self.buildbot_config and "properties" in self.buildbot_config: - buildbot_properties = self.buildbot_config["properties"].items() - else: - buildbot_properties = [] - balrog_props = {} - balrog_props.update(buildbot_properties) balrog_props.update(self.buildbot_properties) if self.config.get('stage_platform'): balrog_props['stage_platform'] = self.config['stage_platform'] From 8c3911873a2bbf5fcaf39a166ed15cf83629e1eb Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 11 Feb 2018 16:53:43 -0700 Subject: [PATCH 26/48] Bug 1429603: Set `hashType` in balrog properties in one place in mozharness; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D577 --HG-- extra : rebase_source : 8e401c12c8e031d6f1f18a5b8dc93da5ae7f1f90 --- testing/mozharness/mozharness/mozilla/updates/balrog.py | 6 ++---- testing/mozharness/scripts/desktop_l10n.py | 2 -- testing/mozharness/scripts/mobile_l10n.py | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/testing/mozharness/mozharness/mozilla/updates/balrog.py b/testing/mozharness/mozharness/mozilla/updates/balrog.py index 01d8c6dbfd5c..3eb0df9b833b 100644 --- a/testing/mozharness/mozharness/mozilla/updates/balrog.py +++ b/testing/mozharness/mozharness/mozilla/updates/balrog.py @@ -16,12 +16,10 @@ class BalrogMixin(object): return python def generate_balrog_props(self, props_path): - self.set_buildbot_property( - "hashType", self.config.get("hash_type", "sha512"), write_to_file=True - ) - balrog_props = {} balrog_props.update(self.buildbot_properties) + + balrog_props['hashType'] = self.config.get("hash_type", "sha512") if self.config.get('stage_platform'): balrog_props['stage_platform'] = self.config['stage_platform'] if self.config.get('platform'): diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index 8d3c0851f28a..d010244d310c 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -899,14 +899,12 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, # common values across different locales config = self.config platform = config["platform"] - hashType = config['hashType'] appName = config['appName'] branch = config['branch'] # values from configuration self.set_buildbot_property("branch", branch) self.set_buildbot_property("appName", appName) # it's hardcoded to sha512 in balrog.py - self.set_buildbot_property("hashType", hashType) self.set_buildbot_property("platform", platform) # values common to the current repacks self.set_buildbot_property("buildid", self._query_buildid()) diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py index 078c2268708d..bbc86c59b10b 100755 --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -700,8 +700,6 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, self.set_buildbot_property("appVersion", self.query_version()) self.set_buildbot_property("appName", "Fennec") - # TODO: don't hardcode - self.set_buildbot_property("hashType", "sha512") self.set_buildbot_property("completeMarSize", self.query_filesize(apkfile)) self.set_buildbot_property("completeMarHash", self.query_sha512sum(apkfile)) self.set_buildbot_property("isOSUpdate", False) From 1aa1b3a84251591d7860d43c01f7e4e08f526415 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 11 Feb 2018 17:21:07 -0700 Subject: [PATCH 27/48] Bug 1429603: Get rid of unused builduid in mozharness; r=jlund Differential Revision: https://phabricator.services.mozilla.com/D578 --HG-- extra : rebase_source : 77a864c5010c8efaf19775bf8e0c338f5e40c2d2 --- .../mozharness/mozilla/building/buildbase.py | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/testing/mozharness/mozharness/mozilla/building/buildbase.py b/testing/mozharness/mozharness/mozilla/building/buildbase.py index 07f2e8ba58fd..f403789d35cf 100755 --- a/testing/mozharness/mozharness/mozilla/building/buildbase.py +++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py @@ -693,9 +693,7 @@ class BuildScript(BuildbotMixin, PurgeMixin, BalrogMixin, self.fatal("Please add missing items to your config") self.repo_path = None self.buildid = None - self.builduid = None self.query_buildid() # sets self.buildid - self.query_builduid() # sets self.builduid self.generated_build_props = False self.client_id = None self.access_token = None @@ -828,30 +826,6 @@ or run without that action (ie: --no-{action})" else: return None - def query_builduid(self): - c = self.config - if self.builduid: - return self.builduid - - builduid = None - if c.get("is_automation"): - if self.buildbot_config['properties'].get('builduid'): - self.info("Determining builduid from buildbot properties") - builduid = self.buildbot_config['properties']['builduid'].encode( - 'ascii', 'replace' - ) - - if not builduid: - self.info("Creating builduid through uuid hex") - builduid = generate_build_UID() - - if c.get('is_automation'): - self.set_buildbot_property('builduid', - builduid, - write_to_file=True) - self.builduid = builduid - return self.builduid - def query_buildid(self): c = self.config if self.buildid: From 9a5713c4ac974f7e8b1e7a453febe754d544ded7 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 11 Feb 2018 20:26:01 -0700 Subject: [PATCH 28/48] Bug 1429603: Remove subsitations in `upload_env` for desktop L10N mozharness scripts; r=Callek The configuration doesn't need to be dynamic, so removed the code that existed to support it. Differential Revision: https://phabricator.services.mozilla.com/D542 --HG-- extra : rebase_source : 34b317b846ed4d8c54344b2379bbd4100a8623e5 extra : source : 36171867cedd5160dc230470033a60d31a7fbee5 --- testing/mozharness/scripts/desktop_l10n.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index d010244d310c..9cb47e87bcf0 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -399,17 +399,7 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, return self.upload_env config = self.config - replace_dict = { - 'buildid': self._query_buildid(), - 'version': self.query_version(), - } - if config['branch'] == 'try': - replace_dict.update({ - 'who': self.query_who(), - 'revision': self._query_revision(), - }) - upload_env = self.query_env(partial_env=config.get("upload_env"), - replace_dict=replace_dict) + upload_env = self.query_env(partial_env=config.get("upload_env")) # check if there are any extra option from the platform configuration # and append them to the env From 8d281c3296c5bdcd98e2c6865fdad0d0a025d882 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 11 Feb 2018 20:39:36 -0700 Subject: [PATCH 29/48] Bug 1429603: Remove always false `update_gecko_source_to_enUS` from L10N mozharness scripts; r=Callek Differential Revision: https://phabricator.services.mozilla.com/D543 --HG-- extra : rebase_source : 2f6989ce9d71ddacac030e5eae6045ef468ef9ee extra : source : e8a9a8f0b02d53186bd93364fad7420937e4e9fb --- .../configs/single_locale/tc_common.py | 1 - .../mozharness/configs/single_locale/try.py | 1 - .../single_locale/try_android-api-16.py | 1 - testing/mozharness/scripts/desktop_l10n.py | 44 +------------------ testing/mozharness/scripts/mobile_l10n.py | 37 +--------------- 5 files changed, 2 insertions(+), 82 deletions(-) diff --git a/testing/mozharness/configs/single_locale/tc_common.py b/testing/mozharness/configs/single_locale/tc_common.py index bd284fc5fbad..483e730a6b44 100644 --- a/testing/mozharness/configs/single_locale/tc_common.py +++ b/testing/mozharness/configs/single_locale/tc_common.py @@ -1,7 +1,6 @@ config = { "mozilla_dir": "src/", "simple_name_move": True, - "update_gecko_source_to_enUS": False, # Override the buildbot path to not read it "buildbot_json_path": None, diff --git a/testing/mozharness/configs/single_locale/try.py b/testing/mozharness/configs/single_locale/try.py index 2cd5470d1708..df9fbcf52533 100644 --- a/testing/mozharness/configs/single_locale/try.py +++ b/testing/mozharness/configs/single_locale/try.py @@ -5,7 +5,6 @@ config = { "branch": "try", "en_us_binary_url": "http://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central", "update_channel": "nightly", - "update_gecko_source_to_enUS": False, # l10n "hg_l10n_base": "https://hg.mozilla.org/l10n-central", diff --git a/testing/mozharness/configs/single_locale/try_android-api-16.py b/testing/mozharness/configs/single_locale/try_android-api-16.py index c6457682d7ff..6eb7f0f4b42f 100644 --- a/testing/mozharness/configs/single_locale/try_android-api-16.py +++ b/testing/mozharness/configs/single_locale/try_android-api-16.py @@ -22,7 +22,6 @@ config = { "manifest": "mobile/android/config/tooltool-manifests/android/releng.manifest", "output_dir": "%(abs_work_dir)s/" + MOZILLA_DIR, }, - "update_gecko_source_to_enUS": False, "nightly_build": True, "repos": [{ "vcs": "hg", diff --git a/testing/mozharness/scripts/desktop_l10n.py b/testing/mozharness/scripts/desktop_l10n.py index 9cb47e87bcf0..4c5337083cae 100755 --- a/testing/mozharness/scripts/desktop_l10n.py +++ b/testing/mozharness/scripts/desktop_l10n.py @@ -18,7 +18,7 @@ import subprocess # load modules from parent dir sys.path.insert(1, os.path.dirname(sys.path[0])) -from mozharness.base.errors import BaseErrorList, MakefileErrorList +from mozharness.base.errors import MakefileErrorList from mozharness.base.script import BaseScript from mozharness.base.transfer import TransferMixin from mozharness.base.vcs.vcsbase import VCSMixin @@ -214,7 +214,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, self.bootstrap_env = None self.upload_env = None self.revision = None - self.enUS_revision = None self.version = None self.upload_urls = {} self.locales_property = {} @@ -472,28 +471,12 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, revision = self.buildbot_config['sourcestamp']['revision'] elif self.buildbot_config and self.buildbot_config.get('revision'): revision = self.buildbot_config['revision'] - elif config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() if not revision: self.fatal("Can't determine revision!") self.revision = str(revision) return self.revision - def _query_enUS_revision(self): - """Get revision from the objdir. - Only valid after setup is run. - """ - if self.enUS_revision: - return self.enUS_revision - r = re.compile(r"^(gecko|fx)_revision ([0-9a-f]+\+?)$") - output = self._query_make_ident_output() - for line in output.splitlines(): - match = r.match(line) - if match: - self.enUS_revision = match.groups()[1] - return self.enUS_revision - def _query_make_variable(self, variable, make_args=None): """returns the value of make echo-variable- it accepts extra make arguements (make_args) @@ -615,7 +598,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, def setup(self): """setup step""" - dirs = self.query_abs_dirs() self._run_tooltool() self._copy_mozconfig() self._mach_configure() @@ -624,30 +606,6 @@ class DesktopSingleLocale(LocalesMixin, ReleaseMixin, BuildbotMixin, self.make_unpack_en_US() self.download_mar_tools() - # on try we want the source we already have, otherwise update to the - # same as the en-US binary - if self.config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() - # TODO do this through VCSMixin instead of hardcoding hg - # self.update(dest=dirs["abs_mozilla_dir"], revision=revision) - hg = self.query_exe("hg") - self.run_command([hg, "update", "-r", revision], - cwd=dirs["abs_mozilla_dir"], - env=self.query_bootstrap_env(), - error_list=BaseErrorList, - halt_on_failure=True, fatal_exit_code=3) - # if checkout updates CLOBBER file with a newer timestamp, - # next make -f client.mk configure will delete archives - # downloaded with make wget_en_US, so just touch CLOBBER file - _clobber_file = self._clobber_file() - if os.path.exists(_clobber_file): - self._touch_file(_clobber_file) - # and again... - # thanks to the last hg update, we can be on different firefox 'version' - # than the one on default, - self._mach_configure() - self._run_make_in_config_dir() - def _run_make_in_config_dir(self): """this step creates nsinstall, needed my make_wget_en_US() """ diff --git a/testing/mozharness/scripts/mobile_l10n.py b/testing/mozharness/scripts/mobile_l10n.py index bbc86c59b10b..396e97935495 100755 --- a/testing/mozharness/scripts/mobile_l10n.py +++ b/testing/mozharness/scripts/mobile_l10n.py @@ -25,7 +25,7 @@ except ImportError: # load modules from parent dir sys.path.insert(1, os.path.dirname(sys.path[0])) -from mozharness.base.errors import BaseErrorList, MakefileErrorList +from mozharness.base.errors import MakefileErrorList from mozharness.base.log import OutputParser from mozharness.base.transfer import TransferMixin from mozharness.mozilla.buildbot import BuildbotMixin @@ -162,7 +162,6 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, self.buildid = None self.make_ident_output = None self.repack_env = None - self.enUS_revision = None self.revision = None self.upload_env = None self.version = None @@ -293,28 +292,12 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, revision = self.buildbot_config['sourcestamp']['revision'] elif self.buildbot_config and self.buildbot_config.get('revision'): revision = self.buildbot_config['revision'] - elif config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() if not revision: self.fatal("Can't determine revision!") self.revision = str(revision) return self.revision - def _query_enUS_revision(self): - """Get revision from the objdir. - Only valid after setup is run. - """ - if self.enUS_revision: - return self.enUS_revision - r = re.compile(r"^gecko_revision ([0-9a-f]+\+?)$") - output = self._query_make_ident_output() - for line in output.splitlines(): - match = r.match(line) - if match: - self.enUS_revision = match.groups()[0] - return self.enUS_revision - def _query_make_variable(self, variable, make_args=None): make = self.query_exe('make') env = self.query_repack_env() @@ -497,24 +480,6 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin, error_list=MakefileErrorList, halt_on_failure=True) - # on try we want the source we already have, otherwise update to the - # same as the en-US binary - if self.config.get("update_gecko_source_to_enUS", True): - revision = self._query_enUS_revision() - if not revision: - self.fatal("Can't determine revision!") - hg = self.query_exe("hg") - # TODO do this through VCSMixin instead of hardcoding hg - self.run_command_m([hg, "update", "-r", revision], - cwd=dirs["abs_mozilla_dir"], - env=env, - error_list=BaseErrorList, - halt_on_failure=True) - self.set_buildbot_property('revision', revision, write_to_file=True) - # Configure again since the hg update may have invalidated it. - buildid = self.query_buildid() - self._setup_configure(buildid=buildid) - def repack(self): # TODO per-locale logs and reporting. dirs = self.query_abs_dirs() From 1dfbc7a3317075302e95c6f24dfb53ebf1366fe4 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Fri, 16 Feb 2018 20:42:58 +0200 Subject: [PATCH 30/48] Bug 1430301 - Implement ShadowRoot.elementFromPoint/elementsFromPoint, r=emilio --HG-- extra : rebase_source : 570f17a7a63ea602533910192c04b4e12f082aa8 --- dom/base/DocumentOrShadowRoot.cpp | 117 ++++++++++++++++++ dom/base/DocumentOrShadowRoot.h | 24 ++++ dom/base/nsDocument.cpp | 106 +--------------- dom/base/nsDocument.h | 18 --- dom/base/nsIDocument.h | 34 ++--- dom/webidl/Document.webidl | 2 - dom/webidl/DocumentOrShadowRoot.webidl | 6 +- .../elementsFromPoint-shadowroot.html.ini | 6 - ...owRoot-prototype-elementFromPoint.html.ini | 27 ---- .../shadowroot-methods/test-006.html.ini | 4 - .../shadowroot-methods/test-007.html.ini | 7 -- 11 files changed, 154 insertions(+), 197 deletions(-) delete mode 100644 testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-006.html.ini delete mode 100644 testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-007.html.ini diff --git a/dom/base/DocumentOrShadowRoot.cpp b/dom/base/DocumentOrShadowRoot.cpp index 091d7132aa69..f28f3071edab 100644 --- a/dom/base/DocumentOrShadowRoot.cpp +++ b/dom/base/DocumentOrShadowRoot.cpp @@ -9,6 +9,8 @@ #include "mozilla/dom/StyleSheetList.h" #include "nsDocument.h" #include "nsFocusManager.h" +#include "nsLayoutUtils.h" +#include "nsSVGUtils.h" namespace mozilla { namespace dom { @@ -166,5 +168,120 @@ DocumentOrShadowRoot::GetFullscreenElement() return nullptr; } +Element* +DocumentOrShadowRoot::ElementFromPoint(float aX, float aY) +{ + return ElementFromPointHelper(aX, aY, false, true); +} + +void +DocumentOrShadowRoot::ElementsFromPoint(float aX, float aY, + nsTArray>& aElements) +{ + ElementsFromPointHelper(aX, aY, nsIDocument::FLUSH_LAYOUT, aElements); +} + +Element* +DocumentOrShadowRoot::ElementFromPointHelper(float aX, float aY, + bool aIgnoreRootScrollFrame, + bool aFlushLayout) +{ + AutoTArray, 1> elementArray; + ElementsFromPointHelper(aX, aY, + ((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) | + (aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) | + nsIDocument::IS_ELEMENT_FROM_POINT), + elementArray); + if (elementArray.IsEmpty()) { + return nullptr; + } + return elementArray[0]; +} + +void +DocumentOrShadowRoot::ElementsFromPointHelper(float aX, float aY, + uint32_t aFlags, + nsTArray>& aElements) +{ + // As per the the spec, we return null if either coord is negative + if (!(aFlags & nsIDocument::IGNORE_ROOT_SCROLL_FRAME) && (aX < 0 || aY < 0)) { + return; + } + + nscoord x = nsPresContext::CSSPixelsToAppUnits(aX); + nscoord y = nsPresContext::CSSPixelsToAppUnits(aY); + nsPoint pt(x, y); + + nsCOMPtr doc = AsNode().OwnerDoc(); + + // Make sure the layout information we get is up-to-date, and + // ensure we get a root frame (for everything but XUL) + if (aFlags & nsIDocument::FLUSH_LAYOUT) { + doc->FlushPendingNotifications(FlushType::Layout); + } + + nsIPresShell* ps = doc->GetShell(); + if (!ps) { + return; + } + nsIFrame* rootFrame = ps->GetRootFrame(); + + // XUL docs, unlike HTML, have no frame tree until everything's done loading + if (!rootFrame) { + return; // return null to premature XUL callers as a reminder to wait + } + + nsTArray outFrames; + // Emulate what GetFrameAtPoint does, since we want all the frames under our + // point. + nsLayoutUtils::GetFramesForArea(rootFrame, nsRect(pt, nsSize(1, 1)), outFrames, + nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC | + ((aFlags & nsIDocument::IGNORE_ROOT_SCROLL_FRAME) ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0)); + + // Dunno when this would ever happen, as we should at least have a root frame under us? + if (outFrames.IsEmpty()) { + return; + } + + // Used to filter out repeated elements in sequence. + nsIContent* lastAdded = nullptr; + + for (uint32_t i = 0; i < outFrames.Length(); i++) { + nsIContent* node = doc->GetContentInThisDocument(outFrames[i]); + + if (!node || !node->IsElement()) { + // If this helper is called via ElementsFromPoint, we need to make sure + // our frame is an element. Otherwise return whatever the top frame is + // even if it isn't the top-painted element. + // SVG 'text' element's SVGTextFrame doesn't respond to hit-testing, so + // if 'node' is a child of such an element then we need to manually defer + // to the parent here. + if (!(aFlags & nsIDocument::IS_ELEMENT_FROM_POINT) && + !nsSVGUtils::IsInSVGTextSubtree(outFrames[i])) { + continue; + } + node = node->GetParent(); + if (ShadowRoot* shadow = ShadowRoot::FromNodeOrNull(node)) { + node = shadow->Host(); + } + } + + //XXXsmaug There is plenty of unspec'ed behavior here + // https://github.com/w3c/webcomponents/issues/735 + // https://github.com/w3c/webcomponents/issues/736 + node = Retarget(node); + + if (node && node != lastAdded) { + aElements.AppendElement(node->AsElement()); + lastAdded = node; + // If this helper is called via ElementFromPoint, just return the first + // element we find. + if (aFlags & nsIDocument::IS_ELEMENT_FROM_POINT) { + return; + } + } + } +} + } } diff --git a/dom/base/DocumentOrShadowRoot.h b/dom/base/DocumentOrShadowRoot.h index 3d5dac28e6a7..291426377e63 100644 --- a/dom/base/DocumentOrShadowRoot.h +++ b/dom/base/DocumentOrShadowRoot.h @@ -115,6 +115,30 @@ public: Element* GetPointerLockElement(); Element* GetFullscreenElement(); + + Element* ElementFromPoint(float aX, float aY); + void ElementsFromPoint(float aX, float aY, + nsTArray>& aElements); + + /** + * Helper for nsIDOMDocument::elementFromPoint implementation that allows + * ignoring the scroll frame and/or avoiding layout flushes. + * + * @see nsIDOMWindowUtils::elementFromPoint + */ + Element* ElementFromPointHelper(float aX, float aY, + bool aIgnoreRootScrollFrame, + bool aFlushLayout); + enum ElementsFromPointFlags + { + IGNORE_ROOT_SCROLL_FRAME = 1, + FLUSH_LAYOUT = 2, + IS_ELEMENT_FROM_POINT = 4 + }; + + void ElementsFromPointHelper(float aX, float aY, uint32_t aFlags, + nsTArray>& aElements); + protected: nsIContent* Retarget(nsIContent* aContent) const; diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 1b6b3d889bc9..df0721e1cdbc 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3534,110 +3534,6 @@ nsIDocument::GetCurrentScript() return el; } -Element* -nsIDocument::ElementFromPoint(float aX, float aY) -{ - return ElementFromPointHelper(aX, aY, false, true); -} - -void -nsIDocument::ElementsFromPoint(float aX, float aY, - nsTArray>& aElements) -{ - ElementsFromPointHelper(aX, aY, nsIDocument::FLUSH_LAYOUT, aElements); -} - -Element* -nsDocument::ElementFromPointHelper(float aX, float aY, - bool aIgnoreRootScrollFrame, - bool aFlushLayout) -{ - AutoTArray, 1> elementArray; - ElementsFromPointHelper(aX, aY, - ((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) | - (aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) | - nsIDocument::IS_ELEMENT_FROM_POINT), - elementArray); - if (elementArray.IsEmpty()) { - return nullptr; - } - return elementArray[0]; -} - -void -nsDocument::ElementsFromPointHelper(float aX, float aY, - uint32_t aFlags, - nsTArray>& aElements) -{ - // As per the the spec, we return null if either coord is negative - if (!(aFlags & nsIDocument::IGNORE_ROOT_SCROLL_FRAME) && (aX < 0 || aY < 0)) { - return; - } - - nscoord x = nsPresContext::CSSPixelsToAppUnits(aX); - nscoord y = nsPresContext::CSSPixelsToAppUnits(aY); - nsPoint pt(x, y); - - // Make sure the layout information we get is up-to-date, and - // ensure we get a root frame (for everything but XUL) - if (aFlags & nsIDocument::FLUSH_LAYOUT) { - FlushPendingNotifications(FlushType::Layout); - } - - nsIPresShell *ps = GetShell(); - if (!ps) { - return; - } - nsIFrame *rootFrame = ps->GetRootFrame(); - - // XUL docs, unlike HTML, have no frame tree until everything's done loading - if (!rootFrame) { - return; // return null to premature XUL callers as a reminder to wait - } - - nsTArray outFrames; - // Emulate what GetFrameAtPoint does, since we want all the frames under our - // point. - nsLayoutUtils::GetFramesForArea(rootFrame, nsRect(pt, nsSize(1, 1)), outFrames, - nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC | - ((aFlags & nsIDocument::IGNORE_ROOT_SCROLL_FRAME) ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0)); - - // Dunno when this would ever happen, as we should at least have a root frame under us? - if (outFrames.IsEmpty()) { - return; - } - - // Used to filter out repeated elements in sequence. - nsIContent* lastAdded = nullptr; - - for (uint32_t i = 0; i < outFrames.Length(); i++) { - nsIContent* node = GetContentInThisDocument(outFrames[i]); - - if (!node || !node->IsElement()) { - // If this helper is called via ElementsFromPoint, we need to make sure - // our frame is an element. Otherwise return whatever the top frame is - // even if it isn't the top-painted element. - // SVG 'text' element's SVGTextFrame doesn't respond to hit-testing, so - // if 'node' is a child of such an element then we need to manually defer - // to the parent here. - if (!(aFlags & nsIDocument::IS_ELEMENT_FROM_POINT) && - !nsSVGUtils::IsInSVGTextSubtree(outFrames[i])) { - continue; - } - node = node->GetParent(); - } - if (node && node != lastAdded) { - aElements.AppendElement(node->AsElement()); - lastAdded = node; - // If this helper is called via ElementFromPoint, just return the first - // element we find. - if (aFlags & nsIDocument::IS_ELEMENT_FROM_POINT) { - return; - } - } - } -} - nsresult nsDocument::NodesFromRectHelper(float aX, float aY, float aTopSize, float aRightSize, @@ -8529,7 +8425,7 @@ nsDocument::DoUnblockOnload() } nsIContent* -nsDocument::GetContentInThisDocument(nsIFrame* aFrame) const +nsIDocument::GetContentInThisDocument(nsIFrame* aFrame) const { for (nsIFrame* f = aFrame; f; f = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(f)) { diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h index d015aae0bc8f..2002b5380589 100644 --- a/dom/base/nsDocument.h +++ b/dom/base/nsDocument.h @@ -690,14 +690,6 @@ public: nsAtom* aAttrName, const nsAString& aAttrValue) const override; - virtual Element* ElementFromPointHelper(float aX, float aY, - bool aIgnoreRootScrollFrame, - bool aFlushLayout) override; - - virtual void ElementsFromPointHelper(float aX, float aY, - uint32_t aFlags, - nsTArray>& aElements) override; - virtual nsresult NodesFromRectHelper(float aX, float aY, float aTopSize, float aRightSize, float aBottomSize, float aLeftSize, @@ -1225,16 +1217,6 @@ private: nsresult InitCSP(nsIChannel* aChannel); - /** - * Find the (non-anonymous) content in this document for aFrame. It will - * be aFrame's content node if that content is in this document and not - * anonymous. Otherwise, when aFrame is in a subdocument, we use the frame - * element containing the subdocument containing aFrame, and/or find the - * nearest non-anonymous ancestor in this document. - * Returns null if there is no such element. - */ - nsIContent* GetContentInThisDocument(nsIFrame* aFrame) const; - // Just like EnableStyleSheetsForSet, but doesn't check whether // aSheetSet is null and allows the caller to control whether to set // aSheetSet as the preferred set in the CSSLoader. diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 98d5b0d2ed15..96feed22ff4c 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -2096,26 +2096,6 @@ public: nsAtom* aAttrName, const nsAString& aAttrValue) const = 0; - /** - * Helper for nsIDOMDocument::elementFromPoint implementation that allows - * ignoring the scroll frame and/or avoiding layout flushes. - * - * @see nsIDOMWindowUtils::elementFromPoint - */ - virtual Element* ElementFromPointHelper(float aX, float aY, - bool aIgnoreRootScrollFrame, - bool aFlushLayout) = 0; - - enum ElementsFromPointFlags { - IGNORE_ROOT_SCROLL_FRAME = 1, - FLUSH_LAYOUT = 2, - IS_ELEMENT_FROM_POINT = 4 - }; - - virtual void ElementsFromPointHelper(float aX, float aY, - uint32_t aFlags, - nsTArray>& aElements) = 0; - virtual nsresult NodesFromRectHelper(float aX, float aY, float aTopSize, float aRightSize, float aBottomSize, float aLeftSize, @@ -2955,10 +2935,6 @@ public: void GetPreferredStyleSheetSet(nsAString& aSheetSet); virtual mozilla::dom::DOMStringList* StyleSheetSets() = 0; virtual void EnableStyleSheetsForSet(const nsAString& aSheetSet) = 0; - Element* ElementFromPoint(float aX, float aY); - void ElementsFromPoint(float aX, - float aY, - nsTArray>& aElements); /** * Retrieve the location of the caret position (DOM node and character @@ -3210,6 +3186,16 @@ public: bool ModuleScriptsEnabled(); + /** + * Find the (non-anonymous) content in this document for aFrame. It will + * be aFrame's content node if that content is in this document and not + * anonymous. Otherwise, when aFrame is in a subdocument, we use the frame + * element containing the subdocument containing aFrame, and/or find the + * nearest non-anonymous ancestor in this document. + * Returns null if there is no such element. + */ + nsIContent* GetContentInThisDocument(nsIFrame* aFrame) const; + protected: bool GetUseCounter(mozilla::UseCounter aUseCounter) { diff --git a/dom/webidl/Document.webidl b/dom/webidl/Document.webidl index efcfa38e00a8..b116b3008e8c 100644 --- a/dom/webidl/Document.webidl +++ b/dom/webidl/Document.webidl @@ -285,8 +285,6 @@ partial interface Document { // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-document-interface partial interface Document { - Element? elementFromPoint (float x, float y); - sequence elementsFromPoint (float x, float y); CaretPosition? caretPositionFromPoint (float x, float y); readonly attribute Element? scrollingElement; diff --git a/dom/webidl/DocumentOrShadowRoot.webidl b/dom/webidl/DocumentOrShadowRoot.webidl index d28ae0d159e3..8a288f6151cc 100644 --- a/dom/webidl/DocumentOrShadowRoot.webidl +++ b/dom/webidl/DocumentOrShadowRoot.webidl @@ -12,10 +12,8 @@ interface DocumentOrShadowRoot { // Not implemented yet: bug 1430308. // Selection? getSelection(); - // Not implemented yet: bug 1430301. - // Element? elementFromPoint (float x, float y); - // Not implemented yet: bug 1430301. - // sequence elementsFromPoint (float x, float y); + Element? elementFromPoint (float x, float y); + sequence elementsFromPoint (float x, float y); // Not implemented yet: bug 1430307. // CaretPosition? caretPositionFromPoint (float x, float y); diff --git a/testing/web-platform/meta/css/cssom-view/elementsFromPoint-shadowroot.html.ini b/testing/web-platform/meta/css/cssom-view/elementsFromPoint-shadowroot.html.ini index 7357502399af..8be571d2508b 100644 --- a/testing/web-platform/meta/css/cssom-view/elementsFromPoint-shadowroot.html.ini +++ b/testing/web-platform/meta/css/cssom-view/elementsFromPoint-shadowroot.html.ini @@ -1,8 +1,2 @@ [elementsFromPoint-shadowroot.html] prefs: [dom.webcomponents.shadowdom.enabled:true] - [elementsFromPoint on the document root should not return elements in shadow trees] - expected: FAIL - - [elementsFromPoint on a shadow root should include elements in that shadow tree] - expected: FAIL - diff --git a/testing/web-platform/meta/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html.ini b/testing/web-platform/meta/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html.ini index 908827fb1aa1..666335a0a6fc 100644 --- a/testing/web-platform/meta/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html.ini +++ b/testing/web-platform/meta/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html.ini @@ -1,13 +1,4 @@ [DocumentOrShadowRoot-prototype-elementFromPoint.html] - expected: - if debug and not stylo and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): CRASH - if debug and not stylo and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): CRASH - if debug and stylo and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): CRASH - if debug and stylo and not e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): CRASH - if debug and stylo and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): CRASH - if debug and stylo and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): CRASH - if debug and stylo and e10s and (os == "win") and (version == "10.0.15063") and (processor == "x86_64") and (bits == 64): CRASH - if debug and stylo and e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): CRASH [document.elementFromPoint and shadow.ElementFromPoint must return the shadow host of the hit-tested text node when the hit-tested text node is a direct child of the root and the host has display: inline] expected: FAIL @@ -35,24 +26,6 @@ [document.elementFromPoint and shadowRoot.elementFromPoint must return the element assigned to a slot when hit-tested text node under an element is assigned to a slot in the shadow tree and the shadow host of the slot has display: inline-block] expected: FAIL - [document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: inline] - expected: FAIL - - [document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: block] - expected: FAIL - - [document.elementFromPoint must return the shadow host of the hit-tested element under a shadow root and shadowRoot.elementFromPoint must return the element parent of the hit-tested text node under the point when the shadow host has display: inline-block] - expected: FAIL - - [document.elementFromPoint must return the shadow host and shadowRoot.elementFromPoint must return the slot parent of the fallback text when the hit-tested text node is a fallback content and the host has display: inline] - expected: FAIL - - [document.elementFromPoint must return the shadow host and shadowRoot.elementFromPoint must return the slot parent of the fallback text when the hit-tested text node is a fallback content and the host has display: block] - expected: FAIL - - [document.elementFromPoint must return the shadow host and shadowRoot.elementFromPoint must return the slot parent of the fallback text when the hit-tested text node is a fallback content and the host has display: inline-block] - expected: FAIL - [document.elementFromPoint, shadowRoot.elementFromPoint, innerShadow.elementFromPoint must return a child element assigned to a slot when the hit-tested text node is assigned to a slot in the shadow tree of the child element and the outer shadow host has display: inline] expected: FAIL diff --git a/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-006.html.ini b/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-006.html.ini deleted file mode 100644 index b7c73494f2f6..000000000000 --- a/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-006.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[test-006.html] - [A_10_01_02_06_01_T02] - expected: FAIL - diff --git a/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-007.html.ini b/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-007.html.ini deleted file mode 100644 index 1a173f7dcb3d..000000000000 --- a/testing/web-platform/meta/shadow-dom/untriaged/elements-and-dom-objects/shadowroot-object/shadowroot-methods/test-007.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[test-007.html] - [A_10_01_02_06_02_T01] - expected: FAIL - - [A_10_01_02_06_02_T02] - expected: FAIL - From d69f427e5229d172a31ebeae0f1db983fe6beda3 Mon Sep 17 00:00:00 2001 From: Geoff Brown Date: Fri, 16 Feb 2018 12:09:16 -0700 Subject: [PATCH 31/48] Bug 1427236 - Disable mochitest layout/base/tests/test_bug607529.html on Android/opt for frequent intermittent failures; r=me,a=test-only --- layout/base/tests/mochitest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/layout/base/tests/mochitest.ini b/layout/base/tests/mochitest.ini index 47d45cd35b44..37a82d3a78ce 100644 --- a/layout/base/tests/mochitest.ini +++ b/layout/base/tests/mochitest.ini @@ -63,6 +63,7 @@ support-files = [test_bug603550.html] skip-if = toolkit == 'android' # Doesn't work on Android [test_bug607529.html] +skip-if = (toolkit == 'android' && !debug) support-files = file_bug607529.html file_bug607529-1.html From e46e537e06ee26cf972f6302b8cb24d1662262c7 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Tue, 16 Jan 2018 15:10:54 -0600 Subject: [PATCH 32/48] Bug 1437955 - Part 1: Split ParseNodeKind::Semi into ExpressionStatement and EmptyStatement. r=Waldo. --HG-- extra : rebase_source : 69fab597bdba8ed555c83ef94a4fa737a2ecbdce --- js/src/builtin/ReflectParse.cpp | 18 ++++++------ js/src/frontend/BytecodeEmitter.cpp | 34 +++++++++++------------ js/src/frontend/BytecodeEmitter.h | 2 +- js/src/frontend/FoldConstants.cpp | 6 ++-- js/src/frontend/FullParseHandler.h | 7 +++-- js/src/frontend/NameFunctions.cpp | 3 +- js/src/frontend/ParseNode.cpp | 5 ++-- js/src/frontend/ParseNode.h | 16 ++++++----- js/src/wasm/AsmJS.cpp | 43 ++++++++++++++--------------- 9 files changed, 68 insertions(+), 66 deletions(-) diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp index b222b7a09885..155ffb3dd2a9 100644 --- a/js/src/builtin/ReflectParse.cpp +++ b/js/src/builtin/ReflectParse.cpp @@ -2278,14 +2278,17 @@ ASTSerializer::statement(ParseNode* pn, MutableHandleValue dst) case ParseNodeKind::ExportFrom: return exportDeclaration(pn, dst); - case ParseNodeKind::Semi: - if (pn->pn_kid) { - RootedValue expr(cx); - return expression(pn->pn_kid, &expr) && - builder.expressionStatement(expr, &pn->pn_pos, dst); - } + case ParseNodeKind::Nop: + case ParseNodeKind::EmptyStatement: return builder.emptyStatement(&pn->pn_pos, dst); + case ParseNodeKind::ExpressionStatement: + { + RootedValue expr(cx); + return expression(pn->pn_kid, &expr) && + builder.expressionStatement(expr, &pn->pn_pos, dst); + } + case ParseNodeKind::LexicalScope: pn = pn->pn_expr; if (!pn->isKind(ParseNodeKind::StatementList)) @@ -2456,9 +2459,6 @@ ASTSerializer::statement(ParseNode* pn, MutableHandleValue dst) return builder.classMethods(methods, dst); } - case ParseNodeKind::Nop: - return builder.emptyStatement(&pn->pn_pos, dst); - default: LOCAL_NOT_REACHED("unexpected statement type"); } diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 277719ceafae..0566ef0358fb 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -3068,6 +3068,7 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer) switch (pn->getKind()) { // Trivial cases with no side effects. case ParseNodeKind::Nop: + case ParseNodeKind::EmptyStatement: case ParseNodeKind::String: case ParseNodeKind::TemplateString: case ParseNodeKind::RegExp: @@ -3199,12 +3200,9 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer) return checkSideEffects(expr, answer); } - case ParseNodeKind::Semi: + case ParseNodeKind::ExpressionStatement: MOZ_ASSERT(pn->isArity(PN_UNARY)); - if (ParseNode* expr = pn->pn_kid) - return checkSideEffects(expr, answer); - *answer = false; - return true; + return checkSideEffects(pn->pn_kid, answer); // Binary cases with obvious side effects. case ParseNodeKind::Assign: @@ -8714,13 +8712,9 @@ BytecodeEmitter::emitStatementList(ParseNode* pn) } bool -BytecodeEmitter::emitStatement(ParseNode* pn) +BytecodeEmitter::emitExpressionStatement(ParseNode* pn) { - MOZ_ASSERT(pn->isKind(ParseNodeKind::Semi)); - - ParseNode* pn2 = pn->pn_kid; - if (!pn2) - return true; + MOZ_ASSERT(pn->isKind(ParseNodeKind::ExpressionStatement)); if (!updateSourceCoordNotes(pn->pn_pos.begin)) return false; @@ -8742,8 +8736,9 @@ BytecodeEmitter::emitStatement(ParseNode* pn) useful = wantval = !script->noScriptRval(); /* Don't eliminate expressions with side effects. */ + ParseNode* expr = pn->pn_kid; if (!useful) { - if (!checkSideEffects(pn2, &useful)) + if (!checkSideEffects(expr, &useful)) return false; /* @@ -8762,8 +8757,8 @@ BytecodeEmitter::emitStatement(ParseNode* pn) if (useful) { JSOp op = wantval ? JSOP_SETRVAL : JSOP_POP; ValueUsage valueUsage = wantval ? ValueUsage::WantValue : ValueUsage::IgnoreValue; - MOZ_ASSERT_IF(pn2->isKind(ParseNodeKind::Assign), pn2->isOp(JSOP_NOP)); - if (!emitTree(pn2, valueUsage)) + MOZ_ASSERT_IF(expr->isKind(ParseNodeKind::Assign), expr->isOp(JSOP_NOP)); + if (!emitTree(expr, valueUsage)) return false; if (!emit1(op)) return false; @@ -8789,11 +8784,11 @@ BytecodeEmitter::emitStatement(ParseNode* pn) } if (directive) { - if (!reportExtraWarning(pn2, JSMSG_CONTRARY_NONDIRECTIVE, directive)) + if (!reportExtraWarning(expr, JSMSG_CONTRARY_NONDIRECTIVE, directive)) return false; } } else { - if (!reportExtraWarning(pn2, JSMSG_USELESS_EXPR)) + if (!reportExtraWarning(expr, JSMSG_USELESS_EXPR)) return false; } } @@ -10742,8 +10737,11 @@ BytecodeEmitter::emitTree(ParseNode* pn, ValueUsage valueUsage /* = ValueUsage:: return false; break; - case ParseNodeKind::Semi: - if (!emitStatement(pn)) + case ParseNodeKind::EmptyStatement: + break; + + case ParseNodeKind::ExpressionStatement: + if (!emitExpressionStatement(pn)) return false; break; diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index f4d26341f85d..577f90a912c0 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -767,7 +767,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter MOZ_MUST_USE bool emitAssignment(ParseNode* lhs, ParseNodeKind pnk, ParseNode* rhs); MOZ_MUST_USE bool emitReturn(ParseNode* pn); - MOZ_MUST_USE bool emitStatement(ParseNode* pn); + MOZ_MUST_USE bool emitExpressionStatement(ParseNode* pn); MOZ_MUST_USE bool emitStatementList(ParseNode* pn); MOZ_MUST_USE bool emitDeleteName(ParseNode* pn); diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp index 2913676b6525..81136e96d697 100644 --- a/js/src/frontend/FoldConstants.cpp +++ b/js/src/frontend/FoldConstants.cpp @@ -103,13 +103,14 @@ ContainsHoistedDeclaration(JSContext* cx, ParseNode* node, bool* result) // Statements with no sub-components at all. case ParseNodeKind::Nop: // induced by function f() {} function f() {} + case ParseNodeKind::EmptyStatement: case ParseNodeKind::Debugger: MOZ_ASSERT(node->isArity(PN_NULLARY)); *result = false; return true; // Statements containing only an expression have no declarations. - case ParseNodeKind::Semi: + case ParseNodeKind::ExpressionStatement: case ParseNodeKind::Throw: case ParseNodeKind::Return: MOZ_ASSERT(node->isArity(PN_UNARY)); @@ -1591,6 +1592,7 @@ Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser& parser) switch (pn->getKind()) { case ParseNodeKind::Nop: + case ParseNodeKind::EmptyStatement: case ParseNodeKind::RegExp: case ParseNodeKind::String: case ParseNodeKind::True: @@ -1655,6 +1657,7 @@ Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser& parser) case ParseNodeKind::PostDecrement: return FoldIncrementDecrement(cx, pn, parser); + case ParseNodeKind::ExpressionStatement: case ParseNodeKind::Throw: case ParseNodeKind::MutateProto: case ParseNodeKind::ComputedName: @@ -1668,7 +1671,6 @@ Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser& parser) MOZ_ASSERT(pn->isArity(PN_BINARY)); return Fold(cx, &pn->pn_left, parser); - case ParseNodeKind::Semi: case ParseNodeKind::This: MOZ_ASSERT(pn->isArity(PN_UNARY)); if (ParseNode*& expr = pn->pn_kid) diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h index 9ac5c893860a..d9108322537b 100644 --- a/js/src/frontend/FullParseHandler.h +++ b/js/src/frontend/FullParseHandler.h @@ -494,7 +494,7 @@ class FullParseHandler } ParseNode* newEmptyStatement(const TokenPos& pos) { - return new_(ParseNodeKind::Semi, pos, nullptr); + return new_(ParseNodeKind::EmptyStatement, pos); } ParseNode* newImportDeclaration(ParseNode* importSpecSet, @@ -541,7 +541,8 @@ class FullParseHandler ParseNode* newExprStatement(ParseNode* expr, uint32_t end) { MOZ_ASSERT(expr->pn_pos.end <= end); - return new_(ParseNodeKind::Semi, TokenPos(expr->pn_pos.begin, end), expr); + return new_(ParseNodeKind::ExpressionStatement, + TokenPos(expr->pn_pos.begin, end), expr); } ParseNode* newIfStatement(uint32_t begin, ParseNode* cond, ParseNode* thenBranch, @@ -777,7 +778,7 @@ class FullParseHandler kind == ParseNodeKind::Var || kind == ParseNodeKind::Break || kind == ParseNodeKind::Throw || - (kind == ParseNodeKind::Semi && !node->pn_kid); + kind == ParseNodeKind::EmptyStatement; } bool isSuperBase(ParseNode* node) { diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp index fe9f4f94bf44..1cfd233a88f6 100644 --- a/js/src/frontend/NameFunctions.cpp +++ b/js/src/frontend/NameFunctions.cpp @@ -389,6 +389,7 @@ class NameResolver // Nodes with no children that might require name resolution need no // further work. case ParseNodeKind::Nop: + case ParseNodeKind::EmptyStatement: case ParseNodeKind::String: case ParseNodeKind::TemplateString: case ParseNodeKind::RegExp: @@ -422,6 +423,7 @@ class NameResolver break; // Nodes with a single non-null child requiring name resolution. + case ParseNodeKind::ExpressionStatement: case ParseNodeKind::TypeOfExpr: case ParseNodeKind::Void: case ParseNodeKind::Not: @@ -447,7 +449,6 @@ class NameResolver break; // Nodes with a single nullable child. - case ParseNodeKind::Semi: case ParseNodeKind::This: MOZ_ASSERT(cur->isArity(PN_UNARY)); if (ParseNode* expr = cur->pn_kid) { diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp index fdcf44f5fd4b..1bec10ed3ac3 100644 --- a/js/src/frontend/ParseNode.cpp +++ b/js/src/frontend/ParseNode.cpp @@ -184,6 +184,7 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack) // Trivial nodes that refer to no nodes, are referred to by nothing // but their parents, are never used, and are never a definition. case ParseNodeKind::Nop: + case ParseNodeKind::EmptyStatement: case ParseNodeKind::String: case ParseNodeKind::TemplateString: case ParseNodeKind::RegExp: @@ -204,6 +205,7 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack) return PushResult::Recyclable; // Nodes with a single non-null child. + case ParseNodeKind::ExpressionStatement: case ParseNodeKind::TypeOfName: case ParseNodeKind::TypeOfExpr: case ParseNodeKind::Void: @@ -228,8 +230,7 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack) return PushUnaryNodeChild(pn, stack); // Nodes with a single nullable child. - case ParseNodeKind::This: - case ParseNodeKind::Semi: { + case ParseNodeKind::This: { MOZ_ASSERT(pn->isArity(PN_UNARY)); if (pn->pn_kid) stack->push(pn->pn_kid); diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index fdb2657bafe5..a3416a2687dc 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -44,7 +44,8 @@ class ObjectBox; #define FOR_EACH_PARSE_NODE_KIND(F) \ F(Nop) \ - F(Semi) \ + F(EmptyStatement) \ + F(ExpressionStatement) \ F(Comma) \ F(Conditional) \ F(Colon) \ @@ -305,10 +306,11 @@ IsTypeofKind(ParseNodeKind kind) * pn_lexdef (NOT pn_expr) set * pn_right: initializer * Return unary pn_kid: return expr or null - * Semi unary pn_kid: expr or null statement - * pn_prologue: true if Directive Prologue member - * in original source, not introduced via - * constant folding or other tree rewriting + * ExpressionStatement unary pn_kid: expr + * pn_prologue: true if Directive Prologue member + * in original source, not introduced via + * constant folding or other tree rewriting + * EmptyStatement nullary (no fields) * Label name pn_atom: label, pn_expr: labeled statement * Import binary pn_left: ImportSpecList import specifiers * pn_right: String module specifier @@ -683,10 +685,10 @@ class ParseNode * nodes; we use it to determine the extent of the prologue. */ JSAtom* isStringExprStatement() const { - if (getKind() == ParseNodeKind::Semi) { + if (getKind() == ParseNodeKind::ExpressionStatement) { MOZ_ASSERT(pn_arity == PN_UNARY); ParseNode* kid = pn_kid; - if (kid && kid->getKind() == ParseNodeKind::String && !kid->pn_parens) + if (kid->getKind() == ParseNodeKind::String && !kid->pn_parens) return kid->pn_atom; } return nullptr; diff --git a/js/src/wasm/AsmJS.cpp b/js/src/wasm/AsmJS.cpp index 24ab6bcb8a71..74653193cd95 100644 --- a/js/src/wasm/AsmJS.cpp +++ b/js/src/wasm/AsmJS.cpp @@ -584,13 +584,13 @@ ComparisonRight(ParseNode* pn) static inline bool IsExpressionStatement(ParseNode* pn) { - return pn->isKind(ParseNodeKind::Semi); + return pn->isKind(ParseNodeKind::ExpressionStatement); } static inline ParseNode* ExpressionStatementExpr(ParseNode* pn) { - MOZ_ASSERT(pn->isKind(ParseNodeKind::Semi)); + MOZ_ASSERT(pn->isKind(ParseNodeKind::ExpressionStatement)); return UnaryKid(pn); } @@ -730,8 +730,7 @@ IsIgnoredDirectiveName(JSContext* cx, JSAtom* atom) static inline bool IsIgnoredDirective(JSContext* cx, ParseNode* pn) { - return pn->isKind(ParseNodeKind::Semi) && - UnaryKid(pn) && + return pn->isKind(ParseNodeKind::ExpressionStatement) && UnaryKid(pn)->isKind(ParseNodeKind::String) && IsIgnoredDirectiveName(cx, UnaryKid(pn)->pn_atom); } @@ -739,7 +738,7 @@ IsIgnoredDirective(JSContext* cx, ParseNode* pn) static inline bool IsEmptyStatement(ParseNode* pn) { - return pn->isKind(ParseNodeKind::Semi) && !UnaryKid(pn); + return pn->isKind(ParseNodeKind::EmptyStatement); } static inline ParseNode* @@ -3890,7 +3889,7 @@ CheckArgumentType(FunctionValidator& f, ParseNode* stmt, PropertyName* name, Typ return ArgFail(f, name, stmt ? stmt : f.fn()); ParseNode* initNode = ExpressionStatementExpr(stmt); - if (!initNode || !initNode->isKind(ParseNodeKind::Assign)) + if (!initNode->isKind(ParseNodeKind::Assign)) return ArgFail(f, name, stmt); ParseNode* argNode = BinaryLeft(initNode); @@ -6567,11 +6566,8 @@ CheckAsExprStatement(FunctionValidator& f, ParseNode* expr) static bool CheckExprStatement(FunctionValidator& f, ParseNode* exprStmt) { - MOZ_ASSERT(exprStmt->isKind(ParseNodeKind::Semi)); - ParseNode* expr = UnaryKid(exprStmt); - if (!expr) - return true; - return CheckAsExprStatement(f, expr); + MOZ_ASSERT(exprStmt->isKind(ParseNodeKind::ExpressionStatement)); + return CheckAsExprStatement(f, UnaryKid(exprStmt)); } static bool @@ -7152,18 +7148,19 @@ CheckStatement(FunctionValidator& f, ParseNode* stmt) return f.m().failOverRecursed(); switch (stmt->getKind()) { - case ParseNodeKind::Semi: return CheckExprStatement(f, stmt); - case ParseNodeKind::While: return CheckWhile(f, stmt); - case ParseNodeKind::For: return CheckFor(f, stmt); - case ParseNodeKind::DoWhile: return CheckDoWhile(f, stmt); - case ParseNodeKind::Label: return CheckLabel(f, stmt); - case ParseNodeKind::If: return CheckIf(f, stmt); - case ParseNodeKind::Switch: return CheckSwitch(f, stmt); - case ParseNodeKind::Return: return CheckReturn(f, stmt); - case ParseNodeKind::StatementList: return CheckStatementList(f, stmt); - case ParseNodeKind::Break: return CheckBreakOrContinue(f, true, stmt); - case ParseNodeKind::Continue: return CheckBreakOrContinue(f, false, stmt); - case ParseNodeKind::LexicalScope: return CheckLexicalScope(f, stmt); + case ParseNodeKind::EmptyStatement: return true; + case ParseNodeKind::ExpressionStatement: return CheckExprStatement(f, stmt); + case ParseNodeKind::While: return CheckWhile(f, stmt); + case ParseNodeKind::For: return CheckFor(f, stmt); + case ParseNodeKind::DoWhile: return CheckDoWhile(f, stmt); + case ParseNodeKind::Label: return CheckLabel(f, stmt); + case ParseNodeKind::If: return CheckIf(f, stmt); + case ParseNodeKind::Switch: return CheckSwitch(f, stmt); + case ParseNodeKind::Return: return CheckReturn(f, stmt); + case ParseNodeKind::StatementList: return CheckStatementList(f, stmt); + case ParseNodeKind::Break: return CheckBreakOrContinue(f, true, stmt); + case ParseNodeKind::Continue: return CheckBreakOrContinue(f, false, stmt); + case ParseNodeKind::LexicalScope: return CheckLexicalScope(f, stmt); default:; } From 6b46f9a3ea9c453b68066d1e8469bc82002fd587 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Tue, 16 Jan 2018 15:12:04 -0600 Subject: [PATCH 33/48] Bug 1437955 - Part 2: Remove unused ParseNodeKind::Nop. r=Waldo. --HG-- extra : rebase_source : f5af2048781f79275389f390cc922080407d4342 --- js/src/builtin/ReflectParse.cpp | 1 - js/src/frontend/BinSource.cpp | 2 -- js/src/frontend/BytecodeEmitter.cpp | 5 ----- js/src/frontend/FoldConstants.cpp | 2 -- js/src/frontend/NameFunctions.cpp | 1 - js/src/frontend/ParseNode.cpp | 1 - js/src/frontend/ParseNode.h | 1 - 7 files changed, 13 deletions(-) diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp index 155ffb3dd2a9..27d1b1fe4b1f 100644 --- a/js/src/builtin/ReflectParse.cpp +++ b/js/src/builtin/ReflectParse.cpp @@ -2278,7 +2278,6 @@ ASTSerializer::statement(ParseNode* pn, MutableHandleValue dst) case ParseNodeKind::ExportFrom: return exportDeclaration(pn, dst); - case ParseNodeKind::Nop: case ParseNodeKind::EmptyStatement: return builder.emptyStatement(&pn->pn_pos, dst); diff --git a/js/src/frontend/BinSource.cpp b/js/src/frontend/BinSource.cpp index 18091bf50b22..1a46871a9aeb 100644 --- a/js/src/frontend/BinSource.cpp +++ b/js/src/frontend/BinSource.cpp @@ -1217,8 +1217,6 @@ BinASTParser::parseVariableDeclarationAux(const BinKind kind, const BinFields& f return raiseMissingField("VariableDeclaration", BinField::Declarations); result->setKind(pnk); - - MOZ_ASSERT(!result->isKind(ParseNodeKind::Nop)); } return result; diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 0566ef0358fb..091eff5a9bb7 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -3067,7 +3067,6 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer) switch (pn->getKind()) { // Trivial cases with no side effects. - case ParseNodeKind::Nop: case ParseNodeKind::EmptyStatement: case ParseNodeKind::String: case ParseNodeKind::TemplateString: @@ -10988,10 +10987,6 @@ BytecodeEmitter::emitTree(ParseNode* pn, ValueUsage valueUsage /* = ValueUsage:: return false; break; - case ParseNodeKind::Nop: - MOZ_ASSERT(pn->getArity() == PN_NULLARY); - break; - case ParseNodeKind::Class: if (!emitClass(pn)) return false; diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp index 81136e96d697..0ea69d0053b7 100644 --- a/js/src/frontend/FoldConstants.cpp +++ b/js/src/frontend/FoldConstants.cpp @@ -102,7 +102,6 @@ ContainsHoistedDeclaration(JSContext* cx, ParseNode* node, bool* result) return true; // Statements with no sub-components at all. - case ParseNodeKind::Nop: // induced by function f() {} function f() {} case ParseNodeKind::EmptyStatement: case ParseNodeKind::Debugger: MOZ_ASSERT(node->isArity(PN_NULLARY)); @@ -1591,7 +1590,6 @@ Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser& parser) ParseNode* pn = *pnp; switch (pn->getKind()) { - case ParseNodeKind::Nop: case ParseNodeKind::EmptyStatement: case ParseNodeKind::RegExp: case ParseNodeKind::String: diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp index 1cfd233a88f6..b17b6ca3eacf 100644 --- a/js/src/frontend/NameFunctions.cpp +++ b/js/src/frontend/NameFunctions.cpp @@ -388,7 +388,6 @@ class NameResolver switch (cur->getKind()) { // Nodes with no children that might require name resolution need no // further work. - case ParseNodeKind::Nop: case ParseNodeKind::EmptyStatement: case ParseNodeKind::String: case ParseNodeKind::TemplateString: diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp index 1bec10ed3ac3..16aba5c92950 100644 --- a/js/src/frontend/ParseNode.cpp +++ b/js/src/frontend/ParseNode.cpp @@ -183,7 +183,6 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack) switch (pn->getKind()) { // Trivial nodes that refer to no nodes, are referred to by nothing // but their parents, are never used, and are never a definition. - case ParseNodeKind::Nop: case ParseNodeKind::EmptyStatement: case ParseNodeKind::String: case ParseNodeKind::TemplateString: diff --git a/js/src/frontend/ParseNode.h b/js/src/frontend/ParseNode.h index a3416a2687dc..c674da56d41d 100644 --- a/js/src/frontend/ParseNode.h +++ b/js/src/frontend/ParseNode.h @@ -43,7 +43,6 @@ class FunctionBox; class ObjectBox; #define FOR_EACH_PARSE_NODE_KIND(F) \ - F(Nop) \ F(EmptyStatement) \ F(ExpressionStatement) \ F(Comma) \ From f668fe528ea040390f9661722ca9e4b02e5ce36f Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Fri, 16 Feb 2018 12:40:43 +0000 Subject: [PATCH 34/48] Bug 1438674 - For non-OpenType/TrueType fonts, use synthesized glyph origin & advance for vertical shaping, rather than just refusing to use the font. r=dholbert --- gfx/thebes/gfxHarfBuzzShaper.cpp | 74 +++++++++++++++++++------------- gfx/thebes/gfxHarfBuzzShaper.h | 9 +++- 2 files changed, 51 insertions(+), 32 deletions(-) diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp index e231b7ac138d..c57504a4d9db 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp @@ -55,6 +55,7 @@ gfxHarfBuzzShaper::gfxHarfBuzzShaper(gfxFont *aFont) mUVSTableOffset(0), mNumLongHMetrics(0), mNumLongVMetrics(0), + mDefaultVOrg(-1.0), mUseFontGetGlyph(aFont->ProvidesGetGlyph()), mUseFontGlyphWidths(false), mInitialized(false), @@ -422,15 +423,17 @@ gfxHarfBuzzShaper::HBGetGlyphVOrigin(hb_font_t *font, void *font_data, { const gfxHarfBuzzShaper::FontCallbackData *fcd = static_cast(font_data); - fcd->mShaper->GetGlyphVOrigin(glyph, x, y); + fcd->mShaper->GetGlyphVOrigin(*fcd->mDrawTarget, glyph, x, y); return true; } void -gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph, +gfxHarfBuzzShaper::GetGlyphVOrigin(DrawTarget& aDT, hb_codepoint_t aGlyph, hb_position_t *aX, hb_position_t *aY) const { - *aX = 0.5 * GetGlyphHAdvance(aGlyph); + *aX = 0.5 * (mUseFontGlyphWidths + ? mFont->GetGlyphWidth(aDT, aGlyph) + : GetGlyphHAdvance(aGlyph)); if (mVORGTable) { // We checked in Initialize() that the VORG table is safely readable, @@ -493,27 +496,42 @@ gfxHarfBuzzShaper::GetGlyphVOrigin(hb_codepoint_t aGlyph, } } - // XXX should we consider using OS/2 sTypo* metrics if available? + if (mDefaultVOrg < 0.0) { + // XXX should we consider using OS/2 sTypo* metrics if available? - gfxFontEntry::AutoTable hheaTable(GetFont()->GetFontEntry(), - TRUETYPE_TAG('h','h','e','a')); - if (hheaTable) { - uint32_t len; - const MetricsHeader* hhea = - reinterpret_cast(hb_blob_get_data(hheaTable, - &len)); - if (len >= sizeof(MetricsHeader)) { - // divide up the default advance we're using (1em) in proportion - // to ascender:descender from the hhea table - int16_t a = int16_t(hhea->ascender); - int16_t d = int16_t(hhea->descender); - *aY = FloatToFixed(GetFont()->GetAdjustedSize() * a / (a - d)); - return; + gfxFontEntry::AutoTable hheaTable(GetFont()->GetFontEntry(), + TRUETYPE_TAG('h','h','e','a')); + if (hheaTable) { + uint32_t len; + const MetricsHeader* hhea = + reinterpret_cast(hb_blob_get_data(hheaTable, + &len)); + if (len >= sizeof(MetricsHeader)) { + // divide up the default advance we're using (1em) in proportion + // to ascender:descender from the hhea table + int16_t a = int16_t(hhea->ascender); + int16_t d = int16_t(hhea->descender); + mDefaultVOrg = + FloatToFixed(GetFont()->GetAdjustedSize() * a / (a - d)); + } + } + + if (mDefaultVOrg < 0.0) { + // Last resort, for non-sfnt fonts: get the horizontal metrics and + // compute a default VOrg from their ascent and descent. + const gfxFont::Metrics& mtx = mFont->GetHorizontalMetrics(); + gfxFloat advance = mFont->GetMetrics(gfxFont::eVertical).aveCharWidth; + gfxFloat ascent = mtx.emAscent; + gfxFloat height = ascent + mtx.emDescent; + // vOrigin that will place the glyph so that its origin is shifted + // down most of the way within overall (vertical) advance, in + // proportion to the font ascent as a part of the overall font + // height. + mDefaultVOrg = FloatToFixed(advance * ascent / height); } } - NS_NOTREACHED("we shouldn't be here!"); - *aY = FloatToFixed(GetFont()->GetAdjustedSize() / 2); + *aY = mDefaultVOrg; } static hb_bool_t @@ -1331,19 +1349,19 @@ gfxHarfBuzzShaper::LoadHmtxTable() return true; } -bool +void gfxHarfBuzzShaper::InitializeVertical() { - // We only try this once. If we don't have a mHmtxTable after that, - // this font can't handle vertical shaping, so return false. + // We only do this once. If we don't have a mHmtxTable after that, + // we'll be making up fallback metrics. if (mVerticalInitialized) { - return mHmtxTable != nullptr; + return; } mVerticalInitialized = true; if (!mHmtxTable) { if (!LoadHmtxTable()) { - return false; + return; } } @@ -1404,8 +1422,6 @@ gfxHarfBuzzShaper::InitializeVertical() } } } - - return true; } bool @@ -1431,9 +1447,7 @@ gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget, } if (aVertical) { - if (!InitializeVertical()) { - return false; - } + InitializeVertical(); if (!mFont->GetFontEntry()-> SupportsOpenTypeFeature(aScript, HB_TAG('v','e','r','t'))) { mUseVerticalPresentationForms = true; diff --git a/gfx/thebes/gfxHarfBuzzShaper.h b/gfx/thebes/gfxHarfBuzzShaper.h index bbcd632039ca..b8d292458d4d 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.h +++ b/gfx/thebes/gfxHarfBuzzShaper.h @@ -52,7 +52,8 @@ public: hb_position_t GetGlyphVAdvance(hb_codepoint_t glyph) const; - void GetGlyphVOrigin(hb_codepoint_t aGlyph, + void GetGlyphVOrigin(mozilla::gfx::DrawTarget& aDT, + hb_codepoint_t aGlyph, hb_position_t *aX, hb_position_t *aY) const; // get harfbuzz horizontal advance in 16.16 fixed point format. @@ -114,7 +115,7 @@ protected: nsTArray& aPositions, uint32_t aAppUnitsPerDevUnit); - bool InitializeVertical(); + void InitializeVertical(); bool LoadHmtxTable(); struct Glyf { // we only need the bounding-box at the beginning @@ -176,6 +177,10 @@ protected: // Similarly for vhea if it's a vertical font. mutable int32_t mNumLongVMetrics; + // Default y-coordinate for glyph vertical origin, used if the font + // does not actually have vertical-layout metrics. + mutable gfxFloat mDefaultVOrg; + // Whether the font implements GetGlyph, or we should read tables // directly bool mUseFontGetGlyph; From 6554ba1e9a9fcf6b8b72035a0e2908c7ec77e5de Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Fri, 16 Feb 2018 09:41:12 -0600 Subject: [PATCH 35/48] Bug 1438670 - Tweak gc/GCIteration filenames one more time. r=jonco. --HG-- rename : js/src/gc/GCIteration-inl.h => js/src/gc/PrivateIterators-inl.h rename : js/src/gc/Iteration.cpp => js/src/gc/PublicIterators.cpp rename : js/src/gc/Iteration.h => js/src/gc/PublicIterators.h extra : rebase_source : 0beaeb757792b82c7d4a0f2b8f112e6b9840dbf5 --- js/src/gc/AtomMarking.cpp | 2 +- js/src/gc/Marking.cpp | 2 +- js/src/gc/Nursery.cpp | 2 +- js/src/gc/{GCIteration-inl.h => PrivateIterators-inl.h} | 8 ++++---- js/src/gc/{Iteration.cpp => PublicIterators.cpp} | 2 +- js/src/gc/{Iteration.h => PublicIterators.h} | 6 +++--- js/src/gc/RootMarking.cpp | 2 +- js/src/gc/Tracer.cpp | 2 +- js/src/gc/Verifier.cpp | 2 +- js/src/gc/Zone.cpp | 2 +- js/src/gc/ZoneGroup.cpp | 2 +- js/src/jit/BaselineJIT.cpp | 2 +- js/src/jit/Ion.cpp | 2 +- js/src/jsapi.cpp | 2 +- js/src/jsfriendapi.cpp | 2 +- js/src/jsgc.cpp | 3 ++- js/src/jsopcode.cpp | 2 +- js/src/jsweakmap.cpp | 2 +- js/src/moz.build | 2 +- js/src/proxy/CrossCompartmentWrapper.cpp | 2 +- js/src/shell/js.cpp | 2 +- js/src/vm/Debugger.cpp | 2 +- js/src/vm/GeckoProfiler.cpp | 2 +- js/src/vm/HelperThreads.cpp | 2 +- js/src/vm/JSCompartment.cpp | 2 +- js/src/vm/MemoryMetrics.cpp | 2 +- js/src/vm/Runtime.cpp | 2 +- js/src/vm/SelfHosting.cpp | 2 +- js/src/vm/Shape.cpp | 2 +- js/src/vm/Stopwatch.cpp | 2 +- js/src/vm/TypeInference.cpp | 2 +- 31 files changed, 37 insertions(+), 36 deletions(-) rename js/src/gc/{GCIteration-inl.h => PrivateIterators-inl.h} (95%) rename js/src/gc/{Iteration.cpp => PublicIterators.cpp} (99%) rename js/src/gc/{Iteration.h => PublicIterators.h} (98%) diff --git a/js/src/gc/AtomMarking.cpp b/js/src/gc/AtomMarking.cpp index a27f3e86f665..eeed8630606a 100644 --- a/js/src/gc/AtomMarking.cpp +++ b/js/src/gc/AtomMarking.cpp @@ -6,7 +6,7 @@ #include "gc/AtomMarking-inl.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "vm/JSCompartment.h" #include "jsgcinlines.h" diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 71f89c51b3bd..15d3af1a5e0d 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -35,8 +35,8 @@ #include "jsgcinlines.h" -#include "gc/GCIteration-inl.h" #include "gc/Nursery-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/JSCompartment-inl.h" #include "vm/NativeObject-inl.h" #include "vm/String-inl.h" diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp index 6f98d7e41d1f..06c4032c26de 100644 --- a/js/src/gc/Nursery.cpp +++ b/js/src/gc/Nursery.cpp @@ -16,8 +16,8 @@ #include "gc/FreeOp.h" #include "gc/GCInternals.h" -#include "gc/Iteration.h" #include "gc/Memory.h" +#include "gc/PublicIterators.h" #include "jit/JitFrames.h" #include "vm/ArrayObject.h" #include "vm/Debugger.h" diff --git a/js/src/gc/GCIteration-inl.h b/js/src/gc/PrivateIterators-inl.h similarity index 95% rename from js/src/gc/GCIteration-inl.h rename to js/src/gc/PrivateIterators-inl.h index d5be94225a4e..808349d18a9e 100644 --- a/js/src/gc/GCIteration-inl.h +++ b/js/src/gc/PrivateIterators-inl.h @@ -8,10 +8,10 @@ * GC-internal iterators for various data structures. */ -#ifndef gc_GCIteration_h -#define gc_GCIteration_h +#ifndef gc_PrivateIterators_inl_h +#define gc_PrivateIterators_inl_h -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "jsgcinlines.h" @@ -122,4 +122,4 @@ typedef CompartmentsIterT SweepGroupCompartmentsIter; } // namespace gc } // namespace js -#endif // gc_GCIteration_h +#endif // gc_PrivateIterators_inl_h diff --git a/js/src/gc/Iteration.cpp b/js/src/gc/PublicIterators.cpp similarity index 99% rename from js/src/gc/Iteration.cpp rename to js/src/gc/PublicIterators.cpp index 94c9260dc97b..6c622e883d50 100644 --- a/js/src/gc/Iteration.cpp +++ b/js/src/gc/PublicIterators.cpp @@ -11,7 +11,7 @@ #include "vm/JSCompartment.h" #include "vm/Runtime.h" -#include "gc/GCIteration-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/JSContext-inl.h" using namespace js; diff --git a/js/src/gc/Iteration.h b/js/src/gc/PublicIterators.h similarity index 98% rename from js/src/gc/Iteration.h rename to js/src/gc/PublicIterators.h index 9ddde8ebcaf5..978ef01b310e 100644 --- a/js/src/gc/Iteration.h +++ b/js/src/gc/PublicIterators.h @@ -8,8 +8,8 @@ * Iterators for various data structures. */ -#ifndef gc_Iteration_h -#define gc_Iteration_h +#ifndef gc_PublicIterators_h +#define gc_PublicIterators_h #include "gc/Zone.h" @@ -224,4 +224,4 @@ typedef CompartmentsIterT CompartmentsIter; } // namespace js -#endif // gc_Iteration_h +#endif // gc_PublicIterators_h diff --git a/js/src/gc/RootMarking.cpp b/js/src/gc/RootMarking.cpp index e4f11bcc8bb9..2e9a72e60c79 100644 --- a/js/src/gc/RootMarking.cpp +++ b/js/src/gc/RootMarking.cpp @@ -23,8 +23,8 @@ #include "vm/JSContext.h" #include "vm/JSONParser.h" -#include "gc/GCIteration-inl.h" #include "gc/Nursery-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/JSObject-inl.h" using namespace js; diff --git a/js/src/gc/Tracer.cpp b/js/src/gc/Tracer.cpp index dcc406efa708..9554132216bf 100644 --- a/js/src/gc/Tracer.cpp +++ b/js/src/gc/Tracer.cpp @@ -13,8 +13,8 @@ #include "NamespaceImports.h" #include "gc/GCInternals.h" -#include "gc/Iteration.h" #include "gc/Marking.h" +#include "gc/PublicIterators.h" #include "gc/Zone.h" #include "vm/JSFunction.h" #include "vm/JSScript.h" diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index 4363fdeadd95..96f405360039 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -15,7 +15,7 @@ #include "jsprf.h" #include "gc/GCInternals.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "gc/Zone.h" #include "js/HashTable.h" #include "vm/JSContext.h" diff --git a/js/src/gc/Zone.cpp b/js/src/gc/Zone.cpp index ef4a2e39b08e..fe9ae79fb369 100644 --- a/js/src/gc/Zone.cpp +++ b/js/src/gc/Zone.cpp @@ -6,8 +6,8 @@ #include "gc/Zone.h" -#include "gc/Iteration.h" #include "gc/Policy.h" +#include "gc/PublicIterators.h" #include "jit/BaselineJIT.h" #include "jit/Ion.h" #include "jit/JitCompartment.h" diff --git a/js/src/gc/ZoneGroup.cpp b/js/src/gc/ZoneGroup.cpp index 04144f2c3623..37601fcecfdc 100644 --- a/js/src/gc/ZoneGroup.cpp +++ b/js/src/gc/ZoneGroup.cpp @@ -6,7 +6,7 @@ #include "gc/ZoneGroup.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "jit/IonBuilder.h" #include "jit/JitCompartment.h" #include "vm/JSContext.h" diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp index eed973f22a89..f1bd6e3019ac 100644 --- a/js/src/jit/BaselineJIT.cpp +++ b/js/src/jit/BaselineJIT.cpp @@ -24,7 +24,7 @@ #include "jsopcodeinlines.h" -#include "gc/GCIteration-inl.h" +#include "gc/PrivateIterators-inl.h" #include "jit/JitFrames-inl.h" #include "jit/MacroAssembler-inl.h" #include "vm/JSObject-inl.h" diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 847fed558138..0eae70ad453d 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -54,7 +54,7 @@ #include "vm/TraceLogging.h" #include "vtune/VTuneWrapper.h" -#include "gc/GCIteration-inl.h" +#include "gc/PrivateIterators-inl.h" #include "jit/JitFrames-inl.h" #include "jit/MacroAssembler-inl.h" #include "jit/shared/Lowering-shared-inl.h" diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 8ce87eead7c3..9d7f2b8c2b89 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -56,9 +56,9 @@ #include "frontend/FullParseHandler.h" // for JS_BufferIsCompileableUnit #include "frontend/Parser.h" // for JS_BufferIsCompileableUnit #include "gc/FreeOp.h" -#include "gc/Iteration.h" #include "gc/Marking.h" #include "gc/Policy.h" +#include "gc/PublicIterators.h" #include "jit/JitCommon.h" #include "js/CharacterEncoding.h" #include "js/Conversions.h" diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index b714202d3385..f392f892fa30 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -17,7 +17,7 @@ #include "builtin/Promise.h" #include "builtin/TestingFunctions.h" #include "gc/GCInternals.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "js/Proxy.h" #include "proxy/DeadObjectProxy.h" #include "vm/ArgumentsObject.h" diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 23168ce96ca4..b797c5dce516 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -204,6 +204,7 @@ # include # include #endif + #include "jsapi.h" #include "jsfriendapi.h" #include "jsprf.h" @@ -241,10 +242,10 @@ #include "vm/TraceLogging.h" #include "vm/WrapperObject.h" -#include "gc/GCIteration-inl.h" #include "gc/Heap-inl.h" #include "gc/Marking-inl.h" #include "gc/Nursery-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/GeckoProfiler-inl.h" #include "vm/JSObject-inl.h" #include "vm/JSScript-inl.h" diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index 6ea86c8d096e..9105cb9db367 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -47,7 +47,7 @@ #include "vm/Shape.h" #include "vm/StringBuffer.h" -#include "gc/GCIteration-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/JSCompartment-inl.h" #include "vm/JSContext-inl.h" #include "vm/JSObject-inl.h" diff --git a/js/src/jsweakmap.cpp b/js/src/jsweakmap.cpp index 360fbeef8e8d..1d5681040678 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/jsweakmap.cpp @@ -12,7 +12,7 @@ #include "jsfriendapi.h" #include "jswrapper.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "vm/GlobalObject.h" #include "vm/JSContext.h" #include "vm/JSObject.h" diff --git a/js/src/moz.build b/js/src/moz.build index db16025cad87..82e1a9e04bb4 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -193,10 +193,10 @@ UNIFIED_SOURCES += [ 'gc/AtomMarking.cpp', 'gc/Barrier.cpp', 'gc/GCTrace.cpp', - 'gc/Iteration.cpp', 'gc/Marking.cpp', 'gc/Memory.cpp', 'gc/Nursery.cpp', + 'gc/PublicIterators.cpp', 'gc/RootMarking.cpp', 'gc/Statistics.cpp', 'gc/Tracer.cpp', diff --git a/js/src/proxy/CrossCompartmentWrapper.cpp b/js/src/proxy/CrossCompartmentWrapper.cpp index 7672cba9fabb..22895d995fec 100644 --- a/js/src/proxy/CrossCompartmentWrapper.cpp +++ b/js/src/proxy/CrossCompartmentWrapper.cpp @@ -7,7 +7,7 @@ #include "jsiter.h" #include "jswrapper.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "proxy/DeadObjectProxy.h" #include "vm/WrapperObject.h" diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 4bc3b28e5079..8638ad5abd6b 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -72,7 +72,7 @@ # include "frontend/BinSource.h" #endif // defined(JS_BUILD_BINAST) #include "frontend/Parser.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "jit/arm/Simulator-arm.h" #include "jit/InlinableNatives.h" #include "jit/Ion.h" diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index d422b832116d..f9efb35a5a29 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -20,9 +20,9 @@ #include "frontend/BytecodeCompiler.h" #include "frontend/Parser.h" #include "gc/FreeOp.h" -#include "gc/Iteration.h" #include "gc/Marking.h" #include "gc/Policy.h" +#include "gc/PublicIterators.h" #include "jit/BaselineDebugModeOSR.h" #include "jit/BaselineJIT.h" #include "js/Date.h" diff --git a/js/src/vm/GeckoProfiler.cpp b/js/src/vm/GeckoProfiler.cpp index 3e66dfcf7f50..7efc902e281e 100644 --- a/js/src/vm/GeckoProfiler.cpp +++ b/js/src/vm/GeckoProfiler.cpp @@ -11,7 +11,7 @@ #include "jsnum.h" #include "jsprf.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "jit/BaselineFrame.h" #include "jit/BaselineJIT.h" #include "jit/JitcodeMap.h" diff --git a/js/src/vm/HelperThreads.cpp b/js/src/vm/HelperThreads.cpp index ca57096fdb3f..bbe13b1d62e5 100644 --- a/js/src/vm/HelperThreads.cpp +++ b/js/src/vm/HelperThreads.cpp @@ -25,7 +25,7 @@ #include "vm/TraceLogging.h" #include "vm/Xdr.h" -#include "gc/GCIteration-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/JSCompartment-inl.h" #include "vm/JSContext-inl.h" #include "vm/JSObject-inl.h" diff --git a/js/src/vm/JSCompartment.cpp b/js/src/vm/JSCompartment.cpp index d3913b4cb1b9..7806d118e164 100644 --- a/js/src/vm/JSCompartment.cpp +++ b/js/src/vm/JSCompartment.cpp @@ -15,8 +15,8 @@ #include "jsiter.h" #include "jswrapper.h" -#include "gc/Iteration.h" #include "gc/Policy.h" +#include "gc/PublicIterators.h" #include "jit/JitCompartment.h" #include "jit/JitOptions.h" #include "js/Date.h" diff --git a/js/src/vm/MemoryMetrics.cpp b/js/src/vm/MemoryMetrics.cpp index 19d5e6dc087c..97b17e54c952 100644 --- a/js/src/vm/MemoryMetrics.cpp +++ b/js/src/vm/MemoryMetrics.cpp @@ -11,8 +11,8 @@ #include "jsgc.h" #include "gc/Heap.h" -#include "gc/Iteration.h" #include "gc/Nursery.h" +#include "gc/PublicIterators.h" #include "jit/BaselineJIT.h" #include "jit/Ion.h" #include "vm/ArrayObject.h" diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp index c9ddb0581fcd..6ec133df56a9 100644 --- a/js/src/vm/Runtime.cpp +++ b/js/src/vm/Runtime.cpp @@ -31,7 +31,7 @@ #include "builtin/Promise.h" #include "gc/FreeOp.h" #include "gc/GCInternals.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "jit/arm/Simulator-arm.h" #include "jit/arm64/vixl/Simulator-vixl.h" #include "jit/JitCompartment.h" diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 664730bd4abd..0ab633225b23 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -56,7 +56,7 @@ #include "vm/TypedArrayObject.h" #include "vm/WrapperObject.h" -#include "gc/GCIteration-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/BooleanObject-inl.h" #include "vm/JSAtom-inl.h" #include "vm/JSFunction-inl.h" diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index 4077e50b768e..f2e712fdf0f2 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -15,8 +15,8 @@ #include "jshashutil.h" #include "gc/FreeOp.h" -#include "gc/Iteration.h" #include "gc/Policy.h" +#include "gc/PublicIterators.h" #include "js/HashTable.h" #include "vm/JSAtom.h" #include "vm/JSContext.h" diff --git a/js/src/vm/Stopwatch.cpp b/js/src/vm/Stopwatch.cpp index a7c2207d45b2..ea4342c09727 100644 --- a/js/src/vm/Stopwatch.cpp +++ b/js/src/vm/Stopwatch.cpp @@ -16,7 +16,7 @@ #include "jswin.h" -#include "gc/Iteration.h" +#include "gc/PublicIterators.h" #include "vm/JSCompartment.h" #include "vm/Runtime.h" diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp index 15e6136a490a..8950f79db14b 100644 --- a/js/src/vm/TypeInference.cpp +++ b/js/src/vm/TypeInference.cpp @@ -34,8 +34,8 @@ #include "vm/Time.h" #include "vm/UnboxedObject.h" -#include "gc/GCIteration-inl.h" #include "gc/Marking-inl.h" +#include "gc/PrivateIterators-inl.h" #include "vm/JSAtom-inl.h" #include "vm/JSScript-inl.h" #include "vm/NativeObject-inl.h" From 12ce692c260f6e98a1eed0c71969d18221742ea0 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 16 Feb 2018 15:52:44 -0500 Subject: [PATCH 36/48] Bug 1438631. Fix typos in IntoLuminance recording event. --- gfx/2d/RecordedEvent.h | 1 + gfx/2d/RecordedEventImpl.h | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gfx/2d/RecordedEvent.h b/gfx/2d/RecordedEvent.h index 52087b3284b7..3977ecc420f0 100644 --- a/gfx/2d/RecordedEvent.h +++ b/gfx/2d/RecordedEvent.h @@ -259,6 +259,7 @@ public: POPLAYER, UNSCALEDFONTCREATION, UNSCALEDFONTDESTRUCTION, + INTOLUMINANCE, }; static const uint32_t kTotalEventTypes = RecordedEvent::FILTERNODESETINPUT + 1; diff --git a/gfx/2d/RecordedEventImpl.h b/gfx/2d/RecordedEventImpl.h index 873faf03f395..4027fe9389f7 100644 --- a/gfx/2d/RecordedEventImpl.h +++ b/gfx/2d/RecordedEventImpl.h @@ -905,7 +905,7 @@ class RecordedIntoLuminanceSource : public RecordedEventDerived RecordedIntoLuminanceSource::RecordedIntoLuminanceSource(S &aStream) - : RecordedEventDerived(SNAPSHOT) + : RecordedEventDerived(INTOLUMINANCE) { ReadElement(aStream, mRefPtr); ReadElement(aStream, mDT); @@ -3413,7 +3413,8 @@ RecordedFilterNodeSetInput::OutputSimpleEventInfo(std::stringstream &aStringStre f(PUSHLAYER, RecordedPushLayer); \ f(POPLAYER, RecordedPopLayer); \ f(UNSCALEDFONTCREATION, RecordedUnscaledFontCreation); \ - f(UNSCALEDFONTDESTRUCTION, RecordedUnscaledFontDestruction); + f(UNSCALEDFONTDESTRUCTION, RecordedUnscaledFontDestruction); \ + f(INTOLUMINANCE, RecordedIntoLuminanceSource); template RecordedEvent * From 167ea616749f6c200fcb65f74141d0aebde695a9 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 16 Feb 2018 15:52:45 -0500 Subject: [PATCH 37/48] Bug 1438631. Use a similar drawtarget when painting masks. r=mstange Avoiding an offscreen drawtarget will avoid using Direct2D with webrender, let us record the masking operation, and also give us OMTP. --- layout/svg/nsSVGMaskFrame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp index d97c82a104cd..30274cab7ad6 100644 --- a/layout/svg/nsSVGMaskFrame.cpp +++ b/layout/svg/nsSVGMaskFrame.cpp @@ -88,10 +88,10 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(MaskParams& aParams) RefPtr maskDT; if (maskType == NS_STYLE_MASK_TYPE_LUMINANCE) { - maskDT = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget( + maskDT = context->GetDrawTarget()->CreateSimilarDrawTarget( maskSurfaceSize, SurfaceFormat::B8G8R8A8); } else { - maskDT = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget( + maskDT = context->GetDrawTarget()->CreateSimilarDrawTarget( maskSurfaceSize, SurfaceFormat::A8); } From 49b816a2e284987ad6abdfad22e8fb964bcd3eff Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 14 Feb 2018 15:56:41 -0600 Subject: [PATCH 38/48] Bug 1438278 - Part 0: Fix places where bug 1429206 left old filenames in comments. r=jandem. --HG-- extra : rebase_source : 96ed5c3b7b4cf201675fa86ebc0e327a49d6ad2e --- js/src/jit/BaselineFrame.h | 4 ++-- js/src/jsfriendapi.h | 12 ++++-------- js/src/vm/GlobalObject.h | 2 +- js/src/vm/JSContext.h | 4 ++++ js/src/vm/JSObject.h | 2 +- js/src/vm/JSScript.h | 2 +- js/src/vm/NativeObject.h | 2 +- js/src/vm/Stack.h | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/js/src/jit/BaselineFrame.h b/js/src/jit/BaselineFrame.h index 10877ee82f2a..7578f4c2ffb9 100644 --- a/js/src/jit/BaselineFrame.h +++ b/js/src/jit/BaselineFrame.h @@ -44,8 +44,8 @@ class BaselineFrame // Frame has execution observed by a Debugger. // - // See comment above 'isDebuggee' in jscompartment.h for explanation of - // invariants of debuggee compartments, scripts, and frames. + // See comment above 'isDebuggee' in vm/JSCompartment.h for explanation + // of invariants of debuggee compartments, scripts, and frames. DEBUGGEE = 1 << 6, // (1 << 7 and 1 << 8 are unused) diff --git a/js/src/jsfriendapi.h b/js/src/jsfriendapi.h index 61c8a2519164..03db35382121 100644 --- a/js/src/jsfriendapi.h +++ b/js/src/jsfriendapi.h @@ -642,7 +642,7 @@ struct String } /* namespace shadow */ // This is equal to |&JSObject::class_|. Use it in places where you don't want -// to #include jsobj.h. +// to #include vm/JSObject.h. extern JS_FRIEND_DATA(const js::Class* const) ObjectClassPtr; inline const js::Class* @@ -1390,12 +1390,6 @@ DateGetMsecSinceEpoch(JSContext* cx, JS::HandleObject obj, double* msecSinceEpoc } /* namespace js */ -/* Implemented in jscntxt.cpp. */ - -/** - * Report an exception, which is currently realized as a printf-style format - * string and its arguments. - */ typedef enum JSErrNum { #define MSG_DEF(name, count, exception, format) \ name, @@ -1406,6 +1400,8 @@ typedef enum JSErrNum { namespace js { +/* Implemented in vm/JSContext.cpp. */ + extern JS_FRIEND_API(const JSErrorFormatString*) GetErrorMessage(void* userRef, const unsigned errorNumber); @@ -2612,7 +2608,7 @@ FunctionObjectToShadowFunction(JSObject* fun) return reinterpret_cast(fun); } -/* Statically asserted in jsfun.h. */ +/* Statically asserted in JSFunction.h. */ static const unsigned JS_FUNCTION_INTERPRETED_BITS = 0x0201; // Return whether the given function object is native. diff --git a/js/src/vm/GlobalObject.h b/js/src/vm/GlobalObject.h index 0bab2e3e299e..fb198d1a2563 100644 --- a/js/src/vm/GlobalObject.h +++ b/js/src/vm/GlobalObject.h @@ -903,7 +903,7 @@ JSObject* GenericCreateConstructor(JSContext* cx, JSProtoKey key) { // Note - We duplicate the trick from ClassName() so that we don't need to - // include jsatominlines.h here. + // include vm/JSAtom-inl.h here. PropertyName* name = (&cx->names().Null)[key]; return GlobalObject::createConstructor(cx, ctor, name, length, kind, jitInfo); } diff --git a/js/src/vm/JSContext.h b/js/src/vm/JSContext.h index 127d2e245faa..e487df8f4dd6 100644 --- a/js/src/vm/JSContext.h +++ b/js/src/vm/JSContext.h @@ -1016,6 +1016,10 @@ enum ErrorArgumentsType { JSFunction* SelfHostedFunction(JSContext* cx, HandlePropertyName propName); +/** + * Report an exception, using printf-style APIs to generate the error + * message. + */ #ifdef va_start extern bool ReportErrorVA(JSContext* cx, unsigned flags, const char* format, diff --git a/js/src/vm/JSObject.h b/js/src/vm/JSObject.h index 99be65234de1..c9fe239cf314 100644 --- a/js/src/vm/JSObject.h +++ b/js/src/vm/JSObject.h @@ -186,7 +186,7 @@ class JSObject : public js::gc::Cell * directly too, as may any object, but only those objects linked after the * head of any prototype or scope chain are flagged as delegates. This * definition helps to optimize shape-based property cache invalidation - * (see Purge{Scope,Proto}Chain in jsobj.cpp). + * (see Purge{Scope,Proto}Chain in JSObject.cpp). */ inline bool isDelegate() const; static bool setDelegate(JSContext* cx, JS::HandleObject obj) { diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index 26c9bbdb729e..3bcd3364fd3f 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -1987,7 +1987,7 @@ class JSScript : public js::gc::TenuredCell bool hasBreakpointsAt(jsbytecode* pc); bool hasAnyBreakpointsOrStepMode() { return hasDebugScript_; } - // See comment above 'debugMode' in jscompartment.h for explanation of + // See comment above 'debugMode' in JSCompartment.h for explanation of // invariants of debuggee compartments, scripts, and frames. inline bool isDebuggee() const; diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h index a76541cda5a7..97339b9a7e4a 100644 --- a/js/src/vm/NativeObject.h +++ b/js/src/vm/NativeObject.h @@ -1610,7 +1610,7 @@ AddPropertyTypesAfterProtoChange(JSContext* cx, NativeObject* obj, ObjectGroup* } // namespace js -/*** Inline functions declared in jsobj.h that use the native declarations above *****************/ +/*** Inline functions declared in JSObject.h that use the native declarations above **************/ inline bool js::HasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp) diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h index 5c6510b016ca..29afbff01e2f 100644 --- a/js/src/vm/Stack.h +++ b/js/src/vm/Stack.h @@ -323,7 +323,7 @@ class InterpreterFrame PREV_UP_TO_DATE = 0x20, /* see DebugScopes::updateLiveScopes */ /* - * See comment above 'isDebuggee' in jscompartment.h for explanation of + * See comment above 'isDebuggee' in JSCompartment.h for explanation of * invariants of debuggee compartments, scripts, and frames. */ DEBUGGEE = 0x40, /* Execution is being observed by Debugger */ From 2001443c7de83d3eeeba2760a3b513d256ff6bd5 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 14 Feb 2018 13:35:54 -0600 Subject: [PATCH 39/48] Bug 1438278 - Part 1: Rename json.* -> builtin/JSON.*. r=jandem. --HG-- rename : js/src/json.cpp => js/src/builtin/JSON.cpp rename : js/src/json.h => js/src/builtin/JSON.h extra : rebase_source : 1fc30184bc2b920b04fd395e301d999b1b690297 extra : amend_source : 578a7f74cf073f584ede82ed37cb70ecb1f3aacc --- js/src/{json.cpp => builtin/JSON.cpp} | 2 +- js/src/{json.h => builtin/JSON.h} | 6 +++--- js/src/jsapi.cpp | 2 +- js/src/moz.build | 4 ++-- js/src/vm/GlobalObject.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename js/src/{json.cpp => builtin/JSON.cpp} (99%) rename js/src/{json.h => builtin/JSON.h} (93%) diff --git a/js/src/json.cpp b/js/src/builtin/JSON.cpp similarity index 99% rename from js/src/json.cpp rename to js/src/builtin/JSON.cpp index 58bb2659a11b..e572355586ab 100644 --- a/js/src/json.cpp +++ b/js/src/builtin/JSON.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "json.h" +#include "builtin/JSON.h" #include "mozilla/FloatingPoint.h" #include "mozilla/Range.h" diff --git a/js/src/json.h b/js/src/builtin/JSON.h similarity index 93% rename from js/src/json.h rename to js/src/builtin/JSON.h index 9eff376854ab..a91df4c74f54 100644 --- a/js/src/json.h +++ b/js/src/builtin/JSON.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef json_h -#define json_h +#ifndef builtin_JSON_h +#define builtin_JSON_h #include "mozilla/Range.h" @@ -40,4 +40,4 @@ ParseJSONWithReviver(JSContext* cx, const mozilla::Range chars, } // namespace js -#endif /* json_h */ +#endif /* builtin_JSON_h */ diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 9d7f2b8c2b89..9a4b3c451b0a 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -31,7 +31,6 @@ #include "jsiter.h" #include "jsmath.h" #include "jsnum.h" -#include "json.h" #include "jsprf.h" #include "jsstr.h" #include "jstypes.h" @@ -41,6 +40,7 @@ #include "builtin/AtomicsObject.h" #include "builtin/Eval.h" +#include "builtin/JSON.h" #include "builtin/MapObject.h" #include "builtin/Promise.h" #include "builtin/RegExp.h" diff --git a/js/src/moz.build b/js/src/moz.build index 82e1a9e04bb4..a10391b82457 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -32,7 +32,7 @@ for gcfile in ['jsgc*', 'devtools/rootAnalysis', 'devtools/gc-ubench', 'devtools with Files(gcfile): BUG_COMPONENT = component_gc -for stlfile in ['jsarray.*', 'jsbool*', 'jsdate.*', 'jsnum.*', 'json.*', 'jsstr.*']: +for stlfile in ['jsarray.*', 'jsbool*', 'jsdate.*', 'jsnum.*', 'jsstr.*']: with Files(stlfile): BUG_COMPONENT = component_stl @@ -165,6 +165,7 @@ UNIFIED_SOURCES += [ 'builtin/intl/PluralRules.cpp', 'builtin/intl/RelativeTimeFormat.cpp', 'builtin/intl/SharedIntlData.cpp', + 'builtin/JSON.cpp', 'builtin/MapObject.cpp', 'builtin/ModuleObject.cpp', 'builtin/Object.cpp', @@ -298,7 +299,6 @@ UNIFIED_SOURCES += [ 'jsiter.cpp', 'jsnativestack.cpp', 'jsnum.cpp', - 'json.cpp', 'jsopcode.cpp', 'jsprf.cpp', 'jsstr.cpp', diff --git a/js/src/vm/GlobalObject.cpp b/js/src/vm/GlobalObject.cpp index d3ae16771155..cf9af04d9de5 100644 --- a/js/src/vm/GlobalObject.cpp +++ b/js/src/vm/GlobalObject.cpp @@ -10,12 +10,12 @@ #include "jsexn.h" #include "jsfriendapi.h" #include "jsmath.h" -#include "json.h" #include "jsprototypes.h" #include "builtin/AtomicsObject.h" #include "builtin/DataViewObject.h" #include "builtin/Eval.h" +#include "builtin/JSON.h" #include "builtin/MapObject.h" #include "builtin/ModuleObject.h" #include "builtin/Object.h" From 7ff58bb5a754d92d52bbbe85f1e516aa8426dbe9 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Fri, 16 Feb 2018 10:54:58 -0600 Subject: [PATCH 40/48] Bug 1438278 - Part 2: Rename a template because there is another global template with the same name in jsgc.cpp. r=jonco. --HG-- extra : rebase_source : 7bc4943739195acbfe1b52a543f32b1ecc99736a extra : amend_source : 21dbeda4baa38db78756b31472f854994e3236e6 --- js/src/gc/Marking.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index 15d3af1a5e0d..da7b1d730257 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -3398,7 +3398,7 @@ IsAboutToBeFinalizedInternal(T** thingp) } template -struct IsAboutToBeFinalizedFunctor : public IdentityDefaultAdaptor { +struct IsAboutToBeFinalizedInternalFunctor : public IdentityDefaultAdaptor { template S operator()(T* t, bool* rv) { *rv = IsAboutToBeFinalizedInternal(&t); return js::gc::RewrapTaggedPointer::wrap(t); @@ -3410,7 +3410,7 @@ static bool IsAboutToBeFinalizedInternal(T* thingp) { bool rv = false; - *thingp = DispatchTyped(IsAboutToBeFinalizedFunctor(), *thingp, &rv); + *thingp = DispatchTyped(IsAboutToBeFinalizedInternalFunctor(), *thingp, &rv); return rv; } From 50d9e51a7dda474a9f7886a60bbe56b983dbd266 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 14 Feb 2018 16:00:46 -0600 Subject: [PATCH 41/48] Bug 1438278 - Part 3: Rename some files into js/src/gc. r=jonco. jsgc.* -> gc/GC.* jshashutil.h -> gc/HashUtil.h jsweakmap.* -> gc/WeakMap.* vm/WeakMapPtr.cpp -> gc/WeakMapPtr.cpp --HG-- rename : js/src/jsgcinlines.h => js/src/gc/GC-inl.h rename : js/src/jsgc.cpp => js/src/gc/GC.cpp rename : js/src/jsgc.h => js/src/gc/GC.h rename : js/src/jshashutil.h => js/src/gc/HashUtil.h rename : js/src/jsweakmap.cpp => js/src/gc/WeakMap.cpp rename : js/src/jsweakmap.h => js/src/gc/WeakMap.h rename : js/src/vm/WeakMapPtr.cpp => js/src/gc/WeakMapPtr.cpp extra : rebase_source : 8435ece63e11545a633ae0cdf6ed4a46cb017457 extra : amend_source : cfb63d098bf2fb27d63221a24457d8aaf8884137 extra : intermediate-source : 2d498c561ba67baf3ad09b6c29f4a8985997928c extra : source : c1df7b31137da2bbea5ae1169cc07dd0f4974376 --- js/public/WeakMapPtr.h | 6 +++--- js/src/builtin/Eval.cpp | 3 +-- js/src/builtin/TypedObject.h | 3 +-- js/src/builtin/WeakMapObject.h | 3 +-- js/src/gc/AtomMarking.cpp | 2 +- js/src/{jsgcinlines.h => gc/GC-inl.h} | 8 ++++---- js/src/{jsgc.cpp => gc/GC.cpp} | 4 ++-- js/src/{jsgc.h => gc/GC.h} | 8 ++++---- js/src/gc/GCRuntime.h | 2 +- js/src/{jshashutil.h => gc/HashUtil.h} | 4 ++-- js/src/gc/Marking.cpp | 3 +-- js/src/gc/PrivateIterators-inl.h | 2 +- js/src/gc/Statistics.cpp | 2 +- js/src/gc/StoreBuffer.cpp | 2 +- js/src/gc/Tracer.cpp | 3 +-- js/src/gc/Verifier.cpp | 3 +-- js/src/{jsweakmap.cpp => gc/WeakMap.cpp} | 2 +- js/src/{jsweakmap.h => gc/WeakMap.h} | 6 +++--- js/src/{vm => gc}/WeakMapPtr.cpp | 2 +- js/src/gc/Zone.cpp | 3 +-- js/src/gc/Zone.h | 2 +- js/src/irregexp/RegExpParser.cpp | 3 +-- js/src/jit/CompileWrappers.cpp | 3 ++- js/src/jit/Linker.cpp | 2 +- js/src/jit/SharedIC.h | 3 +-- js/src/jsapi-tests/testGCGrayMarking.cpp | 4 +--- js/src/jsapi-tests/tests.h | 2 +- js/src/jsapi.cpp | 2 +- js/src/jsfriendapi.cpp | 2 +- js/src/moz.build | 8 ++++---- js/src/vm/Debugger.cpp | 4 ++-- js/src/vm/Debugger.h | 2 +- js/src/vm/EnvironmentObject.h | 3 +-- js/src/vm/JSCompartment.cpp | 3 +-- js/src/vm/JSCompartment.h | 5 +++-- js/src/vm/JSScript.h | 6 +++--- js/src/vm/MemoryMetrics.cpp | 3 +-- js/src/vm/ObjectGroup.cpp | 2 +- js/src/vm/RegExpObject.cpp | 2 +- js/src/vm/Runtime.cpp | 3 +-- js/src/vm/Runtime.h | 2 +- js/src/vm/SavedStacks.cpp | 2 +- js/src/vm/SelfHosting.cpp | 2 +- js/src/vm/Shape.cpp | 3 +-- js/src/vm/TypeInference-inl.h | 3 +-- js/src/vm/TypeInference.cpp | 2 +- 46 files changed, 67 insertions(+), 82 deletions(-) rename js/src/{jsgcinlines.h => gc/GC-inl.h} (99%) rename js/src/{jsgc.cpp => gc/GC.cpp} (99%) rename js/src/{jsgc.h => gc/GC.h} (97%) rename js/src/{jshashutil.h => gc/HashUtil.h} (98%) rename js/src/{jsweakmap.cpp => gc/WeakMap.cpp} (99%) rename js/src/{jsweakmap.h => gc/WeakMap.h} (99%) rename js/src/{vm => gc}/WeakMapPtr.cpp (99%) diff --git a/js/public/WeakMapPtr.h b/js/public/WeakMapPtr.h index 8b2504452d13..11b1e5b86485 100644 --- a/js/public/WeakMapPtr.h +++ b/js/public/WeakMapPtr.h @@ -16,9 +16,9 @@ namespace JS { // A wrapper around the internal C++ representation of SpiderMonkey WeakMaps, // usable outside the engine. // -// The supported template specializations are enumerated in WeakMapPtr.cpp. If -// you want to use this class for a different key/value combination, add it to -// the list and the compiler will generate the relevant machinery. +// The supported template specializations are enumerated in gc/WeakMapPtr.cpp. +// If you want to use this class for a different key/value combination, add it +// to the list and the compiler will generate the relevant machinery. template class JS_PUBLIC_API(WeakMapPtr) { diff --git a/js/src/builtin/Eval.cpp b/js/src/builtin/Eval.cpp index 2218d4dc3ae0..e657b9b89f47 100644 --- a/js/src/builtin/Eval.cpp +++ b/js/src/builtin/Eval.cpp @@ -9,9 +9,8 @@ #include "mozilla/HashFunctions.h" #include "mozilla/Range.h" -#include "jshashutil.h" - #include "frontend/BytecodeCompiler.h" +#include "gc/HashUtil.h" #include "vm/Debugger.h" #include "vm/GlobalObject.h" #include "vm/JSContext.h" diff --git a/js/src/builtin/TypedObject.h b/js/src/builtin/TypedObject.h index a23fd45e4fa3..c03c3b4ba4fb 100644 --- a/js/src/builtin/TypedObject.h +++ b/js/src/builtin/TypedObject.h @@ -7,9 +7,8 @@ #ifndef builtin_TypedObject_h #define builtin_TypedObject_h -#include "jsweakmap.h" - #include "builtin/TypedObjectConstants.h" +#include "gc/WeakMap.h" #include "js/Conversions.h" #include "vm/ArrayBufferObject.h" #include "vm/JSObject.h" diff --git a/js/src/builtin/WeakMapObject.h b/js/src/builtin/WeakMapObject.h index ec75ef3a16b3..666ec1ea06e0 100644 --- a/js/src/builtin/WeakMapObject.h +++ b/js/src/builtin/WeakMapObject.h @@ -7,8 +7,7 @@ #ifndef builtin_WeakMapObject_h #define builtin_WeakMapObject_h -#include "jsweakmap.h" - +#include "gc/WeakMap.h" #include "vm/JSObject.h" namespace js { diff --git a/js/src/gc/AtomMarking.cpp b/js/src/gc/AtomMarking.cpp index eeed8630606a..58e32d534fac 100644 --- a/js/src/gc/AtomMarking.cpp +++ b/js/src/gc/AtomMarking.cpp @@ -9,7 +9,7 @@ #include "gc/PublicIterators.h" #include "vm/JSCompartment.h" -#include "jsgcinlines.h" +#include "gc/GC-inl.h" #include "gc/Heap-inl.h" namespace js { diff --git a/js/src/jsgcinlines.h b/js/src/gc/GC-inl.h similarity index 99% rename from js/src/jsgcinlines.h rename to js/src/gc/GC-inl.h index fc22f3631368..d2ffa52e14b7 100644 --- a/js/src/jsgcinlines.h +++ b/js/src/gc/GC-inl.h @@ -4,10 +4,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsgcinlines_h -#define jsgcinlines_h +#ifndef gc_GC_inl_h +#define gc_GC_inl_h -#include "jsgc.h" +#include "gc/GC.h" #include "mozilla/DebugOnly.h" #include "mozilla/Maybe.h" @@ -348,4 +348,4 @@ class ZoneCellIter : public ZoneCellIter { } /* namespace gc */ } /* namespace js */ -#endif /* jsgcinlines_h */ +#endif /* gc_GC_inl_h */ diff --git a/js/src/jsgc.cpp b/js/src/gc/GC.cpp similarity index 99% rename from js/src/jsgc.cpp rename to js/src/gc/GC.cpp index b797c5dce516..d9c6dce028e9 100644 --- a/js/src/jsgc.cpp +++ b/js/src/gc/GC.cpp @@ -185,7 +185,7 @@ * this bitmap is managed. */ -#include "jsgcinlines.h" +#include "gc/GC-inl.h" #include "mozilla/ArrayUtils.h" #include "mozilla/DebugOnly.h" @@ -210,7 +210,6 @@ #include "jsprf.h" #include "jstypes.h" #include "jsutil.h" -#include "jsweakmap.h" #ifdef XP_WIN # include "jswin.h" #endif @@ -221,6 +220,7 @@ #include "gc/GCTrace.h" #include "gc/Memory.h" #include "gc/Policy.h" +#include "gc/WeakMap.h" #include "jit/BaselineJIT.h" #include "jit/IonCode.h" #include "jit/JitcodeMap.h" diff --git a/js/src/jsgc.h b/js/src/gc/GC.h similarity index 97% rename from js/src/jsgc.h rename to js/src/gc/GC.h index 983226454453..3b31972e40c4 100644 --- a/js/src/jsgc.h +++ b/js/src/gc/GC.h @@ -8,8 +8,8 @@ * JS engine garbage collector API. */ -#ifndef jsgc_h -#define jsgc_h +#ifndef gc_GC_h +#define gc_GC_h #include "jsapi.h" @@ -144,7 +144,7 @@ enum VerifierType { extern const char* ZealModeHelpText; -/* Check that write barriers have been used correctly. See jsgc.cpp. */ +/* Check that write barriers have been used correctly. See gc/Verifier.cpp. */ void VerifyBarriers(JSRuntime* rt, VerifierType type); @@ -214,4 +214,4 @@ UninlinedIsInsideNursery(const gc::Cell* cell); } /* namespace js */ -#endif /* jsgc_h */ +#endif /* gc_GC_h */ diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index 22e8be1e033c..d3752c452165 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -897,7 +897,7 @@ class GCRuntime * mainly useful to embedders. * * We use zeal_ == 4 to enable write barrier verification. See the comment - * in jsgc.cpp for more information about this. + * in gc/Verifier.cpp for more information about this. * * zeal_ values from 8 to 10 periodically run different types of * incremental GC. diff --git a/js/src/jshashutil.h b/js/src/gc/HashUtil.h similarity index 98% rename from js/src/jshashutil.h rename to js/src/gc/HashUtil.h index 67386021789d..56be29a79c54 100644 --- a/js/src/jshashutil.h +++ b/js/src/gc/HashUtil.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jshashutil_h -#define jshashutil_h +#ifndef gc_HashUtil_h +#define gc_HashUtil_h #include "gc/Zone.h" #include "vm/JSContext.h" diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp index da7b1d730257..3f4898fd707d 100644 --- a/js/src/gc/Marking.cpp +++ b/js/src/gc/Marking.cpp @@ -33,8 +33,7 @@ #include "vm/UnboxedObject.h" #include "wasm/WasmJS.h" -#include "jsgcinlines.h" - +#include "gc/GC-inl.h" #include "gc/Nursery-inl.h" #include "gc/PrivateIterators-inl.h" #include "vm/JSCompartment-inl.h" diff --git a/js/src/gc/PrivateIterators-inl.h b/js/src/gc/PrivateIterators-inl.h index 808349d18a9e..6304bc7230e9 100644 --- a/js/src/gc/PrivateIterators-inl.h +++ b/js/src/gc/PrivateIterators-inl.h @@ -13,7 +13,7 @@ #include "gc/PublicIterators.h" -#include "jsgcinlines.h" +#include "gc/GC-inl.h" namespace js { namespace gc { diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp index 4116a53cc91d..b75a1074ceb3 100644 --- a/js/src/gc/Statistics.cpp +++ b/js/src/gc/Statistics.cpp @@ -17,10 +17,10 @@ #include #include -#include "jsgc.h" #include "jsprf.h" #include "jsutil.h" +#include "gc/GC.h" #include "gc/Memory.h" #include "vm/Debugger.h" #include "vm/HelperThreads.h" diff --git a/js/src/gc/StoreBuffer.cpp b/js/src/gc/StoreBuffer.cpp index 3f5f8f308eb8..e6cb1886e55b 100644 --- a/js/src/gc/StoreBuffer.cpp +++ b/js/src/gc/StoreBuffer.cpp @@ -12,7 +12,7 @@ #include "vm/ArgumentsObject.h" #include "vm/Runtime.h" -#include "jsgcinlines.h" +#include "gc/GC-inl.h" using namespace js; using namespace js::gc; diff --git a/js/src/gc/Tracer.cpp b/js/src/gc/Tracer.cpp index 9554132216bf..e77634541527 100644 --- a/js/src/gc/Tracer.cpp +++ b/js/src/gc/Tracer.cpp @@ -21,8 +21,7 @@ #include "vm/Shape.h" #include "vm/Symbol.h" -#include "jsgcinlines.h" - +#include "gc/GC-inl.h" #include "vm/JSCompartment-inl.h" #include "vm/ObjectGroup-inl.h" diff --git a/js/src/gc/Verifier.cpp b/js/src/gc/Verifier.cpp index 96f405360039..91a345725e02 100644 --- a/js/src/gc/Verifier.cpp +++ b/js/src/gc/Verifier.cpp @@ -20,8 +20,7 @@ #include "js/HashTable.h" #include "vm/JSContext.h" -#include "jsgcinlines.h" - +#include "gc/GC-inl.h" #include "gc/Marking-inl.h" #include "vm/JSContext-inl.h" diff --git a/js/src/jsweakmap.cpp b/js/src/gc/WeakMap.cpp similarity index 99% rename from js/src/jsweakmap.cpp rename to js/src/gc/WeakMap.cpp index 1d5681040678..843da4973cb6 100644 --- a/js/src/jsweakmap.cpp +++ b/js/src/gc/WeakMap.cpp @@ -4,7 +4,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jsweakmap.h" +#include "gc/WeakMap.h" #include diff --git a/js/src/jsweakmap.h b/js/src/gc/WeakMap.h similarity index 99% rename from js/src/jsweakmap.h rename to js/src/gc/WeakMap.h index 460c6498f81f..8e0c31989296 100644 --- a/js/src/jsweakmap.h +++ b/js/src/gc/WeakMap.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsweakmap_h -#define jsweakmap_h +#ifndef gc_WeakMap_h +#define gc_WeakMap_h #include "mozilla/LinkedList.h" #include "mozilla/Move.h" @@ -414,4 +414,4 @@ struct DeletePolicy : public js::GCManagedDeletePolicy js::gc::ZoneCellIter cellIter(Args&&... args) { return js::gc::ZoneCellIter(const_cast(this), mozilla::Forward(args)...); diff --git a/js/src/irregexp/RegExpParser.cpp b/js/src/irregexp/RegExpParser.cpp index 4c26b6d58301..fb8c36bccf7f 100644 --- a/js/src/irregexp/RegExpParser.cpp +++ b/js/src/irregexp/RegExpParser.cpp @@ -33,9 +33,8 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/Move.h" -#include "jsgc.h" - #include "frontend/TokenStream.h" +#include "gc/GC.h" #include "irregexp/RegExpCharacters.h" #include "vm/ErrorReporting.h" #include "vm/StringBuffer.h" diff --git a/js/src/jit/CompileWrappers.cpp b/js/src/jit/CompileWrappers.cpp index 475c27f76901..ce6d813a3143 100644 --- a/js/src/jit/CompileWrappers.cpp +++ b/js/src/jit/CompileWrappers.cpp @@ -4,8 +4,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jsgc.h" +#include "jit/CompileWrappers.h" +#include "gc/GC.h" #include "jit/Ion.h" #include "jit/JitCompartment.h" diff --git a/js/src/jit/Linker.cpp b/js/src/jit/Linker.cpp index dac72754cf6b..24305410b425 100644 --- a/js/src/jit/Linker.cpp +++ b/js/src/jit/Linker.cpp @@ -6,7 +6,7 @@ #include "jit/Linker.h" -#include "jsgc.h" +#include "gc/GC.h" #include "gc/StoreBuffer-inl.h" diff --git a/js/src/jit/SharedIC.h b/js/src/jit/SharedIC.h index f996c3675544..1fcd95d756c9 100644 --- a/js/src/jit/SharedIC.h +++ b/js/src/jit/SharedIC.h @@ -7,8 +7,7 @@ #ifndef jit_SharedIC_h #define jit_SharedIC_h -#include "jsgc.h" - +#include "gc/GC.h" #include "jit/BaselineICList.h" #include "jit/BaselineJIT.h" #include "jit/ICState.h" diff --git a/js/src/jsapi-tests/testGCGrayMarking.cpp b/js/src/jsapi-tests/testGCGrayMarking.cpp index 1aca9ae3d497..8d3e26ac53ce 100644 --- a/js/src/jsapi-tests/testGCGrayMarking.cpp +++ b/js/src/jsapi-tests/testGCGrayMarking.cpp @@ -5,11 +5,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jsweakmap.h" - #include "gc/Heap.h" +#include "gc/WeakMap.h" #include "gc/Zone.h" - #include "jsapi-tests/tests.h" using namespace js; diff --git a/js/src/jsapi-tests/tests.h b/js/src/jsapi-tests/tests.h index 93b493276f8a..4ca1d9d7d257 100644 --- a/js/src/jsapi-tests/tests.h +++ b/js/src/jsapi-tests/tests.h @@ -16,8 +16,8 @@ #include #include "jsalloc.h" -#include "jsgc.h" +#include "gc/GC.h" #include "js/Vector.h" #include "vm/JSContext.h" diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 9a4b3c451b0a..a47ab447c822 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -35,7 +35,6 @@ #include "jsstr.h" #include "jstypes.h" #include "jsutil.h" -#include "jsweakmap.h" #include "jswrapper.h" #include "builtin/AtomicsObject.h" @@ -59,6 +58,7 @@ #include "gc/Marking.h" #include "gc/Policy.h" #include "gc/PublicIterators.h" +#include "gc/WeakMap.h" #include "jit/JitCommon.h" #include "js/CharacterEncoding.h" #include "js/Conversions.h" diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp index f392f892fa30..2c950824711b 100644 --- a/js/src/jsfriendapi.cpp +++ b/js/src/jsfriendapi.cpp @@ -11,13 +11,13 @@ #include #include "jsprf.h" -#include "jsweakmap.h" #include "jswrapper.h" #include "builtin/Promise.h" #include "builtin/TestingFunctions.h" #include "gc/GCInternals.h" #include "gc/PublicIterators.h" +#include "gc/WeakMap.h" #include "js/Proxy.h" #include "proxy/DeadObjectProxy.h" #include "vm/ArgumentsObject.h" diff --git a/js/src/moz.build b/js/src/moz.build index a10391b82457..cadf7dcd81fa 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -28,7 +28,7 @@ with Files('jit/**'): BUG_COMPONENT = component_jit # File-specific metadata -for gcfile in ['jsgc*', 'devtools/rootAnalysis', 'devtools/gc-ubench', 'devtools/gctrace']: +for gcfile in ['devtools/rootAnalysis', 'devtools/gc-ubench', 'devtools/gctrace']: with Files(gcfile): BUG_COMPONENT = component_gc @@ -193,6 +193,7 @@ UNIFIED_SOURCES += [ 'gc/Allocator.cpp', 'gc/AtomMarking.cpp', 'gc/Barrier.cpp', + 'gc/GC.cpp', 'gc/GCTrace.cpp', 'gc/Marking.cpp', 'gc/Memory.cpp', @@ -202,6 +203,8 @@ UNIFIED_SOURCES += [ 'gc/Statistics.cpp', 'gc/Tracer.cpp', 'gc/Verifier.cpp', + 'gc/WeakMap.cpp', + 'gc/WeakMapPtr.cpp', 'gc/Zone.cpp', 'gc/ZoneGroup.cpp', 'irregexp/NativeRegExpMacroAssembler.cpp', @@ -295,14 +298,12 @@ UNIFIED_SOURCES += [ 'jsdate.cpp', 'jsexn.cpp', 'jsfriendapi.cpp', - 'jsgc.cpp', 'jsiter.cpp', 'jsnativestack.cpp', 'jsnum.cpp', 'jsopcode.cpp', 'jsprf.cpp', 'jsstr.cpp', - 'jsweakmap.cpp', 'perf/jsperf.cpp', 'proxy/BaseProxyHandler.cpp', 'proxy/CrossCompartmentWrapper.cpp', @@ -377,7 +378,6 @@ UNIFIED_SOURCES += [ 'vm/UnboxedObject.cpp', 'vm/Unicode.cpp', 'vm/Value.cpp', - 'vm/WeakMapPtr.cpp', 'vm/Xdr.cpp', 'wasm/AsmJS.cpp', 'wasm/WasmBaselineCompile.cpp', diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index f9efb35a5a29..37732acabd5e 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -12,7 +12,6 @@ #include "mozilla/TypeTraits.h" #include "jsfriendapi.h" -#include "jshashutil.h" #include "jsnum.h" #include "jsprf.h" #include "jswrapper.h" @@ -20,6 +19,7 @@ #include "frontend/BytecodeCompiler.h" #include "frontend/Parser.h" #include "gc/FreeOp.h" +#include "gc/HashUtil.h" #include "gc/Marking.h" #include "gc/Policy.h" #include "gc/PublicIterators.h" @@ -42,9 +42,9 @@ #include "vm/WrapperObject.h" #include "wasm/WasmInstance.h" -#include "jsgcinlines.h" #include "jsopcodeinlines.h" +#include "gc/GC-inl.h" #include "vm/GeckoProfiler-inl.h" #include "vm/JSObject-inl.h" #include "vm/JSScript-inl.h" diff --git a/js/src/vm/Debugger.h b/js/src/vm/Debugger.h index 1c7f2c84843d..8a6a7a9d3b00 100644 --- a/js/src/vm/Debugger.h +++ b/js/src/vm/Debugger.h @@ -14,12 +14,12 @@ #include "mozilla/TimeStamp.h" #include "mozilla/Vector.h" -#include "jsweakmap.h" #include "jswrapper.h" #include "builtin/Promise.h" #include "ds/TraceableFifo.h" #include "gc/Barrier.h" +#include "gc/WeakMap.h" #include "js/Debug.h" #include "js/GCVariant.h" #include "js/HashTable.h" diff --git a/js/src/vm/EnvironmentObject.h b/js/src/vm/EnvironmentObject.h index fed16c358e5e..a5a906b280d4 100644 --- a/js/src/vm/EnvironmentObject.h +++ b/js/src/vm/EnvironmentObject.h @@ -7,11 +7,10 @@ #ifndef vm_EnvironmentObject_h #define vm_EnvironmentObject_h -#include "jsweakmap.h" - #include "builtin/ModuleObject.h" #include "frontend/NameAnalysisTypes.h" #include "gc/Barrier.h" +#include "gc/WeakMap.h" #include "js/GCHashTable.h" #include "vm/ArgumentsObject.h" #include "vm/JSContext.h" diff --git a/js/src/vm/JSCompartment.cpp b/js/src/vm/JSCompartment.cpp index 7806d118e164..db08ced59d3d 100644 --- a/js/src/vm/JSCompartment.cpp +++ b/js/src/vm/JSCompartment.cpp @@ -27,8 +27,7 @@ #include "vm/JSContext.h" #include "vm/WrapperObject.h" -#include "jsgcinlines.h" - +#include "gc/GC-inl.h" #include "gc/Marking-inl.h" #include "vm/JSAtom-inl.h" #include "vm/JSFunction-inl.h" diff --git a/js/src/vm/JSCompartment.h b/js/src/vm/JSCompartment.h index eb624505e226..44621dc18b60 100644 --- a/js/src/vm/JSCompartment.h +++ b/js/src/vm/JSCompartment.h @@ -1382,8 +1382,9 @@ struct WrapperValue /* * We use unsafeGet() in the constructors to avoid invoking a read barrier * on the wrapper, which may be dead (see the comment about bug 803376 in - * jsgc.cpp regarding this). If there is an incremental GC while the wrapper - * is in use, the AutoWrapper rooter will ensure the wrapper gets marked. + * gc/GC.cpp regarding this). If there is an incremental GC while the + * wrapper is in use, the AutoWrapper rooter will ensure the wrapper gets + * marked. */ explicit WrapperValue(const WrapperMap::Ptr& ptr) : value(*ptr->value().unsafeGet()) diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index 3bcd3364fd3f..b1f805cd81ff 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -234,10 +234,10 @@ class ScriptCounts }; // Note: The key of this hash map is a weak reference to a JSScript. We do not -// use the WeakMap implementation provided in jsweakmap.h because it would be +// use the WeakMap implementation provided in gc/WeakMap.h because it would be // collected at the beginning of the sweeping of the compartment, thus before -// the calls to the JSScript::finalize function which are used to aggregate code -// coverage results on the compartment. +// the calls to the JSScript::finalize function which are used to aggregate +// code coverage results on the compartment. typedef HashMap, diff --git a/js/src/vm/MemoryMetrics.cpp b/js/src/vm/MemoryMetrics.cpp index 97b17e54c952..37aaee478c4e 100644 --- a/js/src/vm/MemoryMetrics.cpp +++ b/js/src/vm/MemoryMetrics.cpp @@ -8,8 +8,7 @@ #include "mozilla/DebugOnly.h" -#include "jsgc.h" - +#include "gc/GC.h" #include "gc/Heap.h" #include "gc/Nursery.h" #include "gc/PublicIterators.h" diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp index 86e41f8a5b01..87801cc77ade 100644 --- a/js/src/vm/ObjectGroup.cpp +++ b/js/src/vm/ObjectGroup.cpp @@ -7,10 +7,10 @@ #include "vm/ObjectGroup.h" #include "jsexn.h" -#include "jshashutil.h" #include "builtin/DataViewObject.h" #include "gc/FreeOp.h" +#include "gc/HashUtil.h" #include "gc/Policy.h" #include "gc/StoreBuffer.h" #include "gc/Zone.h" diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp index 88eeef0527c5..456b44cc24ff 100644 --- a/js/src/vm/RegExpObject.cpp +++ b/js/src/vm/RegExpObject.cpp @@ -9,7 +9,6 @@ #include "mozilla/MemoryReporting.h" #include "mozilla/PodOperations.h" -#include "jshashutil.h" #include "jsstr.h" #ifdef DEBUG #include "jsutil.h" @@ -17,6 +16,7 @@ #include "builtin/RegExp.h" #include "frontend/TokenStream.h" +#include "gc/HashUtil.h" #ifdef DEBUG #include "irregexp/RegExpBytecode.h" #endif diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp index 6ec133df56a9..07c1b63525a2 100644 --- a/js/src/vm/Runtime.cpp +++ b/js/src/vm/Runtime.cpp @@ -48,8 +48,7 @@ #include "vm/TraceLoggingGraph.h" #include "wasm/WasmSignalHandlers.h" -#include "jsgcinlines.h" - +#include "gc/GC-inl.h" #include "vm/JSContext-inl.h" using namespace js; diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h index e9c2cf981bb9..b595a5f114ec 100644 --- a/js/src/vm/Runtime.h +++ b/js/src/vm/Runtime.h @@ -685,7 +685,7 @@ struct JSRuntime : public js::MallocProvider /* Gets current default locale. String remains owned by context. */ const char* getDefaultLocale(); - /* Garbage collector state, used by jsgc.c. */ + /* Garbage collector state. */ js::gc::GCRuntime gc; /* Garbage collector state has been successfully initialized. */ diff --git a/js/src/vm/SavedStacks.cpp b/js/src/vm/SavedStacks.cpp index 79a98eb4355d..926cc770d48b 100644 --- a/js/src/vm/SavedStacks.cpp +++ b/js/src/vm/SavedStacks.cpp @@ -16,11 +16,11 @@ #include "jsapi.h" #include "jsfriendapi.h" -#include "jshashutil.h" #include "jsmath.h" #include "jsnum.h" #include "gc/FreeOp.h" +#include "gc/HashUtil.h" #include "gc/Marking.h" #include "gc/Policy.h" #include "gc/Rooting.h" diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 0ab633225b23..a85f298605e7 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -14,7 +14,6 @@ #include "jsarray.h" #include "jsdate.h" #include "jsfriendapi.h" -#include "jshashutil.h" #include "jsiter.h" #include "jsstr.h" #include "jswrapper.h" @@ -37,6 +36,7 @@ #include "builtin/Stream.h" #include "builtin/TypedObject.h" #include "builtin/WeakMapObject.h" +#include "gc/HashUtil.h" #include "gc/Marking.h" #include "gc/Policy.h" #include "jit/AtomicOperations.h" diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index f2e712fdf0f2..21c7c0b1f6b0 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -12,9 +12,8 @@ #include "mozilla/MathAlgorithms.h" #include "mozilla/PodOperations.h" -#include "jshashutil.h" - #include "gc/FreeOp.h" +#include "gc/HashUtil.h" #include "gc/Policy.h" #include "gc/PublicIterators.h" #include "js/HashTable.h" diff --git a/js/src/vm/TypeInference-inl.h b/js/src/vm/TypeInference-inl.h index 12d293fdfc64..eaa0d60aee3a 100644 --- a/js/src/vm/TypeInference-inl.h +++ b/js/src/vm/TypeInference-inl.h @@ -15,9 +15,8 @@ #include "mozilla/Casting.h" #include "mozilla/PodOperations.h" -#include "jsgc.h" - #include "builtin/SymbolObject.h" +#include "gc/GC.h" #include "jit/BaselineJIT.h" #include "vm/ArrayObject.h" #include "vm/BooleanObject.h" diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp index 8950f79db14b..21eac0384d8d 100644 --- a/js/src/vm/TypeInference.cpp +++ b/js/src/vm/TypeInference.cpp @@ -13,10 +13,10 @@ #include "mozilla/Sprintf.h" #include "jsapi.h" -#include "jshashutil.h" #include "jsprf.h" #include "jsstr.h" +#include "gc/HashUtil.h" #include "jit/BaselineJIT.h" #include "jit/CompileInfo.h" #include "jit/Ion.h" From c1d0be71906c390e1dcf39edeffafce64bfa1073 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 14 Feb 2018 16:04:42 -0600 Subject: [PATCH 42/48] Bug 1438278 - Part 4: Rename some files into js/src/util. r=jandem. jsdtoa.* -> util/DoubleToString.* jswin.h -> util/Windows.h jsnativestack.cpp -> util/NativeStack.cpp jsnativestack.h -> util/NativeStack.h jsnspr.h -> util/NSPR.h --HG-- rename : js/src/jsdtoa.cpp => js/src/util/DoubleToString.cpp rename : js/src/jsdtoa.h => js/src/util/DoubleToString.h rename : js/src/jsnspr.h => js/src/util/NSPR.h rename : js/src/jsnativestack.cpp => js/src/util/NativeStack.cpp rename : js/src/jsnativestack.h => js/src/util/NativeStack.h rename : js/src/jswin.h => js/src/util/Windows.h extra : rebase_source : 189adff9f7cb74dfbd101b6b39986d63b0274096 extra : amend_source : 34efb7c0a7dd23bb797940558616e0657b20ef20 extra : intermediate-source : 16fc0963cac52ccb1ed2de9c174855e8a3cb2b52 extra : source : 7b8377e2efd5994b37b65bebd1fdd4367a849b93 --- config/check_spidermonkey_style.py | 2 +- js/src/builtin/DataViewObject.cpp | 6 ++--- js/src/ctypes/CTypes.cpp | 14 ++++------ js/src/devtools/vprof/vprof.cpp | 2 +- .../ds/MemoryProtectionExceptionHandler.cpp | 2 +- js/src/gc/GC.cpp | 6 ++--- js/src/gc/Memory.cpp | 24 ++++++++--------- js/src/jit/ProcessExecutableMemory.cpp | 6 ++--- js/src/jsapi-tests/testGCAllocator.cpp | 20 +++++++------- js/src/jsapi.cpp | 2 +- js/src/jsmath.cpp | 6 ++--- js/src/jsnum.cpp | 2 +- js/src/jsutil.cpp | 2 +- js/src/moz.build | 26 +++++++++---------- js/src/shell/OSObject.cpp | 6 ++--- js/src/shell/js.cpp | 6 ++--- js/src/threading/windows/CpuCount.cpp | 4 +-- js/src/threading/windows/Thread.cpp | 2 +- .../{jsdtoa.cpp => util/DoubleToString.cpp} | 2 +- js/src/{jsdtoa.h => util/DoubleToString.h} | 6 ++--- js/src/{jsnspr.h => util/NSPR.h} | 6 ++--- .../NativeStack.cpp} | 4 +-- .../{jsnativestack.h => util/NativeStack.h} | 6 ++--- js/src/{jswin.h => util/Windows.h} | 6 ++--- js/src/vm/ArrayBufferObject.cpp | 6 ++--- js/src/vm/HelperThreads.cpp | 3 +-- js/src/vm/JSContext.cpp | 7 +++-- js/src/vm/JSContext.h | 2 +- js/src/vm/JSONPrinter.cpp | 2 +- js/src/vm/JSObject.cpp | 2 +- js/src/vm/Printer.cpp | 5 ++-- js/src/vm/Runtime.cpp | 3 +-- js/src/vm/Stopwatch.cpp | 3 +-- js/src/vm/TypedArrayObject.cpp | 6 ++--- js/src/vtune/ittnotify_config.h | 2 +- js/src/wasm/WasmModule.cpp | 3 +-- js/src/wasm/WasmSignalHandlers.cpp | 2 +- js/src/wasm/WasmTextToBinary.cpp | 2 +- 38 files changed, 103 insertions(+), 113 deletions(-) rename js/src/{jsdtoa.cpp => util/DoubleToString.cpp} (99%) rename js/src/{jsdtoa.h => util/DoubleToString.h} (98%) rename js/src/{jsnspr.h => util/NSPR.h} (88%) rename js/src/{jsnativestack.cpp => util/NativeStack.cpp} (98%) rename js/src/{jsnativestack.h => util/NativeStack.h} (88%) rename js/src/{jswin.h => util/Windows.h} (89%) diff --git a/config/check_spidermonkey_style.py b/config/check_spidermonkey_style.py index 9157edc7a974..d608b0eaadd6 100644 --- a/config/check_spidermonkey_style.py +++ b/config/check_spidermonkey_style.py @@ -114,7 +114,7 @@ oddly_ordered_inclnames = set([ 'frontend/ReservedWordsGenerated.h', # Included in the body of frontend/TokenStream.h 'gc/StatsPhasesGenerated.h', # Included in the body of gc/Statistics.h 'gc/StatsPhasesGenerated.cpp', # Included in the body of gc/Statistics.cpp - 'jswin.h', # Must be #included before + 'util/Windows.h', # Must be #included before 'machine/endian.h', # Must be included after on BSD 'winbase.h', # Must precede other system headers(?) 'windef.h' # Must precede other system headers(?) diff --git a/js/src/builtin/DataViewObject.cpp b/js/src/builtin/DataViewObject.cpp index df7b793c42c2..84aaf0b7a3ed 100644 --- a/js/src/builtin/DataViewObject.cpp +++ b/js/src/builtin/DataViewObject.cpp @@ -14,13 +14,13 @@ #include "jsapi.h" #include "jsarray.h" #include "jsnum.h" -#ifdef XP_WIN -# include "jswin.h" -#endif #include "jswrapper.h" #include "jit/AtomicOperations.h" #include "js/Conversions.h" +#ifdef XP_WIN +# include "util/Windows.h" +#endif #include "vm/ArrayBufferObject.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp index 26ec8cb7a1d3..efa5417af90f 100644 --- a/js/src/ctypes/CTypes.cpp +++ b/js/src/ctypes/CTypes.cpp @@ -14,27 +14,22 @@ #include #include #include - #if defined(XP_WIN) -#include +# include #endif - #if defined(SOLARIS) -#include +# include #endif - #ifdef HAVE_SSIZE_T -#include +# include #endif - #if defined(XP_UNIX) -#include +# include #endif #include "jsexn.h" #include "jsnum.h" #include "jsprf.h" -#include "jswin.h" #include "builtin/TypedObject.h" #include "ctypes/Library.h" @@ -43,6 +38,7 @@ #include "gc/Zone.h" #include "jit/AtomicOperations.h" #include "js/Vector.h" +#include "util/Windows.h" #include "vm/JSContext.h" #include "vm/JSFunction.h" diff --git a/js/src/devtools/vprof/vprof.cpp b/js/src/devtools/vprof/vprof.cpp index c56fd89ad873..52011c908da5 100644 --- a/js/src/devtools/vprof/vprof.cpp +++ b/js/src/devtools/vprof/vprof.cpp @@ -9,7 +9,7 @@ // in the same process. #ifdef WIN32 -#include "jswin.h" +#include "util/Windows.h" #else #define __cdecl #include diff --git a/js/src/ds/MemoryProtectionExceptionHandler.cpp b/js/src/ds/MemoryProtectionExceptionHandler.cpp index 2f9112cc8c5d..762e97c03c0c 100644 --- a/js/src/ds/MemoryProtectionExceptionHandler.cpp +++ b/js/src/ds/MemoryProtectionExceptionHandler.cpp @@ -10,7 +10,7 @@ #include "mozilla/Atomics.h" #if defined(XP_WIN) -# include "jswin.h" +# include "util/Windows.h" #elif defined(XP_UNIX) && !defined(XP_DARWIN) # include # include diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index d9c6dce028e9..c1f62632257a 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -210,9 +210,6 @@ #include "jsprf.h" #include "jstypes.h" #include "jsutil.h" -#ifdef XP_WIN -# include "jswin.h" -#endif #include "gc/FindSCCs.h" #include "gc/FreeOp.h" @@ -226,6 +223,9 @@ #include "jit/JitcodeMap.h" #include "js/SliceBudget.h" #include "proxy/DeadObjectProxy.h" +#ifdef XP_WIN +# include "util/Windows.h" +#endif #include "vm/Debugger.h" #include "vm/GeckoProfiler.h" #include "vm/JSAtom.h" diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index 886b1926271c..1de79ea3a94b 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -14,24 +14,24 @@ #if defined(XP_WIN) -#include "mozilla/Sprintf.h" -#include "jswin.h" -#include +# include "mozilla/Sprintf.h" +# include "util/Windows.h" +# include #elif defined(SOLARIS) -#include -#include +# include +# include #elif defined(XP_UNIX) -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include +# include #endif diff --git a/js/src/jit/ProcessExecutableMemory.cpp b/js/src/jit/ProcessExecutableMemory.cpp index 6166d80001bc..b2c8fe4b64bd 100644 --- a/js/src/jit/ProcessExecutableMemory.cpp +++ b/js/src/jit/ProcessExecutableMemory.cpp @@ -13,16 +13,16 @@ #include "mozilla/TaggedAnonymousMemory.h" #include "mozilla/XorShift128PlusRNG.h" +#include + #include "jsfriendapi.h" #include "jsmath.h" #include "jsutil.h" -#include "jswin.h" - -#include #include "gc/Memory.h" #include "threading/LockGuard.h" #include "threading/Mutex.h" +#include "util/Windows.h" #include "vm/MutexIDs.h" #ifdef XP_WIN diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp index ec5407e8cca1..f8369844fb33 100644 --- a/js/src/jsapi-tests/testGCAllocator.cpp +++ b/js/src/jsapi-tests/testGCAllocator.cpp @@ -12,20 +12,20 @@ #include "jsapi-tests/tests.h" #if defined(XP_WIN) -#include "jswin.h" -#include +# include "util/Windows.h" +# include #elif defined(SOLARIS) // This test doesn't apply to Solaris. #elif defined(XP_UNIX) -#include -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include +# include #else -#error "Memory mapping functions are not defined for your OS." +# error "Memory mapping functions are not defined for your OS." #endif BEGIN_TEST(testGCAllocator) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index a47ab447c822..370e1eda8754 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -7355,7 +7355,7 @@ JS_GetGlobalJitCompilerOption(JSContext* cx, JSJitCompilerOption opt, uint32_t* #if !defined(STATIC_EXPORTABLE_JS_API) && !defined(STATIC_JS_API) && defined(XP_WIN) -#include "jswin.h" +#include "util/Windows.h" /* * Initialization routine for the JS DLL. diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index f8f174dc310f..945589c14515 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -25,12 +25,12 @@ #include "jsapi.h" #include "jslibmath.h" #include "jstypes.h" -#ifdef XP_WIN -# include "jswin.h" -#endif #include "jit/InlinableNatives.h" #include "js/Class.h" +#ifdef XP_WIN +# include "util/Windows.h" +#endif #include "vm/JSAtom.h" #include "vm/JSCompartment.h" #include "vm/JSContext.h" diff --git a/js/src/jsnum.cpp b/js/src/jsnum.cpp index 63a72b0f897f..16acc83a9f70 100644 --- a/js/src/jsnum.cpp +++ b/js/src/jsnum.cpp @@ -21,11 +21,11 @@ #include #include -#include "jsdtoa.h" #include "jsstr.h" #include "jstypes.h" #include "js/Conversions.h" +#include "util/DoubleToString.h" #include "vm/GlobalObject.h" #include "vm/JSAtom.h" #include "vm/JSContext.h" diff --git a/js/src/jsutil.cpp b/js/src/jsutil.cpp index ffa095eee8b8..01184dad513b 100644 --- a/js/src/jsutil.cpp +++ b/js/src/jsutil.cpp @@ -21,7 +21,7 @@ #include "vm/HelperThreads.h" #ifdef WIN32 -# include "jswin.h" +# include "util/Windows.h" #endif #include "js/Utility.h" diff --git a/js/src/moz.build b/js/src/moz.build index cadf7dcd81fa..381ec27be098 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -299,7 +299,6 @@ UNIFIED_SOURCES += [ 'jsexn.cpp', 'jsfriendapi.cpp', 'jsiter.cpp', - 'jsnativestack.cpp', 'jsnum.cpp', 'jsopcode.cpp', 'jsprf.cpp', @@ -315,6 +314,7 @@ UNIFIED_SOURCES += [ 'proxy/Wrapper.cpp', 'threading/Mutex.cpp', 'threading/ProtectedData.cpp', + 'util/NativeStack.cpp', 'vm/ArgumentsObject.cpp', 'vm/ArrayBufferObject.cpp', 'vm/AsyncFunction.cpp', @@ -406,30 +406,30 @@ UNIFIED_SOURCES += [ ] # jsarray.cpp and vm/JSAtom.cpp cannot be built in unified mode because -# xpcshell is broken during packaging when compiled with gcc-4.8.2 +# xpcshell is broken during packaging when compiled with gcc-4.8.2 # builtin/RegExp.cpp cannot be built in unified mode because it is built -# without PGO +# without PGO # frontend/Parser.cpp cannot be built in unified mode because of explicit -# template instantiations. -# jsdtoa.cpp cannot be built in unified mode because we want to suppress -# compiler warnings in third-party dtoa.c. +# template instantiations. # jsmath.cpp cannot be built in unified mode because it needs to re-#define the -# RtlGenRandom declaration's calling convention in on Windows. +# RtlGenRandom declaration's calling convention in on Windows. # jsutil.cpp cannot be built in unified mode because it is needed for -# check-vanilla-allocations. +# check-vanilla-allocations. # StoreBuffer.cpp cannot be built in unified because its template -# instantiations may or may not be needed depending on what it gets bundled -# with. +# instantiations may or may not be needed depending on what it gets bundled +# with. +# util/DoubleToString.cpp cannot be built in unified mode because we want to +# suppress compiler warnings in third-party dtoa.c. # vm/Interpreter.cpp is gigantic and destroys incremental build times for any -# files unlucky enough to be unified with it. +# files unlucky enough to be unified with it. SOURCES += [ 'builtin/RegExp.cpp', 'frontend/Parser.cpp', 'gc/StoreBuffer.cpp', 'jsarray.cpp', - 'jsdtoa.cpp', 'jsmath.cpp', 'jsutil.cpp', + 'util/DoubleToString.cpp', 'vm/Interpreter.cpp', 'vm/JSAtom.cpp', ] @@ -786,7 +786,7 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'): # Suppress warnings in third-party code. if CONFIG['CC_TYPE'] in ('clang', 'gcc'): - SOURCES['jsdtoa.cpp'].flags += ['-Wno-implicit-fallthrough'] + SOURCES['util/DoubleToString.cpp'].flags += ['-Wno-implicit-fallthrough'] # Generate GC statistics phase data. GENERATED_FILES += ['gc/StatsPhasesGenerated.h'] diff --git a/js/src/shell/OSObject.cpp b/js/src/shell/OSObject.cpp index ca737d6fab7f..367df40d5e7c 100644 --- a/js/src/shell/OSObject.cpp +++ b/js/src/shell/OSObject.cpp @@ -23,14 +23,14 @@ // For JSFunctionSpecWithHelp #include "jsfriendapi.h" #include "jsstr.h" -#ifdef XP_WIN -# include "jswin.h" -#endif #include "jswrapper.h" #include "gc/FreeOp.h" #include "js/Conversions.h" #include "shell/jsshell.h" +#ifdef XP_WIN +# include "util/Windows.h" +#endif #include "vm/JSObject.h" #include "vm/StringBuffer.h" #include "vm/TypedArrayObject.h" diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 8638ad5abd6b..aacff7df6b70 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -55,9 +55,6 @@ #include "jsprf.h" #include "jstypes.h" #include "jsutil.h" -#ifdef XP_WIN -# include "jswin.h" -#endif #include "jswrapper.h" #ifndef JS_POSIX_NSPR # include "prerror.h" @@ -92,6 +89,9 @@ #include "threading/ExclusiveData.h" #include "threading/LockGuard.h" #include "threading/Thread.h" +#ifdef XP_WIN +# include "util/Windows.h" +#endif #include "vm/ArgumentsObject.h" #include "vm/AsyncFunction.h" #include "vm/AsyncIteration.h" diff --git a/js/src/threading/windows/CpuCount.cpp b/js/src/threading/windows/CpuCount.cpp index 5a4ab1ba12ff..e718aeccd530 100644 --- a/js/src/threading/windows/CpuCount.cpp +++ b/js/src/threading/windows/CpuCount.cpp @@ -3,10 +3,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jswin.h" - #include "threading/CpuCount.h" +#include "util/Windows.h" + uint32_t js::GetCPUCount() { diff --git a/js/src/threading/windows/Thread.cpp b/js/src/threading/windows/Thread.cpp index 180fa78a3ec6..077d5e6a1416 100644 --- a/js/src/threading/windows/Thread.cpp +++ b/js/src/threading/windows/Thread.cpp @@ -8,8 +8,8 @@ #include #include -#include "jswin.h" #include "threading/Thread.h" +#include "util/Windows.h" class js::Thread::Id::PlatformData { diff --git a/js/src/jsdtoa.cpp b/js/src/util/DoubleToString.cpp similarity index 99% rename from js/src/jsdtoa.cpp rename to js/src/util/DoubleToString.cpp index 7c593e4a970f..64bab1fab954 100644 --- a/js/src/jsdtoa.cpp +++ b/js/src/util/DoubleToString.cpp @@ -8,7 +8,7 @@ * Portable double to alphanumeric string and back converters. */ -#include "jsdtoa.h" +#include "util/DoubleToString.h" #include "jsprf.h" #include "jstypes.h" diff --git a/js/src/jsdtoa.h b/js/src/util/DoubleToString.h similarity index 98% rename from js/src/jsdtoa.h rename to js/src/util/DoubleToString.h index cf697506fca4..cb7f14b20265 100644 --- a/js/src/jsdtoa.h +++ b/js/src/util/DoubleToString.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsdtoa_h -#define jsdtoa_h +#ifndef util_DoubleToString_h +#define util_DoubleToString_h /* * Public interface to portable double-precision floating point to string @@ -110,4 +110,4 @@ js_dtostr(DtoaState* state, char* buffer, size_t bufferSize, JSDToStrMode mode, char* js_dtobasestr(DtoaState* state, int base, double d); -#endif /* jsdtoa_h */ +#endif /* util_DoubleToString_h */ diff --git a/js/src/jsnspr.h b/js/src/util/NSPR.h similarity index 88% rename from js/src/jsnspr.h rename to js/src/util/NSPR.h index 504bae92bd5b..e78774b88d0c 100644 --- a/js/src/jsnspr.h +++ b/js/src/util/NSPR.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsnspr_h -#define jsnspr_h +#ifndef util_NSPR_h +#define util_NSPR_h #ifdef JS_POSIX_NSPR @@ -19,4 +19,4 @@ #endif /* JS_POSIX_NSPR */ -#endif /* jsnspr_h */ +#endif /* util_NSPR_h */ diff --git a/js/src/jsnativestack.cpp b/js/src/util/NativeStack.cpp similarity index 98% rename from js/src/jsnativestack.cpp rename to js/src/util/NativeStack.cpp index e918fe92ed45..75ae81d08334 100644 --- a/js/src/jsnativestack.cpp +++ b/js/src/util/NativeStack.cpp @@ -4,10 +4,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jsnativestack.h" +#include "util/NativeStack.h" #ifdef XP_WIN -# include "jswin.h" +# include "util/Windows.h" #elif defined(XP_DARWIN) || defined(DARWIN) || defined(XP_UNIX) # include diff --git a/js/src/jsnativestack.h b/js/src/util/NativeStack.h similarity index 88% rename from js/src/jsnativestack.h rename to js/src/util/NativeStack.h index 823749149e01..aa15027c7112 100644 --- a/js/src/jsnativestack.h +++ b/js/src/util/NativeStack.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsnativestack_h -#define jsnativestack_h +#ifndef util_NativeStack_h +#define util_NativeStack_h #include "js/Utility.h" @@ -25,4 +25,4 @@ GetNativeStackBase() } /* namespace js */ -#endif /* jsnativestack_h */ +#endif /* util_NativeStack_h */ diff --git a/js/src/jswin.h b/js/src/util/Windows.h similarity index 89% rename from js/src/jswin.h rename to js/src/util/Windows.h index a14524ee18fc..83eb02477a9b 100644 --- a/js/src/jswin.h +++ b/js/src/util/Windows.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jswin_h -#define jswin_h +#ifndef util_Windows_h +#define util_Windows_h /* * This file is a wrapper around to prevent the mangling of @@ -25,4 +25,4 @@ # undef PASSTHROUGH #endif -#endif /* jswin_h */ +#endif /* util_Windows_h */ diff --git a/js/src/vm/ArrayBufferObject.cpp b/js/src/vm/ArrayBufferObject.cpp index c46f16d37c27..2481c6c4c1cb 100644 --- a/js/src/vm/ArrayBufferObject.cpp +++ b/js/src/vm/ArrayBufferObject.cpp @@ -29,9 +29,6 @@ #include "jsnum.h" #include "jstypes.h" #include "jsutil.h" -#ifdef XP_WIN -# include "jswin.h" -#endif #include "jswrapper.h" #include "builtin/DataViewObject.h" @@ -40,6 +37,9 @@ #include "gc/Memory.h" #include "js/Conversions.h" #include "js/MemoryMetrics.h" +#ifdef XP_WIN +# include "util/Windows.h" +#endif #include "vm/GlobalObject.h" #include "vm/Interpreter.h" #include "vm/JSContext.h" diff --git a/js/src/vm/HelperThreads.cpp b/js/src/vm/HelperThreads.cpp index bbe13b1d62e5..448e86edeb5f 100644 --- a/js/src/vm/HelperThreads.cpp +++ b/js/src/vm/HelperThreads.cpp @@ -10,14 +10,13 @@ #include "mozilla/Maybe.h" #include "mozilla/Unused.h" -#include "jsnativestack.h" - #include "builtin/Promise.h" #include "frontend/BytecodeCompiler.h" #include "gc/GCInternals.h" #include "jit/IonBuilder.h" #include "js/Utility.h" #include "threading/CpuCount.h" +#include "util/NativeStack.h" #include "vm/Debugger.h" #include "vm/ErrorReporting.h" #include "vm/SharedImmutableStringsCache.h" diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp index 2c8b98b3afa0..545597112dd7 100644 --- a/js/src/vm/JSContext.cpp +++ b/js/src/vm/JSContext.cpp @@ -27,23 +27,22 @@ #ifdef XP_WIN #include #endif // XP_WIN - -#include "jsdtoa.h" #include "jsexn.h" #include "jsiter.h" -#include "jsnativestack.h" #include "jsopcode.h" #include "jsprf.h" #include "jspubtd.h" #include "jsstr.h" #include "jstypes.h" -#include "jswin.h" #include "gc/FreeOp.h" #include "gc/Marking.h" #include "jit/Ion.h" #include "jit/PcScriptCache.h" #include "js/CharacterEncoding.h" +#include "util/DoubleToString.h" +#include "util/NativeStack.h" +#include "util/Windows.h" #include "vm/ErrorReporting.h" #include "vm/HelperThreads.h" #include "vm/JSAtom.h" diff --git a/js/src/vm/JSContext.h b/js/src/vm/JSContext.h index e487df8f4dd6..f84c26891a92 100644 --- a/js/src/vm/JSContext.h +++ b/js/src/vm/JSContext.h @@ -460,7 +460,7 @@ struct JSContext : public JS::RootingContext, js::jit::AutoFlushICache* autoFlushICache() const; void setAutoFlushICache(js::jit::AutoFlushICache* afc); - /* State used by jsdtoa.cpp. */ + // State used by util/DoubleToString.cpp. js::ThreadLocalData dtoaState; // Any GC activity occurring on this thread. diff --git a/js/src/vm/JSONPrinter.cpp b/js/src/vm/JSONPrinter.cpp index d2b49d0f65b7..38c5e6935bfb 100644 --- a/js/src/vm/JSONPrinter.cpp +++ b/js/src/vm/JSONPrinter.cpp @@ -12,7 +12,7 @@ #include -#include "jsdtoa.h" +#include "util/DoubleToString.h" using namespace js; diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp index ae6dabd46bfa..cfe4a8b95a52 100644 --- a/js/src/vm/JSObject.cpp +++ b/js/src/vm/JSObject.cpp @@ -28,7 +28,6 @@ #include "jsstr.h" #include "jstypes.h" #include "jsutil.h" -#include "jswin.h" #include "jswrapper.h" #include "builtin/Eval.h" @@ -41,6 +40,7 @@ #include "js/Proxy.h" #include "js/UbiNode.h" #include "js/UniquePtr.h" +#include "util/Windows.h" #include "vm/ArgumentsObject.h" #include "vm/Interpreter.h" #include "vm/JSAtom.h" diff --git a/js/src/vm/Printer.cpp b/js/src/vm/Printer.cpp index 461574adb5df..7657da5e296f 100644 --- a/js/src/vm/Printer.cpp +++ b/js/src/vm/Printer.cpp @@ -16,11 +16,10 @@ #include "jsutil.h" #include "ds/LifoAlloc.h" -#include "vm/JSContext.h" - #ifdef XP_WIN32 -#include "jswin.h" +# include "util/Windows.h" #endif +#include "vm/JSContext.h" using mozilla::PodCopy; diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp index 07c1b63525a2..0b46219f58a1 100644 --- a/js/src/vm/Runtime.cpp +++ b/js/src/vm/Runtime.cpp @@ -23,9 +23,7 @@ #ifdef JS_CAN_CHECK_THREADSAFE_ACCESSES # include #endif - #include "jsmath.h" -#include "jswin.h" #include "jswrapper.h" #include "builtin/Promise.h" @@ -40,6 +38,7 @@ #include "js/Date.h" #include "js/MemoryMetrics.h" #include "js/SliceBudget.h" +#include "util/Windows.h" #include "vm/Debugger.h" #include "vm/JSAtom.h" #include "vm/JSObject.h" diff --git a/js/src/vm/Stopwatch.cpp b/js/src/vm/Stopwatch.cpp index ea4342c09727..7e548260f575 100644 --- a/js/src/vm/Stopwatch.cpp +++ b/js/src/vm/Stopwatch.cpp @@ -14,9 +14,8 @@ #include #endif // defined(XP_WIN) -#include "jswin.h" - #include "gc/PublicIterators.h" +#include "util/Windows.h" #include "vm/JSCompartment.h" #include "vm/Runtime.h" diff --git a/js/src/vm/TypedArrayObject.cpp b/js/src/vm/TypedArrayObject.cpp index d476f8452c24..6b05e22089d1 100644 --- a/js/src/vm/TypedArrayObject.cpp +++ b/js/src/vm/TypedArrayObject.cpp @@ -23,9 +23,6 @@ #include "jsnum.h" #include "jstypes.h" #include "jsutil.h" -#ifdef XP_WIN -# include "jswin.h" -#endif #include "jswrapper.h" #include "builtin/DataViewObject.h" @@ -34,6 +31,9 @@ #include "gc/Marking.h" #include "jit/InlinableNatives.h" #include "js/Conversions.h" +#ifdef XP_WIN +# include "util/Windows.h" +#endif #include "vm/ArrayBufferObject.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" diff --git a/js/src/vtune/ittnotify_config.h b/js/src/vtune/ittnotify_config.h index 126afe692259..8fa6c73281a1 100644 --- a/js/src/vtune/ittnotify_config.h +++ b/js/src/vtune/ittnotify_config.h @@ -244,7 +244,7 @@ /* OS communication functions */ #if ITT_PLATFORM==ITT_PLATFORM_WIN -#include "jswin.h" +#include "util/Windows.h" typedef HMODULE lib_t; typedef DWORD TIDT; typedef CRITICAL_SECTION mutex_t; diff --git a/js/src/wasm/WasmModule.cpp b/js/src/wasm/WasmModule.cpp index db67351281d5..b09110379a7e 100644 --- a/js/src/wasm/WasmModule.cpp +++ b/js/src/wasm/WasmModule.cpp @@ -21,10 +21,9 @@ #include #include -#include "jsnspr.h" - #include "jit/JitOptions.h" #include "threading/LockGuard.h" +#include "util/NSPR.h" #include "wasm/WasmCompile.h" #include "wasm/WasmInstance.h" #include "wasm/WasmJS.h" diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp index 380f206b7dc3..87b0e7fac3cd 100644 --- a/js/src/wasm/WasmSignalHandlers.cpp +++ b/js/src/wasm/WasmSignalHandlers.cpp @@ -270,7 +270,7 @@ struct AutoSignalHandler #endif #if defined(XP_WIN) -# include "jswin.h" +# include "util/Windows.h" #else # include # include diff --git a/js/src/wasm/WasmTextToBinary.cpp b/js/src/wasm/WasmTextToBinary.cpp index 26d12490507e..b02e3035a6e4 100644 --- a/js/src/wasm/WasmTextToBinary.cpp +++ b/js/src/wasm/WasmTextToBinary.cpp @@ -22,7 +22,6 @@ #include "mozilla/MathAlgorithms.h" #include "mozilla/Maybe.h" -#include "jsdtoa.h" #include "jsnum.h" #include "jsprf.h" #include "jsstr.h" @@ -30,6 +29,7 @@ #include "ds/LifoAlloc.h" #include "js/CharacterEncoding.h" #include "js/HashTable.h" +#include "util/DoubleToString.h" #include "wasm/WasmAST.h" #include "wasm/WasmTypes.h" #include "wasm/WasmValidate.h" From d928a7f5ea167de4b42f05baa43ca6d70c0b8697 Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Wed, 14 Feb 2018 16:45:07 -0600 Subject: [PATCH 43/48] Bug 1438278 - Part 5: Rename some files into js/src/vm. r=jandem. jsiter* -> vm/Iteration* jsopcode* -> vm/BytecodeUtil* --HG-- rename : js/src/jsopcodeinlines.h => js/src/vm/BytecodeUtil-inl.h rename : js/src/jsopcode.cpp => js/src/vm/BytecodeUtil.cpp rename : js/src/jsopcode.h => js/src/vm/BytecodeUtil.h rename : js/src/jsiter.cpp => js/src/vm/Iteration.cpp rename : js/src/jsiter.h => js/src/vm/Iteration.h extra : rebase_source : 0e1ca938ad4d0143ddd0139f557578f8199b127f extra : amend_source : fc0f8886d045d24a49472b0311e4a5e3f9e7ead9 extra : source : 61d959cb5208c4f5a448ef06058d92c66da906ce --- js/src/builtin/MapObject.cpp | 3 +-- js/src/builtin/Promise.cpp | 2 +- js/src/builtin/TestingFunctions.cpp | 2 +- js/src/builtin/WeakSetObject.cpp | 2 +- js/src/frontend/BytecodeEmitter.cpp | 2 +- js/src/frontend/BytecodeEmitter.h | 5 ++--- js/src/frontend/NameAnalysisTypes.h | 9 ++++----- js/src/frontend/Parser.cpp | 2 +- js/src/frontend/Parser.h | 2 +- js/src/frontend/SharedContext.h | 2 +- js/src/jit/BaselineIC.h | 3 +-- js/src/jit/BaselineJIT.cpp | 3 +-- js/src/jit/BytecodeAnalysis.cpp | 6 ++---- js/src/jit/IonAnalysis.cpp | 3 +-- js/src/jit/IonBuilder.cpp | 3 +-- js/src/jit/Lowering.cpp | 3 +-- js/src/jit/RangeAnalysis.cpp | 2 +- js/src/jit/Recover.cpp | 2 +- js/src/jit/arm/MacroAssembler-arm.h | 3 +-- js/src/jit/mips32/MacroAssembler-mips32.h | 3 +-- js/src/jit/mips32/SharedIC-mips32.cpp | 3 +-- js/src/jit/mips64/MacroAssembler-mips64.h | 3 +-- js/src/jit/mips64/SharedIC-mips64.cpp | 3 +-- js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp | 2 +- js/src/jsapi.cpp | 2 +- js/src/jsarray.cpp | 2 +- js/src/jsstr.cpp | 6 +++--- js/src/moz.build | 4 ++-- js/src/proxy/CrossCompartmentWrapper.cpp | 2 +- js/src/{jsopcodeinlines.h => vm/BytecodeUtil-inl.h} | 8 ++++---- js/src/{jsopcode.cpp => vm/BytecodeUtil.cpp} | 2 +- js/src/{jsopcode.h => vm/BytecodeUtil.h} | 6 +++--- js/src/vm/CodeCoverage.cpp | 8 ++++---- js/src/vm/Debugger.cpp | 3 +-- js/src/vm/EnvironmentObject.cpp | 3 +-- js/src/vm/GlobalObject.h | 6 ++++-- js/src/vm/Interpreter.cpp | 4 ++-- js/src/vm/Interpreter.h | 2 +- js/src/{jsiter.cpp => vm/Iteration.cpp} | 4 ++-- js/src/{jsiter.h => vm/Iteration.h} | 6 +++--- js/src/vm/JSCompartment-inl.h | 3 +-- js/src/vm/JSCompartment.cpp | 2 +- js/src/vm/JSContext-inl.h | 3 +-- js/src/vm/JSContext.cpp | 6 +++--- js/src/vm/JSObject.cpp | 4 ++-- js/src/vm/JSScript.cpp | 2 +- js/src/vm/JSScript.h | 2 +- js/src/vm/Scope.h | 3 +-- js/src/vm/SelfHosting.cpp | 2 +- 49 files changed, 75 insertions(+), 93 deletions(-) rename js/src/{jsopcodeinlines.h => vm/BytecodeUtil-inl.h} (95%) rename js/src/{jsopcode.cpp => vm/BytecodeUtil.cpp} (99%) rename js/src/{jsopcode.h => vm/BytecodeUtil.h} (99%) rename js/src/{jsiter.cpp => vm/Iteration.cpp} (99%) rename js/src/{jsiter.h => vm/Iteration.h} (98%) diff --git a/js/src/builtin/MapObject.cpp b/js/src/builtin/MapObject.cpp index 3633d44fe9ae..d1ea484fe406 100644 --- a/js/src/builtin/MapObject.cpp +++ b/js/src/builtin/MapObject.cpp @@ -6,13 +6,12 @@ #include "builtin/MapObject.h" -#include "jsiter.h" - #include "ds/OrderedHashTable.h" #include "gc/FreeOp.h" #include "js/Utility.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSContext.h" #include "vm/JSObject.h" #include "vm/SelfHosting.h" diff --git a/js/src/builtin/Promise.cpp b/js/src/builtin/Promise.cpp index 4c4231a62517..b2b43767a9e6 100644 --- a/js/src/builtin/Promise.cpp +++ b/js/src/builtin/Promise.cpp @@ -12,13 +12,13 @@ #include "jsexn.h" #include "jsfriendapi.h" -#include "jsiter.h" #include "gc/Heap.h" #include "js/Debug.h" #include "vm/AsyncFunction.h" #include "vm/AsyncIteration.h" #include "vm/Debugger.h" +#include "vm/Iteration.h" #include "vm/JSContext.h" #include "vm/Debugger-inl.h" diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index f9aa6a32fd43..acdcc3a957ca 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -18,7 +18,6 @@ #include "jsapi.h" #include "jsfriendapi.h" -#include "jsiter.h" #include "jsprf.h" #include "jswrapper.h" @@ -42,6 +41,7 @@ #include "vm/Debugger.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSContext.h" #include "vm/JSObject.h" #include "vm/ProxyObject.h" diff --git a/js/src/builtin/WeakSetObject.cpp b/js/src/builtin/WeakSetObject.cpp index e6a7c9379579..80c467c9a93e 100644 --- a/js/src/builtin/WeakSetObject.cpp +++ b/js/src/builtin/WeakSetObject.cpp @@ -7,10 +7,10 @@ #include "builtin/WeakSetObject.h" #include "jsapi.h" -#include "jsiter.h" #include "builtin/MapObject.h" #include "vm/GlobalObject.h" +#include "vm/Iteration.h" #include "vm/JSContext.h" #include "vm/SelfHosting.h" diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 091eff5a9bb7..59fb359e84a1 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -20,13 +20,13 @@ #include "jsapi.h" #include "jsnum.h" -#include "jsopcode.h" #include "jstypes.h" #include "jsutil.h" #include "ds/Nestable.h" #include "frontend/Parser.h" #include "frontend/TokenStream.h" +#include "vm/BytecodeUtil.h" #include "vm/Debugger.h" #include "vm/GeneratorObject.h" #include "vm/JSAtom.h" diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h index 577f90a912c0..fee88be237c6 100644 --- a/js/src/frontend/BytecodeEmitter.h +++ b/js/src/frontend/BytecodeEmitter.h @@ -11,14 +11,13 @@ #include "mozilla/Attributes.h" -#include "jsiter.h" -#include "jsopcode.h" - #include "ds/InlineTable.h" #include "frontend/EitherParser.h" #include "frontend/SharedContext.h" #include "frontend/SourceNotes.h" +#include "vm/BytecodeUtil.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSContext.h" #include "vm/JSScript.h" diff --git a/js/src/frontend/NameAnalysisTypes.h b/js/src/frontend/NameAnalysisTypes.h index f586417151dc..b24799b8e363 100644 --- a/js/src/frontend/NameAnalysisTypes.h +++ b/js/src/frontend/NameAnalysisTypes.h @@ -4,11 +4,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef frontend_NameAnalysis_h -#define frontend_NameAnalysis_h - -#include "jsopcode.h" +#ifndef frontend_NameAnalysisTypes_h +#define frontend_NameAnalysisTypes_h +#include "vm/BytecodeUtil.h" #include "vm/Scope.h" namespace js { @@ -377,4 +376,4 @@ struct IsPod : TrueType {}; } // namespace mozilla -#endif // frontend_NameAnalysis_h +#endif // frontend_NameAnalysisTypes_h diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index b4f73ae41acb..f7a848b6065e 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -24,7 +24,6 @@ #include "mozilla/TypeTraits.h" #include "jsapi.h" -#include "jsopcode.h" #include "jstypes.h" #include "builtin/ModuleObject.h" @@ -33,6 +32,7 @@ #include "frontend/FoldConstants.h" #include "frontend/TokenStream.h" #include "irregexp/RegExpParser.h" +#include "vm/BytecodeUtil.h" #include "vm/JSAtom.h" #include "vm/JSContext.h" #include "vm/JSFunction.h" diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h index 3752b9d5dfa2..a0362cde875e 100644 --- a/js/src/frontend/Parser.h +++ b/js/src/frontend/Parser.h @@ -168,7 +168,6 @@ #include "mozilla/Maybe.h" #include "mozilla/TypeTraits.h" -#include "jsiter.h" #include "jspubtd.h" #include "ds/Nestable.h" @@ -181,6 +180,7 @@ #include "frontend/SharedContext.h" #include "frontend/SyntaxParseHandler.h" #include "frontend/TokenStream.h" +#include "vm/Iteration.h" namespace js { diff --git a/js/src/frontend/SharedContext.h b/js/src/frontend/SharedContext.h index 9117a9790935..74ca11a431b0 100644 --- a/js/src/frontend/SharedContext.h +++ b/js/src/frontend/SharedContext.h @@ -7,7 +7,6 @@ #ifndef frontend_SharedContext_h #define frontend_SharedContext_h -#include "jsopcode.h" #include "jspubtd.h" #include "jstypes.h" @@ -15,6 +14,7 @@ #include "ds/InlineTable.h" #include "frontend/ParseNode.h" #include "frontend/TokenStream.h" +#include "vm/BytecodeUtil.h" #include "vm/EnvironmentObject.h" #include "vm/JSAtom.h" #include "vm/JSScript.h" diff --git a/js/src/jit/BaselineIC.h b/js/src/jit/BaselineIC.h index 96337c2097ae..a9995d23e799 100644 --- a/js/src/jit/BaselineIC.h +++ b/js/src/jit/BaselineIC.h @@ -9,8 +9,6 @@ #include "mozilla/Assertions.h" -#include "jsopcode.h" - #include "builtin/TypedObject.h" #include "gc/Barrier.h" #include "jit/BaselineICList.h" @@ -19,6 +17,7 @@ #include "jit/SharedICRegisters.h" #include "js/GCVector.h" #include "vm/ArrayObject.h" +#include "vm/BytecodeUtil.h" #include "vm/JSCompartment.h" #include "vm/JSContext.h" #include "vm/UnboxedObject.h" diff --git a/js/src/jit/BaselineJIT.cpp b/js/src/jit/BaselineJIT.cpp index f1bd6e3019ac..0737ffdec5c5 100644 --- a/js/src/jit/BaselineJIT.cpp +++ b/js/src/jit/BaselineJIT.cpp @@ -22,11 +22,10 @@ #include "vm/TraceLogging.h" #include "wasm/WasmInstance.h" -#include "jsopcodeinlines.h" - #include "gc/PrivateIterators-inl.h" #include "jit/JitFrames-inl.h" #include "jit/MacroAssembler-inl.h" +#include "vm/BytecodeUtil-inl.h" #include "vm/JSObject-inl.h" #include "vm/JSScript-inl.h" #include "vm/Stack-inl.h" diff --git a/js/src/jit/BytecodeAnalysis.cpp b/js/src/jit/BytecodeAnalysis.cpp index b83ee96d4b19..b7197fc65634 100644 --- a/js/src/jit/BytecodeAnalysis.cpp +++ b/js/src/jit/BytecodeAnalysis.cpp @@ -6,12 +6,10 @@ #include "jit/BytecodeAnalysis.h" -#include "jsopcode.h" - #include "jit/JitSpewer.h" +#include "vm/BytecodeUtil.h" -#include "jsopcodeinlines.h" - +#include "vm/BytecodeUtil-inl.h" #include "vm/JSScript-inl.h" using namespace js; diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index 52091e2f9518..bd95ccb67493 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -19,9 +19,8 @@ #include "vm/RegExpObject.h" #include "vm/SelfHosting.h" -#include "jsopcodeinlines.h" - #include "jit/shared/Lowering-shared-inl.h" +#include "vm/BytecodeUtil-inl.h" #include "vm/JSObject-inl.h" #include "vm/JSScript-inl.h" diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 60d7d2937b4b..3b43fca9ae8e 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -25,11 +25,10 @@ #include "vm/RegExpStatics.h" #include "vm/TraceLogging.h" -#include "jsopcodeinlines.h" - #include "gc/Nursery-inl.h" #include "jit/CompileInfo-inl.h" #include "jit/shared/Lowering-shared-inl.h" +#include "vm/BytecodeUtil-inl.h" #include "vm/EnvironmentObject-inl.h" #include "vm/JSScript-inl.h" #include "vm/NativeObject-inl.h" diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index 8e29495e8d69..07faf8b9b9a3 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -14,9 +14,8 @@ #include "jit/MIRGraph.h" #include "wasm/WasmSignalHandlers.h" -#include "jsopcodeinlines.h" - #include "jit/shared/Lowering-shared-inl.h" +#include "vm/BytecodeUtil-inl.h" #include "vm/JSObject-inl.h" using namespace js; diff --git a/js/src/jit/RangeAnalysis.cpp b/js/src/jit/RangeAnalysis.cpp index 465f6324c89f..026cfa9e7a66 100644 --- a/js/src/jit/RangeAnalysis.cpp +++ b/js/src/jit/RangeAnalysis.cpp @@ -18,7 +18,7 @@ #include "vm/ArgumentsObject.h" #include "vm/TypedArrayObject.h" -#include "jsopcodeinlines.h" +#include "vm/BytecodeUtil-inl.h" using namespace js; using namespace js::jit; diff --git a/js/src/jit/Recover.cpp b/js/src/jit/Recover.cpp index f89a1a066f14..a37ce9d85da4 100644 --- a/js/src/jit/Recover.cpp +++ b/js/src/jit/Recover.cpp @@ -7,7 +7,6 @@ #include "jit/Recover.h" #include "jsapi.h" -#include "jsiter.h" #include "jsmath.h" #include "jsstr.h" @@ -21,6 +20,7 @@ #include "jit/MIRGraph.h" #include "jit/VMFunctions.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSContext.h" #include "vm/JSObject.h" #include "vm/String.h" diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h index bdc0e0a3aae8..48149b0894f7 100644 --- a/js/src/jit/arm/MacroAssembler-arm.h +++ b/js/src/jit/arm/MacroAssembler-arm.h @@ -9,11 +9,10 @@ #include "mozilla/DebugOnly.h" -#include "jsopcode.h" - #include "jit/arm/Assembler-arm.h" #include "jit/JitFrames.h" #include "jit/MoveResolver.h" +#include "vm/BytecodeUtil.h" using mozilla::DebugOnly; diff --git a/js/src/jit/mips32/MacroAssembler-mips32.h b/js/src/jit/mips32/MacroAssembler-mips32.h index a7b2685331e8..dade88ae3689 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.h +++ b/js/src/jit/mips32/MacroAssembler-mips32.h @@ -7,11 +7,10 @@ #ifndef jit_mips32_MacroAssembler_mips32_h #define jit_mips32_MacroAssembler_mips32_h -#include "jsopcode.h" - #include "jit/JitFrames.h" #include "jit/mips-shared/MacroAssembler-mips-shared.h" #include "jit/MoveResolver.h" +#include "vm/BytecodeUtil.h" namespace js { namespace jit { diff --git a/js/src/jit/mips32/SharedIC-mips32.cpp b/js/src/jit/mips32/SharedIC-mips32.cpp index 94a77fd85b98..a396e6fd6d2c 100644 --- a/js/src/jit/mips32/SharedIC-mips32.cpp +++ b/js/src/jit/mips32/SharedIC-mips32.cpp @@ -4,13 +4,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jsiter.h" - #include "jit/BaselineCompiler.h" #include "jit/BaselineIC.h" #include "jit/BaselineJIT.h" #include "jit/Linker.h" #include "jit/SharedICHelpers.h" +#include "vm/Iteration.h" #include "jsboolinlines.h" diff --git a/js/src/jit/mips64/MacroAssembler-mips64.h b/js/src/jit/mips64/MacroAssembler-mips64.h index 18f9f51bd075..892c332b5d07 100644 --- a/js/src/jit/mips64/MacroAssembler-mips64.h +++ b/js/src/jit/mips64/MacroAssembler-mips64.h @@ -7,11 +7,10 @@ #ifndef jit_mips64_MacroAssembler_mips64_h #define jit_mips64_MacroAssembler_mips64_h -#include "jsopcode.h" - #include "jit/JitFrames.h" #include "jit/mips-shared/MacroAssembler-mips-shared.h" #include "jit/MoveResolver.h" +#include "vm/BytecodeUtil.h" namespace js { namespace jit { diff --git a/js/src/jit/mips64/SharedIC-mips64.cpp b/js/src/jit/mips64/SharedIC-mips64.cpp index 1e73a92fe2d5..6db871e1d59f 100644 --- a/js/src/jit/mips64/SharedIC-mips64.cpp +++ b/js/src/jit/mips64/SharedIC-mips64.cpp @@ -4,13 +4,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jsiter.h" - #include "jit/BaselineCompiler.h" #include "jit/BaselineIC.h" #include "jit/BaselineJIT.h" #include "jit/Linker.h" #include "jit/SharedICHelpers.h" +#include "vm/Iteration.h" #include "jsboolinlines.h" diff --git a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp index 5ca091070d12..483174cdc15a 100644 --- a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp +++ b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp @@ -8,7 +8,7 @@ #include "mozilla/Sprintf.h" -#include "jsopcode.h" +#include "vm/BytecodeUtil.h" using namespace js; using namespace jit; diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 370e1eda8754..68a55043b8ed 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -28,7 +28,6 @@ #include "jsdate.h" #include "jsexn.h" #include "jsfriendapi.h" -#include "jsiter.h" #include "jsmath.h" #include "jsnum.h" #include "jsprf.h" @@ -76,6 +75,7 @@ #include "vm/ErrorObject.h" #include "vm/HelperThreads.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSAtom.h" #include "vm/JSContext.h" #include "vm/JSFunction.h" diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 65e8dd05c786..c237be74cdb3 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -16,7 +16,6 @@ #include "jsapi.h" #include "jsfriendapi.h" -#include "jsiter.h" #include "jsnum.h" #include "jstypes.h" #include "jsutil.h" @@ -28,6 +27,7 @@ #include "js/Conversions.h" #include "vm/ArgumentsObject.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSAtom.h" #include "vm/JSContext.h" #include "vm/JSFunction.h" diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index d51771d21283..8e72dc02fb82 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -24,7 +24,6 @@ #include "jsarray.h" #include "jsbool.h" #include "jsnum.h" -#include "jsopcode.h" #include "jstypes.h" #include "jsutil.h" @@ -35,9 +34,10 @@ #include "js/Conversions.h" #include "js/UniquePtr.h" #if ENABLE_INTL_API -#include "unicode/uchar.h" -#include "unicode/unorm2.h" +# include "unicode/uchar.h" +# include "unicode/unorm2.h" #endif +#include "vm/BytecodeUtil.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" #include "vm/JSAtom.h" diff --git a/js/src/moz.build b/js/src/moz.build index 381ec27be098..3dd68884a772 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -298,9 +298,7 @@ UNIFIED_SOURCES += [ 'jsdate.cpp', 'jsexn.cpp', 'jsfriendapi.cpp', - 'jsiter.cpp', 'jsnum.cpp', - 'jsopcode.cpp', 'jsprf.cpp', 'jsstr.cpp', 'perf/jsperf.cpp', @@ -319,6 +317,7 @@ UNIFIED_SOURCES += [ 'vm/ArrayBufferObject.cpp', 'vm/AsyncFunction.cpp', 'vm/AsyncIteration.cpp', + 'vm/BytecodeUtil.cpp', 'vm/Caches.cpp', 'vm/CallNonGenericMethod.cpp', 'vm/CharacterEncoding.cpp', @@ -337,6 +336,7 @@ UNIFIED_SOURCES += [ 'vm/HelperThreads.cpp', 'vm/Id.cpp', 'vm/Initialization.cpp', + 'vm/Iteration.cpp', 'vm/JSCompartment.cpp', 'vm/JSContext.cpp', 'vm/JSFunction.cpp', diff --git a/js/src/proxy/CrossCompartmentWrapper.cpp b/js/src/proxy/CrossCompartmentWrapper.cpp index 22895d995fec..48b507f1581b 100644 --- a/js/src/proxy/CrossCompartmentWrapper.cpp +++ b/js/src/proxy/CrossCompartmentWrapper.cpp @@ -4,11 +4,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "jsiter.h" #include "jswrapper.h" #include "gc/PublicIterators.h" #include "proxy/DeadObjectProxy.h" +#include "vm/Iteration.h" #include "vm/WrapperObject.h" #include "gc/Nursery-inl.h" diff --git a/js/src/jsopcodeinlines.h b/js/src/vm/BytecodeUtil-inl.h similarity index 95% rename from js/src/jsopcodeinlines.h rename to js/src/vm/BytecodeUtil-inl.h index 724ba5fef405..6b052335b87c 100644 --- a/js/src/jsopcodeinlines.h +++ b/js/src/vm/BytecodeUtil-inl.h @@ -4,10 +4,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsopcodeinlines_h -#define jsopcodeinlines_h +#ifndef vm_BytecodeUtil_inl_h +#define vm_BytecodeUtil_inl_h -#include "jsopcode.h" +#include "vm/BytecodeUtil.h" #include "vm/JSScript.h" @@ -113,4 +113,4 @@ class BytecodeRange { } // namespace js -#endif /* jsopcodeinlines_h */ +#endif /* vm_BytecodeUtil_inl_h */ diff --git a/js/src/jsopcode.cpp b/js/src/vm/BytecodeUtil.cpp similarity index 99% rename from js/src/jsopcode.cpp rename to js/src/vm/BytecodeUtil.cpp index 9105cb9db367..8468a1c90ec8 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/vm/BytecodeUtil.cpp @@ -8,7 +8,7 @@ * JS bytecode descriptors, disassemblers, and (expression) decompilers. */ -#include "jsopcodeinlines.h" +#include "vm/BytecodeUtil-inl.h" #define __STDC_FORMAT_MACROS diff --git a/js/src/jsopcode.h b/js/src/vm/BytecodeUtil.h similarity index 99% rename from js/src/jsopcode.h rename to js/src/vm/BytecodeUtil.h index a5bc3ee92a33..bc2347ee9d61 100644 --- a/js/src/jsopcode.h +++ b/js/src/vm/BytecodeUtil.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsopcode_h -#define jsopcode_h +#ifndef vm_BytecodeUtil_h +#define vm_BytecodeUtil_h /* * JS bytecode definitions. @@ -940,4 +940,4 @@ DumpCompartmentPCCounts(JSContext* cx); } // namespace js -#endif /* jsopcode_h */ +#endif /* vm_BytecodeUtil_h */ diff --git a/js/src/vm/CodeCoverage.cpp b/js/src/vm/CodeCoverage.cpp index b604f8b86270..979905496e93 100644 --- a/js/src/vm/CodeCoverage.cpp +++ b/js/src/vm/CodeCoverage.cpp @@ -12,15 +12,15 @@ #include #ifdef XP_WIN -#include -#define getpid _getpid +# include +# define getpid _getpid #else -#include +# include #endif -#include "jsopcode.h" #include "jsprf.h" +#include "vm/BytecodeUtil.h" #include "vm/JSCompartment.h" #include "vm/JSScript.h" #include "vm/Runtime.h" diff --git a/js/src/vm/Debugger.cpp b/js/src/vm/Debugger.cpp index 37732acabd5e..67e395287e75 100644 --- a/js/src/vm/Debugger.cpp +++ b/js/src/vm/Debugger.cpp @@ -42,9 +42,8 @@ #include "vm/WrapperObject.h" #include "wasm/WasmInstance.h" -#include "jsopcodeinlines.h" - #include "gc/GC-inl.h" +#include "vm/BytecodeUtil-inl.h" #include "vm/GeckoProfiler-inl.h" #include "vm/JSObject-inl.h" #include "vm/JSScript-inl.h" diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp index 6d05551ad22b..236c49e75a8a 100644 --- a/js/src/vm/EnvironmentObject.cpp +++ b/js/src/vm/EnvironmentObject.cpp @@ -9,13 +9,12 @@ #include "mozilla/PodOperations.h" #include "mozilla/ScopeExit.h" -#include "jsiter.h" - #include "builtin/ModuleObject.h" #include "gc/Policy.h" #include "vm/ArgumentsObject.h" #include "vm/AsyncFunction.h" #include "vm/GlobalObject.h" +#include "vm/Iteration.h" #include "vm/JSCompartment.h" #include "vm/ProxyObject.h" #include "vm/Shape.h" diff --git a/js/src/vm/GlobalObject.h b/js/src/vm/GlobalObject.h index fb198d1a2563..67de867a73e1 100644 --- a/js/src/vm/GlobalObject.h +++ b/js/src/vm/GlobalObject.h @@ -764,7 +764,7 @@ class GlobalObject : public NativeObject // Infallibly test whether the given value is the eval function for this global. bool valueIsEval(const Value& val); - // Implemented in jsiter.cpp. + // Implemented in vm/Iteration.cpp. static bool initIteratorProto(JSContext* cx, Handle global); static bool initArrayIteratorProto(JSContext* cx, Handle global); static bool initStringIteratorProto(JSContext* cx, Handle global); @@ -780,8 +780,10 @@ class GlobalObject : public NativeObject static bool initMapIteratorProto(JSContext* cx, Handle global); static bool initSetIteratorProto(JSContext* cx, Handle global); - // Implemented in Intl.cpp. + // Implemented in builtin/intl/IntlObject.cpp. static bool initIntlObject(JSContext* cx, Handle global); + + // Implemented in builtin/intl/RelativeTimeFormat.cpp. static bool addRelativeTimeFormatConstructor(JSContext* cx, HandleObject intl); // Implemented in builtin/ModuleObject.cpp diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp index 3f5cd7b21583..befeb2745491 100644 --- a/js/src/vm/Interpreter.cpp +++ b/js/src/vm/Interpreter.cpp @@ -20,10 +20,8 @@ #include #include "jsarray.h" -#include "jsiter.h" #include "jslibmath.h" #include "jsnum.h" -#include "jsopcode.h" #include "jsprf.h" #include "jsstr.h" @@ -35,8 +33,10 @@ #include "jit/Jit.h" #include "vm/AsyncFunction.h" #include "vm/AsyncIteration.h" +#include "vm/BytecodeUtil.h" #include "vm/Debugger.h" #include "vm/GeneratorObject.h" +#include "vm/Iteration.h" #include "vm/JSAtom.h" #include "vm/JSContext.h" #include "vm/JSFunction.h" diff --git a/js/src/vm/Interpreter.h b/js/src/vm/Interpreter.h index 61a03b7bf7f9..89d70c2f4c95 100644 --- a/js/src/vm/Interpreter.h +++ b/js/src/vm/Interpreter.h @@ -11,9 +11,9 @@ * JS interpreter interface. */ -#include "jsiter.h" #include "jspubtd.h" +#include "vm/Iteration.h" #include "vm/Stack.h" namespace js { diff --git a/js/src/jsiter.cpp b/js/src/vm/Iteration.cpp similarity index 99% rename from js/src/jsiter.cpp rename to js/src/vm/Iteration.cpp index 9dc5628acd2c..508f72766ea2 100644 --- a/js/src/jsiter.cpp +++ b/js/src/vm/Iteration.cpp @@ -6,7 +6,7 @@ /* JavaScript iterators. */ -#include "jsiter.h" +#include "vm/Iteration.h" #include "mozilla/ArrayUtils.h" #include "mozilla/DebugOnly.h" @@ -16,7 +16,6 @@ #include "mozilla/Unused.h" #include "jsarray.h" -#include "jsopcode.h" #include "jstypes.h" #include "jsutil.h" @@ -24,6 +23,7 @@ #include "gc/FreeOp.h" #include "gc/Marking.h" #include "js/Proxy.h" +#include "vm/BytecodeUtil.h" #include "vm/GeneratorObject.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" diff --git a/js/src/jsiter.h b/js/src/vm/Iteration.h similarity index 98% rename from js/src/jsiter.h rename to js/src/vm/Iteration.h index 2d253abff62a..79076030257f 100644 --- a/js/src/jsiter.h +++ b/js/src/vm/Iteration.h @@ -4,8 +4,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef jsiter_h -#define jsiter_h +#ifndef vm_Iteration_h +#define vm_Iteration_h /* * JavaScript iterators. @@ -200,4 +200,4 @@ enum class IteratorKind { Sync, Async }; } /* namespace js */ -#endif /* jsiter_h */ +#endif /* vm_Iteration_h */ diff --git a/js/src/vm/JSCompartment-inl.h b/js/src/vm/JSCompartment-inl.h index 4f1c7aa5b355..d8fa4cee9bb1 100644 --- a/js/src/vm/JSCompartment-inl.h +++ b/js/src/vm/JSCompartment-inl.h @@ -9,10 +9,9 @@ #include "vm/JSCompartment.h" -#include "jsiter.h" - #include "gc/Barrier.h" #include "gc/Marking.h" +#include "vm/Iteration.h" #include "vm/JSContext-inl.h" diff --git a/js/src/vm/JSCompartment.cpp b/js/src/vm/JSCompartment.cpp index db08ced59d3d..48685d6123d3 100644 --- a/js/src/vm/JSCompartment.cpp +++ b/js/src/vm/JSCompartment.cpp @@ -12,7 +12,6 @@ #include #include "jsfriendapi.h" -#include "jsiter.h" #include "jswrapper.h" #include "gc/Policy.h" @@ -24,6 +23,7 @@ #include "js/RootingAPI.h" #include "proxy/DeadObjectProxy.h" #include "vm/Debugger.h" +#include "vm/Iteration.h" #include "vm/JSContext.h" #include "vm/WrapperObject.h" diff --git a/js/src/vm/JSContext-inl.h b/js/src/vm/JSContext-inl.h index e035aafbc710..fac1c6defcad 100644 --- a/js/src/vm/JSContext-inl.h +++ b/js/src/vm/JSContext-inl.h @@ -9,13 +9,12 @@ #include "vm/JSContext.h" -#include "jsiter.h" - #include "builtin/Object.h" #include "jit/JitFrames.h" #include "proxy/Proxy.h" #include "vm/HelperThreads.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSCompartment.h" #include "vm/Symbol.h" diff --git a/js/src/vm/JSContext.cpp b/js/src/vm/JSContext.cpp index 545597112dd7..3d43acc03640 100644 --- a/js/src/vm/JSContext.cpp +++ b/js/src/vm/JSContext.cpp @@ -25,11 +25,9 @@ # include #endif // ANDROID #ifdef XP_WIN -#include +# include #endif // XP_WIN #include "jsexn.h" -#include "jsiter.h" -#include "jsopcode.h" #include "jsprf.h" #include "jspubtd.h" #include "jsstr.h" @@ -43,8 +41,10 @@ #include "util/DoubleToString.h" #include "util/NativeStack.h" #include "util/Windows.h" +#include "vm/BytecodeUtil.h" #include "vm/ErrorReporting.h" #include "vm/HelperThreads.h" +#include "vm/Iteration.h" #include "vm/JSAtom.h" #include "vm/JSCompartment.h" #include "vm/JSFunction.h" diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp index cfe4a8b95a52..43eff12626ef 100644 --- a/js/src/vm/JSObject.cpp +++ b/js/src/vm/JSObject.cpp @@ -21,9 +21,7 @@ #include "jsarray.h" #include "jsexn.h" #include "jsfriendapi.h" -#include "jsiter.h" #include "jsnum.h" -#include "jsopcode.h" #include "jsprf.h" #include "jsstr.h" #include "jstypes.h" @@ -42,7 +40,9 @@ #include "js/UniquePtr.h" #include "util/Windows.h" #include "vm/ArgumentsObject.h" +#include "vm/BytecodeUtil.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSAtom.h" #include "vm/JSContext.h" #include "vm/JSFunction.h" diff --git a/js/src/vm/JSScript.cpp b/js/src/vm/JSScript.cpp index a3dfb75f8db5..129d516cf1af 100644 --- a/js/src/vm/JSScript.cpp +++ b/js/src/vm/JSScript.cpp @@ -23,7 +23,6 @@ #include #include "jsapi.h" -#include "jsopcode.h" #include "jsprf.h" #include "jstypes.h" #include "jsutil.h" @@ -39,6 +38,7 @@ #include "js/MemoryMetrics.h" #include "js/Utility.h" #include "vm/ArgumentsObject.h" +#include "vm/BytecodeUtil.h" #include "vm/Compression.h" #include "vm/Debugger.h" #include "vm/JSAtom.h" diff --git a/js/src/vm/JSScript.h b/js/src/vm/JSScript.h index b1f805cd81ff..429cd722924b 100644 --- a/js/src/vm/JSScript.h +++ b/js/src/vm/JSScript.h @@ -15,7 +15,6 @@ #include "mozilla/PodOperations.h" #include "mozilla/Variant.h" -#include "jsopcode.h" #include "jstypes.h" #include "frontend/NameAnalysisTypes.h" @@ -24,6 +23,7 @@ #include "jit/IonCode.h" #include "js/UbiNode.h" #include "js/UniquePtr.h" +#include "vm/BytecodeUtil.h" #include "vm/JSAtom.h" #include "vm/NativeObject.h" #include "vm/Scope.h" diff --git a/js/src/vm/Scope.h b/js/src/vm/Scope.h index 07cb989c0108..0170d4da19c1 100644 --- a/js/src/vm/Scope.h +++ b/js/src/vm/Scope.h @@ -10,13 +10,12 @@ #include "mozilla/Maybe.h" #include "mozilla/Variant.h" -#include "jsopcode.h" - #include "gc/DeletePolicy.h" #include "gc/Heap.h" #include "gc/Policy.h" #include "js/UbiNode.h" #include "js/UniquePtr.h" +#include "vm/BytecodeUtil.h" #include "vm/JSObject.h" #include "vm/Xdr.h" diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index a85f298605e7..95b05e041c67 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -14,7 +14,6 @@ #include "jsarray.h" #include "jsdate.h" #include "jsfriendapi.h" -#include "jsiter.h" #include "jsstr.h" #include "jswrapper.h" #include "selfhosted.out.h" @@ -46,6 +45,7 @@ #include "vm/Compression.h" #include "vm/GeneratorObject.h" #include "vm/Interpreter.h" +#include "vm/Iteration.h" #include "vm/JSCompartment.h" #include "vm/JSContext.h" #include "vm/JSFunction.h" From 2c249430be6dcd201e035f77b41f50845cbc4eee Mon Sep 17 00:00:00 2001 From: Jason Orendorff Date: Fri, 16 Feb 2018 11:34:46 -0600 Subject: [PATCH 44/48] Bug 1438278 - Part 6: Remove unnecessary #ifdef XP_WIN guards around #include "util/Windows.h". r=jandem. --HG-- extra : rebase_source : 71367461beeda42c4e68b066b3ef9a919bcc9059 --- js/src/builtin/DataViewObject.cpp | 4 +--- js/src/devtools/vprof/vprof.cpp | 8 ++++---- js/src/gc/GC.cpp | 4 +--- js/src/jsmath.cpp | 4 +--- js/src/jsutil.cpp | 8 ++------ js/src/shell/OSObject.cpp | 4 +--- js/src/shell/js.cpp | 4 +--- js/src/vm/ArrayBufferObject.cpp | 4 +--- js/src/vm/Printer.cpp | 4 +--- js/src/vm/TypedArrayObject.cpp | 4 +--- 10 files changed, 14 insertions(+), 34 deletions(-) diff --git a/js/src/builtin/DataViewObject.cpp b/js/src/builtin/DataViewObject.cpp index 84aaf0b7a3ed..0eef4cb6913b 100644 --- a/js/src/builtin/DataViewObject.cpp +++ b/js/src/builtin/DataViewObject.cpp @@ -18,9 +18,7 @@ #include "jit/AtomicOperations.h" #include "js/Conversions.h" -#ifdef XP_WIN -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/ArrayBufferObject.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" diff --git a/js/src/devtools/vprof/vprof.cpp b/js/src/devtools/vprof/vprof.cpp index 52011c908da5..ea44219af5b6 100644 --- a/js/src/devtools/vprof/vprof.cpp +++ b/js/src/devtools/vprof/vprof.cpp @@ -9,11 +9,11 @@ // in the same process. #ifdef WIN32 -#include "util/Windows.h" +# include "util/Windows.h" #else -#define __cdecl -#include -#include +# define __cdecl +# include +# include #endif #include "vprof.h" diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index c1f62632257a..a40cbf8ae180 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -223,9 +223,7 @@ #include "jit/JitcodeMap.h" #include "js/SliceBudget.h" #include "proxy/DeadObjectProxy.h" -#ifdef XP_WIN -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/Debugger.h" #include "vm/GeckoProfiler.h" #include "vm/JSAtom.h" diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp index 945589c14515..e9bda002e0f4 100644 --- a/js/src/jsmath.cpp +++ b/js/src/jsmath.cpp @@ -28,9 +28,7 @@ #include "jit/InlinableNatives.h" #include "js/Class.h" -#ifdef XP_WIN -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/JSAtom.h" #include "vm/JSCompartment.h" #include "vm/JSContext.h" diff --git a/js/src/jsutil.cpp b/js/src/jsutil.cpp index 01184dad513b..13a7f8ad89e9 100644 --- a/js/src/jsutil.cpp +++ b/js/src/jsutil.cpp @@ -18,13 +18,9 @@ #include "jstypes.h" -#include "vm/HelperThreads.h" - -#ifdef WIN32 -# include "util/Windows.h" -#endif - #include "js/Utility.h" +#include "util/Windows.h" +#include "vm/HelperThreads.h" using namespace js; diff --git a/js/src/shell/OSObject.cpp b/js/src/shell/OSObject.cpp index 367df40d5e7c..83f8be2e5d1e 100644 --- a/js/src/shell/OSObject.cpp +++ b/js/src/shell/OSObject.cpp @@ -28,9 +28,7 @@ #include "gc/FreeOp.h" #include "js/Conversions.h" #include "shell/jsshell.h" -#ifdef XP_WIN -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/JSObject.h" #include "vm/StringBuffer.h" #include "vm/TypedArrayObject.h" diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index aacff7df6b70..fb661231921b 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -89,9 +89,7 @@ #include "threading/ExclusiveData.h" #include "threading/LockGuard.h" #include "threading/Thread.h" -#ifdef XP_WIN -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/ArgumentsObject.h" #include "vm/AsyncFunction.h" #include "vm/AsyncIteration.h" diff --git a/js/src/vm/ArrayBufferObject.cpp b/js/src/vm/ArrayBufferObject.cpp index 2481c6c4c1cb..9da327078a59 100644 --- a/js/src/vm/ArrayBufferObject.cpp +++ b/js/src/vm/ArrayBufferObject.cpp @@ -37,9 +37,7 @@ #include "gc/Memory.h" #include "js/Conversions.h" #include "js/MemoryMetrics.h" -#ifdef XP_WIN -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" #include "vm/JSContext.h" diff --git a/js/src/vm/Printer.cpp b/js/src/vm/Printer.cpp index 7657da5e296f..edd17b27b975 100644 --- a/js/src/vm/Printer.cpp +++ b/js/src/vm/Printer.cpp @@ -16,9 +16,7 @@ #include "jsutil.h" #include "ds/LifoAlloc.h" -#ifdef XP_WIN32 -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/JSContext.h" using mozilla::PodCopy; diff --git a/js/src/vm/TypedArrayObject.cpp b/js/src/vm/TypedArrayObject.cpp index 6b05e22089d1..fa5fc2dd077a 100644 --- a/js/src/vm/TypedArrayObject.cpp +++ b/js/src/vm/TypedArrayObject.cpp @@ -31,9 +31,7 @@ #include "gc/Marking.h" #include "jit/InlinableNatives.h" #include "js/Conversions.h" -#ifdef XP_WIN -# include "util/Windows.h" -#endif +#include "util/Windows.h" #include "vm/ArrayBufferObject.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" From 8d97ab038d071d3552d78a4a684f5566bf6e2639 Mon Sep 17 00:00:00 2001 From: Jason Laster Date: Tue, 6 Feb 2018 14:55:57 -0500 Subject: [PATCH 45/48] Bug 1436151 - Breakpoints at the beginning of a line are missed. r=jimb --- devtools/server/actors/source.js | 30 +++++++-- ...etBreakpoint-at-the-beginning-of-a-line.js | 64 +++++++++++++++++++ devtools/server/tests/unit/xpcshell.ini | 1 + 3 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js diff --git a/devtools/server/actors/source.js b/devtools/server/actors/source.js index 1dee0a942e70..54344fbf6d06 100644 --- a/devtools/server/actors/source.js +++ b/devtools/server/actors/source.js @@ -908,24 +908,44 @@ let SourceActor = ActorClassWithSpec(sourceSpec, { } } } else { + // Compute columnToOffsetMaps for each script so that we can + // find matching entrypoints for the column breakpoint. + const columnToOffsetMaps = scripts.map(script => + [ + script, + script.getAllColumnOffsets() + .filter(({ lineNumber }) => lineNumber === generatedLine) + ] + ); + // This is a column breakpoint, so we are interested in all column // offsets that correspond to the given line *and* column number. - for (let script of scripts) { - let columnToOffsetMap = script.getAllColumnOffsets() - .filter(({ lineNumber }) => { - return lineNumber === generatedLine; - }); + for (let [script, columnToOffsetMap] of columnToOffsetMaps) { for (let { columnNumber: column, offset } of columnToOffsetMap) { if (column >= generatedColumn && column <= generatedLastColumn) { entryPoints.push({ script, offsets: [offset] }); } } } + + // If we don't find any matching entrypoints, then + // we should check to see if the breakpoint is to the left of the first offset. + if (entryPoints.length === 0) { + for (let [script, columnToOffsetMap] of columnToOffsetMaps) { + if (columnToOffsetMap.length > 0) { + let { columnNumber: column, offset } = columnToOffsetMap[0]; + if (generatedColumn < column) { + entryPoints.push({ script, offsets: [offset] }); + } + } + } + } } if (entryPoints.length === 0) { return false; } + setBreakpointAtEntryPoints(actor, entryPoints); return true; } diff --git a/devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js b/devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js new file mode 100644 index 000000000000..fdaceb01bb10 --- /dev/null +++ b/devtools/server/tests/unit/test_setBreakpoint-at-the-beginning-of-a-line.js @@ -0,0 +1,64 @@ +"use strict"; + +var SOURCE_URL = getFileUrl("setBreakpoint-on-column.js"); + +function run_test() { + return async function () { + do_test_pending(); + + DebuggerServer.registerModule("xpcshell-test/testactors"); + DebuggerServer.init(() => true); + + let global = createTestGlobal("test"); + DebuggerServer.addTestGlobal(global); + + let client = new DebuggerClient(DebuggerServer.connectPipe()); + await connect(client); + + let { tabs } = await listTabs(client); + let tab = findTab(tabs, "test"); + let [, tabClient] = await attachTab(client, tab); + let [, threadClient] = await attachThread(tabClient); + await resume(threadClient); + + let promise = waitForNewSource(threadClient, SOURCE_URL); + loadSubScript(SOURCE_URL, global); + let { source } = await promise; + let sourceClient = threadClient.source(source); + + let location = { line: 4, column: 2 }; + let [packet, breakpointClient] = await setBreakpoint( + sourceClient, + location + ); + + Assert.ok(!packet.isPending); + Assert.equal(false, "actualLocation" in packet); + + packet = await executeOnNextTickAndWaitForPause(function () { + Cu.evalInSandbox("f()", global); + }, client); + + Assert.equal(packet.type, "paused"); + let why = packet.why; + Assert.equal(why.type, "breakpoint"); + Assert.equal(why.actors.length, 1); + Assert.equal(why.actors[0], breakpointClient.actor); + + let frame = packet.frame; + let where = frame.where; + Assert.equal(where.source.actor, source.actor); + Assert.equal(where.line, location.line); + Assert.equal(where.column, 6); + + let variables = frame.environment.bindings.variables; + Assert.equal(variables.a.value.type, "undefined"); + Assert.equal(variables.b.value.type, "undefined"); + Assert.equal(variables.c.value.type, "undefined"); + + await resume(threadClient); + await close(client); + + do_test_finished(); + }; +} diff --git a/devtools/server/tests/unit/xpcshell.ini b/devtools/server/tests/unit/xpcshell.ini index 4e1e6e84044a..6f84ce913715 100644 --- a/devtools/server/tests/unit/xpcshell.ini +++ b/devtools/server/tests/unit/xpcshell.ini @@ -222,6 +222,7 @@ reason = bug 937197 [test_get-executable-lines-source-map.js] [test_xpcshell_debugging.js] support-files = xpcshell_debugging_script.js +[test_setBreakpoint-at-the-beginning-of-a-line.js] [test_setBreakpoint-on-column.js] [test_setBreakpoint-on-column-in-gcd-script.js] [test_setBreakpoint-on-column-with-no-offsets-at-end-of-line.js] From 7fdde79d5cf643ea6a7130fd58a0430c523b463e Mon Sep 17 00:00:00 2001 From: Gurzau Raul Date: Fri, 16 Feb 2018 23:42:04 +0200 Subject: [PATCH 46/48] Backed out changeset b2fe34d6f8a0 (bug 1433163) for reftest failures on Android --- taskcluster/ci/test/reftest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taskcluster/ci/test/reftest.yml b/taskcluster/ci/test/reftest.yml index 333f151eecc9..8ddd983d88aa 100644 --- a/taskcluster/ci/test/reftest.yml +++ b/taskcluster/ci/test/reftest.yml @@ -98,8 +98,8 @@ reftest: virtualization: virtual-with-gpu chunks: by-test-platform: - android-4.3-arm7-api-16/debug: 56 - android.*: 28 + android-4.3-arm7-api-16/debug: 48 + android.*: 24 macosx64.*/opt: 1 macosx64.*/debug: 2 windows10-64.*/opt: 1 From 051f79e41274313d5bc7773441b5c2b399d5c4c8 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Sat, 17 Feb 2018 00:43:36 +0100 Subject: [PATCH 47/48] Bug 1437492 - Part 1: Add a Matrix class with optimizations for simple matrices. r=mattwoodrow MozReview-Commit-ID: EVrgqE0VlwM --- gfx/2d/Matrix.h | 410 +++++++++++++++++++++++++++++++++++++++++++++ gfx/2d/MatrixFwd.h | 3 + 2 files changed, 413 insertions(+) diff --git a/gfx/2d/Matrix.h b/gfx/2d/Matrix.h index 080db49c7fde..d5a9f9bdc800 100644 --- a/gfx/2d/Matrix.h +++ b/gfx/2d/Matrix.h @@ -1851,6 +1851,416 @@ public: }; }; +/* This Matrix class will carry one additional type field in order to + * track what type of 4x4 matrix we're dealing with, it can then execute + * simplified versions of certain operations when applicable. + * This does not allow access to the parent class directly, as a caller + * could then mutate the parent class without updating the type. + */ +template +class Matrix4x4TypedFlagged : protected Matrix4x4Typed +{ +public: + using Parent = Matrix4x4Typed; + using TargetPoint = PointTyped; + using Parent::_11; using Parent::_12; using Parent::_13; using Parent::_14; + using Parent::_21; using Parent::_22; using Parent::_23; using Parent::_24; + using Parent::_31; using Parent::_32; using Parent::_33; using Parent::_34; + using Parent::_41; using Parent::_42; using Parent::_43; using Parent::_44; + + Matrix4x4TypedFlagged() + : mType(MatrixType::Identity) + {} + + Matrix4x4TypedFlagged(Float a11, Float a12, Float a13, Float a14, + Float a21, Float a22, Float a23, Float a24, + Float a31, Float a32, Float a33, Float a34, + Float a41, Float a42, Float a43, Float a44) + : Parent(a11, a12, a13, a14, a21, a22, a23, a24, + a31, a32, a33, a34, a41, a42, a43, a44) + { + Analyze(); + } + + MOZ_IMPLICIT Matrix4x4TypedFlagged(const Parent& aOther) + : Parent(aOther) + { + Analyze(); + } + + template + PointTyped TransformPoint(const PointTyped &aPoint) const + { + if (mType == MatrixType::Identity) { + return aPoint; + } + + if (mType == MatrixType::Simple) { + return TransformPointSimple(aPoint); + } + + return Parent::TransformPoint(aPoint); + } + + template + RectTyped TransformAndClipBounds(const RectTyped& aRect, + const RectTyped& aClip) const + { + if (mType == MatrixType::Identity) { + return aRect; + } + + if (mType == MatrixType::Simple) { + PointTyped p1 = TransformPointSimple(aRect.TopLeft()); + PointTyped p2 = TransformPointSimple(aRect.TopRight()); + PointTyped p3 = TransformPointSimple(aRect.BottomLeft()); + PointTyped p4 = TransformPointSimple(aRect.BottomRight()); + + F min_x = std::min(std::min(std::min(p1.x, p2.x), p3.x), p4.x); + F max_x = std::max(std::max(std::max(p1.x, p2.x), p3.x), p4.x); + F min_y = std::min(std::min(std::min(p1.y, p2.y), p3.y), p4.y); + F max_y = std::max(std::max(std::max(p1.y, p2.y), p3.y), p4.y); + + TargetPoint topLeft(std::max(min_x, aClip.x), std::max(min_y, aClip.y)); + F xMost = std::min(max_x, aClip.XMost()) - topLeft.x; + F yMost = std::min(max_y, aClip.YMost()) - topLeft.y; + + return RectTyped(topLeft.x, topLeft.y, xMost, yMost); + } + return Parent::TransformAndClipBounds(aRect, aClip); + } + + bool FuzzyEqual(const Parent& o) const + { + return Parent::FuzzyEqual(o); + } + + bool FuzzyEqual(const Matrix4x4TypedFlagged& o) const + { + if (mType == MatrixType::Identity && o.mType == MatrixType::Identity) { + return true; + } + return Parent::FuzzyEqual(o); + } + + Matrix4x4TypedFlagged &PreTranslate(Float aX, Float aY, Float aZ) + { + if (mType == MatrixType::Identity) { + _41 = aX; + _42 = aY; + _43 = aZ; + + if (!aZ) { + mType = MatrixType::Simple; + return *this; + } + mType = MatrixType::Full; + return *this; + } + + Parent::PreTranslate(aX, aY, aZ); + + if (aZ != 0) { + mType = MatrixType::Full; + } + + return *this; + } + + Matrix4x4TypedFlagged &PostTranslate(Float aX, Float aY, Float aZ) + { + if (mType == MatrixType::Identity) { + _41 = aX; + _42 = aY; + _43 = aZ; + + if (!aZ) { + mType = MatrixType::Simple; + return *this; + } + mType = MatrixType::Full; + return *this; + } + + Parent::PostTranslate(aX, aY, aZ); + + if (aZ != 0) { + mType = MatrixType::Full; + } + + return *this; + } + + Matrix4x4TypedFlagged &ChangeBasis(Float aX, Float aY, Float aZ) + { + // Translate to the origin before applying this matrix + PreTranslate(-aX, -aY, -aZ); + + // Translate back into position after applying this matrix + PostTranslate(aX, aY, aZ); + + return *this; + } + + bool IsIdentity() const + { + return mType == MatrixType::Identity; + } + + template + Point4DTyped + ProjectPoint(const PointTyped& aPoint) const { + if (mType == MatrixType::Identity) { + return Point4DTyped(aPoint.x, aPoint.y, 0, 1); + } + + if (mType == MatrixType::Simple) { + TargetPoint point = TransformPointSimple(aPoint); + return Point4DTyped(point.x, point.y, 0, 1); + } + + return Parent::ProjectPoint(aPoint); + } + + Matrix4x4TypedFlagged& ProjectTo2D() { + if (mType == MatrixType::Full) { + Parent::ProjectTo2D(); + } + return *this; + } + + bool IsSingular() const + { + if (mType == MatrixType::Identity) { + return false; + } + return Parent::Determinant() == 0.0; + } + + bool Invert() + { + if (mType == MatrixType::Identity) { + return true; + } + + return Parent::Invert(); + } + + Matrix4x4TypedFlagged Inverse() const + { + typedef Matrix4x4TypedFlagged InvertedMatrix; + InvertedMatrix clone = InvertedMatrix::FromUnknownMatrix(ToUnknownMatrix()); + if (mType == MatrixType::Identity) { + return clone; + } + DebugOnly inverted = clone.Invert(); + MOZ_ASSERT(inverted, "Attempted to get the inverse of a non-invertible matrix"); + + // Inverting a 2D Matrix should result in a 2D matrix, ergo mType doesn't change. + return clone; + } + + template + Matrix4x4TypedFlagged operator*(const Matrix4x4Typed &aMatrix) const + { + if (mType == MatrixType::Identity) { + return aMatrix; + } + + if (mType == MatrixType::Simple) { + Matrix4x4TypedFlagged matrix; + matrix._11 = _11 * aMatrix._11 + _12 * aMatrix._21; + matrix._21 = _21 * aMatrix._11 + _22 * aMatrix._21; + matrix._31 = aMatrix._31; + matrix._41 = _41 * aMatrix._11 + _42 * aMatrix._21; + matrix._12 = _11 * aMatrix._12 + _12 * aMatrix._22; + matrix._22 = _21 * aMatrix._12 + _22 * aMatrix._22; + matrix._32 = aMatrix._32; + matrix._42 = _41 * aMatrix._12 + _42 * aMatrix._22; + matrix._13 = _11 * aMatrix._13 + _12 * aMatrix._23; + matrix._23 = _21 * aMatrix._13 + _22 * aMatrix._23; + matrix._33 = aMatrix._33; + matrix._43 = _41 * aMatrix._13 + _42 * aMatrix._23; + matrix._14 = _11 * aMatrix._14 + _12 * aMatrix._24; + matrix._24 = _21 * aMatrix._14 + _22 * aMatrix._24; + matrix._34 = aMatrix._34; + matrix._44 = _41 * aMatrix._14 + _42 * aMatrix._24; + matrix.Analyze(); + return matrix; + } + + return Parent::operator*(aMatrix); + } + + template + Matrix4x4TypedFlagged operator*(const Matrix4x4TypedFlagged &aMatrix) const + { + if (mType == MatrixType::Identity) { + return aMatrix; + } + + if (aMatrix.mType == MatrixType::Identity) { + return Matrix4x4TypedFlagged::FromUnknownMatrix(this->ToUnknownMatrix()); + } + + if (mType == MatrixType::Simple && aMatrix.mType == MatrixType::Simple) { + Matrix4x4TypedFlagged matrix; + matrix._11 = _11 * aMatrix._11 + _12 * aMatrix._21; + matrix._21 = _21 * aMatrix._11 + _22 * aMatrix._21; + matrix._41 = _41 * aMatrix._11 + _42 * aMatrix._21 + aMatrix._41; + matrix._12 = _11 * aMatrix._12 + _12 * aMatrix._22; + matrix._22 = _21 * aMatrix._12 + _22 * aMatrix._22; + matrix._42 = _41 * aMatrix._12 + _42 * aMatrix._22 + aMatrix._42; + matrix.mType = MatrixType::Simple; + return matrix; + } else if (mType == MatrixType::Simple) { + Matrix4x4TypedFlagged matrix; + matrix._11 = _11 * aMatrix._11 + _12 * aMatrix._21; + matrix._21 = _21 * aMatrix._11 + _22 * aMatrix._21; + matrix._31 = aMatrix._31; + matrix._41 = _41 * aMatrix._11 + _42 * aMatrix._21 + aMatrix._41; + matrix._12 = _11 * aMatrix._12 + _12 * aMatrix._22; + matrix._22 = _21 * aMatrix._12 + _22 * aMatrix._22; + matrix._32 = aMatrix._32; + matrix._42 = _41 * aMatrix._12 + _42 * aMatrix._22 + aMatrix._42; + matrix._13 = _11 * aMatrix._13 + _12 * aMatrix._23; + matrix._23 = _21 * aMatrix._13 + _22 * aMatrix._23; + matrix._33 = aMatrix._33; + matrix._43 = _41 * aMatrix._13 + _42 * aMatrix._23 + aMatrix._43; + matrix._14 = _11 * aMatrix._14 + _12 * aMatrix._24; + matrix._24 = _21 * aMatrix._14 + _22 * aMatrix._24; + matrix._34 = aMatrix._34; + matrix._44 = _41 * aMatrix._14 + _42 * aMatrix._24 + aMatrix._44; + matrix.mType = MatrixType::Full; + return matrix; + } else if (aMatrix.mType == MatrixType::Simple) { + Matrix4x4TypedFlagged matrix; + matrix._11 = _11 * aMatrix._11 + _12 * aMatrix._21 + _14 * aMatrix._41; + matrix._21 = _21 * aMatrix._11 + _22 * aMatrix._21 + _24 * aMatrix._41; + matrix._31 = _31 * aMatrix._11 + _32 * aMatrix._21 + _34 * aMatrix._41; + matrix._41 = _41 * aMatrix._11 + _42 * aMatrix._21 + _44 * aMatrix._41; + matrix._12 = _11 * aMatrix._12 + _12 * aMatrix._22 + _14 * aMatrix._42; + matrix._22 = _21 * aMatrix._12 + _22 * aMatrix._22 + _24 * aMatrix._42; + matrix._32 = _31 * aMatrix._12 + _32 * aMatrix._22 + _34 * aMatrix._42; + matrix._42 = _41 * aMatrix._12 + _42 * aMatrix._22 + _44 * aMatrix._42; + matrix._13 = _13; + matrix._23 = _23; + matrix._33 = _33; + matrix._43 = _43; + matrix._14 = _14; + matrix._24 = _24; + matrix._34 = _34; + matrix._44 = _44; + matrix.mType = MatrixType::Full; + return matrix; + } + + return Parent::operator*(aMatrix); + } + + bool Is2D() const + { + return mType != MatrixType::Full; + } + + bool CanDraw2D(Matrix* aMatrix = nullptr) const + { + if (mType != MatrixType::Full) { + if (aMatrix) { + aMatrix->_11 = _11; + aMatrix->_12 = _12; + aMatrix->_21 = _21; + aMatrix->_22 = _22; + aMatrix->_31 = _41; + aMatrix->_32 = _42; + } + return true; + } + return Parent::CanDraw2D(aMatrix); + } + + bool Is2D(Matrix* aMatrix) const { + if (!Is2D()) { + return false; + } + if (aMatrix) { + aMatrix->_11 = _11; + aMatrix->_12 = _12; + aMatrix->_21 = _21; + aMatrix->_22 = _22; + aMatrix->_31 = _41; + aMatrix->_32 = _42; + } + return true; + } + + template + RectTyped + ProjectRectBounds(const RectTyped& aRect, const RectTyped& aClip) const + { + return Parent::ProjectRectBounds(aRect, aClip); + } + + const Parent &GetMatrix() const { return *this; } +private: + enum class MatrixType : uint8_t + { + Identity, + Simple, // 2x3 Matrix + Full // 4x4 Matrix + }; + + Matrix4x4TypedFlagged(Float a11, Float a12, Float a13, Float a14, + Float a21, Float a22, Float a23, Float a24, + Float a31, Float a32, Float a33, Float a34, + Float a41, Float a42, Float a43, Float a44, + typename Matrix4x4TypedFlagged::MatrixType aType) + : Parent(a11, a12, a13, a14, a21, a22, a23, a24, + a31, a32, a33, a34, a41, a42, a43, a44) + { + mType = aType; + } + static Matrix4x4TypedFlagged FromUnknownMatrix(const Matrix4x4Flagged& aUnknown) { + return Matrix4x4TypedFlagged{ aUnknown._11, aUnknown._12, aUnknown._13, aUnknown._14, + aUnknown._21, aUnknown._22, aUnknown._23, aUnknown._24, + aUnknown._31, aUnknown._32, aUnknown._33, aUnknown._34, + aUnknown._41, aUnknown._42, aUnknown._43, aUnknown._44, aUnknown.mType }; + } + Matrix4x4Flagged ToUnknownMatrix() const { + return Matrix4x4Flagged{ _11, _12, _13, _14, + _21, _22, _23, _24, + _31, _32, _33, _34, + _41, _42, _43, _44, mType }; + } + + template + PointTyped TransformPointSimple(const PointTyped &aPoint) const + { + PointTyped temp; + temp.x = aPoint.x * _11 + aPoint.y * +_21 + _41; + temp.y = aPoint.x * _12 + aPoint.y * +_22 + _42; + return temp; + } + + void Analyze() { + if (Parent::IsIdentity()) { + mType = MatrixType::Identity; + return; + } + + if (Parent::Is2D()) { + mType = MatrixType::Simple; + return; + } + + mType = MatrixType::Full; + } + + MatrixType mType; +}; + +using Matrix4x4Flagged = Matrix4x4TypedFlagged; + } // namespace gfx } // namespace mozilla diff --git a/gfx/2d/MatrixFwd.h b/gfx/2d/MatrixFwd.h index 26bca40cb0b6..13c9f8685b6d 100644 --- a/gfx/2d/MatrixFwd.h +++ b/gfx/2d/MatrixFwd.h @@ -27,8 +27,11 @@ struct UnknownUnits; template class Matrix4x4Typed; +template +class Matrix4x4TypedFlagged; typedef Matrix4x4Typed Matrix4x4; +typedef Matrix4x4TypedFlagged Matrix4x4Flagged; } // namespace gfx } // namespace mozilla From 628d3b7134763bd017e40b83fbd3caa3a80cb046 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Sat, 17 Feb 2018 00:43:38 +0100 Subject: [PATCH 48/48] Bug 1437492 - Part 2: Based on profile data, use the simple-matrix optimized matrix class in some places. r=mattwoodrow MozReview-Commit-ID: EBRrGXc2wEj --- dom/base/Element.cpp | 6 +- gfx/layers/LayerTreeInvalidation.cpp | 10 ++-- layout/base/nsLayoutUtils.cpp | 57 ++++++++++++------- layout/base/nsLayoutUtils.h | 11 ++-- ...test_getBoxQuads_convertPointRectQuad.html | 2 +- layout/forms/nsComboboxControlFrame.cpp | 2 +- layout/generic/nsFrame.cpp | 8 +-- layout/generic/nsIFrame.h | 7 ++- layout/painting/FrameLayerBuilder.cpp | 4 +- layout/painting/nsDisplayList.cpp | 20 +++---- layout/painting/nsDisplayList.h | 5 +- 11 files changed, 78 insertions(+), 54 deletions(-) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 58cae333bc0d..bed045ce13a7 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -3726,7 +3726,7 @@ Element::GetTransformToAncestor(Element& aAncestor) // then the call to GetTransformToAncestor will return the transform // all the way up through the parent chain. transform = nsLayoutUtils::GetTransformToAncestor(primaryFrame, - ancestorFrame, nsIFrame::IN_CSS_UNITS); + ancestorFrame, nsIFrame::IN_CSS_UNITS).GetMatrix(); } DOMMatrixReadOnly* matrix = new DOMMatrix(this, transform, IsStyledByServo()); @@ -3743,7 +3743,7 @@ Element::GetTransformToParent() if (primaryFrame) { nsIFrame* parentFrame = primaryFrame->GetParent(); transform = nsLayoutUtils::GetTransformToAncestor(primaryFrame, - parentFrame, nsIFrame::IN_CSS_UNITS); + parentFrame, nsIFrame::IN_CSS_UNITS).GetMatrix(); } DOMMatrixReadOnly* matrix = new DOMMatrix(this, transform, IsStyledByServo()); @@ -3758,7 +3758,7 @@ Element::GetTransformToViewport() Matrix4x4 transform; if (primaryFrame) { transform = nsLayoutUtils::GetTransformToAncestor(primaryFrame, - nsLayoutUtils::GetDisplayRootFrame(primaryFrame), nsIFrame::IN_CSS_UNITS); + nsLayoutUtils::GetDisplayRootFrame(primaryFrame), nsIFrame::IN_CSS_UNITS).GetMatrix(); } DOMMatrixReadOnly* matrix = new DOMMatrix(this, transform, IsStyledByServo()); diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index de169e18f93b..75eb7dec3dec 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -71,14 +71,14 @@ GetTransformIn3DContext(Layer* aLayer) { * @return local transform for layers not participating 3D rendering * context, or the accmulated transform in the context for else. */ -static Matrix4x4 +static Matrix4x4Flagged GetTransformForInvalidation(Layer* aLayer) { return (!aLayer->Is3DContextLeaf() && !aLayer->Extend3DContext() ? aLayer->GetLocalTransform() : GetTransformIn3DContext(aLayer)); } static IntRect -TransformRect(const IntRect& aRect, const Matrix4x4& aTransform) +TransformRect(const IntRect& aRect, const Matrix4x4Flagged& aTransform) { if (aRect.IsEmpty()) { return IntRect(); @@ -97,7 +97,7 @@ TransformRect(const IntRect& aRect, const Matrix4x4& aTransform) } static void -AddTransformedRegion(nsIntRegion& aDest, const nsIntRegion& aSource, const Matrix4x4& aTransform) +AddTransformedRegion(nsIntRegion& aDest, const nsIntRegion& aSource, const Matrix4x4Flagged& aTransform) { for (auto iter = aSource.RectIter(); !iter.Done(); iter.Next()) { aDest.Or(aDest, TransformRect(iter.Get(), aTransform)); @@ -328,7 +328,7 @@ public: UniquePtr mMaskLayer; nsTArray> mAncestorMaskLayers; nsIntRegion mVisibleRegion; - Matrix4x4 mTransform; + Matrix4x4Flagged mTransform; float mPostXScale; float mPostYScale; float mOpacity; @@ -507,7 +507,7 @@ public: if (!mLayer->Extend3DContext()) { // |result| contains invalid regions only of children. - result.Transform(GetTransformForInvalidation(mLayer)); + result.Transform(GetTransformForInvalidation(mLayer).GetMatrix()); } // else, effective transforms have applied on children. diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 83849663b5b7..921c1113cf2f 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -2662,6 +2662,25 @@ nsLayoutUtils::MatrixTransformRect(const nsRect &aBounds, return RoundGfxRectToAppRect(ThebesRect(image), aFactor); } +nsRect +nsLayoutUtils::MatrixTransformRect(const nsRect &aBounds, + const Matrix4x4Flagged &aMatrix, float aFactor) +{ + RectDouble image = RectDouble(NSAppUnitsToDoublePixels(aBounds.x, aFactor), + NSAppUnitsToDoublePixels(aBounds.y, aFactor), + NSAppUnitsToDoublePixels(aBounds.width, aFactor), + NSAppUnitsToDoublePixels(aBounds.height, aFactor)); + + RectDouble maxBounds = RectDouble(double(nscoord_MIN) / aFactor * 0.5, + double(nscoord_MIN) / aFactor * 0.5, + double(nscoord_MAX) / aFactor, + double(nscoord_MAX) / aFactor); + + image = aMatrix.TransformAndClipBounds(image, maxBounds); + + return RoundGfxRectToAppRect(ThebesRect(image), aFactor); +} + nsPoint nsLayoutUtils::MatrixTransformPoint(const nsPoint &aPoint, const Matrix4x4 &aMatrix, float aFactor) @@ -2705,14 +2724,14 @@ nsLayoutUtils::FrameHasDisplayPort(nsIFrame* aFrame, nsIFrame* aScrolledFrame) return false; } -Matrix4x4 +Matrix4x4Flagged nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame, const nsIFrame *aAncestor, uint32_t aFlags, nsIFrame** aOutAncestor) { nsIFrame* parent; - Matrix4x4 ctm; + Matrix4x4Flagged ctm; if (aFrame == aAncestor) { return ctm; } @@ -2736,7 +2755,7 @@ nsLayoutUtils::GetTransformToAncestor(nsIFrame *aFrame, gfxSize nsLayoutUtils::GetTransformToAncestorScale(nsIFrame* aFrame) { - Matrix4x4 transform = GetTransformToAncestor(aFrame, + Matrix4x4Flagged transform = GetTransformToAncestor(aFrame, nsLayoutUtils::GetDisplayRootFrame(aFrame)); Matrix transform2D; if (transform.Is2D(&transform2D)) { @@ -2745,12 +2764,12 @@ nsLayoutUtils::GetTransformToAncestorScale(nsIFrame* aFrame) return gfxSize(1, 1); } -static Matrix4x4 +static Matrix4x4Flagged GetTransformToAncestorExcludingAnimated(nsIFrame* aFrame, const nsIFrame* aAncestor) { nsIFrame* parent; - Matrix4x4 ctm; + Matrix4x4Flagged ctm; if (aFrame == aAncestor) { return ctm; } @@ -2760,7 +2779,7 @@ GetTransformToAncestorExcludingAnimated(nsIFrame* aFrame, ctm = aFrame->GetTransformMatrix(aAncestor, &parent); while (parent && parent != aAncestor) { if (ActiveLayerTracker::IsScaleSubjectToAnimation(parent)) { - return Matrix4x4(); + return Matrix4x4Flagged(); } if (!parent->Extend3DContext()) { ctm.ProjectTo2D(); @@ -2773,7 +2792,7 @@ GetTransformToAncestorExcludingAnimated(nsIFrame* aFrame, gfxSize nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(nsIFrame* aFrame) { - Matrix4x4 transform = GetTransformToAncestorExcludingAnimated(aFrame, + Matrix4x4Flagged transform = GetTransformToAncestorExcludingAnimated(aFrame, nsLayoutUtils::GetDisplayRootFrame(aFrame)); Matrix transform2D; if (transform.Is2D(&transform2D)) { @@ -2818,12 +2837,12 @@ nsLayoutUtils::TransformPoints(nsIFrame* aFromFrame, nsIFrame* aToFrame, if (!nearestCommonAncestor) { return NO_COMMON_ANCESTOR; } - Matrix4x4 downToDest = GetTransformToAncestor(aToFrame, nearestCommonAncestor); + Matrix4x4Flagged downToDest = GetTransformToAncestor(aToFrame, nearestCommonAncestor); if (downToDest.IsSingular()) { return NONINVERTIBLE_TRANSFORM; } downToDest.Invert(); - Matrix4x4 upToAncestor = GetTransformToAncestor(aFromFrame, nearestCommonAncestor); + Matrix4x4Flagged upToAncestor = GetTransformToAncestor(aFromFrame, nearestCommonAncestor); CSSToLayoutDeviceScale devPixelsPerCSSPixelFromFrame = aFromFrame->PresContext()->CSSToDevPixelScale(); CSSToLayoutDeviceScale devPixelsPerCSSPixelToFrame = @@ -2850,12 +2869,12 @@ nsLayoutUtils::TransformPoint(nsIFrame* aFromFrame, nsIFrame* aToFrame, if (!nearestCommonAncestor) { return NO_COMMON_ANCESTOR; } - Matrix4x4 downToDest = GetTransformToAncestor(aToFrame, nearestCommonAncestor); + Matrix4x4Flagged downToDest = GetTransformToAncestor(aToFrame, nearestCommonAncestor); if (downToDest.IsSingular()) { return NONINVERTIBLE_TRANSFORM; } downToDest.Invert(); - Matrix4x4 upToAncestor = GetTransformToAncestor(aFromFrame, nearestCommonAncestor); + Matrix4x4Flagged upToAncestor = GetTransformToAncestor(aFromFrame, nearestCommonAncestor); float devPixelsPerAppUnitFromFrame = 1.0f / aFromFrame->PresContext()->AppUnitsPerDevPixel(); @@ -2882,12 +2901,12 @@ nsLayoutUtils::TransformRect(nsIFrame* aFromFrame, nsIFrame* aToFrame, if (!nearestCommonAncestor) { return NO_COMMON_ANCESTOR; } - Matrix4x4 downToDest = GetTransformToAncestor(aToFrame, nearestCommonAncestor); + Matrix4x4Flagged downToDest = GetTransformToAncestor(aToFrame, nearestCommonAncestor); if (downToDest.IsSingular()) { return NONINVERTIBLE_TRANSFORM; } downToDest.Invert(); - Matrix4x4 upToAncestor = GetTransformToAncestor(aFromFrame, nearestCommonAncestor); + Matrix4x4Flagged upToAncestor = GetTransformToAncestor(aFromFrame, nearestCommonAncestor); float devPixelsPerAppUnitFromFrame = 1.0f / aFromFrame->PresContext()->AppUnitsPerDevPixel(); @@ -2976,7 +2995,7 @@ nsLayoutUtils::ClampRectToScrollFrames(nsIFrame* aFrame, const nsRect& aRect) bool nsLayoutUtils::GetLayerTransformForFrame(nsIFrame* aFrame, - Matrix4x4* aTransform) + Matrix4x4Flagged* aTransform) { // FIXME/bug 796690: we can sometimes compute a transform in these // cases, it just increases complexity considerably. Punt for now. @@ -3018,7 +3037,7 @@ TransformGfxPointFromAncestor(nsIFrame *aFrame, nsIFrame *aAncestor, Point* aOut) { - Matrix4x4 ctm = nsLayoutUtils::GetTransformToAncestor(aFrame, aAncestor); + Matrix4x4Flagged ctm = nsLayoutUtils::GetTransformToAncestor(aFrame, aAncestor); ctm.Invert(); Point4D point = ctm.ProjectPoint(aPoint); if (!point.HasPositiveWCoord()) { @@ -3033,11 +3052,11 @@ TransformGfxRectToAncestor(nsIFrame *aFrame, const Rect &aRect, const nsIFrame *aAncestor, bool* aPreservesAxisAlignedRectangles = nullptr, - Maybe* aMatrixCache = nullptr, + Maybe* aMatrixCache = nullptr, bool aStopAtStackingContextAndDisplayPort = false, nsIFrame** aOutAncestor = nullptr) { - Matrix4x4 ctm; + Matrix4x4Flagged ctm; if (aMatrixCache && *aMatrixCache) { // We are given a matrix to use, so use it ctm = aMatrixCache->value(); @@ -3110,7 +3129,7 @@ nsLayoutUtils::TransformFrameRectToAncestor(nsIFrame* aFrame, const nsRect& aRect, const nsIFrame* aAncestor, bool* aPreservesAxisAlignedRectangles /* = nullptr */, - Maybe* aMatrixCache /* = nullptr */, + Maybe* aMatrixCache /* = nullptr */, bool aStopAtStackingContextAndDisplayPort /* = false */, nsIFrame** aOutAncestor /* = nullptr */) { @@ -9618,7 +9637,7 @@ nsLayoutUtils::TransformToAncestorAndCombineRegions( const nsIFrame* aAncestorFrame, nsRegion* aPreciseTargetDest, nsRegion* aImpreciseTargetDest, - Maybe* aMatrixCache, + Maybe* aMatrixCache, const DisplayItemClip* aClip) { if (aRegion.IsEmpty()) { diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 7437178c69d1..a534a05eb930 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -159,6 +159,7 @@ class nsLayoutUtils typedef mozilla::gfx::RectDouble RectDouble; typedef mozilla::gfx::Size Size; typedef mozilla::gfx::Matrix4x4 Matrix4x4; + typedef mozilla::gfx::Matrix4x4Flagged Matrix4x4Flagged; typedef mozilla::gfx::RectCornerRadii RectCornerRadii; typedef mozilla::gfx::StrokeOptions StrokeOptions; typedef mozilla::image::ImgDrawResult ImgDrawResult; @@ -857,7 +858,7 @@ public: const nsRect& aRect, const nsIFrame* aAncestor, bool* aPreservesAxisAlignedRectangles = nullptr, - mozilla::Maybe* aMatrixCache = nullptr, + mozilla::Maybe* aMatrixCache = nullptr, bool aStopAtStackingContextAndDisplayPort = false, nsIFrame** aOutAncestor = nullptr); @@ -867,7 +868,7 @@ public: * aAncestor to go up to the root frame. aInCSSUnits set to true will * return CSS units, set to false (the default) will return App units. */ - static Matrix4x4 GetTransformToAncestor(nsIFrame *aFrame, + static Matrix4x4Flagged GetTransformToAncestor(nsIFrame *aFrame, const nsIFrame *aAncestor, uint32_t aFlags = 0, nsIFrame** aOutAncestor = nullptr); @@ -960,7 +961,7 @@ public: * transaction were opened at the time this helper is called. */ static bool GetLayerTransformForFrame(nsIFrame* aFrame, - Matrix4x4* aTransform); + Matrix4x4Flagged* aTransform); /** * Given a point in the global coordinate space, returns that point expressed @@ -996,6 +997,8 @@ public: */ static nsRect MatrixTransformRect(const nsRect &aBounds, const Matrix4x4 &aMatrix, float aFactor); + static nsRect MatrixTransformRect(const nsRect &aBounds, + const Matrix4x4Flagged &aMatrix, float aFactor); /** * Helper function that, given a point and a matrix, returns the image @@ -2729,7 +2732,7 @@ public: const nsIFrame* aAncestorFrame, nsRegion* aPreciseTargetDest, nsRegion* aImpreciseTargetDest, - mozilla::Maybe* aMatrixCache, + mozilla::Maybe* aMatrixCache, const mozilla::DisplayItemClip* aClip); /** diff --git a/layout/base/tests/test_getBoxQuads_convertPointRectQuad.html b/layout/base/tests/test_getBoxQuads_convertPointRectQuad.html index a65cdecd932b..10252a73d894 100644 --- a/layout/base/tests/test_getBoxQuads_convertPointRectQuad.html +++ b/layout/base/tests/test_getBoxQuads_convertPointRectQuad.html @@ -1,4 +1,4 @@ - + diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 168ef3dbc050..ec19c8f4aaa6 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -506,7 +506,7 @@ nsComboboxControlFrame::GetCSSTransformTranslation() Matrix transform; while (frame) { nsIFrame* parent; - Matrix4x4 ctm = frame->GetTransformMatrix(nullptr, &parent); + Matrix4x4Flagged ctm = frame->GetTransformMatrix(nullptr, &parent); Matrix matrix; if (ctm.Is2D(&matrix)) { transform = transform * matrix; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 1d9556eea33d..cbb120b15a84 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -6854,7 +6854,7 @@ nsIFrame::GetNearestWidget(nsPoint& aOffset) const return widget; } -Matrix4x4 +Matrix4x4Flagged nsIFrame::GetTransformMatrix(const nsIFrame* aStopAtAncestor, nsIFrame** aOutAncestor, uint32_t aFlags) @@ -6915,7 +6915,7 @@ nsIFrame::GetTransformMatrix(const nsIFrame* aStopAtAncestor, *aOutAncestor = docRootFrame; Matrix4x4 docRootTransformToTop = - nsLayoutUtils::GetTransformToAncestor(docRootFrame, nullptr); + nsLayoutUtils::GetTransformToAncestor(docRootFrame, nullptr).GetMatrix(); if (docRootTransformToTop.IsSingular()) { NS_WARNING("Containing document is invisible, we can't compute a valid transform"); } else { @@ -7203,7 +7203,7 @@ nsIFrame::TryUpdateTransformOnly(Layer** aLayerResult) return false; } - gfx::Matrix4x4 transform3d; + gfx::Matrix4x4Flagged transform3d; if (!nsLayoutUtils::GetLayerTransformForFrame(this, &transform3d)) { // We're not able to compute a layer transform that we know would // be used at the next layers transaction, so we can't only update @@ -7228,7 +7228,7 @@ nsIFrame::TryUpdateTransformOnly(Layer** aLayerResult) !gfx::FuzzyEqual(transform._12, previousTransform._12, kError)) { return false; } - layer->SetBaseTransformForNextTransaction(transform3d); + layer->SetBaseTransformForNextTransaction(transform3d.GetMatrix()); *aLayerResult = layer; return true; } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index fd0bd40380a6..500b301504f7 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -597,6 +597,7 @@ public: typedef mozilla::gfx::DrawTarget DrawTarget; typedef mozilla::gfx::Matrix Matrix; typedef mozilla::gfx::Matrix4x4 Matrix4x4; + typedef mozilla::gfx::Matrix4x4Flagged Matrix4x4Flagged; typedef mozilla::Sides Sides; typedef mozilla::LogicalSides LogicalSides; typedef mozilla::SmallPointerArray DisplayItemDataArray; @@ -2829,9 +2830,9 @@ public: IN_CSS_UNITS = 1 << 0, STOP_AT_STACKING_CONTEXT_AND_DISPLAY_PORT = 1 << 1 }; - Matrix4x4 GetTransformMatrix(const nsIFrame* aStopAtAncestor, - nsIFrame **aOutAncestor, - uint32_t aFlags = 0); + Matrix4x4Flagged GetTransformMatrix(const nsIFrame* aStopAtAncestor, + nsIFrame **aOutAncestor, + uint32_t aFlags = 0); /** * Bit-flags to pass to IsFrameOfType() diff --git a/layout/painting/FrameLayerBuilder.cpp b/layout/painting/FrameLayerBuilder.cpp index 71710b68dcdb..6fdea66178b3 100644 --- a/layout/painting/FrameLayerBuilder.cpp +++ b/layout/painting/FrameLayerBuilder.cpp @@ -3330,7 +3330,7 @@ void ContainerState::FinishPaintedLayerData(PaintedLayerData& aData, FindOpaqueB containingPaintedLayerData->mMaybeHitRegion, rect); containingPaintedLayerData->mMaybeHitRegion.SimplifyOutward(8); } - Maybe matrixCache; + Maybe matrixCache; nsLayoutUtils::TransformToAncestorAndCombineRegions( data->mHitRegion, mContainerReferenceFrame, @@ -5836,7 +5836,7 @@ FrameLayerBuilder::GetPaintedLayerScaleForFrame(nsIFrame* aFrame) float resolution = presCtx->PresShell()->GetResolution(); - Matrix4x4 transform = Matrix4x4::Scaling(resolution, resolution, 1.0); + Matrix4x4Flagged transform = Matrix4x4::Scaling(resolution, resolution, 1.0); if (aFrame != root) { // aTransform is applied first, then the scale is applied to the result transform = nsLayoutUtils::GetTransformToAncestor(aFrame, root) * transform; diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 5aece7d79341..3ddcbe038d35 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -1920,7 +1920,7 @@ nsDisplayListBuilder::AdjustWindowDraggingRegion(nsIFrame* aFrame) // RTL mode - it should be able to exclude itself from the draggable region. referenceFrameToRootReferenceFrame = ViewAs( - nsLayoutUtils::GetTransformToAncestor(referenceFrame, mReferenceFrame)); + nsLayoutUtils::GetTransformToAncestor(referenceFrame, mReferenceFrame).GetMatrix()); Matrix referenceFrameToRootReferenceFrame2d; if (!referenceFrameToRootReferenceFrame.Is2D(&referenceFrameToRootReferenceFrame2d) || !referenceFrameToRootReferenceFrame2d.IsRectilinear()) { @@ -8495,7 +8495,7 @@ static bool IsFrameVisible(nsIFrame* aFrame, const Matrix4x4& aMatrix) return true; } -const Matrix4x4& +const Matrix4x4Flagged& nsDisplayTransform::GetTransform() const { if (mTransform.IsIdentity()) { @@ -8533,7 +8533,7 @@ nsDisplayTransform::GetTransformForRendering(LayoutDevicePoint* aOutOrigin) *aOutOrigin = LayoutDevicePoint::FromAppUnits(ToReferenceFrame(), scale); return GetResultingTransformMatrix(mFrame, nsPoint(0, 0), scale, INCLUDE_PERSPECTIVE); } - return GetTransform(); + return GetTransform().GetMatrix(); } MOZ_ASSERT(!mTransformGetter); @@ -8551,7 +8551,7 @@ nsDisplayTransform::GetAccumulatedPreserved3DTransform(nsDisplayListBuilder* aBu if (!mTransformPreserves3DInited) { mTransformPreserves3DInited = true; if (!IsLeafOf3DContext()) { - mTransformPreserves3D = GetTransform(); + mTransformPreserves3D = GetTransform().GetMatrix(); return mTransformPreserves3D; } @@ -8662,7 +8662,7 @@ nsDisplayTransform::UpdateScrollData(mozilla::layers::WebRenderScrollData* aData mozilla::layers::WebRenderLayerScrollData* aLayerData) { if (aLayerData) { - aLayerData->SetTransform(GetTransform()); + aLayerData->SetTransform(GetTransform().GetMatrix()); aLayerData->SetTransformIsPerspective(mFrame->HasPerspective()); } return true; @@ -8955,7 +8955,7 @@ nsDisplayTransform::ComputeBounds(nsDisplayListBuilder* aBuilder) */ nsDisplayListBuilder::AutoAccumulateTransform accTransform(aBuilder); - accTransform.Accumulate(GetTransform()); + accTransform.Accumulate(GetTransform().GetMatrix()); if (!IsLeafOf3DContext()) { // Do not dive into another 3D context. @@ -9004,7 +9004,7 @@ nsDisplayTransform::GetOpaqueRegion(nsDisplayListBuilder *aBuilder, return nsRegion(); } - const Matrix4x4& matrix = GetTransform(); + const Matrix4x4Flagged& matrix = GetTransform(); nsRegion result; Matrix matrix2d; @@ -9028,7 +9028,7 @@ nsDisplayTransform::IsUniform(nsDisplayListBuilder *aBuilder) const if (!UntransformVisibleRect(aBuilder, &untransformedVisible)) { return Nothing(); } - const Matrix4x4& matrix = GetTransform(); + const Matrix4x4Flagged& matrix = GetTransform(); Matrix matrix2d; if (matrix.Is2D(&matrix2d) && @@ -9103,7 +9103,7 @@ bool nsDisplayTransform::UntransformRect(const nsRect &aTransformedBounds, bool nsDisplayTransform::UntransformVisibleRect(nsDisplayListBuilder* aBuilder, nsRect *aOutRect) const { - const Matrix4x4& matrix = GetTransform(); + const Matrix4x4Flagged& matrix = GetTransform(); if (matrix.IsSingular()) return false; @@ -9132,7 +9132,7 @@ bool nsDisplayTransform::UntransformVisibleRect(nsDisplayListBuilder* aBuilder, void nsDisplayTransform::WriteDebugInfo(std::stringstream& aStream) { - AppendToString(aStream, GetTransform()); + AppendToString(aStream, GetTransform().GetMatrix()); if (IsTransformSeparator()) { aStream << " transform-separator"; } diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index cfedd11db1ef..7124e1ffa3b0 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -6065,6 +6065,7 @@ private: class nsDisplayTransform: public nsDisplayItem { typedef mozilla::gfx::Matrix4x4 Matrix4x4; + typedef mozilla::gfx::Matrix4x4Flagged Matrix4x4Flagged; typedef mozilla::gfx::Point3D Point3D; /* @@ -6244,7 +6245,7 @@ public: * we set on the layer (for rendering), since there will be an * nsDisplayPerspective created for that. */ - const Matrix4x4& GetTransform() const; + const Matrix4x4Flagged& GetTransform() const; Matrix4x4 GetTransformForRendering(mozilla::LayoutDevicePoint* aOutOrigin = nullptr); /** @@ -6445,7 +6446,7 @@ private: const nsRect* aBoundsOverride); StoreList mStoredList; - mutable Matrix4x4 mTransform; + mutable Matrix4x4Flagged mTransform; // Accumulated transform of ancestors on the preserves-3d chain. Matrix4x4 mTransformPreserves3D; ComputeTransformFunction mTransformGetter;