Index: src/builtins/builtins-number.cc |
diff --git a/src/builtins/builtins-number.cc b/src/builtins/builtins-number.cc |
index f09bcb2819345d9f044e8969f31946854848cc99..234fa54781f77ec92cd015b654c045b6746d95fb 100644 |
--- a/src/builtins/builtins-number.cc |
+++ b/src/builtins/builtins-number.cc |
@@ -1228,23 +1228,23 @@ TF_BUILTIN(Divide, CodeStubAssembler) { |
Label bailout(this); |
// Do floating point division if {divisor} is zero. |
- GotoIf(WordEqual(divisor, IntPtrConstant(0)), &bailout); |
+ GotoIf(SmiEqual(divisor, SmiConstant(0)), &bailout); |
// Do floating point division {dividend} is zero and {divisor} is |
// negative. |
Label dividend_is_zero(this), dividend_is_not_zero(this); |
- Branch(WordEqual(dividend, IntPtrConstant(0)), ÷nd_is_zero, |
+ Branch(SmiEqual(dividend, SmiConstant(0)), ÷nd_is_zero, |
÷nd_is_not_zero); |
Bind(÷nd_is_zero); |
{ |
- GotoIf(IntPtrLessThan(divisor, IntPtrConstant(0)), &bailout); |
+ GotoIf(SmiLessThan(divisor, SmiConstant(0)), &bailout); |
Goto(÷nd_is_not_zero); |
} |
Bind(÷nd_is_not_zero); |
- Node* untagged_divisor = SmiUntag(divisor); |
- Node* untagged_dividend = SmiUntag(dividend); |
+ Node* untagged_divisor = SmiToWord32(divisor); |
+ Node* untagged_dividend = SmiToWord32(dividend); |
// Do floating point division if {dividend} is kMinInt (or kMinInt - 1 |
// if the Smi size is 31) and {divisor} is -1. |
@@ -1269,7 +1269,7 @@ TF_BUILTIN(Divide, CodeStubAssembler) { |
Node* truncated = Int32Mul(untagged_result, untagged_divisor); |
// Do floating point division if the remainder is not 0. |
GotoIf(Word32NotEqual(untagged_dividend, truncated), &bailout); |
- var_result.Bind(SmiTag(untagged_result)); |
+ var_result.Bind(SmiFromWord32(untagged_result)); |
Goto(&end); |
// Bailout: convert {dividend} and {divisor} to double and do double |