@@ -122,7 +122,7 @@ public class InvocationMethodFactory extends MethodFactory implements Opcodes {
122
122
params (ThreadContext .class , IRubyObject .class , RubyModule .class , String .class , IRubyObject .class , IRubyObject .class , IRubyObject .class ));
123
123
124
124
/** The super constructor signature for Java-based method handles. */
125
- private final static String JAVA_SUPER_SIG = sig (Void .TYPE , params (RubyModule .class , Visibility .class ));
125
+ private final static String JAVA_SUPER_SIG = sig (Void .TYPE , params (RubyModule .class , Visibility .class , String . class ));
126
126
127
127
/** The lvar index of "this" */
128
128
public static final int THIS_INDEX = 0 ;
@@ -187,7 +187,7 @@ public InvocationMethodFactory(ClassLoader classLoader) {
187
187
// return signature.isFixed() && signature.required() <= 3;
188
188
//}
189
189
190
- private static final Class [] RubyModule_and_Visibility = new Class []{ RubyModule .class , Visibility .class };
190
+ private static final Class [] RubyModule_and_Visibility_and_Name = new Class []{ RubyModule .class , Visibility . class , String .class };
191
191
192
192
/**
193
193
* Use code generation to provide a method handle based on an annotated Java
@@ -208,7 +208,7 @@ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, List<Jav
208
208
DescriptorInfo info = new DescriptorInfo (descs );
209
209
if (DEBUG ) LOG .debug (" min: " + info .getMin () + ", max: " + info .getMax ());
210
210
211
- JavaMethod ic = (JavaMethod ) c .getConstructor (RubyModule_and_Visibility ).newInstance (implementationClass , anno .visibility ());
211
+ JavaMethod ic = (JavaMethod ) c .getConstructor (RubyModule_and_Visibility_and_Name ).newInstance (implementationClass , anno .visibility (), desc1 . name );
212
212
213
213
TypePopulator .populateMethod (
214
214
ic ,
@@ -324,7 +324,7 @@ public DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMeth
324
324
try {
325
325
Class c = getAnnotatedMethodClass (Collections .singletonList (desc ));
326
326
327
- JavaMethod ic = (JavaMethod ) c .getConstructor (RubyModule_and_Visibility ).newInstance (implementationClass , desc .anno .visibility ());
327
+ JavaMethod ic = (JavaMethod ) c .getConstructor (RubyModule_and_Visibility_and_Name ).newInstance (implementationClass , desc .anno .visibility (), desc . name );
328
328
329
329
TypePopulator .populateMethod (
330
330
ic ,
@@ -419,7 +419,7 @@ private static ClassWriter createJavaMethodCtor(String namePath, String sup, Str
419
419
cw .visitSource (sourceFile , null );
420
420
SkinnyMethodAdapter mv = new SkinnyMethodAdapter (cw , ACC_PUBLIC , "<init>" , JAVA_SUPER_SIG , null , null );
421
421
mv .start ();
422
- mv .aloadMany (0 , 1 , 2 );
422
+ mv .aloadMany (0 , 1 , 2 , 3 );
423
423
mv .invokespecial (sup , "<init>" , JAVA_SUPER_SIG );
424
424
mv .aload (0 );
425
425
mv .ldc (parameterDesc );
0 commit comments