Index: runtime/vm/intermediate_language_dbc.cc |
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc |
index 04dd1905c3b3188124993a2d46e095e4e6bc12fe..d7340743e04dd9c279400945f3bfc82549c336d4 100644 |
--- a/runtime/vm/intermediate_language_dbc.cc |
+++ b/runtime/vm/intermediate_language_dbc.cc |
@@ -252,7 +252,7 @@ EMIT_NATIVE_CODE(PolymorphicInstanceCall, |
} |
bool using_ranges = false; |
for (intptr_t i = 0; i < length; i++) { |
- if (targets_[i].cid_start != targets_[i].cid_end) { |
+ if (!targets_[i].IsSingleCid()) { |
using_ranges = true; |
break; |
} |
@@ -1490,7 +1490,14 @@ EMIT_NATIVE_CODE(CheckEitherNonSmi, 2) { |
EMIT_NATIVE_CODE(CheckClassId, 1) { |
- __ CheckClassId(locs()->in(0).reg(), compiler->ToEmbeddableCid(cid_, this)); |
+ if (cids_.IsSingleCid()) { |
+ __ CheckClassId(locs()->in(0).reg(), |
+ compiler->ToEmbeddableCid(cids_.cid_start, this)); |
+ } else { |
+ __ CheckClassIdRange(locs()->in(0).reg(), |
+ compiler->ToEmbeddableCid(cids_.cid_start, this), |
+ compiler->ToEmbeddableCid(cids_.cid_end, this)); |
kustermann
2017/05/18 09:59:45
Please ASSERT that the range is within [0, 255] he
erikcorry
2017/05/18 14:25:30
Nice catch, this was wrong, fixed with a double DB
|
+ } |
compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckClass); |
} |
@@ -1523,7 +1530,7 @@ EMIT_NATIVE_CODE(CheckClass, 1) { |
int smi_adjustment = 0; |
int length = cids_.length(); |
for (intptr_t i = 0; i < length; i++) { |
- if (cids_[i].cid_start != cids_[i].cid_end) { |
+ if (!cids_[i].IsSingleCid()) { |
using_ranges = true; |
} else if (cids_[i].cid_start == kSmiCid) { |
ASSERT(cids_[i].cid_end == kSmiCid); // We are in the else clause. |