Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/hydrogen-instructions.cc

Issue 140683011: Improve positions tracking inside the HGraphBuilder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-representation-changes.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 675 }
676 676
677 677
678 void HValue::ComputeInitialRange(Zone* zone) { 678 void HValue::ComputeInitialRange(Zone* zone) {
679 ASSERT(!HasRange()); 679 ASSERT(!HasRange());
680 range_ = InferRange(zone); 680 range_ = InferRange(zone);
681 ASSERT(HasRange()); 681 ASSERT(HasRange());
682 } 682 }
683 683
684 684
685 void HSourcePosition::PrintTo(FILE* out) {
686 if (IsUnknown()) {
687 PrintF(out, "<?>");
688 } else {
689 if (FLAG_hydrogen_track_positions) {
690 PrintF(out, "<%d:%d>", inlining_id(), position());
691 } else {
692 PrintF(out, "<0:%d>", raw());
693 }
694 }
695 }
696
697
685 void HInstruction::PrintTo(StringStream* stream) { 698 void HInstruction::PrintTo(StringStream* stream) {
686 PrintMnemonicTo(stream); 699 PrintMnemonicTo(stream);
687 PrintDataTo(stream); 700 PrintDataTo(stream);
688 PrintRangeTo(stream); 701 PrintRangeTo(stream);
689 PrintChangesTo(stream); 702 PrintChangesTo(stream);
690 PrintTypeTo(stream); 703 PrintTypeTo(stream);
691 if (CheckFlag(HValue::kHasNoObservableSideEffects)) { 704 if (CheckFlag(HValue::kHasNoObservableSideEffects)) {
692 stream->Add(" [noOSE]"); 705 stream->Add(" [noOSE]");
693 } 706 }
694 if (CheckFlag(HValue::kIsDead)) { 707 if (CheckFlag(HValue::kIsDead)) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 ASSERT(!next->IsBlockEntry()); 744 ASSERT(!next->IsBlockEntry());
732 ASSERT(!IsControlInstruction()); 745 ASSERT(!IsControlInstruction());
733 ASSERT(!next->block()->IsStartBlock()); 746 ASSERT(!next->block()->IsStartBlock());
734 ASSERT(next->previous_ != NULL); 747 ASSERT(next->previous_ != NULL);
735 HInstruction* prev = next->previous(); 748 HInstruction* prev = next->previous();
736 prev->next_ = this; 749 prev->next_ = this;
737 next->previous_ = this; 750 next->previous_ = this;
738 next_ = next; 751 next_ = next;
739 previous_ = prev; 752 previous_ = prev;
740 SetBlock(next->block()); 753 SetBlock(next->block());
741 if (position() == RelocInfo::kNoPosition && 754 if (!has_position() && next->has_position()) {
742 next->position() != RelocInfo::kNoPosition) {
743 set_position(next->position()); 755 set_position(next->position());
744 } 756 }
745 } 757 }
746 758
747 759
748 void HInstruction::InsertAfter(HInstruction* previous) { 760 void HInstruction::InsertAfter(HInstruction* previous) {
749 ASSERT(!IsLinked()); 761 ASSERT(!IsLinked());
750 ASSERT(!previous->IsControlInstruction()); 762 ASSERT(!previous->IsControlInstruction());
751 ASSERT(!IsControlInstruction() || previous->next_ == NULL); 763 ASSERT(!IsControlInstruction() || previous->next_ == NULL);
752 HBasicBlock* block = previous->block(); 764 HBasicBlock* block = previous->block();
(...skipping 16 matching lines...) Expand all
769 } 781 }
770 782
771 previous_ = previous; 783 previous_ = previous;
772 next_ = next; 784 next_ = next;
773 SetBlock(block); 785 SetBlock(block);
774 previous->next_ = this; 786 previous->next_ = this;
775 if (next != NULL) next->previous_ = this; 787 if (next != NULL) next->previous_ = this;
776 if (block->last() == previous) { 788 if (block->last() == previous) {
777 block->set_last(this); 789 block->set_last(this);
778 } 790 }
779 if (position() == RelocInfo::kNoPosition && 791 if (!has_position() && previous->has_position()) {
780 previous->position() != RelocInfo::kNoPosition) {
781 set_position(previous->position()); 792 set_position(previous->position());
782 } 793 }
783 } 794 }
784 795
785 796
786 #ifdef DEBUG 797 #ifdef DEBUG
787 void HInstruction::Verify() { 798 void HInstruction::Verify() {
788 // Verify that input operands are defined before use. 799 // Verify that input operands are defined before use.
789 HBasicBlock* cur_block = block(); 800 HBasicBlock* cur_block = block();
790 for (int i = 0; i < OperandCount(); ++i) { 801 for (int i = 0; i < OperandCount(); ++i) {
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 Range* HConstant::InferRange(Zone* zone) { 1653 Range* HConstant::InferRange(Zone* zone) {
1643 if (has_int32_value_) { 1654 if (has_int32_value_) {
1644 Range* result = new(zone) Range(int32_value_, int32_value_); 1655 Range* result = new(zone) Range(int32_value_, int32_value_);
1645 result->set_can_be_minus_zero(false); 1656 result->set_can_be_minus_zero(false);
1646 return result; 1657 return result;
1647 } 1658 }
1648 return HValue::InferRange(zone); 1659 return HValue::InferRange(zone);
1649 } 1660 }
1650 1661
1651 1662
1652 int HPhi::position() const { 1663 HSourcePosition HPhi::position() const {
1653 return block()->first()->position(); 1664 return block()->first()->position();
1654 } 1665 }
1655 1666
1656 1667
1657 Range* HPhi::InferRange(Zone* zone) { 1668 Range* HPhi::InferRange(Zone* zone) {
1658 Representation r = representation(); 1669 Representation r = representation();
1659 if (r.IsSmiOrInteger32()) { 1670 if (r.IsSmiOrInteger32()) {
1660 if (block()->IsLoopHeader()) { 1671 if (block()->IsLoopHeader()) {
1661 Range* range = r.IsSmi() 1672 Range* range = r.IsSmi()
1662 ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue) 1673 ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue)
(...skipping 2831 matching lines...) Expand 10 before | Expand all | Expand 10 after
4494 break; 4505 break;
4495 case kExternalMemory: 4506 case kExternalMemory:
4496 stream->Add("[external-memory]"); 4507 stream->Add("[external-memory]");
4497 break; 4508 break;
4498 } 4509 }
4499 4510
4500 stream->Add("@%d", offset()); 4511 stream->Add("@%d", offset());
4501 } 4512 }
4502 4513
4503 } } // namespace v8::internal 4514 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/hydrogen-representation-changes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698