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

Unified Diff: runtime/vm/il_printer.cc

Issue 10972003: Fix convergence issues in range analysis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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: runtime/vm/il_printer.cc
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index b536165d7acf0b4d4a14dec36217bdb3a3f499c0..0218f49003a36d83e34d2af50fe0f85cf053bc5c 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -229,6 +229,16 @@ void Range::PrintTo(BufferFormatter* f) const {
}
+const char* Range::ToCString(Range* range) {
+ if (range == NULL) return "[_|_, _|_]";
+
+ char buffer[256];
+ BufferFormatter f(buffer, sizeof(buffer));
+ range->PrintTo(&f);
+ return Isolate::Current()->current_zone()->MakeCopyOfString(buffer);
+}
+
+
void RangeBoundary::PrintTo(BufferFormatter* f) const {
switch (kind_) {
case kSymbol:
@@ -236,7 +246,13 @@ void RangeBoundary::PrintTo(BufferFormatter* f) const {
if (offset_ != 0) f->Print("%+"Pd, offset_);
break;
case kConstant:
- f->Print("%"Pd, value_);
+ if (value_ == kMinusInfinity) {
+ f->Print("-inf");
+ } else if (value_ == kPlusInfinity) {
+ f->Print("+inf");
+ } else {
+ f->Print("%"Pd, value_);
+ }
break;
case kUnknown:
f->Print("_|_");

Powered by Google App Engine
This is Rietveld 408576698