Title: [169956] trunk/Source/WebCore
Revision
169956
Author
achristen...@apple.com
Date
2014-06-13 16:37:22 -0700 (Fri, 13 Jun 2014)

Log Message

Make css jit compile on armv7.
https://bugs.webkit.org/show_bug.cgi?id=133889

Reviewed by Benjamin Poulain.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::moduloHelper):
(WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
Implement modulo using a function call for now.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169955 => 169956)


--- trunk/Source/WebCore/ChangeLog	2014-06-13 23:01:31 UTC (rev 169955)
+++ trunk/Source/WebCore/ChangeLog	2014-06-13 23:37:22 UTC (rev 169956)
@@ -1,3 +1,15 @@
+2014-06-13  Alex Christensen  <achristen...@webkit.org>
+
+        Make css jit compile on armv7.
+        https://bugs.webkit.org/show_bug.cgi?id=133889
+
+        Reviewed by Benjamin Poulain.
+
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::moduloHelper):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
+        Implement modulo using a function call for now.
+
 2014-06-13  Anders Carlsson  <ander...@apple.com>
 
         Use the callOnMainThread version that takes an std::function in BlobResourceHandle::start()

Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (169955 => 169956)


--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2014-06-13 23:01:31 UTC (rev 169955)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2014-06-13 23:37:22 UTC (rev 169956)
@@ -1457,6 +1457,14 @@
     }
 }
 
+#if CPU(ARM_THUMB2) && !CPU(APPLE_ARMV7S)
+// FIXME: This could be implemented in assembly to avoid a function call, and we know the divisor at jit-compile time.
+static int moduloHelper(int dividend, int divisor)
+{
+    return dividend % divisor;
+}
+#endif
+
 // The value in inputDividend is destroyed by the modulo operation.
 Assembler::Jump SelectorCodeGenerator::modulo(Assembler::ResultCondition condition, Assembler::RegisterID inputDividend, int divisor)
 {
@@ -1473,6 +1481,13 @@
 #endif
     m_assembler.mul32(divisorRegister, resultRegister);
     return m_assembler.branchSub32(condition, inputDividend, resultRegister, resultRegister);
+#elif CPU(ARM_THUMB2) && !CPU(APPLE_ARMV7S)
+    LocalRegisterWithPreference divisorRegister(m_registerAllocator, , JSC::GPRInfo::argumentGPR1);
+    m_assembler.move(Assembler::TrustedImm32(divisor), divisorRegister);
+    FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls);
+    functionCall.setFunctionAddress(moduloHelper);
+    functionCall.setTwoArguments(inputDividend, divisorRegister);
+    return functionCall.callAndBranchOnBooleanReturnValue(condition);
 #elif CPU(X86_64)
     // idiv takes RAX + an arbitrary register, and return RAX + RDX. Most of this code is about doing
     // an efficient allocation of those registers. If a register is already in use and is not the inputDividend,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to