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

Unified Diff: src/lithium.h

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/lithium.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium.h
diff --git a/src/lithium.h b/src/lithium.h
index 8aeebe6c835190920549efa71433363534c935d5..821b35a59f01d5e694f81c02a69273b55a78f5c2 100644
--- a/src/lithium.h
+++ b/src/lithium.h
@@ -22,7 +22,6 @@ namespace internal {
V(Register, REGISTER, 16) \
V(DoubleRegister, DOUBLE_REGISTER, 16)
-
class LOperand : public ZoneObject {
public:
enum Kind {
@@ -49,6 +48,7 @@ class LOperand : public ZoneObject {
void PrintTo(StringStream* stream);
void ConvertTo(Kind kind, int index) {
+ if (kind == REGISTER) ASSERT(index >= 0);
value_ = KindField::encode(kind);
value_ |= index << kKindFieldWidth;
ASSERT(this->index() == index);
@@ -278,9 +278,10 @@ class LMoveOperands V8_FINAL BASE_EMBEDDED {
}
// A move is redundant if it's been eliminated, if its source and
- // destination are the same, or if its destination is unneeded.
+ // destination are the same, or if its destination is unneeded or constant.
bool IsRedundant() const {
- return IsEliminated() || source_->Equals(destination_) || IsIgnored();
+ return IsEliminated() || source_->Equals(destination_) || IsIgnored() ||
+ (destination_ != NULL && destination_->IsConstantOperand());
}
bool IsIgnored() const {
@@ -341,9 +342,7 @@ class LParallelMove V8_FINAL : public ZoneObject {
bool IsRedundant() const;
- const ZoneList<LMoveOperands>* move_operands() const {
- return &move_operands_;
- }
+ ZoneList<LMoveOperands>* move_operands() { return &move_operands_; }
void PrintDataTo(StringStream* stream) const;
@@ -747,6 +746,61 @@ class LPhase : public CompilationPhase {
};
+// A register-allocator view of a Lithium instruction. It contains the id of
+// the output operand and a list of input operand uses.
+
+enum RegisterKind {
+ UNALLOCATED_REGISTERS,
+ GENERAL_REGISTERS,
+ DOUBLE_REGISTERS
+};
+
+// Iterator for non-null temp operands.
+class TempIterator BASE_EMBEDDED {
+ public:
+ inline explicit TempIterator(LInstruction* instr);
+ inline bool Done();
+ inline LOperand* Current();
+ inline void Advance();
+
+ private:
+ inline void SkipUninteresting();
+ LInstruction* instr_;
+ int limit_;
+ int current_;
+};
+
+
+// Iterator for non-constant input operands.
+class InputIterator BASE_EMBEDDED {
+ public:
+ inline explicit InputIterator(LInstruction* instr);
+ inline bool Done();
+ inline LOperand* Current();
+ inline void Advance();
+
+ private:
+ inline void SkipUninteresting();
+ LInstruction* instr_;
+ int limit_;
+ int current_;
+};
+
+
+class UseIterator BASE_EMBEDDED {
+ public:
+ inline explicit UseIterator(LInstruction* instr);
+ inline bool Done();
+ inline LOperand* Current();
+ inline void Advance();
+
+ private:
+ InputIterator input_iterator_;
+ DeepIterator env_iterator_;
+};
+
+class LInstruction;
+class LCodeGen;
} } // namespace v8::internal
#endif // V8_LITHIUM_H_
« no previous file with comments | « src/isolate.cc ('k') | src/lithium.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698