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

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

Issue 10782010: Make it clear that HInstruction's position is a write-once variable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 5 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.cc ('k') | no next file » | 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 HInstruction* previous() const { return previous_; } 850 HInstruction* previous() const { return previous_; }
851 851
852 virtual void PrintTo(StringStream* stream); 852 virtual void PrintTo(StringStream* stream);
853 virtual void PrintDataTo(StringStream* stream) { } 853 virtual void PrintDataTo(StringStream* stream) { }
854 854
855 bool IsLinked() const { return block() != NULL; } 855 bool IsLinked() const { return block() != NULL; }
856 void Unlink(); 856 void Unlink();
857 void InsertBefore(HInstruction* next); 857 void InsertBefore(HInstruction* next);
858 void InsertAfter(HInstruction* previous); 858 void InsertAfter(HInstruction* previous);
859 859
860 // The position is a write-once variable.
860 int position() const { return position_; } 861 int position() const { return position_; }
861 bool has_position() const { return position_ != RelocInfo::kNoPosition; } 862 bool has_position() const { return position_ != RelocInfo::kNoPosition; }
862 void set_position(int position) { position_ = position; } 863 void set_position(int position) {
864 ASSERT(!has_position());
865 ASSERT(position != RelocInfo::kNoPosition);
866 position_ = position;
867 }
863 868
864 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } 869 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }
865 870
866 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; 871 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
867 872
868 #ifdef DEBUG 873 #ifdef DEBUG
869 virtual void Verify(); 874 virtual void Verify();
870 #endif 875 #endif
871 876
872 virtual bool IsCall() { return false; } 877 virtual bool IsCall() { return false; }
(...skipping 4272 matching lines...) Expand 10 before | Expand all | Expand 10 after
5145 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); 5150 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex);
5146 }; 5151 };
5147 5152
5148 5153
5149 #undef DECLARE_INSTRUCTION 5154 #undef DECLARE_INSTRUCTION
5150 #undef DECLARE_CONCRETE_INSTRUCTION 5155 #undef DECLARE_CONCRETE_INSTRUCTION
5151 5156
5152 } } // namespace v8::internal 5157 } } // namespace v8::internal
5153 5158
5154 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5159 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698