public void invokeConstructor(TypeDesc[] params) { invokeConstructor(mClassFile.getClassName(), mClassFile.getType(), params); }
void set(ConstantPool cp, MethodInfo info) { TypeDesc[] paramTypes = info.getMethodDescriptor().getParameterTypes(); VerificationTypeInfo[] infos; int offset; if (info.getModifiers().isStatic()) { infos = new VerificationTypeInfo[paramTypes.length]; offset = 0; } else { infos = new VerificationTypeInfo[1 + paramTypes.length]; if (info.getName().equals("<init>")) { infos[0] = UninitThisVariableInfo.THE; } else { infos[0] = VerificationTypeInfo.forType(cp, info.getClassFile().getType()); } offset = 1; } for (int i=0; i<paramTypes.length; i++) { infos[offset + i] = VerificationTypeInfo.forType(cp, paramTypes[i]); } mLocalInfos = infos; } }
mThisReference = null; } else { localVar = mInstructions.createLocalParameter("this", mClassFile.getType()); mThisReference = localVar;
public void invokeConstructor(TypeDesc[] params) { invokeConstructor(mClassFile.getClassName(), mClassFile.getType(), params); }
mThisReference = null; } else { localVar = mInstructions.createLocalParameter("this", mClassFile.getType()); mThisReference = localVar;
void set(ConstantPool cp, MethodInfo info) { TypeDesc[] paramTypes = info.getMethodDescriptor().getParameterTypes(); VerificationTypeInfo[] infos; int offset; if (info.getModifiers().isStatic()) { infos = new VerificationTypeInfo[paramTypes.length]; offset = 0; } else { infos = new VerificationTypeInfo[1 + paramTypes.length]; if (info.getName().equals("<init>")) { infos[0] = UninitThisVariableInfo.THE; } else { infos[0] = VerificationTypeInfo.forType(cp, info.getClassFile().getType()); } offset = 1; } for (int i=0; i<paramTypes.length; i++) { infos[offset + i] = VerificationTypeInfo.forType(cp, paramTypes[i]); } mLocalInfos = infos; } }
/** * Add a prepare bridge method to the classfile for the given type. * * @param cf file to which to add the prepare bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method * @since 1.2 */ private static void definePrepareBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, PREPARE_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), PREPARE_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(PREPARE_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
/** * Add a copy bridge method to the classfile for the given type. This is * needed to allow the genericised class make a copy itself -- which will * be erased to the base type -- and return it as the correct type. * * @param cf file to which to add the copy bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method */ private static void defineCopyBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, COPY_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), COPY_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(COPY_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
/** * Add a copy bridge method to the classfile for the given type. This is * needed to allow the genericised class make a copy itself -- which will * be erased to the base type -- and return it as the correct type. * * @param cf file to which to add the copy bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method */ private static void defineCopyBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, COPY_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), COPY_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(COPY_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
/** * Add a prepare bridge method to the classfile for the given type. * * @param cf file to which to add the prepare bridge * @param leaf leaf class * @param returnClass type returned from generated bridge method * @since 1.2 */ private static void definePrepareBridge(ClassFile cf, Class leaf, Class returnClass) { TypeDesc returnType = TypeDesc.forClass(returnClass); if (isPublicMethodFinal(leaf, PREPARE_METHOD_NAME, returnType, null)) { // Cannot override. return; } MethodInfo mi = cf.addMethod(Modifiers.PUBLIC.toBridge(true), PREPARE_METHOD_NAME, returnType, null); CodeBuilder b = new CodeBuilder(mi); b.loadThis(); b.invokeVirtual(PREPARE_METHOD_NAME, cf.getType(), null); b.returnValue(returnType); }
b.dup(); b.loadThis(); b.invokeConstructor(lobLoaderType, new TypeDesc[] {mClassFile.getType()});
b.dup(); b.loadThis(); b.invokeConstructor(lobLoaderType, new TypeDesc[] {mClassFile.getType()});
final TypeDesc enclosingType = mClassFile.getType();
final TypeDesc enclosingType = mClassFile.getType();