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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1852433006: Revert "VM: Improve single-target polymorphic calls." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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.h ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index b9382a9e39086d1ab25160eac9d99cb45822449f..59cb8ab3e5827940d860dd5b0e9d4ed02c90e3be 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -133,7 +133,6 @@ CheckClassInstr::CheckClassInstr(Value* value,
unary_checks_(unary_checks),
cids_(unary_checks.NumberOfChecks()),
licm_hoisted_(false),
- is_dense_switch_(IsDenseCidRange(unary_checks)),
token_pos_(token_pos) {
ASSERT(unary_checks.IsZoneHandle());
// Expected useful check data.
@@ -232,22 +231,14 @@ bool CheckClassInstr::DeoptIfNotNull() const {
}
-bool CheckClassInstr::IsDenseCidRange(const ICData& unary_checks) {
- if (unary_checks.GetReceiverClassIdAt(0) == kSmiCid) return false;
- if (unary_checks.NumberOfChecks() <= 2) return false;
- intptr_t max = 0;
- intptr_t min = kIntptrMax;
- for (intptr_t i = 0; i < unary_checks.NumberOfChecks(); ++i) {
- intptr_t cid = unary_checks.GetCidAt(i);
- if (cid < min) min = cid;
- if (cid > max) max = cid;
- }
- return (max - min) < kBitsPerWord;
-}
-
bool CheckClassInstr::IsDenseSwitch() const {
- return is_dense_switch_;
+ if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) return false;
+ if (cids_.length() > 2 &&
+ cids_[cids_.length() - 1] - cids_[0] < kBitsPerWord) {
+ return true;
+ }
+ return false;
}
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/jit_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698