public TypeData join() { if (initialized) return new TypeVar(new ClassName(getName())); else return new UninitTypeVar(copy()); }
private void recordStackMap(TypedBlock target, int exceptionType) throws BadBytecode { TypeData[] tStackTypes = TypeData.make(stackTypes.length); tStackTypes[0] = toExceptionType(exceptionType).join(); recordStackMap0(target, 1, tStackTypes); }
private void recordStackMap0(TypedBlock target, int st, TypeData[] tStackTypes) throws BadBytecode { int n = localsTypes.length; TypeData[] tLocalsTypes = TypeData.make(n); int k = recordTypeData(n, localsTypes, tLocalsTypes); target.setStackMap(st, tStackTypes, k, tLocalsTypes); }
public static TypeData make(TypeData array) throws BadBytecode { if (array instanceof ArrayType) return ((ArrayType)array).elementType(); else if (array instanceof AbsTypeVar) return new ArrayElement((AbsTypeVar)array); else if (array instanceof ClassName) if (!array.isNullType()) return new ClassName(typeName(array.getName())); throw new BadBytecode("bad AASTORE: " + array); }
static TypeData make(TypeData element) throws BadBytecode { if (element instanceof ArrayElement) return ((ArrayElement)element).arrayType(); else if (element instanceof AbsTypeVar) return new ArrayType((AbsTypeVar)element); else if (element instanceof ClassName) if (!element.isNullType()) return new ClassName(typeName(element.getName())); throw new BadBytecode("bad AASTORE: " + element); }
public TypeData getArrayType(int dim) throws NotFoundException { if (dim == 0) return this; else { BasicType bt = isBasicType(); if (bt == null) if (isNullType()) return new NullType(); else return new ClassName(getName()).getArrayType(dim); else return bt.getArrayType(dim); } }
private void recordStackMap(TypedBlock target) throws BadBytecode { TypeData[] tStackTypes = TypeData.make(stackTypes.length); int st = stackTop; recordTypeData(st, stackTypes, tStackTypes); recordStackMap0(target, st, tStackTypes); }
public void merge(TypeData t) { try { if (!t.isNullType()) element.merge(ArrayElement.make(t)); } catch (BadBytecode e) { // never happens throw new RuntimeException("fatal: " + e); } }
public void merge(TypeData t) { try { if (!t.isNullType()) array.merge(ArrayType.make(t)); } catch (BadBytecode e) { // never happens throw new RuntimeException("fatal: " + e); } }
protected static int recordTypeData(int n, TypeData[] srcTypes, TypeData[] destTypes) { int k = -1; for (int i = 0; i < n; i++) { TypeData t = validateTypeData(srcTypes, n, i); destTypes[i] = t.join(); if (t != TOP) k = i + 1; // t might be long or double. } return k + 1; }
/** * Sets the type name of this object type. If the given type name is * a subclass of the current type name, then the given name becomes * the name of this object type. * * @param className dot-separated name unless the type is an array type. */ private static void setType(TypeData td, String className, ClassPool cp) throws BadBytecode { td.setType(className, cp); }
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; }
protected void makeJsr(HashMap marks, int pos, int target, int size) throws BadBytecode { /* Mark to = makeMark(marks, target); Mark next = makeMark(marks, pos + size); BasicBlock[] jumps = makeArray(to.block, next.block); makeMark(marks, pos, jumps, size, false); */ throw new JsrBytecode(); }
public TypeData join() { if (this == TypeTag.TOP) return this; else return super.join(); }
private static boolean stackMapEq(TypeData[] oldTd, TypeData[] newTd, int len) { for (int i = 0; i < len; i++) { if (!oldTd[i].eq(newTd[i])) return false; } return true; }