Index: runtime/vm/intermediate_language_x64.cc |
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc |
index 930ace149f1a5932f7b5b079eedd06f45c075df2..a8a7fce89debfa13798a3d916caaa2da8e53bf07 100644 |
--- a/runtime/vm/intermediate_language_x64.cc |
+++ b/runtime/vm/intermediate_language_x64.cc |
@@ -5908,7 +5908,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; |
} |
@@ -5916,8 +5917,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, Immediate(Smi::RawValue(cid_))); |
- __ j(NOT_ZERO, deopt); |
+ if (cids_.IsSingleCid()) { |
+ __ CompareImmediate(value, Immediate(Smi::RawValue(cids_.cid_start))); |
+ __ j(NOT_ZERO, deopt); |
+ } else { |
+ __ AddImmediate(value, Immediate(-Smi::RawValue(cids_.cid_start))); |
+ __ cmpq(value, Immediate(Smi::RawValue(cids_.Extent()))); |
+ __ j(ABOVE, deopt); |
+ } |
} |