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

Side by Side Diff: runtime/vm/il_printer.cc

Issue 321593004: Refactor RangeBoundary +/- infinity to be distinct RangeBoundary kinds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | runtime/vm/intermediate_language.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 char buffer[256]; 289 char buffer[256];
290 BufferFormatter f(buffer, sizeof(buffer)); 290 BufferFormatter f(buffer, sizeof(buffer));
291 range->PrintTo(&f); 291 range->PrintTo(&f);
292 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); 292 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer);
293 } 293 }
294 294
295 295
296 void RangeBoundary::PrintTo(BufferFormatter* f) const { 296 void RangeBoundary::PrintTo(BufferFormatter* f) const {
297 switch (kind_) { 297 switch (kind_) {
298 case kSymbol: 298 case kSymbol:
299 f->Print("v%" Pd, 299 f->Print("v%" Pd "",
300 reinterpret_cast<Definition*>(value_)->ssa_temp_index()); 300 reinterpret_cast<Definition*>(value_)->ssa_temp_index());
301 if (offset_ != 0) f->Print("%+" Pd, offset_); 301 if (offset_ != 0) f->Print("%+" Pd "", offset_);
302 break;
303 case kNegativeInfinity:
304 f->Print("-inf");
305 break;
306 case kPositiveInfinity:
307 f->Print("+inf");
302 break; 308 break;
303 case kConstant: 309 case kConstant:
304 if (value_ == kMinusInfinity) { 310 f->Print("%" Pd "", value_);
305 f->Print("-inf");
306 } else if (value_ == kPlusInfinity) {
307 f->Print("+inf");
308 } else {
309 f->Print("%" Pd, value_);
310 }
311 break; 311 break;
312 case kUnknown: 312 case kUnknown:
313 f->Print("_|_"); 313 f->Print("_|_");
314 break; 314 break;
315 } 315 }
316 } 316 }
317 317
318 318
319 const char* RangeBoundary::ToCString() const { 319 const char* RangeBoundary::ToCString() const {
320 char buffer[256]; 320 char buffer[256];
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 } 1061 }
1062 1062
1063 const char* Environment::ToCString() const { 1063 const char* Environment::ToCString() const {
1064 char buffer[1024]; 1064 char buffer[1024];
1065 BufferFormatter bf(buffer, 1024); 1065 BufferFormatter bf(buffer, 1024);
1066 PrintTo(&bf); 1066 PrintTo(&bf);
1067 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); 1067 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer);
1068 } 1068 }
1069 1069
1070 } // namespace dart 1070 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | runtime/vm/intermediate_language.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698