8157246: MHs.arrayLength, arrayElementGetter/Setter, arrayConstructor need to specify invocation-time behavior

Reviewed-by: psandoz, rriggs
This commit is contained in:
Mandy Chung 2017-11-17 08:12:02 -06:00
parent 6a826075c2
commit 52693f1ca5
8 changed files with 248 additions and 11 deletions

View file

@ -662,8 +662,10 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
}
static void checkSpreadArgument(Object av, int n) {
if (av == null) {
if (n == 0) return;
if (av == null && n == 0) {
return;
} else if (av == null) {
throw new NullPointerException("null array reference");
} else if (av instanceof Object[]) {
int len = ((Object[])av).length;
if (len == n) return;