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

Unified Diff: src/compiler/instruction.h

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 | « no previous file | 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 b5299b3b9b20a914ed0e658e84024730c85aa669..6ad2548b8e7a8e351b6fd1c5c1498731b090f084 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -787,31 +787,17 @@ std::ostream& operator<<(std::ostream& os, const Constant& constant);
class PhiInstruction FINAL : public ZoneObject {
public:
- typedef ZoneVector<InstructionOperand*> Inputs;
+ typedef ZoneVector<InstructionOperand> Inputs;
- PhiInstruction(Zone* zone, int virtual_register, size_t reserved_input_count)
- : virtual_register_(virtual_register),
- operands_(zone),
- output_(nullptr),
- inputs_(zone) {
- UnallocatedOperand* output = new (zone)
- UnallocatedOperand(UnallocatedOperand::NONE, virtual_register);
- output_ = output;
- inputs_.reserve(reserved_input_count);
- operands_.reserve(reserved_input_count);
- }
+ PhiInstruction(Zone* zone, int virtual_register, size_t input_count);
+
+ void SetInput(size_t offset, int virtual_register);
int virtual_register() const { return virtual_register_; }
const IntVector& operands() const { return operands_; }
- void Extend(Zone* zone, int virtual_register) {
- UnallocatedOperand* input = new (zone)
- UnallocatedOperand(UnallocatedOperand::ANY, virtual_register);
- operands_.push_back(virtual_register);
- inputs_.push_back(input);
- }
-
- InstructionOperand* output() const { return output_; }
+ const InstructionOperand& output() const { return output_; }
+ InstructionOperand& output() { return output_; }
const Inputs& inputs() const { return inputs_; }
Inputs& inputs() { return inputs_; }
@@ -819,8 +805,8 @@ class PhiInstruction FINAL : public ZoneObject {
// TODO(dcarney): some of these fields are only for verification, move them to
// verifier.
const int virtual_register_;
+ InstructionOperand output_;
IntVector operands_;
- InstructionOperand* output_;
Inputs inputs_;
};
« no previous file with comments | « no previous file | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698