Chromium Code Reviews| Index: runtime/vm/aot_optimizer.cc |
| diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc |
| index 31897ebdd07c4b9b21ee6078db9a2dc75e44f63d..684c64a7f3a54e8d84ea066f1a8837dd6bd45402 100644 |
| --- a/runtime/vm/aot_optimizer.cc |
| +++ b/runtime/vm/aot_optimizer.cc |
| @@ -1354,6 +1354,16 @@ void AotOptimizer::ReplaceWithInstanceOf(InstanceCallInstr* call) { |
| InsertBefore(call, left_cid, NULL, FlowGraph::kValue); |
| ConstantInstr* lower_cid = |
| flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(lower_limit))); |
| + |
| + if (lower_limit == upper_limit) { |
|
Vyacheslav Egorov (Google)
2017/08/25 07:59:15
Does it make sense to do a similar optimization fo
alexmarkov
2017/08/29 22:45:32
I think you're right - 'as' and 'is' checks should
|
| + StrictCompareInstr* check_cid = new (Z) StrictCompareInstr( |
| + call->token_pos(), Token::kEQ_STRICT, new (Z) Value(left_cid), |
| + new (Z) Value(lower_cid), /* number_check = */ false, |
| + Thread::kNoDeoptId); |
| + ReplaceCall(call, check_cid); |
| + return; |
| + } |
| + |
| ConstantInstr* upper_cid = |
| flow_graph()->GetConstant(Smi::Handle(Z, Smi::New(upper_limit))); |