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

Unified Diff: runtime/vm/intermediate_language_arm.cc

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/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 14e341e54d3285843578e5f7cb48561bc1606fc0..4f9a98108a488f9fbba4cd1bd2e0ac17964a2ace 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -6403,7 +6403,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;
}
@@ -6411,8 +6412,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_.Extent()));
+ __ b(deopt, HI); // Unsigned higher.
+ }
}
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698