Commit c252e398 authored by Ali Ijaz Sheikh's avatar Ali Ijaz Sheikh Committed by Commit Bot

Simplify CodeStubAssembler::ToUint32 for negative smis

BUG=

Change-Id: I55e41786f3d249ed545c359589894f39b2d89284
Reviewed-on: https://chromium-review.googlesource.com/437385
Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44538}
parent 0ce8543e
......@@ -4130,11 +4130,9 @@ Node* CodeStubAssembler::ToUint32(Node* context, Node* input) {
BIND(&if_isnegativesmi);
{
// floor({input}) mod 2^32 === {input} + 2^32.
Node* const float_number = SmiToFloat64(number);
Node* const float_result = Float64Add(float_number, float_two_32);
Node* const result = ChangeFloat64ToTagged(float_result);
var_result.Bind(result);
Node* const uint32_value = SmiToWord32(number);
Node* float64_value = ChangeUint32ToFloat64(uint32_value);
var_result.Bind(AllocateHeapNumberWithValue(float64_value));
Goto(&out);
}
......
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