new Type[]{Type.getType("Lorg/ibex/nestedvm/UnixRuntime;"),Type.STRING,new ArrayType(Type.STRING,1)},
INVOKESTATIC));
else
- a(fac.createInvoke(fullClassName,"run",Type.INT,new Type[]{Type.STRING,new ArrayType(Type.STRING,1)},INVOKEVIRTUAL));
+ a(fac.createInvoke(fullClassName,"run",Type.INT,new Type[]{Type.STRING,new ArrayType(Type.STRING,1)},INVOKEVIRTUAL));
a(fac.createInvoke("java.lang.System","exit",Type.VOID,new Type[]{Type.INT},INVOKESTATIC));
a(InstructionConstants.RETURN);
main.setMaxLocals();
}
private void addConstReturnMethod(String name, int val) {
- MethodGen method = newMethod(ACC_PROTECTED,Type.INT, Type.NO_ARGS,name);
+ MethodGen method = newMethod(ACC_PROTECTED,Type.INT, Type.NO_ARGS,name);
selectMethod(method);
pushConst(val);
a(InstructionConstants.IRETURN);
if(pc == -1) throw new Exn("pc modifying insn in delay slot");
int target = (pc&0xf0000000)|(jumpTarget << 2);
emitInstruction(-1,nextInsn,-1);
- // FIXME: Have a memcpy syscall and just override memcpy in libnestedvm
- if(optimizedMemcpy && (target == memcpy || target == memset)) {
- a(InstructionConstants.ALOAD_0);
- pushRegZ(R+4);
- pushRegZ(R+5);
- pushRegZ(R+6);
- a(fac.createInvoke(fullClassName,target==memcpy ? "memcpy" : "memset", Type.VOID, new Type[]{Type.INT,Type.INT,Type.INT},INVOKEVIRTUAL));
- preSetReg(R+2);
- pushReg(R+4);
- setReg();
- branch(pc,pc+8);
- } else {
- preSetReg(R+RA);
- pushConst(pc+8);
- setReg();
- branch(pc, target);
- }
+ preSetReg(R+RA);
+ pushConst(pc+8);
+ setReg();
+ branch(pc, target);
unreachable = true;
break;
}