@@ -283,7 +283,7 @@ see javassist.Dump. | |||
<p>-version 3.19 | |||
<ul> | |||
<li>JIRA JASSIST-158, 206. | |||
<li>JIRA JASSIST-158, 206, 207. | |||
</ul> | |||
</p> | |||
@@ -228,7 +228,8 @@ public class MapMaker extends Tracer { | |||
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; | |||
@@ -290,7 +291,8 @@ public class MapMaker extends Tracer { | |||
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. | |||
@@ -304,6 +306,15 @@ public class MapMaker extends Tracer { | |||
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 | |||
/* |
@@ -157,6 +157,7 @@ public abstract class TypeData { | |||
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; | |||
@@ -164,6 +165,7 @@ public abstract class TypeData { | |||
usedBy = new ArrayList(2); | |||
merge(t); | |||
fixedType = null; | |||
is2WordType = t.is2WordType(); | |||
} | |||
public String getName() { | |||
@@ -181,8 +183,10 @@ public abstract class TypeData { | |||
} | |||
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; | |||
} | |||
@@ -319,6 +323,7 @@ public abstract class TypeData { | |||
TypeVar cv = (TypeVar)scc.get(i); | |||
cv.lowers.clear(); | |||
cv.lowers.add(kind); | |||
is2WordType = kind.is2WordType(); | |||
} | |||
} | |||
else { |