Chromium Code Reviews| Index: vm/intermediate_language.h |
| =================================================================== |
| --- vm/intermediate_language.h (revision 8786) |
| +++ vm/intermediate_language.h (working copy) |
| @@ -138,6 +138,7 @@ |
| virtual intptr_t InputCount() const = 0; |
| virtual Value* InputAt(intptr_t i) const = 0; |
| + virtual void SetInputAt(intptr_t i, Value* value) = 0; |
| // Static type of the computation. |
| virtual RawAbstractType* StaticType() const = 0; |
| @@ -284,6 +285,7 @@ |
| public: |
| virtual intptr_t InputCount() const { return N; } |
| virtual Value* InputAt(intptr_t i) const { return inputs_[i]; } |
| + virtual void SetInputAt(intptr_t i, Value* value) { inputs_[i] = value; } |
| protected: |
| EmbeddedArray<Value*, N> inputs_; |
| @@ -478,6 +480,9 @@ |
| virtual intptr_t InputCount() const; |
| virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); } |
| + virtual void SetInputAt(intptr_t i, Value* value) { |
| + (*arguments_)[i] = value; |
| + } |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| @@ -528,6 +533,9 @@ |
| virtual intptr_t InputCount() const; |
| virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); } |
| + virtual void SetInputAt(intptr_t i, Value* value) { |
| + (*arguments_)[i] = value; |
| + } |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| @@ -565,6 +573,9 @@ |
| virtual Value* InputAt(intptr_t i) const { |
| return instance_call()->ArgumentAt(i); |
| } |
| + virtual void SetInputAt(intptr_t index, Value* value) { |
| + instance_call()->SetInputAt(index, value); |
| + } |
| virtual void PrintOperandsTo(BufferFormatter* f) const { |
| instance_call()->PrintOperandsTo(f); |
| @@ -754,6 +765,9 @@ |
| virtual intptr_t InputCount() const; |
| virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); } |
| + virtual void SetInputAt(intptr_t i, Value* value) { |
| + (*arguments_)[i] = value; |
| + } |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| @@ -1185,6 +1199,9 @@ |
| virtual intptr_t InputCount() const; |
| virtual Value* InputAt(intptr_t i) const { return arguments()[i]; } |
| + virtual void SetInputAt(intptr_t i, Value* value) { |
| + (*arguments_)[i] = value; |
| + } |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| @@ -1215,6 +1232,9 @@ |
| virtual intptr_t InputCount() const; |
| virtual Value* InputAt(intptr_t i) const { return arguments()[i]; } |
| + virtual void SetInputAt(intptr_t i, Value* value) { |
| + (*arguments_)[i] = value; |
| + } |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| @@ -1254,6 +1274,7 @@ |
| virtual intptr_t InputCount() const; |
| virtual Value* InputAt(intptr_t i) const; |
| + virtual void SetInputAt(intptr_t i, Value* value); |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| @@ -1645,6 +1666,8 @@ |
| DECLARE_COMPUTATION(NumberNegate) |
| + void InsertPhi(intptr_t variable_index) { } |
|
srdjan
2012/06/18 18:04:38
Remove?
Florian Schneider
2012/06/19 11:26:40
Oops. Accidental edit.
|
| + |
| private: |
| InstanceCallComp* instance_call_; |
| @@ -1755,6 +1778,7 @@ |
| virtual type##Instr* As##type() { return this; } \ |
| virtual intptr_t InputCount() const; \ |
| virtual Value* InputAt(intptr_t i) const; \ |
| + virtual void SetInputAt(intptr_t i, Value* value); \ |
| virtual const char* DebugName() const { return #type; } \ |
| virtual void PrintTo(BufferFormatter* f) const; \ |
| virtual void PrintToVisualizer(BufferFormatter* f) const; |
| @@ -1783,6 +1807,7 @@ |
| virtual intptr_t InputCount() const = 0; |
| virtual Value* InputAt(intptr_t i) const = 0; |
| + virtual void SetInputAt(intptr_t i, Value* value) = 0; |
| // Visiting support. |
| virtual Instruction* Accept(FlowGraphVisitor* visitor) = 0; |
| @@ -1953,7 +1978,10 @@ |
| class GraphEntryInstr : public BlockEntryInstr { |
| public: |
| explicit GraphEntryInstr(TargetEntryInstr* normal_entry) |
| - : BlockEntryInstr(), normal_entry_(normal_entry), catch_entries_() { } |
| + : BlockEntryInstr(), |
| + normal_entry_(normal_entry), |
| + catch_entries_(), |
| + start_env_(NULL) { } |
| DECLARE_INSTRUCTION(GraphEntry) |
| @@ -1982,9 +2010,13 @@ |
| virtual void PrepareEntry(FlowGraphCompiler* compiler); |
| + ZoneGrowableArray<Value*>* start_env() const { return start_env_; } |
| + void set_start_env(ZoneGrowableArray<Value*>* env) { start_env_ = env; } |
| + |
| private: |
| TargetEntryInstr* normal_entry_; |
| GrowableArray<TargetEntryInstr*> catch_entries_; |
| + ZoneGrowableArray<Value*>* start_env_; |
| DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); |
| }; |
| @@ -2013,7 +2045,6 @@ |
| return successor_; |
| } |
| virtual void SetSuccessor(Instruction* instr) { |
| - ASSERT(successor_ == NULL); |
| successor_ = instr; |
| } |
| @@ -2068,7 +2099,6 @@ |
| return successor_; |
| } |
| virtual void SetSuccessor(Instruction* instr) { |
| - ASSERT(successor_ == NULL); |
| successor_ = instr; |
| } |
| @@ -2110,7 +2140,6 @@ |
| } |
| virtual void SetSuccessor(Instruction* instr) { |
| - ASSERT(successor_ == NULL); |
| successor_ = instr; |
| } |
| @@ -2135,7 +2164,7 @@ |
| // Abstract super-class of all instructions that define a value (Bind, Phi). |
| class Definition : public Instruction { |
| public: |
| - Definition() : temp_index_(-1) { } |
| + Definition() : temp_index_(-1), ssa_temp_index_(-1) { } |
| virtual bool IsDefinition() const { return true; } |
| virtual Definition* AsDefinition() { return this; } |
| @@ -2143,8 +2172,12 @@ |
| intptr_t temp_index() const { return temp_index_; } |
| void set_temp_index(intptr_t index) { temp_index_ = index; } |
| + intptr_t ssa_temp_index() const { return ssa_temp_index_; } |
| + void set_ssa_temp_index(intptr_t index) { ssa_temp_index_ = index; } |
| + |
| private: |
| intptr_t temp_index_; |
| + intptr_t ssa_temp_index_; |
| DISALLOW_COPY_AND_ASSIGN(Definition); |
| }; |
| @@ -2168,7 +2201,6 @@ |
| } |
| virtual void SetSuccessor(Instruction* instr) { |
| - ASSERT(successor_ == NULL); |
| successor_ = instr; |
| } |
| @@ -2203,10 +2235,6 @@ |
| DECLARE_INSTRUCTION(Phi) |
| - void SetInputAt(intptr_t i, Value* value) { |
| - inputs_[i] = value; |
| - } |
| - |
| virtual Instruction* StraightLineSuccessor() const { return NULL; } |
| virtual void SetSuccessor(Instruction* instr) { UNREACHABLE(); } |
| @@ -2217,8 +2245,6 @@ |
| }; |
| - |
| - |
| class ReturnInstr : public InstructionWithInputs { |
| public: |
| ReturnInstr(intptr_t token_index, Value* value) |