| Index: runtime/vm/il_printer.cc
|
| ===================================================================
|
| --- runtime/vm/il_printer.cc (revision 10101)
|
| +++ runtime/vm/il_printer.cc (working copy)
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "vm/intermediate_language.h"
|
| #include "vm/os.h"
|
| +#include "vm/parser.h"
|
|
|
| namespace dart {
|
|
|
| @@ -82,6 +83,30 @@
|
| }
|
|
|
|
|
| +void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function,
|
| + intptr_t token_pos,
|
| + Value* value,
|
| + const AbstractType& dst_type,
|
| + const String& dst_name,
|
| + bool eliminated) {
|
| + const Class& cls = Class::Handle(parsed_function.function().owner());
|
| + const Script& script = Script::Handle(cls.script());
|
| + const char* static_type_name = "unknown";
|
| + if (value != NULL) {
|
| + const AbstractType& type = AbstractType::Handle(value->StaticType());
|
| + static_type_name = String::Handle(type.UserVisibleName()).ToCString();
|
| + }
|
| + Parser::PrintMessage(script, token_pos, "",
|
| + "%s type check: static type '%s' is %s specific than "
|
| + "type '%s' of '%s'.",
|
| + eliminated ? "Eliminated" : "Generated",
|
| + static_type_name,
|
| + eliminated ? "more" : "not more",
|
| + String::Handle(dst_type.UserVisibleName()).ToCString(),
|
| + dst_name.ToCString());
|
| +}
|
| +
|
| +
|
| static void PrintICData(BufferFormatter* f, const ICData& ic_data) {
|
| f->Print(" IC[%d: ", ic_data.NumberOfChecks());
|
| Function& target = Function::Handle();
|
| @@ -153,7 +178,7 @@
|
| void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const {
|
| for (intptr_t i = 0; i < ArgumentCount(); ++i) {
|
| if (i > 0) f->Print(", ");
|
| - f->Print("cid%d", ArgumentAt(i)->cid());
|
| + ArgumentAt(i)->value()->PrintTo(f);
|
| }
|
| }
|
|
|
| @@ -161,8 +186,8 @@
|
| void InstanceCallComp::PrintOperandsTo(BufferFormatter* f) const {
|
| f->Print("%s", function_name().ToCString());
|
| for (intptr_t i = 0; i < ArgumentCount(); ++i) {
|
| - f->Print(", ");
|
| - f->Print("cid%d", ArgumentAt(i)->cid());
|
| + if (i > 0) f->Print(", ");
|
| + ArgumentAt(i)->value()->PrintTo(f);
|
| }
|
| }
|
|
|
| @@ -194,8 +219,8 @@
|
| void StaticCallComp::PrintOperandsTo(BufferFormatter* f) const {
|
| f->Print("%s", String::Handle(function().name()).ToCString());
|
| for (intptr_t i = 0; i < ArgumentCount(); ++i) {
|
| - f->Print(", ");
|
| - f->Print("cid%d", ArgumentAt(i)->cid());
|
| + if (i > 0) f->Print(", ");
|
| + ArgumentAt(i)->value()->PrintTo(f);
|
| }
|
| }
|
|
|
| @@ -296,8 +321,8 @@
|
| void CreateClosureComp::PrintOperandsTo(BufferFormatter* f) const {
|
| f->Print("%s", function().ToCString());
|
| for (intptr_t i = 0; i < ArgumentCount(); ++i) {
|
| - f->Print(", ");
|
| - f->Print("cid%d", ArgumentAt(i)->cid());
|
| + if (i > 0) f->Print(", ");
|
| + ArgumentAt(i)->value()->PrintTo(f);
|
| }
|
| }
|
|
|
| @@ -431,25 +456,25 @@
|
|
|
|
|
| void PushArgumentInstr::PrintTo(BufferFormatter* f) const {
|
| - f->Print(" %s:%d ", DebugName(), cid());
|
| + f->Print(" %s ", DebugName());
|
| value()->PrintTo(f);
|
| }
|
|
|
|
|
| void ReturnInstr::PrintTo(BufferFormatter* f) const {
|
| - f->Print(" %s ", DebugName());
|
| + f->Print(" %s:%d ", DebugName(), cid());
|
| value()->PrintTo(f);
|
| }
|
|
|
|
|
| void ThrowInstr::PrintTo(BufferFormatter* f) const {
|
| - f->Print(" %s ", DebugName());
|
| + f->Print(" %s:%d ", DebugName(), cid());
|
| exception()->PrintTo(f);
|
| }
|
|
|
|
|
| void ReThrowInstr::PrintTo(BufferFormatter* f) const {
|
| - f->Print(" %s ", DebugName());
|
| + f->Print(" %s:%d ", DebugName(), cid());
|
| exception()->PrintTo(f);
|
| f->Print(", ");
|
| stack_trace()->PrintTo(f);
|
| @@ -467,7 +492,7 @@
|
|
|
|
|
| void BranchInstr::PrintTo(BufferFormatter* f) const {
|
| - f->Print(" %s ", DebugName());
|
| + f->Print(" %s:%d ", DebugName(), cid());
|
| f->Print("if ");
|
| left()->PrintTo(f);
|
| f-> Print(" %s ", Token::Str(kind()));
|
| @@ -700,25 +725,25 @@
|
|
|
|
|
| void PushArgumentInstr::PrintToVisualizer(BufferFormatter* f) const {
|
| - f->Print("_ %s:%d ", DebugName(), cid());
|
| + f->Print("_ %s ", DebugName());
|
| value()->PrintTo(f);
|
| }
|
|
|
|
|
| void ReturnInstr::PrintToVisualizer(BufferFormatter* f) const {
|
| - f->Print("_ %s ", DebugName());
|
| + f->Print("_ %s:%d ", DebugName(), cid());
|
| value()->PrintTo(f);
|
| }
|
|
|
|
|
| void ThrowInstr::PrintToVisualizer(BufferFormatter* f) const {
|
| - f->Print("_ %s ", DebugName());
|
| + f->Print("_ %s:%d ", DebugName(), cid());
|
| exception()->PrintTo(f);
|
| }
|
|
|
|
|
| void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const {
|
| - f->Print("_ %s ", DebugName());
|
| + f->Print("_ %s:%d ", DebugName(), cid());
|
| exception()->PrintTo(f);
|
| f->Print(", ");
|
| stack_trace()->PrintTo(f);
|
|
|