/** * 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); }
public void setType(String s, ClassPool cp) throws BadBytecode { type.setType(s, cp); }
/** * 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. */ @SuppressWarnings("unused") private static void setType(TypeData td, String className, ClassPool cp) throws BadBytecode { td.setType(className, cp); }
@Override public void setType(String s, ClassPool cp) throws BadBytecode { type.setType(s, cp); }
private void setFieldTarget(boolean notStatic, int index) throws BadBytecode { if (notStatic) { String className = cpool.getFieldrefClassName(index); stackTypes[--stackTop].setType(className, classPool); } }
private void setFieldTarget(boolean notStatic, int index) throws BadBytecode { if (notStatic) { String className = cpool.getFieldrefClassName(index); stackTypes[--stackTop].setType(className, classPool); } }
private int doPutField(int pos, byte[] code, boolean notStatic) throws BadBytecode { int index = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getFieldrefType(index); stackTop -= Descriptor.dataSize(desc); char c = desc.charAt(0); if (c == 'L') stackTypes[stackTop].setType(getFieldClassName(desc, 0), classPool); else if (c == '[') stackTypes[stackTop].setType(desc, classPool); setFieldTarget(notStatic, index); return 3; }
private int doPutField(int pos, byte[] code, boolean notStatic) throws BadBytecode { int index = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getFieldrefType(index); stackTop -= Descriptor.dataSize(desc); char c = desc.charAt(0); if (c == 'L') stackTypes[stackTop].setType(getFieldClassName(desc, 0), classPool); else if (c == '[') stackTypes[stackTop].setType(desc, classPool); setFieldTarget(notStatic, index); return 3; }
private int doInvokeIntfMethod(int pos, byte[] code) throws BadBytecode { int i = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getInterfaceMethodrefType(i); checkParamTypes(desc, 1); String className = cpool.getInterfaceMethodrefClassName(i); stackTypes[--stackTop].setType(className, classPool); pushMemberType(desc); return 5; }
private int doInvokeIntfMethod(int pos, byte[] code) throws BadBytecode { int i = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getInterfaceMethodrefType(i); checkParamTypes(desc, 1); String className = cpool.getInterfaceMethodrefClassName(i); stackTypes[--stackTop].setType(className, classPool); pushMemberType(desc); return 5; }
public static void aastore(TypeData array, TypeData value, ClassPool cp) throws BadBytecode { if (array instanceof AbsTypeVar) if (!value.isNullType()) ((AbsTypeVar)array).merge(ArrayType.make(value)); if (value instanceof AbsTypeVar) if (array instanceof AbsTypeVar) ArrayElement.make(array); // should call value.setType() later. else if (array instanceof ClassName) { if (!array.isNullType()) { String type = ArrayElement.typeName(array.getName()); value.setType(type, cp); } } else throw new BadBytecode("bad AASTORE: " + array); }
public static void aastore(TypeData array, TypeData value, ClassPool cp) throws BadBytecode { if (array instanceof AbsTypeVar) if (!value.isNullType()) ((AbsTypeVar)array).merge(ArrayType.make(value)); if (value instanceof AbsTypeVar) if (array instanceof AbsTypeVar) ArrayElement.make(array); // should call value.setType() later. else if (array instanceof ClassName) { if (!array.isNullType()) { String type = ArrayElement.typeName(array.getName()); value.setType(type, cp); } } else throw new BadBytecode("bad AASTORE: " + array); }
private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode { int i = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getMethodrefType(i); checkParamTypes(desc, 1); if (notStatic) { String className = cpool.getMethodrefClassName(i); TypeData target = stackTypes[--stackTop]; if (target instanceof TypeData.UninitTypeVar && target.isUninit()) constructorCalled(target, ((TypeData.UninitTypeVar)target).offset()); else if (target instanceof TypeData.UninitData) constructorCalled(target, ((TypeData.UninitData)target).offset()); target.setType(className, classPool); } pushMemberType(desc); return 3; }
private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode { int i = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getMethodrefType(i); checkParamTypes(desc, 1); if (notStatic) { String className = cpool.getMethodrefClassName(i); TypeData target = stackTypes[--stackTop]; if (target instanceof TypeData.UninitTypeVar && target.isUninit()) constructorCalled(target, ((TypeData.UninitTypeVar)target).offset()); else if (target instanceof TypeData.UninitData) constructorCalled(target, ((TypeData.UninitData)target).offset()); target.setType(className, classPool); } pushMemberType(desc); return 3; }
break; case Opcode.ARETURN : stackTypes[--stackTop].setType(returnType, classPool); visitReturn(pos, code); break; return 3; } case Opcode.ARRAYLENGTH : stackTypes[stackTop - 1].setType("[Ljava.lang.Object;", classPool); stackTypes[stackTop - 1] = INTEGER; break; case Opcode.ATHROW : stackTypes[--stackTop].setType("java.lang.Throwable", classPool); visitThrow(pos, code); break;
break; case Opcode.ARETURN : stackTypes[--stackTop].setType(returnType, classPool); visitReturn(pos, code); break; return 3; } case Opcode.ARRAYLENGTH : stackTypes[stackTop - 1].setType("[Ljava.lang.Object;", classPool); stackTypes[stackTop - 1] = INTEGER; break; case Opcode.ATHROW : stackTypes[--stackTop].setType("java.lang.Throwable", classPool); visitThrow(pos, code); break;
private void setFieldTarget(boolean notStatic, int index) throws BadBytecode { if (notStatic) { String className = cpool.getFieldrefClassName(index); TypeData.setType(stackTypes[--stackTop], className, classPool); } }
private void setFieldTarget(boolean notStatic, int index) throws BadBytecode { if (notStatic) { String className = cpool.getFieldrefClassName(index); stackTypes[--stackTop].setType(className, classPool); } }