Commit d07e3a81 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[turbofan] Fix index-related deopt loop

after c968607e aka r65078.
CheckedTaggedToArrayIndex is the function that's in sync with the
ICs. It does both more (string-to-index conversion) and less (limit
to kMaxSafeInteger) than CheckedTaggedToInt64.

Bug: chromium:1028021
Change-Id: I992b11b8d4c58b4d3f5385b21998f53dd4b235d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1934338Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65170}
parent e34e5271
......@@ -2434,7 +2434,7 @@ Node* EffectControlLinearizer::BuildCheckedFloat64ToInt32(
Node* EffectControlLinearizer::BuildCheckedFloat64ToIndex(
const FeedbackSource& feedback, Node* value, Node* frame_state) {
if (machine()->Is64()) {
Node* value64 = __ ChangeFloat64ToInt64(value);
Node* value64 = __ TruncateFloat64ToInt64(value);
Node* check_same = __ Float64Equal(value, __ ChangeInt64ToFloat64(value64));
__ DeoptimizeIfNot(DeoptimizeReason::kLostPrecisionOrNaN, feedback,
check_same, frame_state);
......
......@@ -1138,13 +1138,14 @@ Node* RepresentationChanger::GetWord64RepresentationFor(
} else if (CanBeTaggedPointer(output_rep)) {
if (output_type.Is(cache_->kInt64)) {
op = simplified()->ChangeTaggedToInt64();
} else if (use_info.type_check() == TypeCheckKind::kSigned64 ||
use_info.type_check() == TypeCheckKind::kArrayIndex) {
} else if (use_info.type_check() == TypeCheckKind::kSigned64) {
op = simplified()->CheckedTaggedToInt64(
output_type.Maybe(Type::MinusZero())
? use_info.minus_zero_check()
: CheckForMinusZeroMode::kDontCheckForMinusZero,
use_info.feedback());
} else if (use_info.type_check() == TypeCheckKind::kArrayIndex) {
op = simplified()->CheckedTaggedToArrayIndex(use_info.feedback());
} else {
return TypeError(node, output_rep, output_type,
MachineRepresentation::kWord64);
......
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