[turbofan] JSUnaryNot and JSToBoolean have exactly 2 inputs, no need to trim.

R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/1071333004

Cr-Commit-Position: refs/heads/master@{#27741}
This commit is contained in:
bmeurer 2015-04-10 04:08:47 -07:00 committed by Commit bot
parent 826a954d1d
commit d8679a2350

View File

@ -537,7 +537,7 @@ Reduction JSTypedLowering::ReduceJSUnaryNot(Node* node) {
// JSUnaryNot(x:number) => NumberEqual(x,#0) // JSUnaryNot(x:number) => NumberEqual(x,#0)
node->set_op(simplified()->NumberEqual()); node->set_op(simplified()->NumberEqual());
node->ReplaceInput(1, jsgraph()->ZeroConstant()); node->ReplaceInput(1, jsgraph()->ZeroConstant());
node->TrimInputCount(2); DCHECK_EQ(2, node->InputCount());
return Changed(node); return Changed(node);
} else if (input_type->Is(Type::String())) { } else if (input_type->Is(Type::String())) {
// JSUnaryNot(x:string) => NumberEqual(x.length,#0) // JSUnaryNot(x:string) => NumberEqual(x.length,#0)
@ -549,8 +549,8 @@ Reduction JSTypedLowering::ReduceJSUnaryNot(Node* node) {
node->set_op(simplified()->NumberEqual()); node->set_op(simplified()->NumberEqual());
node->ReplaceInput(0, length); node->ReplaceInput(0, length);
node->ReplaceInput(1, jsgraph()->ZeroConstant()); node->ReplaceInput(1, jsgraph()->ZeroConstant());
node->TrimInputCount(2);
NodeProperties::ReplaceWithValue(node, node, length); NodeProperties::ReplaceWithValue(node, node, length);
DCHECK_EQ(2, node->InputCount());
return Changed(node); return Changed(node);
} }
return NoChange(); return NoChange();
@ -580,7 +580,7 @@ Reduction JSTypedLowering::ReduceJSToBoolean(Node* node) {
node->set_op(simplified()->NumberLessThan()); node->set_op(simplified()->NumberLessThan());
node->ReplaceInput(0, jsgraph()->ZeroConstant()); node->ReplaceInput(0, jsgraph()->ZeroConstant());
node->ReplaceInput(1, length); node->ReplaceInput(1, length);
node->TrimInputCount(2); DCHECK_EQ(2, node->InputCount());
return Changed(node); return Changed(node);
} }
return NoChange(); return NoChange();