| 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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 304 |
| 305 | 305 |
| 306 const char* RangeBoundary::ToCString() const { | 306 const char* RangeBoundary::ToCString() const { |
| 307 char buffer[256]; | 307 char buffer[256]; |
| 308 BufferFormatter f(buffer, sizeof(buffer)); | 308 BufferFormatter f(buffer, sizeof(buffer)); |
| 309 PrintTo(&f); | 309 PrintTo(&f); |
| 310 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 310 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 311 } | 311 } |
| 312 | 312 |
| 313 | 313 |
| 314 void DropTempsInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 315 f->Print("%" Pd ", ", num_temps()); |
| 316 value()->PrintTo(f); |
| 317 } |
| 318 |
| 319 |
| 314 void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const { | 320 void AssertAssignableInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 315 value()->PrintTo(f); | 321 value()->PrintTo(f); |
| 316 f->Print(", %s, '%s'", | 322 f->Print(", %s, '%s'", |
| 317 dst_type().ToCString(), | 323 dst_type().ToCString(), |
| 318 dst_name().ToCString()); | 324 dst_name().ToCString()); |
| 319 f->Print(" instantiator("); | 325 f->Print(" instantiator("); |
| 320 instantiator()->PrintTo(f); | 326 instantiator()->PrintTo(f); |
| 321 f->Print(")"); | 327 f->Print(")"); |
| 322 f->Print(" instantiator_type_arguments("); | 328 f->Print(" instantiator_type_arguments("); |
| 323 instantiator_type_arguments()->PrintTo(f); | 329 instantiator_type_arguments()->PrintTo(f); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { | 498 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 493 for (int i = 0; i < ArgumentCount(); ++i) { | 499 for (int i = 0; i < ArgumentCount(); ++i) { |
| 494 if (i != 0) f->Print(", "); | 500 if (i != 0) f->Print(", "); |
| 495 PushArgumentAt(i)->value()->PrintTo(f); | 501 PushArgumentAt(i)->value()->PrintTo(f); |
| 496 } | 502 } |
| 497 if (ArgumentCount() > 0) f->Print(", "); | 503 if (ArgumentCount() > 0) f->Print(", "); |
| 498 element_type()->PrintTo(f); | 504 element_type()->PrintTo(f); |
| 499 } | 505 } |
| 500 | 506 |
| 501 | 507 |
| 502 void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 503 f->Print("%s", function().ToCString()); | |
| 504 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | |
| 505 if (i > 0) f->Print(", "); | |
| 506 PushArgumentAt(i)->value()->PrintTo(f); | |
| 507 } | |
| 508 } | |
| 509 | |
| 510 | |
| 511 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 508 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 512 instance()->PrintTo(f); | 509 instance()->PrintTo(f); |
| 513 f->Print(", %" Pd, offset_in_bytes()); | 510 f->Print(", %" Pd, offset_in_bytes()); |
| 514 | 511 |
| 515 if (field() != NULL) { | 512 if (field() != NULL) { |
| 516 f->Print(" {%s}", String::Handle(field()->name()).ToCString()); | 513 f->Print(" {%s}", String::Handle(field()->name()).ToCString()); |
| 517 const char* expected = "?"; | 514 const char* expected = "?"; |
| 518 if (field()->guarded_cid() != kIllegalCid) { | 515 if (field()->guarded_cid() != kIllegalCid) { |
| 519 const Class& cls = Class::Handle( | 516 const Class& cls = Class::Handle( |
| 520 Isolate::Current()->class_table()->At(field()->guarded_cid())); | 517 Isolate::Current()->class_table()->At(field()->guarded_cid())); |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 f->Print(" ["); | 970 f->Print(" ["); |
| 974 locations_[i].PrintTo(f); | 971 locations_[i].PrintTo(f); |
| 975 f->Print("]"); | 972 f->Print("]"); |
| 976 } | 973 } |
| 977 } | 974 } |
| 978 f->Print(" }"); | 975 f->Print(" }"); |
| 979 if (outer_ != NULL) outer_->PrintTo(f); | 976 if (outer_ != NULL) outer_->PrintTo(f); |
| 980 } | 977 } |
| 981 | 978 |
| 982 } // namespace dart | 979 } // namespace dart |
| OLD | NEW |