Commit 6b4e8c21 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Remove self-healing wrt. ChangeFloat64ToTagged.

Make sure that the input to ChangeFloat64ToTagged is definitely of type
Number, because the operator cannot deal with non-Number inputs.

R=jarin@chromium.org
BUG=v8:5267

Review-Url: https://codereview.chromium.org/2858153003
Cr-Commit-Position: refs/heads/master@{#45087}
parent d7b65d42
......@@ -364,12 +364,22 @@ Node* RepresentationChanger::GetTaggedPointerRepresentationFor(
}
op = simplified()->ChangeFloat64ToTaggedPointer();
} else if (output_rep == MachineRepresentation::kFloat32) {
// float32 -> float64 -> tagged
node = InsertChangeFloat32ToFloat64(node);
op = simplified()->ChangeFloat64ToTaggedPointer();
if (output_type->Is(Type::Number())) {
// float32 -> float64 -> tagged
node = InsertChangeFloat32ToFloat64(node);
op = simplified()->ChangeFloat64ToTaggedPointer();
} else {
return TypeError(node, output_rep, output_type,
MachineRepresentation::kTaggedPointer);
}
} else if (output_rep == MachineRepresentation::kFloat64) {
// float64 -> tagged
op = simplified()->ChangeFloat64ToTaggedPointer();
if (output_type->Is(Type::Number())) {
// float64 -> tagged
op = simplified()->ChangeFloat64ToTaggedPointer();
} else {
return TypeError(node, output_rep, output_type,
MachineRepresentation::kTaggedPointer);
}
} else if (CanBeTaggedSigned(output_rep) &&
use_info.type_check() == TypeCheckKind::kHeapObject) {
if (!output_type->Maybe(Type::SignedSmall())) {
......@@ -452,11 +462,14 @@ Node* RepresentationChanger::GetTaggedRepresentationFor(
Type::Unsigned32())) { // float64 -> uint32 -> tagged
node = InsertChangeFloat64ToUint32(node);
op = simplified()->ChangeUint32ToTagged();
} else {
} else if (output_type->Is(Type::Number())) {
op = simplified()->ChangeFloat64ToTagged(
output_type->Maybe(Type::MinusZero())
? CheckForMinusZeroMode::kCheckForMinusZero
: CheckForMinusZeroMode::kDontCheckForMinusZero);
} else {
return TypeError(node, output_rep, output_type,
MachineRepresentation::kTagged);
}
} else {
return TypeError(node, output_rep, output_type,
......
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