| Index: runtime/vm/jit_optimizer.cc
|
| diff --git a/runtime/vm/jit_optimizer.cc b/runtime/vm/jit_optimizer.cc
|
| index 842506320317addf7af94b5e340d089a13636fba..91c5e476e8ed5c3880c19bc77f7f1d918a2d1eec 100644
|
| --- a/runtime/vm/jit_optimizer.cc
|
| +++ b/runtime/vm/jit_optimizer.cc
|
| @@ -1259,21 +1259,6 @@ void JitOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) {
|
| function_type_args = call->ArgumentAt(2);
|
| type = AbstractType::Cast(call->ArgumentAt(3)->AsConstant()->value()).raw();
|
| }
|
| -
|
| - if (TypeCheckAsClassEquality(type)) {
|
| - LoadClassIdInstr* left_cid = new (Z) LoadClassIdInstr(new (Z) Value(left));
|
| - InsertBefore(call, left_cid, NULL, FlowGraph::kValue);
|
| - const intptr_t type_cid = Class::Handle(Z, type.type_class()).id();
|
| - ConstantInstr* cid =
|
| - flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(type_cid)));
|
| -
|
| - StrictCompareInstr* check_cid = new (Z) StrictCompareInstr(
|
| - call->token_pos(), Token::kEQ_STRICT, new (Z) Value(left_cid),
|
| - new (Z) Value(cid), /* number_check = */ false, Thread::kNoDeoptId);
|
| - ReplaceCall(call, check_cid);
|
| - return;
|
| - }
|
| -
|
| const ICData& unary_checks =
|
| ICData::ZoneHandle(Z, call->ic_data()->AsUnaryClassChecks());
|
| const intptr_t number_of_checks = unary_checks.NumberOfChecks();
|
| @@ -1311,6 +1296,20 @@ void JitOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) {
|
| }
|
| }
|
|
|
| + if (TypeCheckAsClassEquality(type)) {
|
| + LoadClassIdInstr* left_cid = new (Z) LoadClassIdInstr(new (Z) Value(left));
|
| + InsertBefore(call, left_cid, NULL, FlowGraph::kValue);
|
| + const intptr_t type_cid = Class::Handle(Z, type.type_class()).id();
|
| + ConstantInstr* cid =
|
| + flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(type_cid)));
|
| +
|
| + StrictCompareInstr* check_cid = new (Z) StrictCompareInstr(
|
| + call->token_pos(), Token::kEQ_STRICT, new (Z) Value(left_cid),
|
| + new (Z) Value(cid), /* number_check = */ false, Thread::kNoDeoptId);
|
| + ReplaceCall(call, check_cid);
|
| + return;
|
| + }
|
| +
|
| InstanceOfInstr* instance_of = new (Z) InstanceOfInstr(
|
| call->token_pos(), new (Z) Value(left),
|
| new (Z) Value(instantiator_type_args), new (Z) Value(function_type_args),
|
|
|