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

Unified Diff: src/hydrogen-instructions.h

Issue 15769010: Improve code for integral modulus calculation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 7 years, 6 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/arm/lithium-codegen-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 813e43dbac9926146b80361a7d8f5e0430fe720e..fc2a20037b8e956fbcb25cfbd190b80843f99535 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1039,7 +1039,13 @@ class HValue: public ZoneObject {
}
Range* range() const { return range_; }
+ // TODO(svenpanne) We should really use the null object pattern here.
bool HasRange() const { return range_ != NULL; }
+ bool CanBeNegative() const { return !HasRange() || range()->CanBeNegative(); }
+ bool CanBeZero() const { return !HasRange() || range()->CanBeZero(); }
+ bool RangeCanInclude(int value) const {
+ return !HasRange() || range()->Includes(value);
+ }
void AddNewRange(Range* r, Zone* zone);
void RemoveLastAddedRange();
void ComputeInitialRange(Zone* zone);
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698