1.1 --- a/boot/src/main/java/org/apidesign/html/boot/impl/JsClassLoader.java Thu Jul 11 21:10:18 2013 +0200
1.2 +++ b/boot/src/main/java/org/apidesign/html/boot/impl/JsClassLoader.java Fri Jul 12 09:43:02 2013 +0200
1.3 @@ -252,6 +252,7 @@
1.4 private boolean nowReturn;
1.5 private Type returnType;
1.6 private int index;
1.7 + private int loadIndex = offset;
1.8
1.9 public SV() {
1.10 super(Opcodes.ASM4);
1.11 @@ -265,15 +266,15 @@
1.12 return;
1.13 }
1.14 FindInMethod.super.visitInsn(Opcodes.DUP);
1.15 - FindInMethod.super.visitIntInsn(Opcodes.SIPUSH, index);
1.16 - FindInMethod.super.visitVarInsn(t.getOpcode(Opcodes.ILOAD), index + offset);
1.17 + FindInMethod.super.visitIntInsn(Opcodes.SIPUSH, index++);
1.18 + FindInMethod.super.visitVarInsn(t.getOpcode(Opcodes.ILOAD), loadIndex++);
1.19 String factory;
1.20 switch (descriptor) {
1.21 case 'I': factory = "java/lang/Integer"; break;
1.22 - case 'J': factory = "java/lang/Long"; break;
1.23 + case 'J': factory = "java/lang/Long"; loadIndex++; break;
1.24 case 'S': factory = "java/lang/Short"; break;
1.25 case 'F': factory = "java/lang/Float"; break;
1.26 - case 'D': factory = "java/lang/Double"; break;
1.27 + case 'D': factory = "java/lang/Double"; loadIndex++; break;
1.28 case 'Z': factory = "java/lang/Boolean"; break;
1.29 case 'C': factory = "java/lang/Character"; break;
1.30 case 'B': factory = "java/lang/Byte"; break;
1.31 @@ -283,7 +284,6 @@
1.32 factory, "valueOf", "(" + descriptor + ")L" + factory + ";"
1.33 );
1.34 FindInMethod.super.visitInsn(Opcodes.AASTORE);
1.35 - index++;
1.36 }
1.37
1.38 @Override
1.39 @@ -312,10 +312,9 @@
1.40
1.41 private void loadObject() {
1.42 FindInMethod.super.visitInsn(Opcodes.DUP);
1.43 - FindInMethod.super.visitIntInsn(Opcodes.SIPUSH, index);
1.44 - FindInMethod.super.visitVarInsn(Opcodes.ALOAD, index + offset);
1.45 + FindInMethod.super.visitIntInsn(Opcodes.SIPUSH, index++);
1.46 + FindInMethod.super.visitVarInsn(Opcodes.ALOAD, loadIndex++);
1.47 FindInMethod.super.visitInsn(Opcodes.AASTORE);
1.48 - index++;
1.49 }
1.50
1.51 }