1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-30 19:40:37 +01:00

Use invokeinterface for methods defined in interfaces in the ASM executor

This commit is contained in:
Spottedleaf 2017-02-14 03:04:20 -08:00
parent 3e91cc60e4
commit 19fa8bcffc

View file

@ -147,7 +147,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ methodGenerator.checkCast(Type.getType(m.getDeclaringClass()));
+ methodGenerator.loadArg(1);
+ methodGenerator.checkCast(Type.getType(m.getParameterTypes()[0]));
+ methodGenerator.visitMethodInsn(INVOKEVIRTUAL, Type.getInternalName(m.getDeclaringClass()), m.getName(), Type.getMethodDescriptor(m), m.getDeclaringClass().isInterface());
+ methodGenerator.visitMethodInsn(m.getDeclaringClass().isInterface() ? INVOKEINTERFACE : INVOKEVIRTUAL, Type.getInternalName(m.getDeclaringClass()), m.getName(), Type.getMethodDescriptor(m), m.getDeclaringClass().isInterface());
+ if (m.getReturnType() != void.class) {
+ methodGenerator.pop();
+ }