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

Unified Diff: src/hydrogen-instructions.cc

Issue 14617014: Fixed constant folding in HMod. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Fixed unit test. Created 7 years, 7 months 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 | « no previous file | test/mjsunit/constant-folding-2.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index f38fb7d5e3d4312383c198cf23b25a7cf2f8f602..2b525159b0ba2be12d386e718c4c0377f33a5448 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -3341,6 +3341,9 @@ HInstruction* HMod::New(
if (c_left->HasInteger32Value() && c_right->HasInteger32Value()) {
int32_t dividend = c_left->Integer32Value();
int32_t divisor = c_right->Integer32Value();
+ if (dividend == kMinInt && divisor == -1) {
+ return H_CONSTANT_DOUBLE(-0.0);
+ }
if (divisor != 0) {
int32_t res = dividend % divisor;
if ((res == 0) && (dividend < 0)) {
« no previous file with comments | « no previous file | test/mjsunit/constant-folding-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698