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

Unified Diff: src/compiler/instruction.h

Issue 738853002: [turbofan]: delay ssa deconstruction in register allocator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 6 years, 1 month 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 d6245d51dc2bfdbc4a6005c70ce094890f806897..1740dfbf25b970054417d75c533ba95e8ea65366 100644
--- a/src/compiler/instruction.h
+++ b/src/compiler/instruction.h
@@ -787,19 +787,45 @@ class FrameStateDescriptor : public ZoneObject {
std::ostream& operator<<(std::ostream& os, const Constant& constant);
-// TODO(dcarney): this is a temporary hack. turn into an actual instruction.
class PhiInstruction FINAL : public ZoneObject {
public:
- PhiInstruction(Zone* zone, int virtual_register)
- : virtual_register_(virtual_register), operands_(zone) {}
+ 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);
+ output->set_virtual_register(virtual_register);
+ output_ = output;
+ inputs_.reserve(reserved_input_count);
+ operands_.reserve(reserved_input_count);
+ }
int virtual_register() const { return virtual_register_; }
const IntVector& operands() const { return operands_; }
- IntVector& operands() { return operands_; }
+
+ void Extend(Zone* zone, int virtual_register) {
+ UnallocatedOperand* input =
+ new (zone) UnallocatedOperand(UnallocatedOperand::ANY);
+ input->set_virtual_register(virtual_register);
+ operands_.push_back(virtual_register);
+ inputs_.push_back(input);
+ }
+
+ InstructionOperand* output() const { return output_; }
+ const Inputs& inputs() const { return inputs_; }
+ Inputs& inputs() { return inputs_; }
private:
+ // TODO(dcarney): some of these fields are only for verification, move them to
+ // verifier.
const int virtual_register_;
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