Title: [259058] branches/safari-609.2.1.2-branch/Source

Diff

Modified: branches/safari-609.2.1.2-branch/Source/_javascript_Core/ChangeLog (259057 => 259058)


--- branches/safari-609.2.1.2-branch/Source/_javascript_Core/ChangeLog	2020-03-26 18:40:42 UTC (rev 259057)
+++ branches/safari-609.2.1.2-branch/Source/_javascript_Core/ChangeLog	2020-03-26 18:40:47 UTC (rev 259058)
@@ -1,180 +1,3 @@
-2020-03-19  Alan Coon  <alanc...@apple.com>
-
-        Cherry-pick r258062. rdar://problem/60396604
-
-    REGRESSION (r258038): Build failure on Windows 10 bots
-    <https://bugs.webkit.org/show_bug.cgi?id=208731>
-    <rdar://problem/59222568>
-    
-    * assembler/testmasm.cpp:
-    (JSC::testCompareDouble):
-    (JSC::testCompareDoubleSameArg):
-    (JSC::testMoveConditionallyFloatingPoint):
-    (JSC::testMoveConditionallyFloatingPointSameArg):
-    - Add RELEASE_ASSERT_NOT_REACHED() statements to try to fix the
-      bots.
-    
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
-    2020-03-06  David Kilzer  <ddkil...@apple.com>
-
-            REGRESSION (r258038): Build failure on Windows 10 bots
-            <https://bugs.webkit.org/show_bug.cgi?id=208731>
-            <rdar://problem/59222568>
-
-            * assembler/testmasm.cpp:
-            (JSC::testCompareDouble):
-            (JSC::testCompareDoubleSameArg):
-            (JSC::testMoveConditionallyFloatingPoint):
-            (JSC::testMoveConditionallyFloatingPointSameArg):
-            - Add RELEASE_ASSERT_NOT_REACHED() statements to try to fix the
-              bots.
-
-2020-03-19  Alan Coon  <alanc...@apple.com>
-
-        Cherry-pick r258038. rdar://problem/60396604
-
-    Fix some issues in the ARM64 moveConditionallyAfterFloatingPointCompare() and moveDoubleConditionallyAfterFloatingPointCompare().
-    https://bugs.webkit.org/show_bug.cgi?id=208731
-    <rdar://problem/59222568>
-    
-    Reviewed by Saam Barati.
-    
-    Both the ARM64 moveConditionallyAfterFloatingPointCompare() and
-    moveDoubleConditionallyAfterFloatingPointCompare() had the following issues:
-    
-    1. For the DoubleNotEqual condition, they fail to set the result register if
-       one or both of the comparison operands is a NaN.
-    
-    2. For the DoubleEqualOrUnordered condition, they can clobber the else case
-       input register if one of the comparison operands is a NaN.
-    
-    This patch fixes both of these, and exhaustive testmasm test cases for affected
-    MacroAssembler instruction emitters using these functions.
-    
-    * assembler/MacroAssemblerARM64.h:
-    (JSC::MacroAssemblerARM64::moveConditionallyAfterFloatingPointCompare):
-    (JSC::MacroAssemblerARM64::moveDoubleConditionallyAfterFloatingPointCompare):
-    * assembler/testmasm.cpp:
-    (JSC::testCompareDouble):
-    (JSC::testCompareDoubleSameArg):
-    (JSC::testMoveConditionallyFloatingPoint):
-    (JSC::testMoveConditionallyDouble2):
-    (JSC::testMoveConditionallyDouble3):
-    (JSC::testMoveConditionallyDouble3DestSameAsThenCase):
-    (JSC::testMoveConditionallyDouble3DestSameAsElseCase):
-    (JSC::testMoveConditionallyFloat2):
-    (JSC::testMoveConditionallyFloat3):
-    (JSC::testMoveConditionallyFloat3DestSameAsThenCase):
-    (JSC::testMoveConditionallyFloat3DestSameAsElseCase):
-    (JSC::testMoveDoubleConditionallyDouble):
-    (JSC::testMoveDoubleConditionallyDoubleDestSameAsThenCase):
-    (JSC::testMoveDoubleConditionallyDoubleDestSameAsElseCase):
-    (JSC::testMoveDoubleConditionallyFloat):
-    (JSC::testMoveDoubleConditionallyFloatDestSameAsThenCase):
-    (JSC::testMoveDoubleConditionallyFloatDestSameAsElseCase):
-    (JSC::testMoveConditionallyFloatingPointSameArg):
-    (JSC::testMoveConditionallyDouble2SameArg):
-    (JSC::testMoveConditionallyDouble3SameArg):
-    (JSC::testMoveConditionallyFloat2SameArg):
-    (JSC::testMoveConditionallyFloat3SameArg):
-    (JSC::testMoveDoubleConditionallyDoubleSameArg):
-    (JSC::testMoveDoubleConditionallyFloatSameArg):
-    (JSC::run):
-    
-    
-    
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
-    2020-03-06  Mark Lam  <mark....@apple.com>
-
-            Fix some issues in the ARM64 moveConditionallyAfterFloatingPointCompare() and moveDoubleConditionallyAfterFloatingPointCompare().
-            https://bugs.webkit.org/show_bug.cgi?id=208731
-            <rdar://problem/59222568>
-
-            Reviewed by Saam Barati.
-
-            Both the ARM64 moveConditionallyAfterFloatingPointCompare() and
-            moveDoubleConditionallyAfterFloatingPointCompare() had the following issues:
-
-            1. For the DoubleNotEqual condition, they fail to set the result register if
-               one or both of the comparison operands is a NaN.
-
-            2. For the DoubleEqualOrUnordered condition, they can clobber the else case
-               input register if one of the comparison operands is a NaN.
-
-            This patch fixes both of these, and exhaustive testmasm test cases for affected
-            MacroAssembler instruction emitters using these functions.
-
-            * assembler/MacroAssemblerARM64.h:
-            (JSC::MacroAssemblerARM64::moveConditionallyAfterFloatingPointCompare):
-            (JSC::MacroAssemblerARM64::moveDoubleConditionallyAfterFloatingPointCompare):
-            * assembler/testmasm.cpp:
-            (JSC::testCompareDouble):
-            (JSC::testCompareDoubleSameArg):
-            (JSC::testMoveConditionallyFloatingPoint):
-            (JSC::testMoveConditionallyDouble2):
-            (JSC::testMoveConditionallyDouble3):
-            (JSC::testMoveConditionallyDouble3DestSameAsThenCase):
-            (JSC::testMoveConditionallyDouble3DestSameAsElseCase):
-            (JSC::testMoveConditionallyFloat2):
-            (JSC::testMoveConditionallyFloat3):
-            (JSC::testMoveConditionallyFloat3DestSameAsThenCase):
-            (JSC::testMoveConditionallyFloat3DestSameAsElseCase):
-            (JSC::testMoveDoubleConditionallyDouble):
-            (JSC::testMoveDoubleConditionallyDoubleDestSameAsThenCase):
-            (JSC::testMoveDoubleConditionallyDoubleDestSameAsElseCase):
-            (JSC::testMoveDoubleConditionallyFloat):
-            (JSC::testMoveDoubleConditionallyFloatDestSameAsThenCase):
-            (JSC::testMoveDoubleConditionallyFloatDestSameAsElseCase):
-            (JSC::testMoveConditionallyFloatingPointSameArg):
-            (JSC::testMoveConditionallyDouble2SameArg):
-            (JSC::testMoveConditionallyDouble3SameArg):
-            (JSC::testMoveConditionallyFloat2SameArg):
-            (JSC::testMoveConditionallyFloat3SameArg):
-            (JSC::testMoveDoubleConditionallyDoubleSameArg):
-            (JSC::testMoveDoubleConditionallyFloatSameArg):
-            (JSC::run):
-
-2020-03-17  Kocsen Chung  <kocsen_ch...@apple.com>
-
-        Cherry-pick r258381. rdar://problem/60539194
-
-    DFG nodes that take a TypedArray's storage need to keepAlive the TypedArray
-    https://bugs.webkit.org/show_bug.cgi?id=209035
-    
-    Reviewed by Saam Barati.
-    
-    It might be possible to produce a graph where the last reference to a TypedArray
-    is via a GetByVal or PutByVal. Since those nodes don't create any reference to the
-    TypedArray in B3 we may end up not keeping the TypedArray alive until after the
-    storage access.
-    
-    * ftl/FTLLowerDFGToB3.cpp:
-    (JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
-    (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
-    (JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
-    
-    
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
-    2020-03-12  Keith Miller  <keith_mil...@apple.com>
-
-            DFG nodes that take a TypedArray's storage need to keepAlive the TypedArray
-            https://bugs.webkit.org/show_bug.cgi?id=209035
-
-            Reviewed by Saam Barati.
-
-            It might be possible to produce a graph where the last reference to a TypedArray
-            is via a GetByVal or PutByVal. Since those nodes don't create any reference to the
-            TypedArray in B3 we may end up not keeping the TypedArray alive until after the
-            storage access.
-
-            * ftl/FTLLowerDFGToB3.cpp:
-            (JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
-            (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
-            (JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
-
 2020-02-24  Kocsen Chung  <kocsen_ch...@apple.com>
 
         Cherry-pick r257134. rdar://problem/59676898

Modified: branches/safari-609.2.1.2-branch/Source/_javascript_Core/assembler/MacroAssemblerARM64.h (259057 => 259058)


--- branches/safari-609.2.1.2-branch/Source/_javascript_Core/assembler/MacroAssemblerARM64.h	2020-03-26 18:40:42 UTC (rev 259057)
+++ branches/safari-609.2.1.2-branch/Source/_javascript_Core/assembler/MacroAssemblerARM64.h	2020-03-26 18:40:47 UTC (rev 259058)
@@ -2028,35 +2028,18 @@
     void moveConditionallyAfterFloatingPointCompare(DoubleCondition cond, RegisterID thenCase, RegisterID elseCase, RegisterID dest)
     {
         if (cond == DoubleNotEqual) {
-            if (dest == thenCase) {
-                // If the compare is unordered, elseCase is copied to thenCase and the
-                // next csel has all arguments equal to elseCase.
-                // If the compare is ordered, dest is unchanged and NE decides
-                // what value to set.
-                m_assembler.csel<datasize>(thenCase, elseCase, thenCase, Assembler::ConditionNE);
-                m_assembler.csel<datasize>(dest, thenCase, elseCase, Assembler::ConditionNE);
-            } else {
-                move(elseCase, dest);
-                Jump unordered = makeBranch(Assembler::ConditionVS);
-                m_assembler.csel<datasize>(dest, thenCase, elseCase, Assembler::ConditionNE);
-                unordered.link(this);
-            }
+            Jump unordered = makeBranch(Assembler::ConditionVS);
+            m_assembler.csel<datasize>(dest, thenCase, elseCase, Assembler::ConditionNE);
+            unordered.link(this);
             return;
         }
         if (cond == DoubleEqualOrUnordered) {
-            if (dest == elseCase) {
-                // If the compare is unordered, thenCase is copied to elseCase and the
-                // next csel has all arguments equal to thenCase.
-                // If the compare is ordered, dest is unchanged and EQ decides
-                // what value to set.
-                m_assembler.csel<datasize>(elseCase, thenCase, elseCase, Assembler::ConditionVS);
-                m_assembler.csel<datasize>(dest, thenCase, elseCase, Assembler::ConditionEQ);
-            } else {
-                move(thenCase, dest);
-                Jump unordered = makeBranch(Assembler::ConditionVS);
-                m_assembler.csel<datasize>(dest, thenCase, elseCase, Assembler::ConditionEQ);
-                unordered.link(this);
-            }
+            // If the compare is unordered, thenCase is copied to elseCase and the
+            // next csel has all arguments equal to thenCase.
+            // If the compare is ordered, dest is unchanged and EQ decides
+            // what value to set.
+            m_assembler.csel<datasize>(elseCase, thenCase, elseCase, Assembler::ConditionVS);
+            m_assembler.csel<datasize>(dest, thenCase, elseCase, Assembler::ConditionEQ);
             return;
         }
         m_assembler.csel<datasize>(dest, thenCase, elseCase, ARM64Condition(cond));
@@ -2066,35 +2049,18 @@
     void moveDoubleConditionallyAfterFloatingPointCompare(DoubleCondition cond, FPRegisterID thenCase, FPRegisterID elseCase, FPRegisterID dest)
     {
         if (cond == DoubleNotEqual) {
-            if (dest == thenCase) {
-                // If the compare is unordered, elseCase is copied to thenCase and the
-                // next fcsel has all arguments equal to elseCase.
-                // If the compare is ordered, dest is unchanged and NE decides
-                // what value to set.
-                m_assembler.fcsel<datasize>(thenCase, elseCase, thenCase, Assembler::ConditionVS);
-                m_assembler.fcsel<datasize>(dest, thenCase, elseCase, Assembler::ConditionNE);
-            } else {
-                m_assembler.fmov<64>(dest, elseCase);
-                Jump unordered = makeBranch(Assembler::ConditionVS);
-                m_assembler.fcsel<datasize>(dest, thenCase, elseCase, Assembler::ConditionNE);
-                unordered.link(this);
-            }
+            Jump unordered = makeBranch(Assembler::ConditionVS);
+            m_assembler.fcsel<datasize>(dest, thenCase, elseCase, Assembler::ConditionNE);
+            unordered.link(this);
             return;
         }
         if (cond == DoubleEqualOrUnordered) {
-            if (dest == elseCase) {
-                // If the compare is unordered, thenCase is copied to elseCase and the
-                // next csel has all arguments equal to thenCase.
-                // If the compare is ordered, dest is unchanged and EQ decides
-                // what value to set.
-                m_assembler.fcsel<datasize>(elseCase, thenCase, elseCase, Assembler::ConditionVS);
-                m_assembler.fcsel<datasize>(dest, thenCase, elseCase, Assembler::ConditionEQ);
-            } else {
-                m_assembler.fmov<64>(dest, thenCase);
-                Jump unordered = makeBranch(Assembler::ConditionVS);
-                m_assembler.fcsel<datasize>(dest, thenCase, elseCase, Assembler::ConditionEQ);
-                unordered.link(this);
-            }
+            // If the compare is unordered, thenCase is copied to elseCase and the
+            // next csel has all arguments equal to thenCase.
+            // If the compare is ordered, dest is unchanged and EQ decides
+            // what value to set.
+            m_assembler.fcsel<datasize>(elseCase, thenCase, elseCase, Assembler::ConditionVS);
+            m_assembler.fcsel<datasize>(dest, thenCase, elseCase, Assembler::ConditionEQ);
             return;
         }
         m_assembler.fcsel<datasize>(dest, thenCase, elseCase, ARM64Condition(cond));

Modified: branches/safari-609.2.1.2-branch/Source/_javascript_Core/assembler/testmasm.cpp (259057 => 259058)


--- branches/safari-609.2.1.2-branch/Source/_javascript_Core/assembler/testmasm.cpp	2020-03-26 18:40:42 UTC (rev 259057)
+++ branches/safari-609.2.1.2-branch/Source/_javascript_Core/assembler/testmasm.cpp	2020-03-26 18:40:47 UTC (rev 259058)
@@ -499,119 +499,16 @@
         jit.ret();
     });
 
-    auto expectedResult = [&, condition] (double a, double b) -> int {
-        auto isUnordered = [] (double x) {
-            return x != x;
-        };
-        switch (condition) {
-        case MacroAssembler::DoubleEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a == b);
-        case MacroAssembler::DoubleNotEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a != b);
-        case MacroAssembler::DoubleGreaterThan:
-            return !isUnordered(a) && !isUnordered(b) && (a > b);
-        case MacroAssembler::DoubleGreaterThanOrEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a >= b);
-        case MacroAssembler::DoubleLessThan:
-            return !isUnordered(a) && !isUnordered(b) && (a < b);
-        case MacroAssembler::DoubleLessThanOrEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a <= b);
-        case MacroAssembler::DoubleEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a == b);
-        case MacroAssembler::DoubleNotEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a != b);
-        case MacroAssembler::DoubleGreaterThanOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a > b);
-        case MacroAssembler::DoubleGreaterThanOrEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a >= b);
-        case MacroAssembler::DoubleLessThanOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a < b);
-        case MacroAssembler::DoubleLessThanOrEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a <= b);
-        } // switch
-        RELEASE_ASSERT_NOT_REACHED();
-    };
-
     auto operands = doubleOperands();
     for (auto a : operands) {
         for (auto b : operands) {
             arg1 = a;
             arg2 = b;
-            CHECK_EQ(invoke<int>(compareDouble), expectedResult(a, b));
-            CHECK_EQ(invoke<int>(compareDoubleGeneric), expectedResult(a, b));
+            CHECK_EQ(invoke<int>(compareDouble), invoke<int>(compareDoubleGeneric));
         }
     }
 }
 
-void testCompareDoubleSameArg(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-
-    auto compareDouble = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.move(CCallHelpers::TrustedImm32(-1), GPRInfo::returnValueGPR);
-        jit.compareDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0, GPRInfo::returnValueGPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    auto compareDoubleGeneric = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.move(CCallHelpers::TrustedImm32(1), GPRInfo::returnValueGPR);
-        auto jump = jit.branchDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-        jit.move(CCallHelpers::TrustedImm32(0), GPRInfo::returnValueGPR);
-        jump.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    auto expectedResult = [&, condition] (double a) -> int {
-        auto isUnordered = [] (double x) {
-            return x != x;
-        };
-        switch (condition) {
-        case MacroAssembler::DoubleEqual:
-            return !isUnordered(a) && (a == a);
-        case MacroAssembler::DoubleNotEqual:
-            return !isUnordered(a) && (a != a);
-        case MacroAssembler::DoubleGreaterThan:
-            return !isUnordered(a) && (a > a);
-        case MacroAssembler::DoubleGreaterThanOrEqual:
-            return !isUnordered(a) && (a >= a);
-        case MacroAssembler::DoubleLessThan:
-            return !isUnordered(a) && (a < a);
-        case MacroAssembler::DoubleLessThanOrEqual:
-            return !isUnordered(a) && (a <= a);
-        case MacroAssembler::DoubleEqualOrUnordered:
-            return isUnordered(a) || (a == a);
-        case MacroAssembler::DoubleNotEqualOrUnordered:
-            return isUnordered(a) || (a != a);
-        case MacroAssembler::DoubleGreaterThanOrUnordered:
-            return isUnordered(a) || (a > a);
-        case MacroAssembler::DoubleGreaterThanOrEqualOrUnordered:
-            return isUnordered(a) || (a >= a);
-        case MacroAssembler::DoubleLessThanOrUnordered:
-            return isUnordered(a) || (a < a);
-        case MacroAssembler::DoubleLessThanOrEqualOrUnordered:
-            return isUnordered(a) || (a <= a);
-        } // switch
-        RELEASE_ASSERT_NOT_REACHED();
-    };
-
-    auto operands = doubleOperands();
-    for (auto a : operands) {
-        arg1 = a;
-        CHECK_EQ(invoke<int>(compareDouble), expectedResult(a));
-        CHECK_EQ(invoke<int>(compareDoubleGeneric), expectedResult(a));
-    }
-}
-
 void testMul32WithImmediates()
 {
     for (auto immediate : int32Operands()) {
@@ -689,771 +586,8 @@
         }
     }
 }
-#endif // CPU(X86) || CPU(X86_64) || CPU(ARM64)
+#endif
 
-#if CPU(X86_64) || CPU(ARM64)
-
-template<typename T, typename SelectionType>
-void testMoveConditionallyFloatingPoint(MacroAssembler::DoubleCondition condition, const MacroAssemblerCodeRef<JSEntryPtrTag>& testCode, T& arg1, T& arg2, const Vector<T> operands, SelectionType selectionA, SelectionType selectionB)
-{
-    auto expectedResult = [&, condition] (T a, T b) -> SelectionType {
-        auto isUnordered = [] (double x) {
-            return x != x;
-        };
-        switch (condition) {
-        case MacroAssembler::DoubleEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a == b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleNotEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a != b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThan:
-            return !isUnordered(a) && !isUnordered(b) && (a > b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThanOrEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a >= b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThan:
-            return !isUnordered(a) && !isUnordered(b) && (a < b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThanOrEqual:
-            return !isUnordered(a) && !isUnordered(b) && (a <= b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a == b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleNotEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a != b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThanOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a > b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThanOrEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a >= b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThanOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a < b) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThanOrEqualOrUnordered:
-            return isUnordered(a) || isUnordered(b) || (a <= b) ? selectionA : selectionB;
-        } // switch
-        RELEASE_ASSERT_NOT_REACHED();
-    };
-
-    for (auto a : operands) {
-        for (auto b : operands) {
-            arg1 = a;
-            arg2 = b;
-            CHECK_EQ(invoke<SelectionType>(testCode), expectedResult(a, b));
-        }
-    }
-}
-
-void testMoveConditionallyDouble2(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        RELEASE_ASSERT(destGPR != selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), destGPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, destGPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyDouble3(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-    unsigned corruptedSelectionA = 0xbbad000a;
-    unsigned corruptedSelectionB = 0xbbad000b;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        GPRReg selectionBGPR = GPRInfo::argumentGPR3;
-        RELEASE_ASSERT(destGPR != selectionAGPR);
-        RELEASE_ASSERT(destGPR != selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(-1), destGPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, selectionBGPR, destGPR);
-
-        auto aIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionAGPR, CCallHelpers::TrustedImm32(selectionA));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionA), destGPR);
-        aIsUnchanged.link(&jit);
-
-        auto bIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionBGPR, CCallHelpers::TrustedImm32(selectionB));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionB), destGPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyDouble3DestSameAsThenCase(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-    unsigned corruptedSelectionB = 0xbbad000b;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = destGPR;
-        GPRReg selectionBGPR = GPRInfo::argumentGPR3;
-        RELEASE_ASSERT(destGPR == selectionAGPR);
-        RELEASE_ASSERT(destGPR != selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, selectionBGPR, destGPR);
-
-        auto bIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionBGPR, CCallHelpers::TrustedImm32(selectionB));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionB), destGPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyDouble3DestSameAsElseCase(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-    unsigned corruptedSelectionA = 0xbbad000a;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        GPRReg selectionBGPR = destGPR;
-        RELEASE_ASSERT(destGPR != selectionAGPR);
-        RELEASE_ASSERT(destGPR == selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, selectionBGPR, destGPR);
-
-        auto aIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionAGPR, CCallHelpers::TrustedImm32(selectionA));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionA), destGPR);
-        aIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyFloat2(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    float arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        RELEASE_ASSERT(destGPR != selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), GPRInfo::returnValueGPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyFloat(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, destGPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyFloat3(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    float arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-    unsigned corruptedSelectionA = 0xbbad000a;
-    unsigned corruptedSelectionB = 0xbbad000b;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        GPRReg selectionBGPR = GPRInfo::argumentGPR3;
-        RELEASE_ASSERT(destGPR != selectionAGPR);
-        RELEASE_ASSERT(destGPR != selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(-1), destGPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyFloat(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, selectionBGPR, destGPR);
-
-        auto aIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionAGPR, CCallHelpers::TrustedImm32(selectionA));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionA), destGPR);
-        aIsUnchanged.link(&jit);
-
-        auto bIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionBGPR, CCallHelpers::TrustedImm32(selectionB));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionB), destGPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyFloat3DestSameAsThenCase(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    float arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-    unsigned corruptedSelectionB = 0xbbad000b;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = destGPR;
-        GPRReg selectionBGPR = GPRInfo::argumentGPR3;
-        RELEASE_ASSERT(destGPR == selectionAGPR);
-        RELEASE_ASSERT(destGPR != selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyFloat(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, selectionBGPR, destGPR);
-
-        auto bIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionBGPR, CCallHelpers::TrustedImm32(selectionB));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionB), destGPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyFloat3DestSameAsElseCase(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    float arg2 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-    unsigned corruptedSelectionA = 0xbbad000a;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg destGPR = GPRInfo::returnValueGPR;
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        GPRReg selectionBGPR = destGPR;
-        RELEASE_ASSERT(destGPR != selectionAGPR);
-        RELEASE_ASSERT(destGPR == selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg2), FPRInfo::fpRegT1);
-        jit.moveConditionallyFloat(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1, selectionAGPR, selectionBGPR, destGPR);
-
-        auto aIsUnchanged = jit.branch32(CCallHelpers::Equal, selectionAGPR, CCallHelpers::TrustedImm32(selectionA));
-        jit.move(CCallHelpers::TrustedImm32(corruptedSelectionA), destGPR);
-        aIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyDouble(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double arg2 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-    double corruptedSelectionA = 55555;
-    double corruptedSelectionB = 66666;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        FPRReg destFPR = FPRInfo::returnValueFPR;
-        FPRReg selectionAFPR = FPRInfo::fpRegT1;
-        FPRReg selectionBFPR = FPRInfo::fpRegT2;
-        FPRReg arg1FPR = FPRInfo::fpRegT3;
-        FPRReg arg2FPR = FPRInfo::fpRegT4;
-
-        RELEASE_ASSERT(destFPR != selectionAFPR);
-        RELEASE_ASSERT(destFPR != selectionBFPR);
-        RELEASE_ASSERT(destFPR != arg1FPR);
-        RELEASE_ASSERT(destFPR != arg2FPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), arg1FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg2), arg2FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), selectionAFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), selectionBFPR);
-        jit.moveDoubleConditionallyDouble(condition, arg1FPR, arg2FPR, selectionAFPR, selectionBFPR, destFPR);
-
-        FPRReg tempFPR = FPRInfo::fpRegT5;
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR);
-        auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionAFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR);
-        aIsUnchanged.link(&jit);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR);
-        auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionBFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyDoubleDestSameAsThenCase(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double arg2 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-    double corruptedSelectionB = 66666;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        FPRReg destFPR = FPRInfo::returnValueFPR;
-        FPRReg selectionAFPR = destFPR;
-        FPRReg selectionBFPR = FPRInfo::fpRegT2;
-        FPRReg arg1FPR = FPRInfo::fpRegT3;
-        FPRReg arg2FPR = FPRInfo::fpRegT4;
-
-        RELEASE_ASSERT(destFPR == selectionAFPR);
-        RELEASE_ASSERT(destFPR != selectionBFPR);
-        RELEASE_ASSERT(destFPR != arg1FPR);
-        RELEASE_ASSERT(destFPR != arg2FPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), arg1FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg2), arg2FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), selectionAFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), selectionBFPR);
-        jit.moveDoubleConditionallyDouble(condition, arg1FPR, arg2FPR, selectionAFPR, selectionBFPR, destFPR);
-
-        FPRReg tempFPR = FPRInfo::fpRegT5;
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR);
-        auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionBFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyDoubleDestSameAsElseCase(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double arg2 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-    double corruptedSelectionA = 55555;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        FPRReg destFPR = FPRInfo::returnValueFPR;
-        FPRReg selectionAFPR = FPRInfo::fpRegT1;
-        FPRReg selectionBFPR = destFPR;
-        FPRReg arg1FPR = FPRInfo::fpRegT3;
-        FPRReg arg2FPR = FPRInfo::fpRegT4;
-
-        RELEASE_ASSERT(destFPR != selectionAFPR);
-        RELEASE_ASSERT(destFPR == selectionBFPR);
-        RELEASE_ASSERT(destFPR != arg1FPR);
-        RELEASE_ASSERT(destFPR != arg2FPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), arg1FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg2), arg2FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), selectionAFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), selectionBFPR);
-        jit.moveDoubleConditionallyDouble(condition, arg1FPR, arg2FPR, selectionAFPR, selectionBFPR, destFPR);
-
-        FPRReg tempFPR = FPRInfo::fpRegT5;
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR);
-        auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionAFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR);
-        aIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyFloat(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    float arg2 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-    double corruptedSelectionA = 55555;
-    double corruptedSelectionB = 66666;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        FPRReg destFPR = FPRInfo::returnValueFPR;
-        FPRReg selectionAFPR = FPRInfo::fpRegT1;
-        FPRReg selectionBFPR = FPRInfo::fpRegT2;
-        FPRReg arg1FPR = FPRInfo::fpRegT3;
-        FPRReg arg2FPR = FPRInfo::fpRegT4;
-
-        RELEASE_ASSERT(destFPR != selectionAFPR);
-        RELEASE_ASSERT(destFPR != selectionBFPR);
-        RELEASE_ASSERT(destFPR != arg1FPR);
-        RELEASE_ASSERT(destFPR != arg2FPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), arg1FPR);
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg2), arg2FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), selectionAFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), selectionBFPR);
-        jit.moveDoubleConditionallyFloat(condition, arg1FPR, arg2FPR, selectionAFPR, selectionBFPR, destFPR);
-
-        FPRReg tempFPR = FPRInfo::fpRegT5;
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR);
-        auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionAFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR);
-        aIsUnchanged.link(&jit);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR);
-        auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionBFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyFloatDestSameAsThenCase(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    float arg2 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-    double corruptedSelectionB = 66666;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        FPRReg destFPR = FPRInfo::returnValueFPR;
-        FPRReg selectionAFPR = destFPR;
-        FPRReg selectionBFPR = FPRInfo::fpRegT2;
-        FPRReg arg1FPR = FPRInfo::fpRegT3;
-        FPRReg arg2FPR = FPRInfo::fpRegT4;
-
-        RELEASE_ASSERT(destFPR == selectionAFPR);
-        RELEASE_ASSERT(destFPR != selectionBFPR);
-        RELEASE_ASSERT(destFPR != arg1FPR);
-        RELEASE_ASSERT(destFPR != arg2FPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), arg1FPR);
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg2), arg2FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), selectionAFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), selectionBFPR);
-        jit.moveDoubleConditionallyFloat(condition, arg1FPR, arg2FPR, selectionAFPR, selectionBFPR, destFPR);
-
-        FPRReg tempFPR = FPRInfo::fpRegT5;
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), tempFPR);
-        auto bIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionBFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionB), destFPR);
-        bIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyFloatDestSameAsElseCase(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    float arg2 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-    double corruptedSelectionA = 55555;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        FPRReg destFPR = FPRInfo::returnValueFPR;
-        FPRReg selectionAFPR = FPRInfo::fpRegT1;
-        FPRReg selectionBFPR = destFPR;
-        FPRReg arg1FPR = FPRInfo::fpRegT3;
-        FPRReg arg2FPR = FPRInfo::fpRegT4;
-
-        RELEASE_ASSERT(destFPR != selectionAFPR);
-        RELEASE_ASSERT(destFPR == selectionBFPR);
-        RELEASE_ASSERT(destFPR != arg1FPR);
-        RELEASE_ASSERT(destFPR != arg2FPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), arg1FPR);
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg2), arg2FPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), selectionAFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), selectionBFPR);
-        jit.moveDoubleConditionallyFloat(condition, arg1FPR, arg2FPR, selectionAFPR, selectionBFPR, destFPR);
-
-        FPRReg tempFPR = FPRInfo::fpRegT5;
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), tempFPR);
-        auto aIsUnchanged = jit.branchDouble(CCallHelpers::DoubleEqual, selectionAFPR, tempFPR);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&corruptedSelectionA), destFPR);
-        aIsUnchanged.link(&jit);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPoint(condition, testCode, arg1, arg2, floatOperands(), selectionA, selectionB);
-}
-
-template<typename T, typename SelectionType>
-void testMoveConditionallyFloatingPointSameArg(MacroAssembler::DoubleCondition condition, const MacroAssemblerCodeRef<JSEntryPtrTag>& testCode, T& arg1, const Vector<T> operands, SelectionType selectionA, SelectionType selectionB)
-{
-    auto expectedResult = [&, condition] (T a) -> SelectionType {
-        auto isUnordered = [] (double x) {
-            return x != x;
-        };
-        switch (condition) {
-        case MacroAssembler::DoubleEqual:
-            return !isUnordered(a) && (a == a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleNotEqual:
-            return !isUnordered(a) && (a != a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThan:
-            return !isUnordered(a) && (a > a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThanOrEqual:
-            return !isUnordered(a) && (a >= a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThan:
-            return !isUnordered(a) && (a < a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThanOrEqual:
-            return !isUnordered(a) && (a <= a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleEqualOrUnordered:
-            return isUnordered(a) || (a == a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleNotEqualOrUnordered:
-            return isUnordered(a) || (a != a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThanOrUnordered:
-            return isUnordered(a) || (a > a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleGreaterThanOrEqualOrUnordered:
-            return isUnordered(a) || (a >= a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThanOrUnordered:
-            return isUnordered(a) || (a < a) ? selectionA : selectionB;
-        case MacroAssembler::DoubleLessThanOrEqualOrUnordered:
-            return isUnordered(a) || (a <= a) ? selectionA : selectionB;
-        } // switch
-        RELEASE_ASSERT_NOT_REACHED();
-    };
-
-    for (auto a : operands) {
-        arg1 = a;
-        CHECK_EQ(invoke<SelectionType>(testCode), expectedResult(a));
-    }
-}
-
-void testMoveConditionallyDouble2SameArg(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        RELEASE_ASSERT(GPRInfo::returnValueGPR != selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), GPRInfo::returnValueGPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.moveConditionallyDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0, selectionAGPR, GPRInfo::returnValueGPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPointSameArg(condition, testCode, arg1, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyDouble3SameArg(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        GPRReg selectionBGPR = GPRInfo::argumentGPR3;
-        RELEASE_ASSERT(GPRInfo::returnValueGPR != selectionAGPR);
-        RELEASE_ASSERT(GPRInfo::returnValueGPR != selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(-1), GPRInfo::returnValueGPR);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.moveConditionallyDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0, selectionAGPR, selectionBGPR, GPRInfo::returnValueGPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPointSameArg(condition, testCode, arg1, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyFloat2SameArg(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        RELEASE_ASSERT(GPRInfo::returnValueGPR != selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), GPRInfo::returnValueGPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.moveConditionallyFloat(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0, selectionAGPR, GPRInfo::returnValueGPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPointSameArg(condition, testCode, arg1, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveConditionallyFloat3SameArg(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    unsigned selectionA = 42;
-    unsigned selectionB = 17;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        GPRReg selectionAGPR = GPRInfo::argumentGPR2;
-        GPRReg selectionBGPR = GPRInfo::argumentGPR3;
-        RELEASE_ASSERT(GPRInfo::returnValueGPR != selectionAGPR);
-        RELEASE_ASSERT(GPRInfo::returnValueGPR != selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionA), selectionAGPR);
-        jit.move(CCallHelpers::TrustedImm32(selectionB), selectionBGPR);
-        jit.move(CCallHelpers::TrustedImm32(-1), GPRInfo::returnValueGPR);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.moveConditionallyFloat(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0, selectionAGPR, selectionBGPR, GPRInfo::returnValueGPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPointSameArg(condition, testCode, arg1, floatOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyDoubleSameArg(MacroAssembler::DoubleCondition condition)
-{
-    double arg1 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), FPRInfo::fpRegT2);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), FPRInfo::fpRegT3);
-        jit.moveDoubleConditionallyDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0, FPRInfo::fpRegT2, FPRInfo::fpRegT3, FPRInfo::returnValueFPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPointSameArg(condition, testCode, arg1, doubleOperands(), selectionA, selectionB);
-}
-
-void testMoveDoubleConditionallyFloatSameArg(MacroAssembler::DoubleCondition condition)
-{
-    float arg1 = 0;
-    double selectionA = 42.0;
-    double selectionB = 17.0;
-
-    auto testCode = compile([&, condition] (CCallHelpers& jit) {
-        emitFunctionPrologue(jit);
-
-        jit.loadFloat(CCallHelpers::TrustedImmPtr(&arg1), FPRInfo::fpRegT0);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionA), FPRInfo::fpRegT2);
-        jit.loadDouble(CCallHelpers::TrustedImmPtr(&selectionB), FPRInfo::fpRegT3);
-        jit.moveDoubleConditionallyFloat(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT0, FPRInfo::fpRegT2, FPRInfo::fpRegT3, FPRInfo::returnValueFPR);
-
-        emitFunctionEpilogue(jit);
-        jit.ret();
-    });
-
-    testMoveConditionallyFloatingPointSameArg(condition, testCode, arg1, floatOperands(), selectionA, selectionB);
-}
-
-#endif // CPU(X86_64) || CPU(ARM64)
-
 #if ENABLE(MASM_PROBE)
 void testProbeReadsArgumentRegisters()
 {
@@ -2203,25 +1337,18 @@
     // reset to check a conversion result
     RUN(testBranchTruncateDoubleToInt32(123, 123));
 
-#define FOR_EACH_DOUBLE_CONDITION_RUN(__test) \
-    do { \
-        RUN(__test(MacroAssembler::DoubleEqual)); \
-        RUN(__test(MacroAssembler::DoubleNotEqual)); \
-        RUN(__test(MacroAssembler::DoubleGreaterThan)); \
-        RUN(__test(MacroAssembler::DoubleGreaterThanOrEqual)); \
-        RUN(__test(MacroAssembler::DoubleLessThan)); \
-        RUN(__test(MacroAssembler::DoubleLessThanOrEqual)); \
-        RUN(__test(MacroAssembler::DoubleEqualOrUnordered)); \
-        RUN(__test(MacroAssembler::DoubleNotEqualOrUnordered)); \
-        RUN(__test(MacroAssembler::DoubleGreaterThanOrUnordered)); \
-        RUN(__test(MacroAssembler::DoubleGreaterThanOrEqualOrUnordered)); \
-        RUN(__test(MacroAssembler::DoubleLessThanOrUnordered)); \
-        RUN(__test(MacroAssembler::DoubleLessThanOrEqualOrUnordered)); \
-    } while (false)
-
-    FOR_EACH_DOUBLE_CONDITION_RUN(testCompareDouble);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testCompareDoubleSameArg);
-
+    RUN(testCompareDouble(MacroAssembler::DoubleEqual));
+    RUN(testCompareDouble(MacroAssembler::DoubleNotEqual));
+    RUN(testCompareDouble(MacroAssembler::DoubleGreaterThan));
+    RUN(testCompareDouble(MacroAssembler::DoubleGreaterThanOrEqual));
+    RUN(testCompareDouble(MacroAssembler::DoubleLessThan));
+    RUN(testCompareDouble(MacroAssembler::DoubleLessThanOrEqual));
+    RUN(testCompareDouble(MacroAssembler::DoubleEqualOrUnordered));
+    RUN(testCompareDouble(MacroAssembler::DoubleNotEqualOrUnordered));
+    RUN(testCompareDouble(MacroAssembler::DoubleGreaterThanOrUnordered));
+    RUN(testCompareDouble(MacroAssembler::DoubleGreaterThanOrEqualOrUnordered));
+    RUN(testCompareDouble(MacroAssembler::DoubleLessThanOrUnordered));
+    RUN(testCompareDouble(MacroAssembler::DoubleLessThanOrEqualOrUnordered));
     RUN(testMul32WithImmediates());
 
 #if CPU(X86_64)
@@ -2238,35 +1365,20 @@
 #endif
 
 #if CPU(X86) || CPU(X86_64) || CPU(ARM64)
-    FOR_EACH_DOUBLE_CONDITION_RUN(testCompareFloat);
+    RUN(testCompareFloat(MacroAssembler::DoubleEqual));
+    RUN(testCompareFloat(MacroAssembler::DoubleNotEqual));
+    RUN(testCompareFloat(MacroAssembler::DoubleGreaterThan));
+    RUN(testCompareFloat(MacroAssembler::DoubleGreaterThanOrEqual));
+    RUN(testCompareFloat(MacroAssembler::DoubleLessThan));
+    RUN(testCompareFloat(MacroAssembler::DoubleLessThanOrEqual));
+    RUN(testCompareFloat(MacroAssembler::DoubleEqualOrUnordered));
+    RUN(testCompareFloat(MacroAssembler::DoubleNotEqualOrUnordered));
+    RUN(testCompareFloat(MacroAssembler::DoubleGreaterThanOrUnordered));
+    RUN(testCompareFloat(MacroAssembler::DoubleGreaterThanOrEqualOrUnordered));
+    RUN(testCompareFloat(MacroAssembler::DoubleLessThanOrUnordered));
+    RUN(testCompareFloat(MacroAssembler::DoubleLessThanOrEqualOrUnordered));
 #endif
 
-#if CPU(X86_64) || CPU(ARM64)
-    // Comparing 2 different registers.
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyDouble2);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyDouble3);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyDouble3DestSameAsThenCase);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyDouble3DestSameAsElseCase);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyFloat2);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyFloat3);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyFloat3DestSameAsThenCase);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyFloat3DestSameAsElseCase);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyDouble);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyDoubleDestSameAsThenCase);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyDoubleDestSameAsElseCase);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyFloat);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyFloatDestSameAsThenCase);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyFloatDestSameAsElseCase);
-
-    // Comparing the same register against itself.
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyDouble2SameArg);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyDouble3SameArg);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyFloat2SameArg);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveConditionallyFloat3SameArg);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyDoubleSameArg);
-    FOR_EACH_DOUBLE_CONDITION_RUN(testMoveDoubleConditionallyFloatSameArg);
-#endif
-
 #if ENABLE(MASM_PROBE)
     RUN(testProbeReadsArgumentRegisters());
     RUN(testProbeWritesArgumentRegisters());

Modified: branches/safari-609.2.1.2-branch/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (259057 => 259058)


--- branches/safari-609.2.1.2-branch/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2020-03-26 18:40:42 UTC (rev 259057)
+++ branches/safari-609.2.1.2-branch/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2020-03-26 18:40:47 UTC (rev 259058)
@@ -3818,9 +3818,7 @@
         // the typed array storage, since that's as precise of an abstraction as we can have of shared
         // array buffer storage.
         m_heaps.decorateFencedAccess(&m_heaps.typedArrayProperties, atomicValue);
-
-        // We have to keep base alive since that keeps storage alive.
-        keepAlive(lowCell(baseEdge));
+        
         setIntTypedArrayLoadResult(result, type);
     }
     
@@ -4634,7 +4632,6 @@
         case Array::Uint32Array:
         case Array::Float32Array:
         case Array::Float64Array: {
-            LValue base = lowCell(m_graph.varArgChild(m_node, 0));
             LValue index = lowInt32(m_graph.varArgChild(m_node, 1));
             LValue storage = lowStorage(m_graph.varArgChild(m_node, 2));
             
@@ -4664,8 +4661,6 @@
                     DFG_CRASH(m_graph, m_node, "Bad typed array type");
                 }
                 
-                // We have to keep base alive since that keeps storage alive.
-                keepAlive(base);
                 setDouble(result);
                 return;
             }
@@ -5032,8 +5027,6 @@
                     m_out.appendTo(continuation, lastNext);
                 }
                 
-                // We have to keep base alive since that keeps storage alive.
-                keepAlive(base);
                 return;
             }
         }

Modified: branches/safari-609.2.1.2-branch/Source/WebCore/ChangeLog (259057 => 259058)


--- branches/safari-609.2.1.2-branch/Source/WebCore/ChangeLog	2020-03-26 18:40:42 UTC (rev 259057)
+++ branches/safari-609.2.1.2-branch/Source/WebCore/ChangeLog	2020-03-26 18:40:47 UTC (rev 259058)
@@ -1,35 +1,3 @@
-b'2020-03-20  Alan Coon  <alanc...@apple.com>\n\n        Cherry-pick r258267. rdar://problem/60703602\n\n    Consolidate detachment of document timeline into Document::commonTeardown.\n    https://bugs.webkit.org/show_bug.cgi?id=208786\n    <rdar://problem/59936716>\n    \n    Patch by Jack Lee <shihchieh_...@apple.com> on 2020-03-11\n    Reviewed by Ryosuke Niwa.\n    \n    Move detachment of DocumentTimeline to Document::commonTeardown().\n    \n    No new tests. Covered by existing document tests.\n    \n    * dom/Document.cpp:\n    (WebCore::Document::removedLastRef):\n    (WebCore::Document::commonTeardown):\n    (WebCore::Document::prepareForDestruction):\n    \n    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258267 268f45cc-cd09-0410-ab3c-d52691b4dbfc\n\n    2020-03-11  Jack Lee  <shihchieh_...@apple.com>\n\n            Consolidate detachment of document timeline into Document::commonTeardown.\n            https://bugs.webkit
 .org/show_bug.cgi?id=208786\n            <rdar://problem/59936716>\n\n            Reviewed by Ryosuke Niwa.\n\n            Move detachment of DocumentTimeline to Document::commonTeardown().\n\n            No new tests. Covered by existing document tests.\n\n            * dom/Document.cpp:\n            (WebCore::Document::removedLastRef):\n            (WebCore::Document::commonTeardown):\n            (WebCore::Document::prepareForDestruction):\n\n'2020-03-17  Kocsen Chung  <kocsen_ch...@apple.com>
-
-        Cherry-pick r255997. rdar://problem/60507340
-
-    Incorrect TextTrack sorting with invalid BCP47 language
-    https://bugs.webkit.org/show_bug.cgi?id=207315
-    
-    Patch by Doug Kelly <do...@apple.com> on 2020-02-06
-    Reviewed by Jer Noble.
-    
-    When comparing TextTracks, this ensures all tracks are compared based on consistent parameters, including tracks with an invalid BCP47
-    language attribute.
-    
-    * page/CaptionUserPreferencesMediaAF.cpp:
-    (WebCore::textTrackCompare):
-    
-    
-    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
-    2020-02-06  Doug Kelly  <do...@apple.com>
-
-            Incorrect TextTrack sorting with invalid BCP47 language
-            https://bugs.webkit.org/show_bug.cgi?id=207315
-
-            Reviewed by Jer Noble.
-
-            When comparing TextTracks, this ensures all tracks are compared based on consistent parameters, including tracks with an invalid BCP47
-            language attribute.
-
-            * page/CaptionUserPreferencesMediaAF.cpp:
-            (WebCore::textTrackCompare):
-
 2020-03-13  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r257746. rdar://problem/60260331

Modified: branches/safari-609.2.1.2-branch/Source/WebCore/dom/Document.cpp (259057 => 259058)


--- branches/safari-609.2.1.2-branch/Source/WebCore/dom/Document.cpp	2020-03-26 18:40:42 UTC (rev 259057)
+++ branches/safari-609.2.1.2-branch/Source/WebCore/dom/Document.cpp	2020-03-26 18:40:47 UTC (rev 259058)
@@ -757,7 +757,7 @@
 #endif
         decrementReferencingNodeCount();
     } else {
-        commonTeardown();
+        stopActiveDOMObjects();
 #ifndef NDEBUG
         m_inRemovedLastRefFunction = false;
         m_deletionHasBegun = true;
@@ -783,10 +783,6 @@
         m_highlightMap->clear();
 
     m_pendingScrollEventTargetList = nullptr;
-
-    while (!m_timelines.computesEmpty())
-        m_timelines.begin()->detachFromDocument();
-    m_timeline = nullptr;
 }
 
 Element* Document::elementForAccessKey(const String& key)
@@ -2581,6 +2577,10 @@
 
     detachFromFrame();
 
+    while (!m_timelines.computesEmpty())
+        m_timelines.begin()->detachFromDocument();
+    m_timeline = nullptr;
+
 #if ENABLE(CSS_PAINTING_API)
     for (auto& scope : m_paintWorkletGlobalScopes.values())
         scope->prepareForDestruction();

Modified: branches/safari-609.2.1.2-branch/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp (259057 => 259058)


--- branches/safari-609.2.1.2-branch/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp	2020-03-26 18:40:42 UTC (rev 259057)
+++ branches/safari-609.2.1.2-branch/Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp	2020-03-26 18:40:47 UTC (rev 259058)
@@ -813,32 +813,36 @@
 {
     String preferredLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(defaultLanguage()));
     String aLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(a->validBCP47Language()));
-    String bLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(b->validBCP47Language()));
+    String bLanguageDisplayName = displayNameForLanguageLocale(languageIdentifier(b->language()));
 
     // Tracks in the user's preferred language are always at the top of the menu.
     bool aIsPreferredLanguage = !codePointCompare(aLanguageDisplayName, preferredLanguageDisplayName);
     bool bIsPreferredLanguage = !codePointCompare(bLanguageDisplayName, preferredLanguageDisplayName);
-    if (aIsPreferredLanguage != bIsPreferredLanguage)
+    if ((aIsPreferredLanguage || bIsPreferredLanguage) && (aIsPreferredLanguage != bIsPreferredLanguage))
         return aIsPreferredLanguage;
 
     // Tracks not in the user's preferred language sort first by language ...
-    if (auto languageDisplayNameComparison = codePointCompare(aLanguageDisplayName, bLanguageDisplayName))
-        return languageDisplayNameComparison < 0;
+    if (codePointCompare(aLanguageDisplayName, bLanguageDisplayName))
+        return codePointCompare(aLanguageDisplayName, bLanguageDisplayName) < 0;
 
     // ... but when tracks have the same language, main program content sorts next highest ...
     bool aIsMainContent = a->isMainProgramContent();
     bool bIsMainContent = b->isMainProgramContent();
-    if (aIsMainContent != bIsMainContent)
+    if ((aIsMainContent || bIsMainContent) && (aIsMainContent != bIsMainContent))
         return aIsMainContent;
 
-    // ... and main program tracks sort higher than CC tracks ...
+    // ... and main program trakcs sort higher than CC tracks ...
     bool aIsCC = a->isClosedCaptions();
     bool bIsCC = b->isClosedCaptions();
-    if (aIsCC != bIsCC)
-        return aIsCC;
+    if ((aIsCC || bIsCC) && (aIsCC != bIsCC)) {
+        if (aIsCC)
+            return aIsMainContent;
+        return bIsMainContent;
+    }
 
     // ... and tracks of the same type and language sort by the menu item text.
-    if (auto trackDisplayComparison = codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get())))
+    auto trackDisplayComparison = codePointCompare(trackDisplayName(a.get()), trackDisplayName(b.get()));
+    if (trackDisplayComparison)
         return trackDisplayComparison < 0;
 
     // ... and if the menu item text is the same, compare the unique IDs
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to