Skip to content

Commit

Permalink
handle InvokePolymorphicExpr as java8 style
Browse files Browse the repository at this point in the history
  • Loading branch information
pxb1988 committed Aug 2, 2017
1 parent 3e93d20 commit 1d51507
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -710,19 +710,12 @@ private static void reBuildEnExpression(EnExpr value, MethodVisitor asm) {
String argTypes[] = ipe.getProto().getParameterTypes();
Value[] vbs = ipe.getOps();
accept(vbs[0], asm);
asm.visitLdcInsn(vbs.length - 1);
asm.visitTypeInsn(ANEWARRAY, "java/lang/Object");
for (int i = 1; i < vbs.length; i++) {
asm.visitInsn(DUP);
asm.visitLdcInsn(i - 1);
Value vb = vbs[i];
accept(vb, asm);
insertI2x(vb.valueType, argTypes[i - 1], asm);
box(argTypes[i - 1], "Ljava/lang/Object;", asm);
asm.visitInsn(AASTORE);
}
asm.visitMethodInsn(INVOKEVIRTUAL, toInternal(m.getOwner()), m.getName(), m.getDesc(), false);
box(ipe.method.getReturnType(), ipe.getProto().getReturnType(), asm);
asm.visitMethodInsn(INVOKEVIRTUAL, toInternal(m.getOwner()), m.getName(), ipe.getProto().getDesc(), false);
}
}
}
Expand Down

0 comments on commit 1d51507

Please sign in to comment.