| 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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 value()->PrintTo(f); | 432 value()->PrintTo(f); |
| 433 } | 433 } |
| 434 | 434 |
| 435 | 435 |
| 436 void NativeCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 436 void NativeCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 437 f->Print("%s", native_name().ToCString()); | 437 f->Print("%s", native_name().ToCString()); |
| 438 } | 438 } |
| 439 | 439 |
| 440 | 440 |
| 441 void GuardFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 441 void GuardFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 442 const char* expected = "?"; | 442 f->Print("%s %s, ", |
| 443 if (field().guarded_cid() != kIllegalCid) { | |
| 444 const Class& cls = Class::Handle( | |
| 445 Isolate::Current()->class_table()->At(field().guarded_cid())); | |
| 446 expected = String::Handle(cls.Name()).ToCString(); | |
| 447 } | |
| 448 | |
| 449 f->Print("%s [%s %s], ", | |
| 450 String::Handle(field().name()).ToCString(), | 443 String::Handle(field().name()).ToCString(), |
| 451 field().is_nullable() ? "nullable" : "non-nullable", | 444 field().GuardedPropertiesAsCString()); |
| 452 expected); | |
| 453 value()->PrintTo(f); | 445 value()->PrintTo(f); |
| 454 } | 446 } |
| 455 | 447 |
| 456 | 448 |
| 457 void StoreInstanceFieldInstr::PrintOperandsTo(BufferFormatter* f) const { | 449 void StoreInstanceFieldInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 458 if (field().IsNull()) { | 450 if (field().IsNull()) { |
| 459 f->Print("{%" Pd "}, ", offset_in_bytes()); | 451 f->Print("{%" Pd "}, ", offset_in_bytes()); |
| 460 } else { | 452 } else { |
| 461 f->Print("%s {%" Pd "}, ", | 453 f->Print("%s {%" Pd "}, ", |
| 462 String::Handle(field().name()).ToCString(), | 454 String::Handle(field().name()).ToCString(), |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 } | 1061 } |
| 1070 | 1062 |
| 1071 const char* Environment::ToCString() const { | 1063 const char* Environment::ToCString() const { |
| 1072 char buffer[1024]; | 1064 char buffer[1024]; |
| 1073 BufferFormatter bf(buffer, 1024); | 1065 BufferFormatter bf(buffer, 1024); |
| 1074 PrintTo(&bf); | 1066 PrintTo(&bf); |
| 1075 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 1067 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 1076 } | 1068 } |
| 1077 | 1069 |
| 1078 } // namespace dart | 1070 } // namespace dart |
| OLD | NEW |