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

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. ia32/x64/ARM done, MIPS restructured. 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
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 2b9dbf2bb68f1f92a0ea43e5eaff012478298101..c79db8d52c17925ef0ee125629ba13e3a7e94843 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1039,7 +1039,13 @@ class HValue: public ZoneObject {
}
Range* range() const { return range_; }
+ // We should really use the null object pattern here...
Jakob Kummerow 2013/06/07 16:50:07 nit: I don't think this comment adds value.
Sven Panne 2013/06/10 11:05:39 I'll change this into a real TODO then, code like
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);

Powered by Google App Engine
This is Rietveld 408576698