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

Unified Diff: src/compiler/instruction.h

Issue 803493002: revert r25736 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/compiler/graph-visualizer.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction.h
diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
index 9e2004fa88bc5cad6aad1013773092b2f02d565e..9a5b87d63801bc6f54209c74faa1cbd6ff75cb77 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -39,6 +39,7 @@ const InstructionCode kSourcePositionInstruction = -3;
class InstructionOperand : public ZoneObject {
public:
enum Kind {
+ INVALID,
UNALLOCATED,
CONSTANT,
IMMEDIATE,
@@ -48,6 +49,7 @@ class InstructionOperand : public ZoneObject {
DOUBLE_REGISTER
};
+ InstructionOperand() : value_(KindField::encode(INVALID)) {}
InstructionOperand(Kind kind, int index) { ConvertTo(kind, index); }
Kind kind() const { return KindField::decode(value_); }
@@ -56,6 +58,7 @@ class InstructionOperand : public ZoneObject {
bool Is##name() const { return kind() == type; }
INSTRUCTION_OPERAND_LIST(INSTRUCTION_OPERAND_PREDICATE)
INSTRUCTION_OPERAND_PREDICATE(Unallocated, UNALLOCATED, 0)
+ INSTRUCTION_OPERAND_PREDICATE(Ignored, INVALID, 0)
#undef INSTRUCTION_OPERAND_PREDICATE
bool Equals(const InstructionOperand* other) const {
return value_ == other->value_;
@@ -288,12 +291,16 @@ class MoveOperands FINAL {
}
// A move is redundant if it's been eliminated, if its source and
- // destination are the same, or if its destination is constant.
+ // destination are the same, or if its destination is unneeded or constant.
bool IsRedundant() const {
- return IsEliminated() || source_->Equals(destination_) ||
+ return IsEliminated() || source_->Equals(destination_) || IsIgnored() ||
(destination_ != NULL && destination_->IsConstant());
}
+ bool IsIgnored() const {
+ return destination_ != NULL && destination_->IsIgnored();
+ }
+
// We clear both operands to indicate move that's been eliminated.
void Eliminate() { source_ = destination_ = NULL; }
bool IsEliminated() const {
@@ -341,7 +348,7 @@ class SubKindOperand FINAL : public InstructionOperand {
private:
static SubKindOperand* cache;
- SubKindOperand() : InstructionOperand(kOperandKind, 0) {} // For the caches.
+ SubKindOperand() : InstructionOperand() {}
explicit SubKindOperand(int index)
: InstructionOperand(kOperandKind, index) {}
};
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698