Index: src/compiler/instruction.cc |
diff --git a/src/compiler/instruction.cc b/src/compiler/instruction.cc |
index 45bd3f75c12268357e1ebe464006ec18bc8c4746..177de6f379a4fc231677f5c8caccccec264cbd7f 100644 |
--- a/src/compiler/instruction.cc |
+++ b/src/compiler/instruction.cc |
@@ -42,17 +42,23 @@ std::ostream& operator<<(std::ostream& os, |
} |
} |
case InstructionOperand::CONSTANT: |
- return os << "[constant:" << op.index() << "]"; |
+ return os << "[constant:" << ConstantOperand::cast(op).virtual_register() |
+ << "]"; |
case InstructionOperand::IMMEDIATE: |
- return os << "[immediate:" << op.index() << "]"; |
+ return os << "[immediate:" << ImmediateOperand::cast(op).index() << "]"; |
case InstructionOperand::STACK_SLOT: |
- return os << "[stack:" << op.index() << "]"; |
+ return os << "[stack:" << StackSlotOperand::cast(op).index() << "]"; |
case InstructionOperand::DOUBLE_STACK_SLOT: |
- return os << "[double_stack:" << op.index() << "]"; |
+ return os << "[double_stack:" << DoubleStackSlotOperand::cast(op).index() |
+ << "]"; |
case InstructionOperand::REGISTER: |
- return os << "[" << conf->general_register_name(op.index()) << "|R]"; |
+ return os << "[" |
+ << conf->general_register_name( |
+ RegisterOperand::cast(op).index()) << "|R]"; |
case InstructionOperand::DOUBLE_REGISTER: |
- return os << "[" << conf->double_register_name(op.index()) << "|R]"; |
+ return os << "[" |
+ << conf->double_register_name( |
+ DoubleRegisterOperand::cast(op).index()) << "|R]"; |
case InstructionOperand::INVALID: |
return os << "(x)"; |
} |
@@ -173,7 +179,7 @@ std::ostream& operator<<(std::ostream& os, |
void PointerMap::RecordPointer(InstructionOperand* op, Zone* zone) { |
// Do not record arguments as pointers. |
- if (op->IsStackSlot() && op->index() < 0) return; |
+ if (op->IsStackSlot() && StackSlotOperand::cast(op)->index() < 0) return; |
DCHECK(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); |
pointer_operands_.Add(op, zone); |
} |
@@ -181,7 +187,7 @@ void PointerMap::RecordPointer(InstructionOperand* op, Zone* zone) { |
void PointerMap::RemovePointer(InstructionOperand* op) { |
// Do not record arguments as pointers. |
- if (op->IsStackSlot() && op->index() < 0) return; |
+ if (op->IsStackSlot() && StackSlotOperand::cast(op)->index() < 0) return; |
DCHECK(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); |
for (int i = 0; i < pointer_operands_.length(); ++i) { |
if (pointer_operands_[i]->Equals(op)) { |
@@ -194,7 +200,7 @@ void PointerMap::RemovePointer(InstructionOperand* op) { |
void PointerMap::RecordUntagged(InstructionOperand* op, Zone* zone) { |
// Do not record arguments as pointers. |
- if (op->IsStackSlot() && op->index() < 0) return; |
+ if (op->IsStackSlot() && StackSlotOperand::cast(op)->index() < 0) return; |
DCHECK(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); |
untagged_operands_.Add(op, zone); |
} |
@@ -593,6 +599,16 @@ int InstructionSequence::GetFrameStateDescriptorCount() { |
} |
+RpoNumber InstructionSequence::InputRpo(Instruction* instr, size_t index) { |
+ InstructionOperand* operand = instr->InputAt(index); |
+ Constant constant = |
+ operand->IsImmediate() |
+ ? GetImmediate(ImmediateOperand::cast(operand)->index()) |
+ : GetConstant(ConstantOperand::cast(operand)->virtual_register()); |
+ return constant.ToRpoNumber(); |
+} |
+ |
+ |
FrameStateDescriptor::FrameStateDescriptor( |
Zone* zone, const FrameStateCallInfo& state_info, size_t parameters_count, |
size_t locals_count, size_t stack_count, FrameStateDescriptor* outer_state) |