| Index: runtime/vm/aot_optimizer.cc
|
| diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
|
| index 5dfe8f507c5c258647c1c4d08ef7533b7a01ab75..d0e04bde0c900ebf09e28b1f0569e7179544d05d 100644
|
| --- a/runtime/vm/aot_optimizer.cc
|
| +++ b/runtime/vm/aot_optimizer.cc
|
| @@ -17,6 +17,7 @@
|
| #include "vm/flow_graph_range_analysis.h"
|
| #include "vm/hash_map.h"
|
| #include "vm/il_printer.h"
|
| +#include "vm/jit_optimizer.h"
|
| #include "vm/intermediate_language.h"
|
| #include "vm/object.h"
|
| #include "vm/object_store.h"
|
| @@ -1721,8 +1722,9 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
|
| RawFunction::Kind function_kind =
|
| Function::Handle(Z, unary_checks.GetTargetAt(0)).kind();
|
| if (!flow_graph()->InstanceCallNeedsClassCheck(instr, function_kind)) {
|
| + CallTargets* targets = CallTargets::Create(Z, unary_checks);
|
| PolymorphicInstanceCallInstr* call =
|
| - new (Z) PolymorphicInstanceCallInstr(instr, unary_checks,
|
| + new (Z) PolymorphicInstanceCallInstr(instr, *targets,
|
| /* with_checks = */ false,
|
| /* complete = */ true);
|
| instr->ReplaceWith(call, current_iterator());
|
| @@ -1783,17 +1785,16 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
|
| Array::Handle(Z, ArgumentsDescriptor::New(instr->ArgumentCount(),
|
| instr->argument_names()));
|
| ArgumentsDescriptor args_desc(args_desc_array);
|
| - const Function& function = Function::Handle(
|
| + Function& function = Function::Handle(
|
| Z, Resolver::ResolveDynamicForReceiverClass(
|
| receiver_class, instr->function_name(), args_desc));
|
| if (!function.IsNull()) {
|
| - const ICData& ic_data = ICData::Handle(
|
| - ICData::New(flow_graph_->function(), instr->function_name(),
|
| - args_desc_array, Thread::kNoDeoptId,
|
| - /* args_tested = */ 1, false));
|
| - ic_data.AddReceiverCheck(receiver_class.id(), function);
|
| + CallTargets* targets = new (Z) CallTargets();
|
| + Function& target = Function::ZoneHandle(Z, function.raw());
|
| + targets->Add(CidRangeTarget(receiver_class.id(), receiver_class.id(),
|
| + &target, /*count = */ 1));
|
| PolymorphicInstanceCallInstr* call =
|
| - new (Z) PolymorphicInstanceCallInstr(instr, ic_data,
|
| + new (Z) PolymorphicInstanceCallInstr(instr, *targets,
|
| /* with_checks = */ false,
|
| /* complete = */ true);
|
| instr->ReplaceWith(call, current_iterator());
|
| @@ -1916,8 +1917,9 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
|
| return;
|
| } else if ((ic_data.raw() != ICData::null()) &&
|
| !ic_data.NumberOfChecksIs(0)) {
|
| + CallTargets* targets = CallTargets::Create(Z, ic_data);
|
| PolymorphicInstanceCallInstr* call =
|
| - new (Z) PolymorphicInstanceCallInstr(instr, ic_data,
|
| + new (Z) PolymorphicInstanceCallInstr(instr, *targets,
|
| /* with_checks = */ true,
|
| /* complete = */ true);
|
| instr->ReplaceWith(call, current_iterator());
|
| @@ -1932,8 +1934,9 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
|
| ASSERT(!FLAG_polymorphic_with_deopt);
|
| // OK to use checks with PolymorphicInstanceCallInstr since no
|
| // deoptimization is allowed.
|
| + CallTargets* targets = CallTargets::Create(Z, *instr->ic_data());
|
| PolymorphicInstanceCallInstr* call =
|
| - new (Z) PolymorphicInstanceCallInstr(instr, unary_checks,
|
| + new (Z) PolymorphicInstanceCallInstr(instr, *targets,
|
| /* with_checks = */ true,
|
| /* complete = */ false);
|
| instr->ReplaceWith(call, current_iterator());
|
|
|