Chromium Code Reviews| Index: runtime/vm/jit_optimizer.cc |
| diff --git a/runtime/vm/jit_optimizer.cc b/runtime/vm/jit_optimizer.cc |
| index 9e71b2728a12de19a082ce4d0ae07d76ab7f6825..b98e23d0382336068af685a6bb8c67edddcf9aaf 100644 |
| --- a/runtime/vm/jit_optimizer.cc |
| +++ b/runtime/vm/jit_optimizer.cc |
| @@ -1549,17 +1549,6 @@ 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; |
| } |
| @@ -1629,7 +1618,11 @@ void JitOptimizer::VisitInstanceCall(InstanceCallInstr* instr) { |
| } |
| bool call_with_checks; |
| - if (has_one_target && FLAG_polymorphic_with_deopt) { |
| + const int max_cids = (op_kind == Token::kEQ) |
|
Vyacheslav Egorov (Google)
2017/04/19 08:24:00
It might be good to put the reasoning here to info
erikcorry
2017/04/19 13:15:41
Done.
|
| + ? FLAG_max_equality_polymorphic_checks |
| + : FLAG_max_polymorphic_checks; |
| + if (has_one_target && FLAG_polymorphic_with_deopt && |
| + unary_checks.NumberOfChecks() <= max_cids) { |
| // Type propagation has not run yet, we cannot eliminate the check. |
| AddReceiverCheck(instr); |
| // Call can still deoptimize, do not detach environment from instr. |