Cleanup work for @NeverCompile in art
This change is a followup to aosp/1897910. It makes a style change to
the list of parameters provided to MethodIsNeverCompile, and adds a
clause for abstract methods when calling it in the class linker.
Bug: 197753440
Test: Checked that the behavior of @NeverCompile is maintained by
inspecting services.odex after annotating specific methods.
Change-Id: I91969898a635c71656451e59ad22940eb78143f6
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 3f5b09f..d2ab81e 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -3672,8 +3672,8 @@
// Check if the native method is annotated with @FastNative or @CriticalNative.
access_flags |= annotations::GetNativeMethodAnnotationAccessFlags(
dex_file, dst->GetClassDef(), dex_method_idx);
- }
- if (annotations::MethodIsNeverCompile(dex_file, dst->GetClassDef(), dex_method_idx)) {
+ } else if ((access_flags & kAccAbstract) == 0u &&
+ annotations::MethodIsNeverCompile(dex_file, dst->GetClassDef(), dex_method_idx)) {
access_flags |= kAccCompileDontBother;
}
dst->SetAccessFlags(access_flags);