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

Unified Diff: src/compiler/instruction.cc

Issue 910753002: [turbofan] remove one level of indirection in phi inputs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/instruction-selector.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 23f33ac740e1d2db6d422c90fd3e5ee5c87c60e8..ebd8125848eb16d1a897e5f9df0d7bd61b1b5dc0 100644
--- a/src/compiler/instruction.cc
+++ b/src/compiler/instruction.cc
@@ -337,6 +337,22 @@ std::ostream& operator<<(std::ostream& os, const Constant& constant) {
}
+PhiInstruction::PhiInstruction(Zone* zone, int virtual_register,
+ size_t input_count)
+ : virtual_register_(virtual_register),
+ output_(UnallocatedOperand(UnallocatedOperand::NONE, virtual_register)),
+ operands_(input_count, zone),
+ inputs_(input_count, zone) {}
+
+
+void PhiInstruction::SetInput(size_t offset, int virtual_register) {
+ DCHECK(inputs_[offset].IsInvalid());
+ auto input = UnallocatedOperand(UnallocatedOperand::ANY, virtual_register);
+ inputs_[offset] = input;
+ operands_[offset] = virtual_register;
+}
+
+
InstructionBlock::InstructionBlock(Zone* zone, BasicBlock::Id id,
BasicBlock::RpoNumber rpo_number,
BasicBlock::RpoNumber loop_header,
@@ -666,10 +682,10 @@ std::ostream& operator<<(std::ostream& os,
for (auto phi : block->phis()) {
PrintableInstructionOperand printable_op = {
- printable.register_configuration_, phi->output()};
+ printable.register_configuration_, &phi->output()};
os << " phi: " << printable_op << " =";
for (auto input : phi->inputs()) {
- printable_op.op_ = input;
+ printable_op.op_ = &input;
os << " " << printable_op;
}
os << "\n";
« no previous file with comments | « src/compiler/instruction.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698