Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: runtime/vm/aot_optimizer.cc

Issue 2087893004: VM: AOT optimizer does not need to check for overrides if receiver's cid is known. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/aot_optimizer.cc
diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc
index 89d6b091ed43adba93821a62d7629e4d32a07bcb..025784e6fb74c927addba3d9e8c984b203d0dc8b 100644
--- a/runtime/vm/aot_optimizer.cc
+++ b/runtime/vm/aot_optimizer.cc
@@ -2404,9 +2404,7 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
break;
}
- // No IC data checks. Try resolve target using the propagated type.
- // If the propagated type has a method with the target name and there are
- // no overrides with that name according to CHA, call the method directly.
+ // No IC data checks. Try resolve target using the propagated cid.
const intptr_t receiver_cid =
instr->PushArgumentAt(0)->value()->Type()->ToCid();
if (receiver_cid != kDynamicCid) {
@@ -2423,32 +2421,20 @@ void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) {
instr->function_name(),
args_desc));
if (!function.IsNull()) {
- intptr_t subclasses = 0;
- if (!thread()->cha()->HasOverride(receiver_class,
- instr->function_name(),
- &subclasses)) {
- if (FLAG_trace_cha) {
- THR_Print(" **(CHA) Instance call needs no check, "
- "no overrides of '%s' '%s'\n",
- instr->function_name().ToCString(), receiver_class.ToCString());
- }
-
- // Create fake IC data with the resolved target.
- 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);
- PolymorphicInstanceCallInstr* call =
- new(Z) PolymorphicInstanceCallInstr(instr, ic_data,
- /* with_checks = */ false,
- /* complete = */ true);
- instr->ReplaceWith(call, current_iterator());
- return;
- }
+ 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);
+ PolymorphicInstanceCallInstr* call =
+ new(Z) PolymorphicInstanceCallInstr(instr, ic_data,
+ /* with_checks = */ false,
+ /* complete = */ true);
+ instr->ReplaceWith(call, current_iterator());
+ return;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698