Package jbet

Examples of jbet.Instruction


        jbet.MethodInfo mi = new jbet.MethodInfo("<init>",
                emptyDesc,
                jbet.MethodInfo.ACC_PUBLIC);
        mi.code = new Snippit();
        mi.code.push(new Instruction().setAload(0));
        mi.code.push(new Instruction().setInvokeSpecial("java/lang/Object",
                "<init>",
                emptyDesc));
        mi.code.push(new Instruction().setReturn());
        mi.maxLocals = 1;
        mi.maxStack = 1;
        ci.addMethod(mi);

        mi = new jbet.MethodInfo("main", mainDesc, jbet.MethodInfo.ACC_PUBLIC
                | jbet.MethodInfo.ACC_STATIC);
        mi.code = new Snippit();
        mi.code.push(new Instruction().setGetstatic("java/lang/System",
                "out",
                printStreamType));
        mi.code.push(new Instruction().setSpush("Hello world!"));
        mi.code.push(new Instruction().setInvokeVirtual("java/io/PrintStream",
                "println",
                printlnDesc));
        mi.maxLocals = 1;
        mi.maxStack = 2;
        ci.addMethod(mi);
View Full Code Here

TOP

Related Classes of jbet.Instruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.