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: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44538}
This commit is contained in:
Ali Ijaz Sheikh 2017-04-07 14:21:39 -07:00 committed by Commit Bot
parent 0ce8543e76
commit c252e3986e

View File

@ -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);
}