| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 } | 583 } |
| 584 } | 584 } |
| 585 | 585 |
| 586 | 586 |
| 587 void HValue::PrintTypeTo(StringStream* stream) { | 587 void HValue::PrintTypeTo(StringStream* stream) { |
| 588 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return; | 588 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return; |
| 589 stream->Add(" type:%s", type().ToString()); | 589 stream->Add(" type:%s", type().ToString()); |
| 590 } | 590 } |
| 591 | 591 |
| 592 | 592 |
| 593 void HValue::PrintRangeTo(StringStream* stream) { | |
| 594 if (range() == NULL || range()->IsMostGeneric()) return; | |
| 595 // Note: The c1visualizer syntax for locals allows only a sequence of the | |
| 596 // following characters: A-Za-z0-9_-|: | |
| 597 stream->Add(" range:%d_%d%s", | |
| 598 range()->lower(), | |
| 599 range()->upper(), | |
| 600 range()->CanBeMinusZero() ? "_m0" : ""); | |
| 601 } | |
| 602 | |
| 603 | |
| 604 void HValue::PrintChangesTo(StringStream* stream) { | 593 void HValue::PrintChangesTo(StringStream* stream) { |
| 605 GVNFlagSet changes_flags = ChangesFlags(); | 594 GVNFlagSet changes_flags = ChangesFlags(); |
| 606 if (changes_flags.IsEmpty()) return; | 595 if (changes_flags.IsEmpty()) return; |
| 607 stream->Add(" changes["); | 596 stream->Add(" changes["); |
| 608 if (changes_flags == AllSideEffectsFlagSet()) { | 597 if (changes_flags == AllSideEffectsFlagSet()) { |
| 609 stream->Add("*"); | 598 stream->Add("*"); |
| 610 } else { | 599 } else { |
| 611 bool add_comma = false; | 600 bool add_comma = false; |
| 612 #define PRINT_DO(Type) \ | 601 #define PRINT_DO(Type) \ |
| 613 if (changes_flags.Contains(k##Type)) { \ | 602 if (changes_flags.Contains(k##Type)) { \ |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 } else { | 683 } else { |
| 695 PrintF(out, "<0:%d>", raw()); | 684 PrintF(out, "<0:%d>", raw()); |
| 696 } | 685 } |
| 697 } | 686 } |
| 698 } | 687 } |
| 699 | 688 |
| 700 | 689 |
| 701 void HInstruction::PrintTo(StringStream* stream) { | 690 void HInstruction::PrintTo(StringStream* stream) { |
| 702 PrintMnemonicTo(stream); | 691 PrintMnemonicTo(stream); |
| 703 PrintDataTo(stream); | 692 PrintDataTo(stream); |
| 704 PrintRangeTo(stream); | |
| 705 PrintChangesTo(stream); | 693 PrintChangesTo(stream); |
| 706 PrintTypeTo(stream); | 694 PrintTypeTo(stream); |
| 707 if (CheckFlag(HValue::kHasNoObservableSideEffects)) { | 695 if (CheckFlag(HValue::kHasNoObservableSideEffects)) { |
| 708 stream->Add(" [noOSE]"); | 696 stream->Add(" [noOSE]"); |
| 709 } | 697 } |
| 710 if (CheckFlag(HValue::kIsDead)) { | 698 if (CheckFlag(HValue::kIsDead)) { |
| 711 stream->Add(" [dead]"); | 699 stream->Add(" [dead]"); |
| 712 } | 700 } |
| 713 } | 701 } |
| 714 | 702 |
| (...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 stream->Add(" "); | 2480 stream->Add(" "); |
| 2493 value->PrintNameTo(stream); | 2481 value->PrintNameTo(stream); |
| 2494 stream->Add(" "); | 2482 stream->Add(" "); |
| 2495 } | 2483 } |
| 2496 stream->Add(" uses:%d_%ds_%di_%dd_%dt", | 2484 stream->Add(" uses:%d_%ds_%di_%dd_%dt", |
| 2497 UseCount(), | 2485 UseCount(), |
| 2498 smi_non_phi_uses() + smi_indirect_uses(), | 2486 smi_non_phi_uses() + smi_indirect_uses(), |
| 2499 int32_non_phi_uses() + int32_indirect_uses(), | 2487 int32_non_phi_uses() + int32_indirect_uses(), |
| 2500 double_non_phi_uses() + double_indirect_uses(), | 2488 double_non_phi_uses() + double_indirect_uses(), |
| 2501 tagged_non_phi_uses() + tagged_indirect_uses()); | 2489 tagged_non_phi_uses() + tagged_indirect_uses()); |
| 2502 PrintRangeTo(stream); | |
| 2503 PrintTypeTo(stream); | 2490 PrintTypeTo(stream); |
| 2504 stream->Add("]"); | 2491 stream->Add("]"); |
| 2505 } | 2492 } |
| 2506 | 2493 |
| 2507 | 2494 |
| 2508 void HPhi::AddInput(HValue* value) { | 2495 void HPhi::AddInput(HValue* value) { |
| 2509 inputs_.Add(NULL, value->block()->zone()); | 2496 inputs_.Add(NULL, value->block()->zone()); |
| 2510 SetOperandAt(OperandCount() - 1, value); | 2497 SetOperandAt(OperandCount() - 1, value); |
| 2511 // Mark phis that may have 'arguments' directly or indirectly as an operand. | 2498 // Mark phis that may have 'arguments' directly or indirectly as an operand. |
| 2512 if (!CheckFlag(kIsArguments) && value->CheckFlag(kIsArguments)) { | 2499 if (!CheckFlag(kIsArguments) && value->CheckFlag(kIsArguments)) { |
| (...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4727 break; | 4714 break; |
| 4728 case kExternalMemory: | 4715 case kExternalMemory: |
| 4729 stream->Add("[external-memory]"); | 4716 stream->Add("[external-memory]"); |
| 4730 break; | 4717 break; |
| 4731 } | 4718 } |
| 4732 | 4719 |
| 4733 stream->Add("@%d", offset()); | 4720 stream->Add("@%d", offset()); |
| 4734 } | 4721 } |
| 4735 | 4722 |
| 4736 } } // namespace v8::internal | 4723 } } // namespace v8::internal |
| OLD | NEW |