Chromium Code Reviews| Index: runtime/vm/intermediate_language.h |
| diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h |
| index ff3822cf9754846491807a5a7f95e99c5ca8b044..ed129ff7b4ef798cade26299768a0e49e8e28b7b 100644 |
| --- a/runtime/vm/intermediate_language.h |
| +++ b/runtime/vm/intermediate_language.h |
| @@ -557,6 +557,10 @@ struct CidRange : public ZoneAllocated { |
| : ZoneAllocated(), cid_start(o.cid_start), cid_end(o.cid_end) {} |
| CidRange(intptr_t cid_start_arg, intptr_t cid_end_arg) |
| : cid_start(cid_start_arg), cid_end(cid_end_arg) {} |
| + |
| + bool IsSingleCid() const { return cid_start == cid_end; } |
| + bool Contains(intptr_t cid) { return cid_start <= cid && cid <= cid_end; } |
| + |
| intptr_t cid_start; |
| intptr_t cid_end; |
|
kustermann
2017/05/18 09:59:45
Maybe consider removing the "cid_" prefixes, it's
erikcorry
2017/05/18 14:25:30
I took a look at this, and the word "CidRange" is
|
| }; |
| @@ -7728,13 +7732,13 @@ class CheckSmiInstr : public TemplateInstruction<1, NoThrow, Pure> { |
| class CheckClassIdInstr : public TemplateInstruction<1, NoThrow> { |
| public: |
| - CheckClassIdInstr(Value* value, intptr_t cid, intptr_t deopt_id) |
| - : TemplateInstruction(deopt_id), cid_(cid) { |
| + CheckClassIdInstr(Value* value, CidRange cids, intptr_t deopt_id) |
| + : TemplateInstruction(deopt_id), cids_(cids) { |
| SetInputAt(0, value); |
| } |
| Value* value() const { return inputs_[0]; } |
| - intptr_t cid() const { return cid_; } |
| + const CidRange& cids() const { return cids_; } |
| DECLARE_INSTRUCTION(CheckClassId) |
| @@ -7750,7 +7754,9 @@ class CheckClassIdInstr : public TemplateInstruction<1, NoThrow> { |
| PRINT_OPERANDS_TO_SUPPORT |
| private: |
| - intptr_t cid_; |
| + bool Contains(intptr_t cid) const; |
| + |
| + CidRange cids_; |
| DISALLOW_COPY_AND_ASSIGN(CheckClassIdInstr); |
| }; |