[turbofan] Don't eagerly introduce machine operators in JSTypedLowering.

This functionality is duplicated with the same functionality in
SimplifiedLowering, which is kinda premature and doesn't seem to
be useful.

R=jarin@chromium.org

Review-Url: https://codereview.chromium.org/2103323003
Cr-Commit-Position: refs/heads/master@{#37386}
This commit is contained in:
bmeurer 2016-06-29 04:13:07 -07:00 committed by Commit bot
parent b4b45ff692
commit e0c87cfce6
2 changed files with 10 additions and 30 deletions

View File

@ -597,17 +597,10 @@ Reduction JSTypedLowering::ReduceJSComparison(Node* node) {
r.OneInputCannotBe(Type::StringOrReceiver())) {
const Operator* less_than;
const Operator* less_than_or_equal;
if (r.BothInputsAre(Type::Unsigned32())) {
less_than = machine()->Uint32LessThan();
less_than_or_equal = machine()->Uint32LessThanOrEqual();
} else if (r.BothInputsAre(Type::Signed32())) {
less_than = machine()->Int32LessThan();
less_than_or_equal = machine()->Int32LessThanOrEqual();
} else if (hint != CompareOperationHints::kAny) {
if (hint != CompareOperationHints::kAny) {
less_than = simplified()->SpeculativeNumberLessThan(hint);
less_than_or_equal = simplified()->SpeculativeNumberLessThanOrEqual(hint);
} else {
// TODO(turbofan): mixed signed/unsigned int32 comparisons.
Node* frame_state = NodeProperties::GetFrameStateInput(node, 1);
r.ConvertInputsToNumber(frame_state);
less_than = simplified()->NumberLessThan();

View File

@ -1192,23 +1192,18 @@ TEST(Int32Comparisons) {
struct Entry {
const Operator* js_op;
const Operator* uint_op;
const Operator* int_op;
const Operator* num_op;
bool commute;
};
Entry ops[] = {
{R.javascript.LessThan(R.compare_hints), R.machine.Uint32LessThan(),
R.machine.Int32LessThan(), R.simplified.NumberLessThan(), false},
{R.javascript.LessThanOrEqual(R.compare_hints),
R.machine.Uint32LessThanOrEqual(), R.machine.Int32LessThanOrEqual(),
R.simplified.NumberLessThanOrEqual(), false},
{R.javascript.GreaterThan(R.compare_hints), R.machine.Uint32LessThan(),
R.machine.Int32LessThan(), R.simplified.NumberLessThan(), true},
{R.javascript.GreaterThanOrEqual(R.compare_hints),
R.machine.Uint32LessThanOrEqual(), R.machine.Int32LessThanOrEqual(),
R.simplified.NumberLessThanOrEqual(), true}};
Entry ops[] = {{R.javascript.LessThan(R.compare_hints),
R.simplified.NumberLessThan(), false},
{R.javascript.LessThanOrEqual(R.compare_hints),
R.simplified.NumberLessThanOrEqual(), false},
{R.javascript.GreaterThan(R.compare_hints),
R.simplified.NumberLessThan(), true},
{R.javascript.GreaterThanOrEqual(R.compare_hints),
R.simplified.NumberLessThanOrEqual(), true}};
for (size_t o = 0; o < arraysize(ops); o++) {
for (size_t i = 0; i < arraysize(kNumberTypes); i++) {
@ -1222,15 +1217,7 @@ TEST(Int32Comparisons) {
Node* cmp = R.Binop(ops[o].js_op, p0, p1);
Node* r = R.reduce(cmp);
const Operator* expected;
if (t0->Is(Type::Unsigned32()) && t1->Is(Type::Unsigned32())) {
expected = ops[o].uint_op;
} else if (t0->Is(Type::Signed32()) && t1->Is(Type::Signed32())) {
expected = ops[o].int_op;
} else {
expected = ops[o].num_op;
}
R.CheckBinop(expected, r);
R.CheckBinop(ops[o].num_op, r);
if (ops[o].commute) {
CHECK_EQ(p1, r->InputAt(0));
CHECK_EQ(p0, r->InputAt(1));