Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (164877 => 164878)
--- trunk/Source/_javascript_Core/ChangeLog 2014-02-28 19:32:11 UTC (rev 164877)
+++ trunk/Source/_javascript_Core/ChangeLog 2014-02-28 20:40:55 UTC (rev 164878)
@@ -1,3 +1,16 @@
+2014-02-28 Filip Pizlo <[email protected]>
+
+ FTL should be able to call sin/cos directly on platforms where the intrinsic is busted
+ https://bugs.webkit.org/show_bug.cgi?id=129503
+
+ Reviewed by Mark Lam.
+
+ * ftl/FTLIntrinsicRepository.h:
+ * ftl/FTLOutput.h:
+ (JSC::FTL::Output::doubleSin):
+ (JSC::FTL::Output::doubleCos):
+ (JSC::FTL::Output::intrinsicOrOperation):
+
2014-02-28 Mark Hahnenberg <[email protected]>
Fix !ENABLE(GGC) builds
Modified: trunk/Source/_javascript_Core/ftl/FTLIntrinsicRepository.h (164877 => 164878)
--- trunk/Source/_javascript_Core/ftl/FTLIntrinsicRepository.h 2014-02-28 19:32:11 UTC (rev 164877)
+++ trunk/Source/_javascript_Core/ftl/FTLIntrinsicRepository.h 2014-02-28 20:40:55 UTC (rev 164878)
@@ -58,6 +58,7 @@
macro(C_JITOperation_EJssJss, functionType(intPtr, intPtr, intPtr, intPtr)) \
macro(C_JITOperation_EJssJssJss, functionType(intPtr, intPtr, intPtr, intPtr, intPtr)) \
macro(C_JITOperation_ESt, functionType(intPtr, intPtr, intPtr)) \
+ macro(D_JITOperation_D, functionType(doubleType, doubleType)) \
macro(I_JITOperation_EJss, functionType(intPtr, intPtr, intPtr)) \
macro(J_JITOperation_E, functionType(int64, intPtr)) \
macro(J_JITOperation_EA, functionType(int64, intPtr, intPtr)) \
Modified: trunk/Source/_javascript_Core/ftl/FTLOutput.h (164877 => 164878)
--- trunk/Source/_javascript_Core/ftl/FTLOutput.h 2014-02-28 19:32:11 UTC (rev 164877)
+++ trunk/Source/_javascript_Core/ftl/FTLOutput.h 2014-02-28 20:40:55 UTC (rev 164878)
@@ -167,14 +167,15 @@
{
return call(doubleAbsIntrinsic(), value);
}
+
LValue doubleSin(LValue value)
{
- return call(doubleSinIntrinsic(), value);
+ return call(intrinsicOrOperation(doubleSinIntrinsic(), sin), value);
+
}
-
LValue doubleCos(LValue value)
{
- return call(doubleCosIntrinsic(), value);
+ return call(intrinsicOrOperation(doubleCosIntrinsic(), cos), value);
}
LValue doubleSqrt(LValue value)
@@ -353,6 +354,21 @@
return intToPtr(constIntPtr(function), pointerType(operationType(function)));
}
+ template<typename FunctionType>
+ LValue intrinsicOrOperation(LValue intrinsic, FunctionType function)
+ {
+ if (isX86())
+ return intrinsic;
+
+ // LLVM's behavior with respect to math intrinsics that lower to calls is pretty odd
+ // on hardware that requires real effort during relocation.
+ // https://bugs.webkit.org/show_bug.cgi?id=129495
+
+ // FIXME: At least mark these pure.
+ // https://bugs.webkit.org/show_bug.cgi?id=129494
+ return operation(function);
+ }
+
void jump(LBasicBlock destination) { buildBr(m_builder, destination); }
void branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight);
void branch(LValue condition, WeightedTarget taken, WeightedTarget notTaken)