| 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 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { | 374 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { |
| 375 f->Print("%2d: [join]", block_id()); | 375 f->Print("%2d: [join]", block_id()); |
| 376 if (phis_ != NULL) { | 376 if (phis_ != NULL) { |
| 377 for (intptr_t i = 0; i < phis_->length(); ++i) { | 377 for (intptr_t i = 0; i < phis_->length(); ++i) { |
| 378 if ((*phis_)[i] == NULL) continue; | 378 if ((*phis_)[i] == NULL) continue; |
| 379 f->Print("\n"); | 379 f->Print("\n"); |
| 380 (*phis_)[i]->PrintTo(f); | 380 (*phis_)[i]->PrintTo(f); |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 if (HasParallelMove()) { |
| 384 f->Print("\n"); |
| 385 parallel_move()->PrintTo(f); |
| 386 } |
| 383 } | 387 } |
| 384 | 388 |
| 385 | 389 |
| 386 void PhiInstr::PrintTo(BufferFormatter* f) const { | 390 void PhiInstr::PrintTo(BufferFormatter* f) const { |
| 387 f->Print(" v%d <- phi(", ssa_temp_index()); | 391 f->Print(" v%d <- phi(", ssa_temp_index()); |
| 388 for (intptr_t i = 0; i < inputs_.length(); ++i) { | 392 for (intptr_t i = 0; i < inputs_.length(); ++i) { |
| 389 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); | 393 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); |
| 390 if (i < inputs_.length() - 1) f->Print(", "); | 394 if (i < inputs_.length() - 1) f->Print(", "); |
| 391 } | 395 } |
| 392 f->Print(")"); | 396 f->Print(")"); |
| 393 } | 397 } |
| 394 | 398 |
| 395 | 399 |
| 396 void ParameterInstr::PrintTo(BufferFormatter* f) const { | 400 void ParameterInstr::PrintTo(BufferFormatter* f) const { |
| 397 f->Print(" v%d <- parameter(%d)", | 401 f->Print(" v%d <- parameter(%d)", |
| 398 HasSSATemp() ? ssa_temp_index() : temp_index(), | 402 HasSSATemp() ? ssa_temp_index() : temp_index(), |
| 399 index()); | 403 index()); |
| 400 } | 404 } |
| 401 | 405 |
| 402 | 406 |
| 403 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { | 407 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { |
| 404 f->Print("%2d: [target", block_id()); | 408 f->Print("%2d: [target", block_id()); |
| 405 if (HasTryIndex()) { | 409 if (HasTryIndex()) { |
| 406 f->Print(" catch %d]", try_index()); | 410 f->Print(" catch %d]", try_index()); |
| 407 } else { | 411 } else { |
| 408 f->Print("]"); | 412 f->Print("]"); |
| 409 } | 413 } |
| 414 if (HasParallelMove()) { |
| 415 f->Print("\n"); |
| 416 parallel_move()->PrintTo(f); |
| 417 } |
| 410 } | 418 } |
| 411 | 419 |
| 412 | 420 |
| 413 void BindInstr::PrintTo(BufferFormatter* f) const { | 421 void BindInstr::PrintTo(BufferFormatter* f) const { |
| 414 if (!is_used()) { | 422 if (!is_used()) { |
| 415 f->Print(" "); | 423 f->Print(" "); |
| 416 } else if (HasSSATemp()) { | 424 } else if (HasSSATemp()) { |
| 417 f->Print(" v%d <- ", ssa_temp_index()); | 425 f->Print(" v%d <- ", ssa_temp_index()); |
| 418 } else { | 426 } else { |
| 419 f->Print(" t%d <- ", temp_index()); | 427 f->Print(" t%d <- ", temp_index()); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 442 | 450 |
| 443 void ReThrowInstr::PrintTo(BufferFormatter* f) const { | 451 void ReThrowInstr::PrintTo(BufferFormatter* f) const { |
| 444 f->Print(" %s ", DebugName()); | 452 f->Print(" %s ", DebugName()); |
| 445 exception()->PrintTo(f); | 453 exception()->PrintTo(f); |
| 446 f->Print(", "); | 454 f->Print(", "); |
| 447 stack_trace()->PrintTo(f); | 455 stack_trace()->PrintTo(f); |
| 448 } | 456 } |
| 449 | 457 |
| 450 | 458 |
| 451 void GotoInstr::PrintTo(BufferFormatter* f) const { | 459 void GotoInstr::PrintTo(BufferFormatter* f) const { |
| 452 f->Print(" goto %d", successor()->block_id()); | 460 if (HasParallelMove()) { |
| 461 parallel_move()->PrintTo(f); |
| 462 } else { |
| 463 f->Print(" "); |
| 464 } |
| 465 f->Print(" goto %d", successor()->block_id()); |
| 453 } | 466 } |
| 454 | 467 |
| 455 | 468 |
| 456 void BranchInstr::PrintTo(BufferFormatter* f) const { | 469 void BranchInstr::PrintTo(BufferFormatter* f) const { |
| 457 f->Print(" %s ", DebugName()); | 470 f->Print(" %s ", DebugName()); |
| 458 f->Print("if "); | 471 f->Print("if "); |
| 459 left()->PrintTo(f); | 472 left()->PrintTo(f); |
| 460 f-> Print(" %s ", Token::Str(kind())); | 473 f-> Print(" %s ", Token::Str(kind())); |
| 461 right()->PrintTo(f); | 474 right()->PrintTo(f); |
| 462 | 475 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { | 755 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { |
| 743 f->Print(" ["); | 756 f->Print(" ["); |
| 744 locations_[i].PrintTo(f); | 757 locations_[i].PrintTo(f); |
| 745 f->Print("]"); | 758 f->Print("]"); |
| 746 } | 759 } |
| 747 } | 760 } |
| 748 f->Print(" }"); | 761 f->Print(" }"); |
| 749 } | 762 } |
| 750 | 763 |
| 751 } // namespace dart | 764 } // namespace dart |
| OLD | NEW |