Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| =================================================================== |
| --- runtime/vm/intermediate_language.h (revision 33059) |
| +++ runtime/vm/intermediate_language.h (working copy) |
| @@ -665,6 +665,7 @@ |
| M(DoubleToFloat) \ |
| M(FloatToDouble) \ |
| M(CheckClass) \ |
| + M(CheckClassId) \ |
| M(CheckSmi) \ |
| M(Constant) \ |
| M(CheckEitherNonSmi) \ |
| @@ -1015,6 +1016,7 @@ |
| friend class MathUnaryInstr; |
| friend class MathMinMaxInstr; |
| friend class CheckClassInstr; |
| + friend class CheckClassIdInstr; |
| friend class GuardFieldInstr; |
| friend class CheckSmiInstr; |
| friend class CheckArrayBoundInstr; |
| @@ -6882,12 +6884,16 @@ |
| const ICData& unary_checks() const { return unary_checks_; } |
| + const GrowableArray<intptr_t>& cids() const { return cids_; } |
| + |
| virtual Instruction* Canonicalize(FlowGraph* flow_graph); |
| virtual void PrintOperandsTo(BufferFormatter* f) const; |
| bool IsNullCheck() const; |
| + bool IsDenseSwitch() const; |
| + |
| virtual bool AllowsCSE() const { return true; } |
| virtual EffectSet Effects() const { return EffectSet::None(); } |
| virtual EffectSet Dependencies() const; |
| @@ -6899,6 +6905,7 @@ |
| private: |
| const ICData& unary_checks_; |
| + GrowableArray<intptr_t> cids_; |
|
srdjan
2014/03/03 18:23:49
Please add comment that the cids_ are sorted, lowe
Florian Schneider
2014/05/05 15:01:47
Done.
|
| bool licm_hoisted_; |
| DISALLOW_COPY_AND_ASSIGN(CheckClassInstr); |
| @@ -6935,6 +6942,36 @@ |
| }; |
| +class CheckClassIdInstr : public TemplateInstruction<2> { |
| + public: |
| + CheckClassIdInstr(Value* left, Value* right, intptr_t deopt_id) { |
| + SetInputAt(0, left); |
| + SetInputAt(1, right); |
| + // Override generated deopt-id. |
| + deopt_id_ = deopt_id; |
| + } |
| + |
| + Value* left() const { return inputs_[0]; } |
| + Value* right() const { return inputs_[1]; } |
| + |
| + DECLARE_INSTRUCTION(CheckClassId) |
| + |
| + virtual intptr_t ArgumentCount() const { return 0; } |
| + |
| + virtual bool CanDeoptimize() const { return true; } |
| + |
| + virtual bool AllowsCSE() const { return true; } |
| + virtual EffectSet Effects() const { return EffectSet::None(); } |
| + virtual EffectSet Dependencies() const { return EffectSet::None(); } |
| + virtual bool AttributesEqual(Instruction* other) const { return true; } |
| + |
| + virtual bool MayThrow() const { return false; } |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(CheckClassIdInstr); |
| +}; |
| + |
| + |
| class CheckArrayBoundInstr : public TemplateInstruction<2> { |
| public: |
| CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) { |