| Index: src/compiler/instruction.h
|
| diff --git a/src/compiler/instruction.h b/src/compiler/instruction.h
|
| index 1740dfbf25b970054417d75c533ba95e8ea65366..8e2192fb86b1f06761296be612946f5feb762798 100644
|
| --- a/src/compiler/instruction.h
|
| +++ b/src/compiler/instruction.h
|
| @@ -441,6 +441,10 @@ class Instruction : public ZoneObject {
|
| DCHECK(i < InputCount());
|
| return operands_[OutputCount() + i];
|
| }
|
| + void SetInputAt(size_t i, InstructionOperand* operand) {
|
| + DCHECK(i < InputCount());
|
| + operands_[OutputCount() + i] = operand;
|
| + }
|
|
|
| size_t TempCount() const { return TempCountField::decode(bit_field_); }
|
| InstructionOperand* TempAt(size_t i) const {
|
| @@ -520,6 +524,12 @@ class Instruction : public ZoneObject {
|
|
|
| void operator delete(void* pointer, void* location) { UNREACHABLE(); }
|
|
|
| + void OverwriteWithNop() {
|
| + opcode_ = ArchOpcodeField::encode(kArchNop);
|
| + bit_field_ = 0;
|
| + pointer_map_ = NULL;
|
| + }
|
| +
|
| protected:
|
| explicit Instruction(InstructionCode opcode)
|
| : opcode_(opcode),
|
| @@ -599,6 +609,8 @@ class GapInstruction : public Instruction {
|
| return parallel_moves_[pos];
|
| }
|
|
|
| + bool IsRedundant() const;
|
| +
|
| static GapInstruction* New(Zone* zone) {
|
| void* buffer = zone->New(sizeof(GapInstruction));
|
| return new (buffer) GapInstruction(kGapInstruction);
|
| @@ -885,12 +897,16 @@ class InstructionBlock FINAL : public ZoneObject {
|
| const PhiInstructions& phis() const { return phis_; }
|
| void AddPhi(PhiInstruction* phi) { phis_.push_back(phi); }
|
|
|
| + void set_ao_number(BasicBlock::RpoNumber ao_number) {
|
| + ao_number_ = ao_number;
|
| + }
|
| +
|
| private:
|
| Successors successors_;
|
| Predecessors predecessors_;
|
| PhiInstructions phis_;
|
| const BasicBlock::Id id_;
|
| - const BasicBlock::RpoNumber ao_number_; // Assembly order number.
|
| + BasicBlock::RpoNumber ao_number_; // Assembly order number.
|
| // TODO(dcarney): probably dont't need this.
|
| const BasicBlock::RpoNumber rpo_number_;
|
| const BasicBlock::RpoNumber loop_header_;
|
| @@ -1024,6 +1040,15 @@ class InstructionSequence FINAL : public ZoneObject {
|
| FrameStateDescriptor* GetFrameStateDescriptor(StateId deoptimization_id);
|
| int GetFrameStateDescriptorCount();
|
|
|
| + BasicBlock::RpoNumber InputRpo(Instruction* instr, int index) {
|
| + InstructionOperand* operand = instr->InputAt(index);
|
| + Constant constant = operand->IsImmediate() ? GetImmediate(operand->index())
|
| + : GetConstant(operand->index());
|
| + int rpo = constant.ToInt32();
|
| + DCHECK(rpo >= 0 && rpo < static_cast<int>(instruction_blocks_->size()));
|
| + return BasicBlock::RpoNumber::FromInt(rpo);
|
| + }
|
| +
|
| private:
|
| friend std::ostream& operator<<(std::ostream& os,
|
| const PrintableInstructionSequence& code);
|
|
|