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/flow_graph_range_analysis.h" | 7 #include "vm/flow_graph_range_analysis.h" |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 #include "vm/os.h" | 9 #include "vm/os.h" |
10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 f->Print(")"); | 349 f->Print(")"); |
350 } | 350 } |
351 | 351 |
352 | 352 |
353 void AssertBooleanInstr::PrintOperandsTo(BufferFormatter* f) const { | 353 void AssertBooleanInstr::PrintOperandsTo(BufferFormatter* f) const { |
354 value()->PrintTo(f); | 354 value()->PrintTo(f); |
355 } | 355 } |
356 | 356 |
357 | 357 |
358 void ClosureCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 358 void ClosureCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
359 f->Print("function="); | 359 f->Print(" function="); |
360 InputAt(0)->PrintTo(f); | 360 InputAt(0)->PrintTo(f); |
361 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 361 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
362 f->Print(", "); | 362 f->Print(", "); |
363 PushArgumentAt(i)->value()->PrintTo(f); | 363 PushArgumentAt(i)->value()->PrintTo(f); |
364 } | 364 } |
365 } | 365 } |
366 | 366 |
367 | 367 |
368 void InstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 368 void InstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
369 f->Print("%s", function_name().ToCString()); | 369 f->Print(" %s", function_name().ToCString()); |
370 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 370 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
371 f->Print(", "); | 371 f->Print(", "); |
372 PushArgumentAt(i)->value()->PrintTo(f); | 372 PushArgumentAt(i)->value()->PrintTo(f); |
373 } | 373 } |
374 if (HasICData()) { | 374 if (HasICData()) { |
375 PrintICDataHelper(f, *ic_data()); | 375 PrintICDataHelper(f, *ic_data()); |
376 } | 376 } |
377 } | 377 } |
378 | 378 |
379 | 379 |
380 void PolymorphicInstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 380 void PolymorphicInstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
381 f->Print("%s", instance_call()->function_name().ToCString()); | 381 f->Print(" %s", instance_call()->function_name().ToCString()); |
382 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 382 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
383 f->Print(", "); | 383 f->Print(", "); |
384 PushArgumentAt(i)->value()->PrintTo(f); | 384 PushArgumentAt(i)->value()->PrintTo(f); |
385 } | 385 } |
386 PrintICDataHelper(f, ic_data()); | 386 PrintICDataHelper(f, ic_data()); |
387 } | 387 } |
388 | 388 |
389 | 389 |
390 void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const { | 390 void StrictCompareInstr::PrintOperandsTo(BufferFormatter* f) const { |
391 f->Print("%s, ", Token::Str(kind())); | 391 f->Print("%s, ", Token::Str(kind())); |
(...skipping 18 matching lines...) Expand all Loading... |
410 | 410 |
411 | 411 |
412 void EqualityCompareInstr::PrintOperandsTo(BufferFormatter* f) const { | 412 void EqualityCompareInstr::PrintOperandsTo(BufferFormatter* f) const { |
413 left()->PrintTo(f); | 413 left()->PrintTo(f); |
414 f->Print(" %s ", Token::Str(kind())); | 414 f->Print(" %s ", Token::Str(kind())); |
415 right()->PrintTo(f); | 415 right()->PrintTo(f); |
416 } | 416 } |
417 | 417 |
418 | 418 |
419 void StaticCallInstr::PrintOperandsTo(BufferFormatter* f) const { | 419 void StaticCallInstr::PrintOperandsTo(BufferFormatter* f) const { |
420 f->Print("%s ", String::Handle(function().name()).ToCString()); | 420 f->Print(" %s ", String::Handle(function().name()).ToCString()); |
421 for (intptr_t i = 0; i < ArgumentCount(); ++i) { | 421 for (intptr_t i = 0; i < ArgumentCount(); ++i) { |
422 if (i > 0) f->Print(", "); | 422 if (i > 0) f->Print(", "); |
423 PushArgumentAt(i)->value()->PrintTo(f); | 423 PushArgumentAt(i)->value()->PrintTo(f); |
424 } | 424 } |
425 } | 425 } |
426 | 426 |
427 | 427 |
428 void LoadLocalInstr::PrintOperandsTo(BufferFormatter* f) const { | 428 void LoadLocalInstr::PrintOperandsTo(BufferFormatter* f) const { |
429 f->Print("%s", local().name().ToCString()); | 429 f->Print("%s", local().name().ToCString()); |
430 } | 430 } |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 } | 1109 } |
1110 | 1110 |
1111 const char* Environment::ToCString() const { | 1111 const char* Environment::ToCString() const { |
1112 char buffer[1024]; | 1112 char buffer[1024]; |
1113 BufferFormatter bf(buffer, 1024); | 1113 BufferFormatter bf(buffer, 1024); |
1114 PrintTo(&bf); | 1114 PrintTo(&bf); |
1115 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 1115 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
1116 } | 1116 } |
1117 | 1117 |
1118 } // namespace dart | 1118 } // namespace dart |
OLD | NEW |