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

Unified Diff: src/compiler/instruction.cc

Issue 1050803002: [turbofan] cleanup InstructionOperand a little (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 8 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/compiler/instruction.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698