| Index: vm/intermediate_language.h
|
| ===================================================================
|
| --- vm/intermediate_language.h (revision 10497)
|
| +++ vm/intermediate_language.h (working copy)
|
| @@ -112,6 +112,7 @@
|
| class BranchInstr;
|
| class BufferFormatter;
|
| class ComparisonComp;
|
| +class Definition;
|
| class Instruction;
|
| class PushArgumentInstr;
|
| class Value;
|
| @@ -147,6 +148,10 @@
|
| // Returns true, if this computation can deoptimize.
|
| virtual bool CanDeoptimize() const = 0;
|
|
|
| + // Optimize this computation. Returns a replacement for the instruction
|
| + // that wraps this computation or NULL if nothing to replace.
|
| + virtual Definition* TryReplace(BindInstr* instr) { return NULL; }
|
| +
|
| // Compile time type of the computation, which typically depends on the
|
| // compile time types (and possibly propagated types) of its inputs.
|
| virtual RawAbstractType* CompileType() const = 0;
|
| @@ -354,6 +359,8 @@
|
| UseVal* next_use_;
|
| UseVal* previous_use_;
|
|
|
| + friend class Definition;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(UseVal);
|
| };
|
|
|
| @@ -646,6 +653,8 @@
|
|
|
| virtual bool CanDeoptimize() const { return false; }
|
|
|
| + virtual Definition* TryReplace(BindInstr* instr);
|
| +
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(StrictCompareComp);
|
| };
|
| @@ -2374,6 +2383,8 @@
|
| use_list_ = head;
|
| }
|
|
|
| + void ReplaceUsesWith(Definition* other);
|
| +
|
| private:
|
| intptr_t temp_index_;
|
| intptr_t ssa_temp_index_;
|
|
|