Commit c56c2013 authored by neis's avatar neis Committed by Commit bot

[compiler] Tune lowering of CheckedUint32ToInt32.

Instead of creating a signed comparison with INT_MAX, create an unsigned
comparison with 0.  This saves a few bytes in the generated code.

R=jarin@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2715513007
Cr-Commit-Position: refs/heads/master@{#43606}
parent de1461b7
......@@ -1488,9 +1488,8 @@ Node* EffectControlLinearizer::LowerCheckedInt32ToTaggedSigned(
Node* EffectControlLinearizer::LowerCheckedUint32ToInt32(Node* node,
Node* frame_state) {
Node* value = node->InputAt(0);
Node* max_int = __ Int32Constant(std::numeric_limits<int32_t>::max());
Node* is_safe = __ Uint32LessThanOrEqual(value, max_int);
__ DeoptimizeUnless(DeoptimizeReason::kLostPrecision, is_safe, frame_state);
Node* unsafe = __ Int32LessThan(value, __ Int32Constant(0));
__ DeoptimizeIf(DeoptimizeReason::kLostPrecision, unsafe, frame_state);
return 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