Index: src/compiler/instruction.cc |
diff --git a/src/compiler/instruction.cc b/src/compiler/instruction.cc |
index 774843ced3038740356b0f5a78f4a0dfc3d3bd7e..1f9543a63531434c279e84cfe01e9be90a3c961b 100644 |
--- a/src/compiler/instruction.cc |
+++ b/src/compiler/instruction.cc |
@@ -105,24 +105,22 @@ std::ostream& operator<<(std::ostream& os, |
return os << "[immediate:" << imm.indexed_value() << "]"; |
} |
} |
+ case InstructionOperand::EXPLICIT: |
case InstructionOperand::ALLOCATED: { |
- auto allocated = AllocatedOperand::cast(op); |
- switch (allocated.allocated_kind()) { |
- case AllocatedOperand::STACK_SLOT: |
- os << "[stack:" << StackSlotOperand::cast(op).index(); |
- break; |
- case AllocatedOperand::DOUBLE_STACK_SLOT: |
- os << "[double_stack:" << DoubleStackSlotOperand::cast(op).index(); |
- break; |
- case AllocatedOperand::REGISTER: |
- os << "[" << RegisterOperand::cast(op).GetRegister().ToString() |
- << "|R"; |
- break; |
- case AllocatedOperand::DOUBLE_REGISTER: |
- os << "[" |
- << DoubleRegisterOperand::cast(op).GetDoubleRegister().ToString() |
- << "|R"; |
- break; |
+ auto allocated = LocationOperand::cast(op); |
+ if (op.IsStackSlot()) { |
+ os << "[stack:" << LocationOperand::cast(op).index(); |
+ } else if (op.IsDoubleStackSlot()) { |
+ os << "[double_stack:" << LocationOperand::cast(op).index(); |
+ } else if (op.IsRegister()) { |
+ os << "[" << LocationOperand::cast(op).GetRegister().ToString() << "|R"; |
+ } else { |
+ DCHECK(op.IsDoubleRegister()); |
+ os << "[" << LocationOperand::cast(op).GetDoubleRegister().ToString() |
+ << "|R"; |
+ } |
+ if (allocated.IsExplicit()) { |
+ os << "|E"; |
} |
switch (allocated.machine_type()) { |
case kRepWord32: |
@@ -181,11 +179,11 @@ MoveOperands* ParallelMove::PrepareInsertAfter(MoveOperands* move) const { |
MoveOperands* to_eliminate = nullptr; |
for (auto curr : *this) { |
if (curr->IsEliminated()) continue; |
- if (curr->destination().EqualsModuloType(move->source())) { |
+ if (curr->destination().EqualsCanonicalized(move->source())) { |
DCHECK(!replacement); |
replacement = curr; |
if (to_eliminate != nullptr) break; |
- } else if (curr->destination().EqualsModuloType(move->destination())) { |
+ } else if (curr->destination().EqualsCanonicalized(move->destination())) { |
DCHECK(!to_eliminate); |
to_eliminate = curr; |
if (replacement != nullptr) break; |
@@ -197,6 +195,16 @@ MoveOperands* ParallelMove::PrepareInsertAfter(MoveOperands* move) const { |
} |
+ExplicitOperand::ExplicitOperand(LocationKind kind, MachineType machine_type, |
+ int index) |
+ : LocationOperand(EXPLICIT, kind, machine_type, index) { |
+ DCHECK_IMPLIES(kind == REGISTER && !IsFloatingPoint(machine_type), |
+ Register::from_code(index).IsAllocatable()); |
+ DCHECK_IMPLIES(kind == REGISTER && IsFloatingPoint(machine_type), |
+ DoubleRegister::from_code(index).IsAllocatable()); |
+} |
+ |
+ |
Instruction::Instruction(InstructionCode opcode) |
: opcode_(opcode), |
bit_field_(OutputCountField::encode(0) | InputCountField::encode(0) | |
@@ -263,7 +271,7 @@ std::ostream& operator<<(std::ostream& os, |
void ReferenceMap::RecordReference(const AllocatedOperand& op) { |
// Do not record arguments as pointers. |
- if (op.IsStackSlot() && StackSlotOperand::cast(op).index() < 0) return; |
+ if (op.IsStackSlot() && LocationOperand::cast(op).index() < 0) return; |
DCHECK(!op.IsDoubleRegister() && !op.IsDoubleStackSlot()); |
reference_operands_.push_back(op); |
} |