-
Bug
-
Resolution: Fixed
-
P3
-
repo-valhalla
For code like this:
0: bipush 9
2: iconst_2
3: multianewarray #2, 2 // class "[[QPoint;"
7: astore_3
8: aload_3
9: iload_1
10: aaload <<<<< should be loading from "[[QPoint;"
11: iload_2
12: aload_0
13: aastore <<<<< should be storing to "[QPoint;"
14: aload_3
15: areturn
The multianewarray instruction at bci#3 throws away the type information. I.e., NewMultiArray::exact_type() returns NULL.
When we get to the aaload at bci#10, we only know that the operand is a T_OBJECT.
When we get to the aastore at bci#13, we only know that the operand is a T_OBJECT, so we don't know that the array is actually flattened.
The fix is to implement this function properly:
ciType* NewMultiArray::exact_type() const {
return _klass;
}
0: bipush 9
2: iconst_2
3: multianewarray #2, 2 // class "[[QPoint;"
7: astore_3
8: aload_3
9: iload_1
10: aaload <<<<< should be loading from "[[QPoint;"
11: iload_2
12: aload_0
13: aastore <<<<< should be storing to "[QPoint;"
14: aload_3
15: areturn
The multianewarray instruction at bci#3 throws away the type information. I.e., NewMultiArray::exact_type() returns NULL.
When we get to the aaload at bci#10, we only know that the operand is a T_OBJECT.
When we get to the aastore at bci#13, we only know that the operand is a T_OBJECT, so we don't know that the array is actually flattened.
The fix is to implement this function properly:
ciType* NewMultiArray::exact_type() const {
return _klass;
}