| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 } | 673 } |
| 674 | 674 |
| 675 | 675 |
| 676 void HValue::ComputeInitialRange(Zone* zone) { | 676 void HValue::ComputeInitialRange(Zone* zone) { |
| 677 ASSERT(!HasRange()); | 677 ASSERT(!HasRange()); |
| 678 range_ = InferRange(zone); | 678 range_ = InferRange(zone); |
| 679 ASSERT(HasRange()); | 679 ASSERT(HasRange()); |
| 680 } | 680 } |
| 681 | 681 |
| 682 | 682 |
| 683 void HSourcePosition::PrintTo(FILE* out) { |
| 684 if (IsUnknown()) { |
| 685 PrintF(out, "<?>"); |
| 686 } else { |
| 687 if (FLAG_hydrogen_track_positions) { |
| 688 PrintF(out, "<%d:%d>", inlining_id(), position()); |
| 689 } else { |
| 690 PrintF(out, "<0:%d>", raw()); |
| 691 } |
| 692 } |
| 693 } |
| 694 |
| 695 |
| 683 void HInstruction::PrintTo(StringStream* stream) { | 696 void HInstruction::PrintTo(StringStream* stream) { |
| 684 PrintMnemonicTo(stream); | 697 PrintMnemonicTo(stream); |
| 685 PrintDataTo(stream); | 698 PrintDataTo(stream); |
| 686 PrintRangeTo(stream); | 699 PrintRangeTo(stream); |
| 687 PrintChangesTo(stream); | 700 PrintChangesTo(stream); |
| 688 PrintTypeTo(stream); | 701 PrintTypeTo(stream); |
| 689 if (CheckFlag(HValue::kHasNoObservableSideEffects)) { | 702 if (CheckFlag(HValue::kHasNoObservableSideEffects)) { |
| 690 stream->Add(" [noOSE]"); | 703 stream->Add(" [noOSE]"); |
| 691 } | 704 } |
| 692 if (CheckFlag(HValue::kIsDead)) { | 705 if (CheckFlag(HValue::kIsDead)) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 ASSERT(!next->IsBlockEntry()); | 742 ASSERT(!next->IsBlockEntry()); |
| 730 ASSERT(!IsControlInstruction()); | 743 ASSERT(!IsControlInstruction()); |
| 731 ASSERT(!next->block()->IsStartBlock()); | 744 ASSERT(!next->block()->IsStartBlock()); |
| 732 ASSERT(next->previous_ != NULL); | 745 ASSERT(next->previous_ != NULL); |
| 733 HInstruction* prev = next->previous(); | 746 HInstruction* prev = next->previous(); |
| 734 prev->next_ = this; | 747 prev->next_ = this; |
| 735 next->previous_ = this; | 748 next->previous_ = this; |
| 736 next_ = next; | 749 next_ = next; |
| 737 previous_ = prev; | 750 previous_ = prev; |
| 738 SetBlock(next->block()); | 751 SetBlock(next->block()); |
| 739 if (position() == RelocInfo::kNoPosition && | 752 if (!has_position() && next->has_position()) { |
| 740 next->position() != RelocInfo::kNoPosition) { | |
| 741 set_position(next->position()); | 753 set_position(next->position()); |
| 742 } | 754 } |
| 743 } | 755 } |
| 744 | 756 |
| 745 | 757 |
| 746 void HInstruction::InsertAfter(HInstruction* previous) { | 758 void HInstruction::InsertAfter(HInstruction* previous) { |
| 747 ASSERT(!IsLinked()); | 759 ASSERT(!IsLinked()); |
| 748 ASSERT(!previous->IsControlInstruction()); | 760 ASSERT(!previous->IsControlInstruction()); |
| 749 ASSERT(!IsControlInstruction() || previous->next_ == NULL); | 761 ASSERT(!IsControlInstruction() || previous->next_ == NULL); |
| 750 HBasicBlock* block = previous->block(); | 762 HBasicBlock* block = previous->block(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 767 } | 779 } |
| 768 | 780 |
| 769 previous_ = previous; | 781 previous_ = previous; |
| 770 next_ = next; | 782 next_ = next; |
| 771 SetBlock(block); | 783 SetBlock(block); |
| 772 previous->next_ = this; | 784 previous->next_ = this; |
| 773 if (next != NULL) next->previous_ = this; | 785 if (next != NULL) next->previous_ = this; |
| 774 if (block->last() == previous) { | 786 if (block->last() == previous) { |
| 775 block->set_last(this); | 787 block->set_last(this); |
| 776 } | 788 } |
| 777 if (position() == RelocInfo::kNoPosition && | 789 if (!has_position() && previous->has_position()) { |
| 778 previous->position() != RelocInfo::kNoPosition) { | |
| 779 set_position(previous->position()); | 790 set_position(previous->position()); |
| 780 } | 791 } |
| 781 } | 792 } |
| 782 | 793 |
| 783 | 794 |
| 784 #ifdef DEBUG | 795 #ifdef DEBUG |
| 785 void HInstruction::Verify() { | 796 void HInstruction::Verify() { |
| 786 // Verify that input operands are defined before use. | 797 // Verify that input operands are defined before use. |
| 787 HBasicBlock* cur_block = block(); | 798 HBasicBlock* cur_block = block(); |
| 788 for (int i = 0; i < OperandCount(); ++i) { | 799 for (int i = 0; i < OperandCount(); ++i) { |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1640 Range* HConstant::InferRange(Zone* zone) { | 1651 Range* HConstant::InferRange(Zone* zone) { |
| 1641 if (has_int32_value_) { | 1652 if (has_int32_value_) { |
| 1642 Range* result = new(zone) Range(int32_value_, int32_value_); | 1653 Range* result = new(zone) Range(int32_value_, int32_value_); |
| 1643 result->set_can_be_minus_zero(false); | 1654 result->set_can_be_minus_zero(false); |
| 1644 return result; | 1655 return result; |
| 1645 } | 1656 } |
| 1646 return HValue::InferRange(zone); | 1657 return HValue::InferRange(zone); |
| 1647 } | 1658 } |
| 1648 | 1659 |
| 1649 | 1660 |
| 1650 int HPhi::position() const { | 1661 HSourcePosition HPhi::position() const { |
| 1651 return block()->first()->position(); | 1662 return block()->first()->position(); |
| 1652 } | 1663 } |
| 1653 | 1664 |
| 1654 | 1665 |
| 1655 Range* HPhi::InferRange(Zone* zone) { | 1666 Range* HPhi::InferRange(Zone* zone) { |
| 1656 Representation r = representation(); | 1667 Representation r = representation(); |
| 1657 if (r.IsSmiOrInteger32()) { | 1668 if (r.IsSmiOrInteger32()) { |
| 1658 if (block()->IsLoopHeader()) { | 1669 if (block()->IsLoopHeader()) { |
| 1659 Range* range = r.IsSmi() | 1670 Range* range = r.IsSmi() |
| 1660 ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue) | 1671 ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue) |
| (...skipping 2817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4478 break; | 4489 break; |
| 4479 case kExternalMemory: | 4490 case kExternalMemory: |
| 4480 stream->Add("[external-memory]"); | 4491 stream->Add("[external-memory]"); |
| 4481 break; | 4492 break; |
| 4482 } | 4493 } |
| 4483 | 4494 |
| 4484 stream->Add("@%d", offset()); | 4495 stream->Add("@%d", offset()); |
| 4485 } | 4496 } |
| 4486 | 4497 |
| 4487 } } // namespace v8::internal | 4498 } } // namespace v8::internal |
| OLD | NEW |