Fix stripping of access flags during JVMTI redefine

When JVMTI redefines a method/field, it replaces the guts of an
ArtMethod with the implementation in a provided dex file. This
process includes overwriting the intrinsics ordinal (stored in
ArtMethod's access flags) so that the new implementation is picked up.
This overwrite, however, does not check if the ArtMethod is an
intrinsic in the first place and will clear the bits regardless.

This caused an issue for hidden API as its access flags conflict
with those of intrinsics. All redefined framework classes would
therefore become completely visible to all callers.

This patch fixes the issue by adding a IsIntrisic() check around the
function which clears the access flags.

Bug: 79698297
Test: art/test.py -b --host -r -t 999-redefine-hiddenapi
Test: art/test.py -b --host -r -t 950-redefine-intrinsic
Merged-In: I7e607d874cc732ceb118d58e4cd40ff4353215f5
Change-Id: I7e607d874cc732ceb118d58e4cd40ff4353215f5
(cherry picked from commit 904e75a66edea51adc11f61ad8ccaab557402095)
13 files changed