Commit 7c3ffd8a authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

Revert "[turbofan] Simplified LowerCheckedInt(32|64)ToTaggedSigned"

This reverts commit 75a61325.

Reason for revert: Fails arm64 gc stress (see bisect): https://ci.chromium.org/p/v8/builders/ci/V8%20Linux%20-%20arm64%20-%20sim%20-%20gc%20stress/16691

Original change's description:
> [turbofan] Simplified LowerCheckedInt(32|64)ToTaggedSigned
> 
> Merge duplicate LowerCheckedInt32ToTaggedSigned code.
> 
> Skip ChangeInt32ToInt64:
> * In 32 bit archs, ChangeInt32ToInt64 is a no-op.
> * In 64 bit archs with 31 bit smis and smi corrupting enabled,
> ChangeInt32ToIntPtr can be skipped. This is because it would only
> change the upper bits, and those upper bits are not significant
> since we are smi-corrupting.
> 
> Change-Id: Ia217773fc7fccdd6227f66fbd600326ebbe9b86d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1893193
> Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
> Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#64906}

TBR=jgruber@chromium.org,tebbi@chromium.org,solanes@chromium.org

Change-Id: I6586a6f226537acba988afa1be7454c2c3e6ee54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1910955Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64915}
parent 06f1864a
......@@ -2265,13 +2265,13 @@ Node* EffectControlLinearizer::LowerCheckedInt32ToTaggedSigned(
Node* value = node->InputAt(0);
const CheckParameters& params = CheckParametersOf(node->op());
// Check for the lost precision at the same time that we are smi tagging.
Node* add = __ Int32AddWithOverflow(value, value);
Node* check = __ Projection(1, add);
__ DeoptimizeIf(DeoptimizeReason::kLostPrecision, params.feedback(), check,
frame_state);
// Since smi tagging shifts left by one, it's the same as adding value twice.
return __ Projection(0, add);
Node* result = __ Projection(0, add);
result = ChangeInt32ToIntPtr(result);
return result;
}
Node* EffectControlLinearizer::LowerCheckedInt64ToInt32(Node* node,
......@@ -2299,7 +2299,13 @@ Node* EffectControlLinearizer::LowerCheckedInt64ToTaggedSigned(
if (SmiValuesAre32Bits()) {
return ChangeInt64ToSmi(value);
} else {
return LowerCheckedInt32ToTaggedSigned(value32, frame_state);
Node* add = __ Int32AddWithOverflow(value32, value32);
Node* check = __ Projection(1, add);
__ DeoptimizeIf(DeoptimizeReason::kLostPrecision, params.feedback(), check,
frame_state);
Node* result = __ Projection(0, add);
result = ChangeInt32ToIntPtr(result);
return result;
}
}
......
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