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