<p>-version 3.19
<ul>
-<li>JIRA JASSIST-158, 206.
+<li>JIRA JASSIST-158, 206, 207.
</ul>
</p>
private void mergeMap(TypedBlock dest, boolean mergeStack) throws BadBytecode {
int n = localsTypes.length;
for (int i = 0; i < n; i++)
- dest.localsTypes[i] = merge(localsTypes[i], dest.localsTypes[i]);
+ dest.localsTypes[i] = merge(validateTypeData(localsTypes, n, i),
+ dest.localsTypes[i]);
if (mergeStack) {
n = stackTop;
protected static int recordTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes) {
int k = -1;
for (int i = 0; i < n; i++) {
- TypeData t = srcTypes[i];
+ // TypeData t = srcTypes[i];
+ TypeData t = validateTypeData(srcTypes, n, i);
destTypes[i] = t.join();
if (t != TOP)
k = i + 1; // t might be long or double.
destTypes[i] = srcTypes[i];
}
+ private static TypeData validateTypeData(TypeData[] data, int length, int index) {
+ TypeData td = data[index];
+ if (td.is2WordType() && index + 1 < length)
+ if (data[index + 1] != TOP)
+ return TOP;
+
+ return td;
+ }
+
// Phase 1.5
/*
protected ArrayList usedBy; // reverse relations of lowers
protected ArrayList uppers; // upper bounds of this type.
protected String fixedType;
+ private boolean is2WordType; // cache
public TypeVar(TypeData t) {
uppers = null;
usedBy = new ArrayList(2);
merge(t);
fixedType = null;
+ is2WordType = t.is2WordType();
}
public String getName() {
}
public boolean is2WordType() {
- if (fixedType == null)
- return ((TypeData)lowers.get(0)).is2WordType();
+ if (fixedType == null) {
+ return is2WordType;
+ // return ((TypeData)lowers.get(0)).is2WordType();
+ }
else
return false;
}
TypeVar cv = (TypeVar)scc.get(i);
cv.lowers.clear();
cv.lowers.add(kind);
+ is2WordType = kind.is2WordType();
}
}
else {