Commit 1f9b9b7d authored by oliver@apple.com's avatar oliver@apple.com

fourthTier: FTL should support CompareGreater, CompareLessEq, and CompareGreaterEq

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

Reviewed by Mark Hahnenberg.

Also fixed a bug where double CompareLess would assert.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileCompareLess):
(LowerDFGToLLVM):
(JSC::FTL::LowerDFGToLLVM::compileCompareLessEq):
(JSC::FTL::LowerDFGToLLVM::compileCompareGreater):
(JSC::FTL::LowerDFGToLLVM::compileCompareGreaterEq):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9eff4657
2013-05-10 Filip Pizlo <fpizlo@apple.com>
fourthTier: FTL should support CompareGreater, CompareLessEq, and CompareGreaterEq
https://bugs.webkit.org/show_bug.cgi?id=115923
Reviewed by Mark Hahnenberg.
Also fixed a bug where double CompareLess would assert.
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileCompareLess):
(LowerDFGToLLVM):
(JSC::FTL::LowerDFGToLLVM::compileCompareLessEq):
(JSC::FTL::LowerDFGToLLVM::compileCompareGreater):
(JSC::FTL::LowerDFGToLLVM::compileCompareGreaterEq):
2013-05-10 Filip Pizlo <fpizlo@apple.com>
fourthTier: FTL CompareEq ObjectUse should handle masquerading
......
......@@ -137,6 +137,9 @@ bool canCompile(Graph& graph)
break;
return false;
case CompareLess:
case CompareLessEq:
case CompareGreater:
case CompareGreaterEq:
if (node->isBinaryUseKind(Int32Use))
break;
if (node->isBinaryUseKind(NumberUse))
......
......@@ -364,6 +364,15 @@ private:
case CompareLess:
compileCompareLess();
break;
case CompareLessEq:
compileCompareLessEq();
break;
case CompareGreater:
compileCompareGreater();
break;
case CompareGreaterEq:
compileCompareGreaterEq();
break;
case Branch:
compileBranch();
break;
......@@ -964,6 +973,68 @@ private:
m_booleanValues.add(
m_node,
m_out.doubleLessThan(lowDouble(m_node->child1()), lowDouble(m_node->child2())));
return;
}
RELEASE_ASSERT_NOT_REACHED();
}
void compileCompareLessEq()
{
if (m_node->isBinaryUseKind(Int32Use)) {
m_booleanValues.add(
m_node,
m_out.lessThanOrEqual(lowInt32(m_node->child1()), lowInt32(m_node->child2())));
return;
}
if (m_node->isBinaryUseKind(NumberUse)) {
m_booleanValues.add(
m_node,
m_out.doubleLessThanOrEqual(
lowDouble(m_node->child1()), lowDouble(m_node->child2())));
return;
}
RELEASE_ASSERT_NOT_REACHED();
}
void compileCompareGreater()
{
if (m_node->isBinaryUseKind(Int32Use)) {
m_booleanValues.add(
m_node,
m_out.greaterThan(lowInt32(m_node->child1()), lowInt32(m_node->child2())));
return;
}
if (m_node->isBinaryUseKind(NumberUse)) {
m_booleanValues.add(
m_node,
m_out.doubleGreaterThan(
lowDouble(m_node->child1()), lowDouble(m_node->child2())));
return;
}
RELEASE_ASSERT_NOT_REACHED();
}
void compileCompareGreaterEq()
{
if (m_node->isBinaryUseKind(Int32Use)) {
m_booleanValues.add(
m_node,
m_out.greaterThanOrEqual(
lowInt32(m_node->child1()), lowInt32(m_node->child2())));
return;
}
if (m_node->isBinaryUseKind(NumberUse)) {
m_booleanValues.add(
m_node,
m_out.doubleGreaterThanOrEqual(
lowDouble(m_node->child1()), lowDouble(m_node->child2())));
return;
}
RELEASE_ASSERT_NOT_REACHED();
......
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