From 4aff8f93fb85c19f53cf4a4e54208ece4bd4011c Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Wed, 28 Nov 2018 09:21:00 +0000 Subject: [PATCH] [VM] Ensure we handle devirtualized calls inside ApplyClassIds() as well After recent changes to pragmas, TFA devirtualizes more calls, which has regressed a Prime This gets rid of the 5% regression in PrimeNumber/PrimeNumberTyped in dart-aot (which 0ef66e0f5 introduced). Furthermore it improves MD5/SHA by double digits percent. Change-Id: Ia4d1fb62512495dec7111efc53c4d7a4de5ef3af Reviewed-on: https://dart-review.googlesource.com/c/85398 Reviewed-by: Vyacheslav Egorov Commit-Queue: Martin Kustermann --- runtime/vm/compiler/call_specializer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/vm/compiler/call_specializer.cc b/runtime/vm/compiler/call_specializer.cc index 948259e5c76..1dd24e3cafa 100644 --- a/runtime/vm/compiler/call_specializer.cc +++ b/runtime/vm/compiler/call_specializer.cc @@ -187,6 +187,10 @@ void CallSpecializer::ApplyClassIds() { VisitInstanceCall(call); } } + } else if (auto static_call = instr->AsStaticCall()) { + // If TFA devirtualized instance calls to static calls we also want to + // process them here. + VisitStaticCall(static_call); } else if (instr->IsPolymorphicInstanceCall()) { SpecializePolymorphicInstanceCall(instr->AsPolymorphicInstanceCall()); }