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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 11618017: Deopt on overflow in integer mod. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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/ia32/lithium-codegen-ia32.cc ('k') | test/mjsunit/regress/regress-166379.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 2a10a87ac71e3868e344c9cc2a004cf0ef89a372..20a34b3c9159c81508da6016fe0082e282cc442f 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -1016,6 +1016,17 @@ void LCodeGen::DoModI(LModI* instr) {
// Slow case, using idiv instruction.
__ bind(&slow);
+
+ // Check for (kMinInt % -1).
+ if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) {
+ Label left_not_min_int;
+ __ cmpl(left_reg, Immediate(kMinInt));
+ __ j(not_zero, &left_not_min_int, Label::kNear);
+ __ cmpl(right_reg, Immediate(-1));
+ DeoptimizeIf(zero, instr->environment());
+ __ bind(&left_not_min_int);
+ }
+
// Sign extend eax to edx.
// (We are using only the low 32 bits of the values.)
__ cdq();
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | test/mjsunit/regress/regress-166379.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698