Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: runtime/vm/intermediate_language.h

Issue 2891713002: Cleanup: Make CheckClassId instruction more general so it (Closed)
Patch Set: Feedback from Martin Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index ff3822cf9754846491807a5a7f95e99c5ca8b044..92f5b0a7a36819a2257b89230aac74c0ace2f1ba 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -557,6 +557,11 @@ 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; }
+ int32_t Extent() const { return cid_end - cid_start; }
+
intptr_t cid_start;
intptr_t cid_end;
};
@@ -7728,13 +7733,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 +7755,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);
};
« no previous file with comments | « runtime/vm/il_printer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698