| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/il_printer.h" | 5 #include "vm/il_printer.h" |
| 6 | 6 |
| 7 #include "vm/intermediate_language.h" | 7 #include "vm/intermediate_language.h" |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 #include "vm/parser.h" | 9 #include "vm/parser.h" |
| 10 | 10 |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 void Range::PrintTo(BufferFormatter* f) const { | 223 void Range::PrintTo(BufferFormatter* f) const { |
| 224 f->Print("["); | 224 f->Print("["); |
| 225 min_.PrintTo(f); | 225 min_.PrintTo(f); |
| 226 f->Print(", "); | 226 f->Print(", "); |
| 227 max_.PrintTo(f); | 227 max_.PrintTo(f); |
| 228 f->Print("]"); | 228 f->Print("]"); |
| 229 } | 229 } |
| 230 | 230 |
| 231 | 231 |
| 232 const char* Range::ToCString(Range* range) { |
| 233 if (range == NULL) return "[_|_, _|_]"; |
| 234 |
| 235 char buffer[256]; |
| 236 BufferFormatter f(buffer, sizeof(buffer)); |
| 237 range->PrintTo(&f); |
| 238 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 239 } |
| 240 |
| 241 |
| 232 void RangeBoundary::PrintTo(BufferFormatter* f) const { | 242 void RangeBoundary::PrintTo(BufferFormatter* f) const { |
| 233 switch (kind_) { | 243 switch (kind_) { |
| 234 case kSymbol: | 244 case kSymbol: |
| 235 f->Print("v%"Pd, reinterpret_cast<Definition*>(value_)->ssa_temp_index()); | 245 f->Print("v%"Pd, reinterpret_cast<Definition*>(value_)->ssa_temp_index()); |
| 236 if (offset_ != 0) f->Print("%+"Pd, offset_); | 246 if (offset_ != 0) f->Print("%+"Pd, offset_); |
| 237 break; | 247 break; |
| 238 case kConstant: | 248 case kConstant: |
| 239 f->Print("%"Pd, value_); | 249 if (value_ == kMinusInfinity) { |
| 250 f->Print("-inf"); |
| 251 } else if (value_ == kPlusInfinity) { |
| 252 f->Print("+inf"); |
| 253 } else { |
| 254 f->Print("%"Pd, value_); |
| 255 } |
| 240 break; | 256 break; |
| 241 case kUnknown: | 257 case kUnknown: |
| 242 f->Print("_|_"); | 258 f->Print("_|_"); |
| 243 break; | 259 break; |
| 244 } | 260 } |
| 245 } | 261 } |
| 246 | 262 |
| 247 | 263 |
| 248 void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const { | 264 void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 249 value()->PrintTo(f); | 265 value()->PrintTo(f); |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 f->Print(" ["); | 847 f->Print(" ["); |
| 832 locations_[i].PrintTo(f); | 848 locations_[i].PrintTo(f); |
| 833 f->Print("]"); | 849 f->Print("]"); |
| 834 } | 850 } |
| 835 } | 851 } |
| 836 f->Print(" }"); | 852 f->Print(" }"); |
| 837 if (outer_ != NULL) outer_->PrintTo(f); | 853 if (outer_ != NULL) outer_->PrintTo(f); |
| 838 } | 854 } |
| 839 | 855 |
| 840 } // namespace dart | 856 } // namespace dart |
| OLD | NEW |