| Index: runtime/vm/aot_optimizer.cc
|
| diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
|
| index 1ff277f486325b70647c3f4524f874442f104834..944a9b43b8c2971ddaa3f2f1eeaf537a254ada5d 100644
|
| --- a/runtime/vm/aot_optimizer.cc
|
| +++ b/runtime/vm/aot_optimizer.cc
|
| @@ -1833,11 +1833,23 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
|
|
|
| Definition* callee_receiver = instr->ArgumentAt(0);
|
| const Function& function = flow_graph_->function();
|
| + Class& receiver_class = Class::Handle(Z);
|
| +
|
| if (function.IsDynamicFunction() &&
|
| flow_graph_->IsReceiver(callee_receiver)) {
|
| // Call receiver is method receiver.
|
| - Class& receiver_class = Class::Handle(Z, function.Owner());
|
| -
|
| + receiver_class = function.Owner();
|
| + } else {
|
| + CompileType* type = instr->ArgumentAt(0)->Type();
|
| + if (type->ToAbstractType()->IsType() &&
|
| + !type->ToAbstractType()->IsDynamicType() && !type->is_nullable()) {
|
| + receiver_class = type->ToAbstractType()->type_class();
|
| + if (receiver_class.is_implemented()) {
|
| + receiver_class = Class::null();
|
| + }
|
| + }
|
| + }
|
| + if (!receiver_class.IsNull()) {
|
| GrowableArray<intptr_t> class_ids(6);
|
| if (thread()->cha()->ConcreteSubclasses(receiver_class, &class_ids)) {
|
| // First check if all subclasses end up calling the same method.
|
|
|