Skip to content

Commit cb9d770

Browse files
committed
try to make this work. fails spectests.
1 parent 2629714 commit cb9d770

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/vm/jvm/runtime/org/perl6/nqp/runtime/BootJavaInterop.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ protected void createShorthandDispatchers(ClassContext c) {
390390
// get the arity of the capture we got passed
391391
mv.visitVarInsn(Opcodes.ALOAD, 3); // csd
392392
mv.visitFieldInsn(Opcodes.GETFIELD, TYPE_CSD.getInternalName(), "numPositionals", "I");
393+
emitInteger(mc, 1); // arity
394+
mv.visitInsn(Opcodes.ISUB);
393395

394396
for (Iterator<Map.Entry<Integer, List<String>>> in_it = descriptors_by_arity.entrySet().iterator(); in_it.hasNext(); ) {
395397
Map.Entry<Integer, List<String>> in_ent = in_it.next();
@@ -510,7 +512,7 @@ protected void createAdaptorMethod(ClassContext c, Method tobind) {
510512
c.arities.get(name).get(arity).add(desc);
511513
// stash the method away for later generation of shorthand methods.
512514
c.methods.put(desc, tobind);
513-
MethodContext cc = startCallout(c, ptype.length + 1, "method/" + tobind.getName() + "/" + desc);
515+
MethodContext cc = startCallout(c, arity + 1, "method/" + tobind.getName() + "/" + desc);
514516

515517
int parix = 1;
516518
preMarshalIn(cc, tobind.getReturnType(), 0);
@@ -868,13 +870,11 @@ protected void endCallout(MethodContext c) {
868870
Label handler = new Label();
869871
Label notcontrol = new Label();
870872

871-
System.out.println("making the endTry piece");
872873
mv.visitLabel(endTry);
873874
mv.visitVarInsn(Opcodes.ALOAD, 5); //cf
874875
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, TYPE_CF.getInternalName(), "leave", "()V");
875876
mv.visitInsn(Opcodes.RETURN);
876877

877-
System.out.println("making the handler piece");
878878
mv.visitLabel(handler);
879879
mv.visitInsn(Opcodes.DUP);
880880
mv.visitTypeInsn(Opcodes.INSTANCEOF, "org/perl6/nqp/runtime/ControlException");
@@ -883,19 +883,15 @@ protected void endCallout(MethodContext c) {
883883
mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, TYPE_CF.getInternalName(), "leave", "()V");
884884
mv.visitInsn(Opcodes.ATHROW);
885885

886-
System.out.println("making the notcontrol piece");
887886
mv.visitLabel(notcontrol);
888887
mv.visitVarInsn(Opcodes.ALOAD, 1); // tc
889888
mv.visitInsn(Opcodes.SWAP);
890889
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "org/perl6/nqp/runtime/ExceptionHandling", "dieInternal",
891890
Type.getMethodDescriptor(Type.getType(RuntimeException.class), TYPE_TC, Type.getType(Throwable.class)));
892891
mv.visitInsn(Opcodes.ATHROW);
893892

894-
System.out.println("making the trycatch block");
895893
c.mv.visitTryCatchBlock(c.tryStart, endTry, handler, null);
896-
System.out.println("visiting Maxs");
897894
c.mv.visitMaxs(0,0);
898-
System.out.println("visiting End");
899895
c.mv.visitEnd();
900896
}
901897

0 commit comments

Comments
 (0)