Rewrite JNI NewStringUTF().
For historical reasons, NewStringUTF() accepts 4-byte UTF-8
sequences which are not valid Modified UTF-8. This can be
considered an extension of the JNI specification.
Rewrite the function to deal with the decoding explicitly,
so that we can later avoid dealing with the 4-byte sequences
in internal ART routines intended for Modified UTF-8.
Note that the DexFileVerifier rejects them in dex files.
Change the decoding to accept improperly encoded ASCII
characters as two-byte or three-byte sequences.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 192935764
Change-Id: I3f91da990110e419c78138ce997123277bf3aaba
3 files changed