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

Unified Diff: runtime/vm/intermediate_language_dbc.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_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7c7e1195c541a528a1a74113bf87619107b45530 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;
}
@@ -266,12 +266,10 @@ EMIT_NATIVE_CODE(PolymorphicInstanceCall,
}
for (intptr_t i = 0; i < length; i++) {
const Function& target = *targets_.TargetAt(i)->target;
- intptr_t cid_start = targets_[i].cid_start;
- intptr_t cid_end = targets_[i].cid_end;
- __ Nop(compiler->ToEmbeddableCid(cid_start, this));
+ __ Nop(compiler->ToEmbeddableCid(targets_[i].cid_start, this));
if (using_ranges) {
- __ Nop(compiler->ToEmbeddableCid(1 + cid_end - cid_start, this));
+ __ Nop(compiler->ToEmbeddableCid(1 + targets_[i].Extent(), this));
}
__ Nop(__ AddConstant(target));
}
@@ -1490,7 +1488,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));
+ __ Nop(__ AddConstant(Smi::Handle(Smi::New(cids_.Extent()))));
+ }
compiler->EmitDeopt(deopt_id(), ICData::kDeoptCheckClass);
}
@@ -1523,7 +1528,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.
@@ -1550,7 +1555,7 @@ EMIT_NATIVE_CODE(CheckClass, 1) {
}
__ Nop(compiler->ToEmbeddableCid(cid_start, this));
if (using_ranges) {
- __ Nop(compiler->ToEmbeddableCid(1 + cid_end - cid_start, this));
+ __ Nop(compiler->ToEmbeddableCid(1 + cids_[i].Extent(), this));
}
}
}
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698