| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { | 502 void CreateArrayInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 497 for (int i = 0; i < ArgumentCount(); ++i) { | 503 for (int i = 0; i < ArgumentCount(); ++i) { |
| 498 if (i != 0) f->Print(", "); | 504 if (i != 0) f->Print(", "); |
| 499 PushArgumentAt(i)->value()->PrintTo(f); | 505 PushArgumentAt(i)->value()->PrintTo(f); |
| 500 } | 506 } |
| 501 if (ArgumentCount() > 0) f->Print(", "); | 507 if (ArgumentCount() > 0) f->Print(", "); |
| 502 element_type()->PrintTo(f); | 508 element_type()->PrintTo(f); |
| 503 } | 509 } |
| 504 | 510 |
| 505 | 511 |
| 506 void CreateClosureInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 507 f->Print("%s", function().ToCString()); | |
| 508 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | |
| 509 if (i > 0) f->Print(", "); | |
| 510 PushArgumentAt(i)->value()->PrintTo(f); | |
| 511 } | |
| 512 } | |
| 513 | |
| 514 | |
| 515 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 512 void LoadFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 516 instance()->PrintTo(f); | 513 instance()->PrintTo(f); |
| 517 f->Print(", %" Pd, offset_in_bytes()); | 514 f->Print(", %" Pd, offset_in_bytes()); |
| 518 | 515 |
| 519 if (field() != NULL) { | 516 if (field() != NULL) { |
| 520 f->Print(" {%s}", String::Handle(field()->name()).ToCString()); | 517 f->Print(" {%s}", String::Handle(field()->name()).ToCString()); |
| 521 const char* expected = "?"; | 518 const char* expected = "?"; |
| 522 if (field()->guarded_cid() != kIllegalCid) { | 519 if (field()->guarded_cid() != kIllegalCid) { |
| 523 const Class& cls = Class::Handle( | 520 const Class& cls = Class::Handle( |
| 524 Isolate::Current()->class_table()->At(field()->guarded_cid())); | 521 Isolate::Current()->class_table()->At(field()->guarded_cid())); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 f->Print(" ["); | 967 f->Print(" ["); |
| 971 locations_[i].PrintTo(f); | 968 locations_[i].PrintTo(f); |
| 972 f->Print("]"); | 969 f->Print("]"); |
| 973 } | 970 } |
| 974 } | 971 } |
| 975 f->Print(" }"); | 972 f->Print(" }"); |
| 976 if (outer_ != NULL) outer_->PrintTo(f); | 973 if (outer_ != NULL) outer_->PrintTo(f); |
| 977 } | 974 } |
| 978 | 975 |
| 979 } // namespace dart | 976 } // namespace dart |
| OLD | NEW |