| Index: runtime/vm/intermediate_language.h
|
| ===================================================================
|
| --- runtime/vm/intermediate_language.h (revision 38118)
|
| +++ runtime/vm/intermediate_language.h (working copy)
|
| @@ -724,6 +724,7 @@
|
| M(DoubleToFloat) \
|
| M(FloatToDouble) \
|
| M(CheckClass) \
|
| + M(CheckClassId) \
|
| M(CheckSmi) \
|
| M(Constant) \
|
| M(UnboxedConstant) \
|
| @@ -1104,6 +1105,7 @@
|
| friend class MathUnaryInstr;
|
| friend class MathMinMaxInstr;
|
| friend class CheckClassInstr;
|
| + friend class CheckClassIdInstr;
|
| friend class GuardFieldInstr;
|
| friend class CheckSmiInstr;
|
| friend class CheckArrayBoundInstr;
|
| @@ -7893,12 +7895,18 @@
|
|
|
| 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;
|
| + intptr_t ComputeCidMask() const;
|
| + static bool IsDenseMask(intptr_t mask);
|
| +
|
| virtual bool AllowsCSE() const { return true; }
|
| virtual EffectSet Effects() const { return EffectSet::None(); }
|
| virtual EffectSet Dependencies() const;
|
| @@ -7910,6 +7918,7 @@
|
|
|
| private:
|
| const ICData& unary_checks_;
|
| + GrowableArray<intptr_t> cids_; // Sorted, lowest first.
|
| bool licm_hoisted_;
|
| const intptr_t token_pos_;
|
|
|
| @@ -7951,6 +7960,39 @@
|
| };
|
|
|
|
|
| +class CheckClassIdInstr : public TemplateInstruction<1> {
|
| + public:
|
| + CheckClassIdInstr(Value* value, intptr_t cid, intptr_t deopt_id) : cid_(cid) {
|
| + SetInputAt(0, value);
|
| + // Override generated deopt-id.
|
| + deopt_id_ = deopt_id;
|
| + }
|
| +
|
| + Value* value() const { return inputs_[0]; }
|
| + intptr_t cid() const { return cid_; }
|
| +
|
| + DECLARE_INSTRUCTION(CheckClassId)
|
| +
|
| + virtual intptr_t ArgumentCount() const { return 0; }
|
| +
|
| + virtual bool CanDeoptimize() const { return true; }
|
| +
|
| + virtual Instruction* Canonicalize(FlowGraph* flow_graph);
|
| +
|
| + virtual bool AllowsCSE() const { return true; }
|
| + virtual EffectSet Effects() const { return EffectSet::None(); }
|
| + virtual EffectSet Dependencies() const;
|
| + virtual bool AttributesEqual(Instruction* other) const { return true; }
|
| +
|
| + virtual bool MayThrow() const { return false; }
|
| +
|
| + private:
|
| + intptr_t cid_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(CheckClassIdInstr);
|
| +};
|
| +
|
| +
|
| class CheckArrayBoundInstr : public TemplateInstruction<2> {
|
| public:
|
| CheckArrayBoundInstr(Value* length, Value* index, intptr_t deopt_id) {
|
|
|