Commit afce403e authored by oliver@apple.com's avatar oliver@apple.com

fourthTier: FTL should support Int32ToDouble

https://bugs.webkit.org/show_bug.cgi?id=115926

Reviewed by Mark Hahnenberg.

This node exists mainly to help the DFG see that a node may have both an int
and a double representation. But in the FTL, nodes already have multiple
representations. So this is just a no-op for the FTL.

I considered making it so that the node isn't even inserted if we're doing
FTL compilation, but that would have required a bunch of conditionalizing in
the DFG's optimization phases, which sort of expect this node to be present
and necessary.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileInt32ToDouble):
(LowerDFGToLLVM):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4965ebc2
2013-05-10 Filip Pizlo <fpizlo@apple.com>
fourthTier: FTL should support Int32ToDouble
https://bugs.webkit.org/show_bug.cgi?id=115926
Reviewed by Mark Hahnenberg.
This node exists mainly to help the DFG see that a node may have both an int
and a double representation. But in the FTL, nodes already have multiple
representations. So this is just a no-op for the FTL.
I considered making it so that the node isn't even inserted if we're doing
FTL compilation, but that would have required a bunch of conditionalizing in
the DFG's optimization phases, which sort of expect this node to be present
and necessary.
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileInt32ToDouble):
(LowerDFGToLLVM):
2013-05-10 Filip Pizlo <fpizlo@apple.com>
fourthTier: FTL should support LogicalNot
......
......@@ -99,6 +99,7 @@ bool canCompile(Graph& graph)
case ArithMul:
case ArithNegate:
case UInt32ToNumber:
case Int32ToDouble:
// These are OK.
break;
case GetArrayLength:
......
......@@ -325,6 +325,9 @@ private:
case UInt32ToNumber:
compileUInt32ToNumber();
break;
case Int32ToDouble:
compileInt32ToDouble();
break;
case CheckStructure:
compileCheckStructure();
break;
......@@ -748,6 +751,18 @@ private:
m_int32Values.add(m_node, value);
}
void compileInt32ToDouble()
{
// This node is tricky to compile in the DFG backend because it tries to
// avoid converting child1 to a double in-place, as that would make subsequent
// int uses of of child1 fail. But the FTL needs no such special magic, since
// unlike the DFG backend, the FTL allows each node to have multiple
// contemporaneous low-level representations. So, this gives child1 a double
// representation and then forwards that representation to m_node.
m_doubleValues.add(m_node, lowDouble(m_node->child1()));
}
void compileCheckStructure()
{
LValue cell = lowCell(m_node->child1());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment