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

Unified Diff: src/hydrogen-instructions.cc

Issue 195133002: Fixed range analysis for HMathFloorOfDiv. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 6 years, 9 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 | « src/hydrogen-instructions.h ('k') | no next file » | 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 ba8d03b6f6f8f04839fee8c07dbfcc9a1c33943c..c93bc1144af36376167cbac155e664ec57cda72c 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1788,7 +1788,7 @@ Range* HMul::InferRange(Zone* zone) {
}
-Range* HDiv::InferRange(Zone* zone) {
+Range* HBinaryOperation::InferRangeForDiv(Zone* zone) {
if (representation().IsInteger32()) {
Range* a = left()->range();
Range* b = right()->range();
@@ -1797,11 +1797,11 @@ Range* HDiv::InferRange(Zone* zone) {
(a->CanBeMinusZero() ||
(a->CanBeZero() && b->CanBeNegative())));
if (!a->Includes(kMinInt) || !b->Includes(-1)) {
- ClearFlag(HValue::kCanOverflow);
+ ClearFlag(kCanOverflow);
}
if (!b->CanBeZero()) {
- ClearFlag(HValue::kCanBeDivByZero);
+ ClearFlag(kCanBeDivByZero);
}
return result;
} else {
@@ -1810,6 +1810,16 @@ Range* HDiv::InferRange(Zone* zone) {
}
+Range* HDiv::InferRange(Zone* zone) {
+ return InferRangeForDiv(zone);
+}
+
+
+Range* HMathFloorOfDiv::InferRange(Zone* zone) {
+ return InferRangeForDiv(zone);
+}
+
+
Range* HMod::InferRange(Zone* zone) {
if (representation().IsInteger32()) {
Range* a = left()->range();
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698