Commit 5afd1f30 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Remove unused Type parameter from ReferenceEqual.

This parameter was never used and doesn't seem like it would ever be
useful, so it's gone now.

R=epertoso@chromium.org

Review-Url: https://codereview.chromium.org/2221043002
Cr-Commit-Position: refs/heads/master@{#38453}
parent 025ddb21
......@@ -323,8 +323,8 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
}
// Check that the {target} is still the {array_function}.
Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
target, array_function);
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target,
array_function);
effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
// Turn the {node} into a {JSCreateArray} call.
......@@ -338,8 +338,8 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
jsgraph()->Constant(handle(cell->value(), isolate()));
// Check that the {target} is still the {target_function}.
Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
target, target_function);
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target,
target_function);
effect =
graph()->NewNode(simplified()->CheckIf(), check, effect, control);
......@@ -439,8 +439,8 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
}
// Check that the {target} is still the {array_function}.
Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
target, array_function);
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target,
array_function);
effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
// Turn the {node} into a {JSCreateArray} call.
......@@ -459,8 +459,8 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
jsgraph()->Constant(handle(cell->value(), isolate()));
// Check that the {target} is still the {target_function}.
Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
target, target_function);
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), target,
target_function);
effect =
graph()->NewNode(simplified()->CheckIf(), check, effect, control);
......
......@@ -555,8 +555,8 @@ Reduction JSCreateLowering::ReduceNewArrayToStubCall(
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
Node* length = NodeProperties::GetValueInput(node, 2);
Node* equal = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
length, jsgraph()->ZeroConstant());
Node* equal = graph()->NewNode(simplified()->ReferenceEqual(), length,
jsgraph()->ZeroConstant());
Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kFalse), equal, control);
......
......@@ -169,9 +169,8 @@ Reduction JSGlobalObjectSpecialization::ReduceJSStoreGlobal(Node* node) {
// Record a code dependency on the cell, and just deoptimize if the new
// value doesn't match the previous value stored inside the cell.
dependencies()->AssumePropertyCell(property_cell);
Node* check =
graph()->NewNode(simplified()->ReferenceEqual(Type::Tagged()), value,
jsgraph()->Constant(property_cell_value));
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), value,
jsgraph()->Constant(property_cell_value));
effect =
graph()->NewNode(simplified()->CheckIf(), check, effect, control);
break;
......
......@@ -148,8 +148,8 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
// Ensure that {index} matches the specified {name} (if {index} is given).
if (index != nullptr) {
Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Name()),
index, jsgraph()->HeapConstant(name));
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), index,
jsgraph()->HeapConstant(name));
effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
}
......@@ -233,8 +233,8 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
for (auto map : receiver_maps) {
DCHECK_LT(0u, num_classes);
Node* check =
graph()->NewNode(simplified()->ReferenceEqual(Type::Internal()),
receiver_map, jsgraph()->Constant(map));
graph()->NewNode(simplified()->ReferenceEqual(), receiver_map,
jsgraph()->Constant(map));
if (--num_classes == 0 && j == access_infos.size() - 1) {
check = graph()->NewNode(simplified()->CheckIf(), check,
this_effect, fallthrough_control);
......@@ -531,8 +531,8 @@ Reduction JSNativeContextSpecialization::ReduceElementAccess(
for (Handle<Map> map : receiver_maps) {
DCHECK_LT(0u, num_classes);
Node* check =
graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
receiver_map, jsgraph()->Constant(map));
graph()->NewNode(simplified()->ReferenceEqual(), receiver_map,
jsgraph()->Constant(map));
if (--num_classes == 0 && j == access_infos.size() - 1) {
// Last map check on the fallthrough control path, do a conditional
// eager deoptimization exit here.
......@@ -753,8 +753,8 @@ JSNativeContextSpecialization::BuildPropertyAccess(
} else if (access_info.IsDataConstant()) {
value = jsgraph()->Constant(access_info.constant());
if (access_mode == AccessMode::kStore) {
Node* check = graph()->NewNode(
simplified()->ReferenceEqual(Type::Tagged()), value, value);
Node* check =
graph()->NewNode(simplified()->ReferenceEqual(), value, value);
effect =
graph()->NewNode(simplified()->CheckIf(), check, effect, control);
}
......
......@@ -666,13 +666,13 @@ Reduction JSTypedLowering::ReduceJSEqualTypeOf(Node* node, bool invert) {
Node* input = m.left().InputAt(0);
Handle<String> value = Handle<String>::cast(m.right().Value());
if (String::Equals(value, factory()->boolean_string())) {
replacement = graph()->NewNode(
common()->Select(MachineRepresentation::kTagged),
graph()->NewNode(simplified()->ReferenceEqual(Type::Any()), input,
jsgraph()->TrueConstant()),
jsgraph()->TrueConstant(),
graph()->NewNode(simplified()->ReferenceEqual(Type::Any()), input,
jsgraph()->FalseConstant()));
replacement =
graph()->NewNode(common()->Select(MachineRepresentation::kTagged),
graph()->NewNode(simplified()->ReferenceEqual(),
input, jsgraph()->TrueConstant()),
jsgraph()->TrueConstant(),
graph()->NewNode(simplified()->ReferenceEqual(),
input, jsgraph()->FalseConstant()));
} else if (String::Equals(value, factory()->function_string())) {
replacement = graph()->NewNode(simplified()->ObjectIsCallable(), input);
} else if (String::Equals(value, factory()->number_string())) {
......@@ -682,7 +682,7 @@ Reduction JSTypedLowering::ReduceJSEqualTypeOf(Node* node, bool invert) {
} else if (String::Equals(value, factory()->undefined_string())) {
replacement = graph()->NewNode(
common()->Select(MachineRepresentation::kTagged),
graph()->NewNode(simplified()->ReferenceEqual(Type::Any()), input,
graph()->NewNode(simplified()->ReferenceEqual(), input,
jsgraph()->NullConstant()),
jsgraph()->FalseConstant(),
graph()->NewNode(simplified()->ObjectIsUndetectable(), input));
......@@ -708,12 +708,10 @@ Reduction JSTypedLowering::ReduceJSEqual(Node* node, bool invert) {
return r.ChangeToPureOperator(simplified()->StringEqual(), invert);
}
if (r.BothInputsAre(Type::Boolean())) {
return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Boolean()),
invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.BothInputsAre(Type::Receiver())) {
return r.ChangeToPureOperator(
simplified()->ReferenceEqual(Type::Receiver()), invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.OneInputIs(Type::Undetectable())) {
RelaxEffectsAndControls(node);
......@@ -770,32 +768,25 @@ Reduction JSTypedLowering::ReduceJSStrictEqual(Node* node, bool invert) {
if (reduction.Changed()) return reduction;
if (r.OneInputIs(the_hole_type_)) {
return r.ChangeToPureOperator(simplified()->ReferenceEqual(the_hole_type_),
invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.OneInputIs(Type::Undefined())) {
return r.ChangeToPureOperator(
simplified()->ReferenceEqual(Type::Undefined()), invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.OneInputIs(Type::Null())) {
return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Null()),
invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.OneInputIs(Type::Boolean())) {
return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Boolean()),
invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.OneInputIs(Type::Object())) {
return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Object()),
invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.OneInputIs(Type::Receiver())) {
return r.ChangeToPureOperator(
simplified()->ReferenceEqual(Type::Receiver()), invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.BothInputsAre(Type::Unique())) {
return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Unique()),
invert);
return r.ChangeToPureOperator(simplified()->ReferenceEqual(), invert);
}
if (r.BothInputsAre(Type::String())) {
return r.ChangeToPureOperator(simplified()->StringEqual(), invert);
......@@ -1311,8 +1302,8 @@ Reduction JSTypedLowering::ReduceJSInstanceOf(Node* node) {
// If not, check if object prototype is the null prototype.
Node* null_proto =
graph()->NewNode(simplified()->ReferenceEqual(r.right_type()),
object_prototype, jsgraph()->NullConstant());
graph()->NewNode(simplified()->ReferenceEqual(), object_prototype,
jsgraph()->NullConstant());
Node* branch_null_proto = graph()->NewNode(
common()->Branch(BranchHint::kFalse), null_proto, control);
Node* if_null_proto = graph()->NewNode(common()->IfTrue(), branch_null_proto);
......@@ -1321,9 +1312,8 @@ Reduction JSTypedLowering::ReduceJSInstanceOf(Node* node) {
control = graph()->NewNode(common()->IfFalse(), branch_null_proto);
// Check if object prototype is equal to function prototype.
Node* eq_proto =
graph()->NewNode(simplified()->ReferenceEqual(r.right_type()),
object_prototype, prototype);
Node* eq_proto = graph()->NewNode(simplified()->ReferenceEqual(),
object_prototype, prototype);
Node* branch_eq_proto =
graph()->NewNode(common()->Branch(BranchHint::kFalse), eq_proto, control);
Node* if_eq_proto = graph()->NewNode(common()->IfTrue(), branch_eq_proto);
......@@ -1440,18 +1430,16 @@ Reduction JSTypedLowering::ReduceJSConvertReceiver(Node* node) {
frame_state, effect, control);
} else {
// Check {receiver} for undefined.
Node* check0 =
graph()->NewNode(simplified()->ReferenceEqual(receiver_type),
receiver, jsgraph()->UndefinedConstant());
Node* check0 = graph()->NewNode(simplified()->ReferenceEqual(), receiver,
jsgraph()->UndefinedConstant());
Node* branch0 = graph()->NewNode(common()->Branch(BranchHint::kFalse),
check0, control);
Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0);
Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
// Check {receiver} for null.
Node* check1 =
graph()->NewNode(simplified()->ReferenceEqual(receiver_type),
receiver, jsgraph()->NullConstant());
Node* check1 = graph()->NewNode(simplified()->ReferenceEqual(), receiver,
jsgraph()->NullConstant());
Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse),
check1, if_false0);
Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
......@@ -1702,8 +1690,8 @@ Reduction JSTypedLowering::ReduceJSForInNext(Node* node) {
receiver, effect, control);
// Check if the expected map still matches that of the {receiver}.
Node* check0 = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()),
receiver_map, cache_type);
Node* check0 = graph()->NewNode(simplified()->ReferenceEqual(), receiver_map,
cache_type);
Node* branch0 =
graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, control);
......
......@@ -426,6 +426,7 @@ NumberOperationHint NumberOperationHintOf(const Operator* op) {
V(ObjectIsSmi, Operator::kNoProperties, 1, 0) \
V(ObjectIsString, Operator::kNoProperties, 1, 0) \
V(ObjectIsUndetectable, Operator::kNoProperties, 1, 0) \
V(ReferenceEqual, Operator::kCommutative, 2, 0) \
V(StringEqual, Operator::kCommutative, 2, 0) \
V(StringLessThan, Operator::kNoProperties, 2, 0) \
V(StringLessThanOrEqual, Operator::kNoProperties, 2, 0)
......@@ -717,12 +718,6 @@ const Operator* SimplifiedOperatorBuilder::CheckTaggedHole(
return nullptr;
}
const Operator* SimplifiedOperatorBuilder::ReferenceEqual(Type* type) {
return new (zone()) Operator(IrOpcode::kReferenceEqual,
Operator::kCommutative | Operator::kPure,
"ReferenceEqual", 2, 0, 0, 1, 0, 0);
}
const Operator* SimplifiedOperatorBuilder::EnsureWritableFastElements() {
return &cache_.kEnsureWritableFastElements;
}
......
......@@ -291,7 +291,7 @@ class SimplifiedOperatorBuilder final : public ZoneObject {
const Operator* SpeculativeNumberLessThanOrEqual(NumberOperationHint hint);
const Operator* SpeculativeNumberEqual(NumberOperationHint hint);
const Operator* ReferenceEqual(Type* type);
const Operator* ReferenceEqual();
const Operator* StringEqual();
const Operator* StringLessThan();
......
......@@ -442,7 +442,7 @@ TEST(JSToNumber_replacement) {
R.graph.NewNode(R.javascript.ToNumber(), n, R.context(),
R.EmptyFrameState(R.context()), R.start(), R.start());
Node* effect_use = R.UseForEffect(c);
Node* add = R.graph.NewNode(R.simplified.ReferenceEqual(Type::Any()), n, c);
Node* add = R.graph.NewNode(R.simplified.ReferenceEqual(), n, c);
R.CheckEffectInput(c, effect_use);
Node* r = R.reduce(c);
......@@ -554,7 +554,7 @@ TEST(JSToString_replacement) {
R.graph.NewNode(R.javascript.ToString(), n, R.context(),
R.EmptyFrameState(R.context()), R.start(), R.start());
Node* effect_use = R.UseForEffect(c);
Node* add = R.graph.NewNode(R.simplified.ReferenceEqual(Type::Any()), n, c);
Node* add = R.graph.NewNode(R.simplified.ReferenceEqual(), n, c);
R.CheckEffectInput(c, effect_use);
Node* r = R.reduce(c);
......
......@@ -811,7 +811,7 @@ class TestingGraph : public HandleAndZoneScope, public GraphAndBuilders {
return graph()->NewNode(machine()->Word32Equal(), node,
jsgraph.Int32Constant(1));
} else {
return graph()->NewNode(simplified()->ReferenceEqual(Type::Any()), node,
return graph()->NewNode(simplified()->ReferenceEqual(), node,
jsgraph.TrueConstant());
}
}
......@@ -1088,7 +1088,7 @@ TEST(LowerReferenceEqual_to_wordeq) {
TestingGraph t(Type::Any(), Type::Any());
IrOpcode::Value opcode =
static_cast<IrOpcode::Value>(t.machine()->WordEqual()->opcode());
t.CheckLoweringBinop(opcode, t.simplified()->ReferenceEqual(Type::Any()));
t.CheckLoweringBinop(opcode, t.simplified()->ReferenceEqual());
}
void CheckChangeInsertion(IrOpcode::Value expected, MachineType from,
......
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