Index: runtime/vm/intermediate_language_arm64.cc |
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc |
index 5c5b274c139ff753038701f99c2aebe58a99b04c..1fed7d8065230af2f5c70740865a0316ca1d3399 100644 |
--- a/runtime/vm/intermediate_language_arm64.cc |
+++ b/runtime/vm/intermediate_language_arm64.cc |
@@ -5559,7 +5559,8 @@ LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, |
const intptr_t kNumTemps = 0; |
LocationSummary* summary = new (zone) |
LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
- summary->set_in(0, Location::RequiresRegister()); |
+ summary->set_in(0, cids_.IsSingleCid() ? Location::RequiresRegister() |
+ : Location::WritableRegister()); |
return summary; |
} |
@@ -5567,8 +5568,14 @@ LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, |
void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
Register value = locs()->in(0).reg(); |
Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); |
- __ CompareImmediate(value, Smi::RawValue(cid_)); |
- __ b(deopt, NE); |
+ if (cids_.IsSingleCid()) { |
+ __ CompareImmediate(value, Smi::RawValue(cids_.cid_start)); |
+ __ b(deopt, NE); |
+ } else { |
+ __ AddImmediate(value, -Smi::RawValue(cids_.cid_start)); |
+ __ CompareImmediate(value, Smi::RawValue(cids_.cid_end - cids_.cid_start)); |
+ __ b(deopt, HI); // Unsigned higher. |
+ } |
} |