/** Translate Java bytecode to AVM2 bytecode */ private void translateCode(AVM2MethodBody body) { // FIXME: handle abstract methods AVM2Code code = new AVM2Code(body.instructions); code.setupInitialScope(); InstructionVisitor visitor = new InstructionVisitor(this); visitor.walk(clazz.javaClass, method); // FIXME: these values need further thought.. // FIXME: could reduce the stack size if longs or doubles are involved CodeAttribute codeAttr = method.code(); body.maxRegisters = codeAttr.maxLocals; body.maxStack = codeAttr.maxStack; body.maxScope = body.scopeDepth + 1; }