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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 OS::Print("%s", str); | 82 OS::Print("%s", str); |
83 } | 83 } |
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 Script& script = Script::Handle(parsed_function.function().script()); |
93 const Script& script = Script::Handle(cls.script()); | |
94 const char* compile_type_name = "unknown"; | 93 const char* compile_type_name = "unknown"; |
95 if (value != NULL) { | 94 if (value != NULL) { |
96 const AbstractType& type = AbstractType::Handle(value->CompileType()); | 95 const AbstractType& type = AbstractType::Handle(value->CompileType()); |
97 if (!type.IsNull()) { | 96 if (!type.IsNull()) { |
98 compile_type_name = String::Handle(type.UserVisibleName()).ToCString(); | 97 compile_type_name = String::Handle(type.UserVisibleName()).ToCString(); |
99 } | 98 } |
100 } | 99 } |
101 Parser::PrintMessage(script, token_pos, "", | 100 Parser::PrintMessage(script, token_pos, "", |
102 "%s type check: compile type '%s' is %s specific than " | 101 "%s type check: compile type '%s' is %s specific than " |
103 "type '%s' of '%s'.", | 102 "type '%s' of '%s'.", |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 292 |
294 void RelationalOpComp::PrintOperandsTo(BufferFormatter* f) const { | 293 void RelationalOpComp::PrintOperandsTo(BufferFormatter* f) const { |
295 f->Print("%s, ", Token::Str(kind())); | 294 f->Print("%s, ", Token::Str(kind())); |
296 left()->PrintTo(f); | 295 left()->PrintTo(f); |
297 f->Print(", "); | 296 f->Print(", "); |
298 right()->PrintTo(f); | 297 right()->PrintTo(f); |
299 } | 298 } |
300 | 299 |
301 | 300 |
302 void AllocateObjectComp::PrintOperandsTo(BufferFormatter* f) const { | 301 void AllocateObjectComp::PrintOperandsTo(BufferFormatter* f) const { |
303 f->Print("%s", Class::Handle(constructor().owner()).ToCString()); | 302 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); |
304 for (intptr_t i = 0; i < ArgumentCount(); i++) { | 303 for (intptr_t i = 0; i < ArgumentCount(); i++) { |
305 f->Print(", "); | 304 f->Print(", "); |
306 ArgumentAt(i)->value()->PrintTo(f); | 305 ArgumentAt(i)->value()->PrintTo(f); |
307 } | 306 } |
308 } | 307 } |
309 | 308 |
310 | 309 |
311 void AllocateObjectWithBoundsCheckComp::PrintOperandsTo( | 310 void AllocateObjectWithBoundsCheckComp::PrintOperandsTo( |
312 BufferFormatter* f) const { | 311 BufferFormatter* f) const { |
313 f->Print("%s", Class::Handle(constructor().owner()).ToCString()); | 312 f->Print("%s", Class::Handle(constructor().Owner()).ToCString()); |
314 for (intptr_t i = 0; i < InputCount(); i++) { | 313 for (intptr_t i = 0; i < InputCount(); i++) { |
315 f->Print(", "); | 314 f->Print(", "); |
316 InputAt(i)->PrintTo(f); | 315 InputAt(i)->PrintTo(f); |
317 } | 316 } |
318 } | 317 } |
319 | 318 |
320 | 319 |
321 void CreateArrayComp::PrintOperandsTo(BufferFormatter* f) const { | 320 void CreateArrayComp::PrintOperandsTo(BufferFormatter* f) const { |
322 for (int i = 0; i < ElementCount(); ++i) { | 321 for (int i = 0; i < ElementCount(); ++i) { |
323 if (i != 0) f->Print(", "); | 322 if (i != 0) f->Print(", "); |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { | 808 if ((locations_ != NULL) && !locations_[i].IsInvalid()) { |
810 f->Print(" ["); | 809 f->Print(" ["); |
811 locations_[i].PrintTo(f); | 810 locations_[i].PrintTo(f); |
812 f->Print("]"); | 811 f->Print("]"); |
813 } | 812 } |
814 } | 813 } |
815 f->Print(" }"); | 814 f->Print(" }"); |
816 } | 815 } |
817 | 816 |
818 } // namespace dart | 817 } // namespace dart |
OLD | NEW |