update classfilecompiler for new syscall method
[nestedvm.git] / src / org / ibex / nestedvm / ClassFileCompiler.java
index f0b9153..3df1d4e 100644 (file)
@@ -768,7 +768,9 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
                 pushRegZ(R+A1);
                 pushRegZ(R+A2);
                 pushRegZ(R+A3);
-                a(fac.createInvoke(fullClassName,"syscall",Type.INT,new Type[]{Type.INT,Type.INT,Type.INT,Type.INT,Type.INT},INVOKEVIRTUAL));
+                pushRegZ(R+T0);
+                pushRegZ(R+T1);
+                a(fac.createInvoke(fullClassName,"syscall",Type.INT,new Type[]{Type.INT,Type.INT,Type.INT,Type.INT,Type.INT,Type.INT,Type.INT},INVOKEVIRTUAL));
                 setReg();
                 
                 a(InstructionConstants.ALOAD_0);
@@ -1262,13 +1264,7 @@ public class ClassFileCompiler extends Compiler implements org.apache.bcel.Const
                     
                     b1 = a(InstructionFactory.createBranchInstruction(IFGT,null));
                     a(d ? InstructionConstants.DCONST_0 : InstructionConstants.FCONST_0);
-                    if(d) {
-                        a(InstructionConstants.DUP2_X2);
-                        a(InstructionConstants.POP2);
-                    } else {
-                        a(InstructionConstants.POP);
-                    }
-                    a(InstructionConstants.DSUB);
+                    a(d ? InstructionConstants.DSUB : InstructionConstants.FSUB);
                     
                     b1.setTarget(setDouble(d));