Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: src/builtins/builtins-number.cc

Issue 2568713002: [stubs] Fixing issues found by machine graph verifier in code stubs. (Closed)
Patch Set: Addressing nits Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/builtins-internal.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)), &dividend_is_zero,
+ Branch(SmiEqual(dividend, SmiConstant(0)), &dividend_is_zero,
&dividend_is_not_zero);
Bind(&dividend_is_zero);
{
- GotoIf(IntPtrLessThan(divisor, IntPtrConstant(0)), &bailout);
+ GotoIf(SmiLessThan(divisor, SmiConstant(0)), &bailout);
Goto(&dividend_is_not_zero);
}
Bind(&dividend_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
« no previous file with comments | « src/builtins/builtins-internal.cc ('k') | src/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698