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

Unified Diff: runtime/vm/jit_optimizer.cc

Issue 2798333004: Temporary fix to ameliorate severe dart2js regression on some workloads (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/jit_optimizer.cc
diff --git a/runtime/vm/jit_optimizer.cc b/runtime/vm/jit_optimizer.cc
index f85d9c46fb3b212ad580ed0ee36a5428469b0e57..c510ff2b50794a66dfcf72f7f00df8be32debb6b 100644
--- a/runtime/vm/jit_optimizer.cc
+++ b/runtime/vm/jit_optimizer.cc
@@ -1543,6 +1543,17 @@ void JitOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
const ICData& unary_checks =
ICData::ZoneHandle(Z, instr->ic_data()->AsUnaryClassChecks());
+ const bool is_dense = CheckClassInstr::IsDenseCidRange(unary_checks);
+ const intptr_t number_of_checks = unary_checks.NumberOfChecks();
+ if (op_kind == Token::kEQ &&
+ number_of_checks > FLAG_max_equality_polymorphic_checks && !is_dense &&
+ flow_graph()->InstanceCallNeedsClassCheck(
+ instr, RawFunction::kRegularFunction)) {
+ // Too many checks, it will be megamorphic which needs unary checks.
+ instr->set_ic_data(&unary_checks);
+ return;
+ }
+
if ((op_kind == Token::kASSIGN_INDEX) && TryReplaceWithIndexedOp(instr)) {
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698