Avoid to generate unecessary checkcast
StackValue already avoid to generate checkcast from a type or an array to java.lang.Object. Add a new case to avoid to generate a checkcast from an array to an array of java.lang.Object when arrays have the same dimensions. #KT-22714 Fixed
This commit is contained in:
committed by
Mikhael Bogdanov
parent
9a9452f73a
commit
126afbb8ac
@@ -395,7 +395,15 @@ public abstract class StackValue {
|
||||
}
|
||||
}
|
||||
else if (toType.getSort() == Type.ARRAY) {
|
||||
v.checkcast(toType);
|
||||
if (fromType.getSort() != Type.ARRAY) {
|
||||
v.checkcast(toType);
|
||||
}
|
||||
else if (toType.getDimensions() != fromType.getDimensions()) {
|
||||
v.checkcast(toType);
|
||||
}
|
||||
else if (!toType.getElementType().equals(OBJECT_TYPE)) {
|
||||
v.checkcast(toType);
|
||||
}
|
||||
}
|
||||
else if (toType.getSort() == Type.OBJECT) {
|
||||
if (fromType.getSort() == Type.OBJECT || fromType.getSort() == Type.ARRAY) {
|
||||
|
||||
Reference in New Issue
Block a user