Commit f5f42639 authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[turbofan] Simplify Map#has lowering.

We don't need an explicit diamond in JSBuiltinReducer to produce a
Boolean. The NumberEqual operator already produces a Boolean, so we
just need to negate the result.

Change-Id: I442b0d98a4ab83002757906d6cc104682b87a853
Reviewed-on: https://chromium-review.googlesource.com/707434Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48406}
parent f47b32b2
......@@ -1877,21 +1877,9 @@ Reduction JSBuiltinReducer::ReduceMapHas(Node* node) {
Node* index = effect = graph()->NewNode(
simplified()->FindOrderedHashMapEntry(), table, key, effect, control);
Node* check = graph()->NewNode(simplified()->NumberEqual(), index,
Node* value = graph()->NewNode(simplified()->NumberEqual(), index,
jsgraph()->MinusOneConstant());
Node* branch = graph()->NewNode(common()->Branch(), check, control);
// Key not found.
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
Node* vtrue = jsgraph()->FalseConstant();
// Key found.
Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
Node* vfalse = jsgraph()->TrueConstant();
control = graph()->NewNode(common()->Merge(2), if_true, if_false);
Node* value = graph()->NewNode(
common()->Phi(MachineRepresentation::kTagged, 2), vtrue, vfalse, control);
value = graph()->NewNode(simplified()->BooleanNot(), value);
ReplaceWithValue(node, value, effect, control);
return Replace(value);
......
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