| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 | 85 |
| 86 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function, | 86 void FlowGraphPrinter::PrintTypeCheck(const ParsedFunction& parsed_function, |
| 87 intptr_t token_pos, | 87 intptr_t token_pos, |
| 88 Value* value, | 88 Value* value, |
| 89 const AbstractType& dst_type, | 89 const AbstractType& dst_type, |
| 90 const String& dst_name, | 90 const String& dst_name, |
| 91 bool eliminated) { | 91 bool eliminated) { |
| 92 const Class& cls = Class::Handle(parsed_function.function().owner()); | 92 const Class& cls = Class::Handle(parsed_function.function().owner()); |
| 93 const Script& script = Script::Handle(cls.script()); | 93 const Script& script = Script::Handle(cls.script()); |
| 94 const char* static_type_name = "unknown"; | 94 const char* compile_type_name = "unknown"; |
| 95 if (value != NULL) { | 95 if (value != NULL) { |
| 96 const AbstractType& type = AbstractType::Handle(value->StaticType()); | 96 const AbstractType& type = AbstractType::Handle(value->CompileType()); |
| 97 static_type_name = String::Handle(type.UserVisibleName()).ToCString(); | 97 compile_type_name = String::Handle(type.UserVisibleName()).ToCString(); |
| 98 } | 98 } |
| 99 Parser::PrintMessage(script, token_pos, "", | 99 Parser::PrintMessage(script, token_pos, "", |
| 100 "%s type check: static type '%s' is %s specific than " | 100 "%s type check: compile type '%s' is %s specific than " |
| 101 "type '%s' of '%s'.", | 101 "type '%s' of '%s'.", |
| 102 eliminated ? "Eliminated" : "Generated", | 102 eliminated ? "Eliminated" : "Generated", |
| 103 static_type_name, | 103 compile_type_name, |
| 104 eliminated ? "more" : "not more", | 104 eliminated ? "more" : "not more", |
| 105 String::Handle(dst_type.UserVisibleName()).ToCString(), | 105 String::Handle(dst_type.UserVisibleName()).ToCString(), |
| 106 dst_name.ToCString()); | 106 dst_name.ToCString()); |
| 107 } | 107 } |
| 108 | 108 |
| 109 | 109 |
| 110 static void PrintICData(BufferFormatter* f, const ICData& ic_data) { | 110 static void PrintICData(BufferFormatter* f, const ICData& ic_data) { |
| 111 f->Print(" IC[%d: ", ic_data.NumberOfChecks()); | 111 f->Print(" IC[%d: ", ic_data.NumberOfChecks()); |
| 112 Function& target = Function::Handle(); | 112 Function& target = Function::Handle(); |
| 113 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { | 113 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 | 158 |
| 159 void ConstantVal::PrintTo(BufferFormatter* f) const { | 159 void ConstantVal::PrintTo(BufferFormatter* f) const { |
| 160 f->Print("#%s", value().ToCString()); | 160 f->Print("#%s", value().ToCString()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 | 163 |
| 164 void AssertAssignableComp::PrintOperandsTo(BufferFormatter* f) const { | 164 void AssertAssignableComp::PrintOperandsTo(BufferFormatter* f) const { |
| 165 value()->PrintTo(f); | 165 value()->PrintTo(f); |
| 166 f->Print(", %s, '%s'", | 166 f->Print(", %s, '%s'%s", |
| 167 String::Handle(dst_type().Name()).ToCString(), | 167 String::Handle(dst_type().Name()).ToCString(), |
| 168 dst_name().ToCString()); | 168 dst_name().ToCString(), |
| 169 IsEliminated() ? " eliminated" : ""); |
| 169 f->Print(" instantiator("); | 170 f->Print(" instantiator("); |
| 170 instantiator()->PrintTo(f); | 171 instantiator()->PrintTo(f); |
| 171 f->Print(")"); | 172 f->Print(")"); |
| 172 f->Print(" instantiator_type_arguments("); | 173 f->Print(" instantiator_type_arguments("); |
| 173 instantiator_type_arguments()->PrintTo(f); | 174 instantiator_type_arguments()->PrintTo(f); |
| 174 f->Print(")"); | 175 f->Print(")"); |
| 175 } | 176 } |
| 176 | 177 |
| 177 | 178 |
| 178 void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const { | 179 void ClosureCallComp::PrintOperandsTo(BufferFormatter* f) const { |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 !locations_[i].IsInvalid()) { | 781 !locations_[i].IsInvalid()) { |
| 781 f->Print(" ["); | 782 f->Print(" ["); |
| 782 locations_[i].PrintTo(f); | 783 locations_[i].PrintTo(f); |
| 783 f->Print("]"); | 784 f->Print("]"); |
| 784 } | 785 } |
| 785 } | 786 } |
| 786 f->Print(" }"); | 787 f->Print(" }"); |
| 787 } | 788 } |
| 788 | 789 |
| 789 } // namespace dart | 790 } // namespace dart |
| OLD | NEW |