Package jdk.internal.org.objectweb.asm.commons

Examples of jdk.internal.org.objectweb.asm.commons.GeneratorAdapter


            binaryOp(cw, op, long.class, realOp, integerOp);
        }

        static void binaryOp(ClassWriter cw, String op, Class<?> returnType, Consumer<GeneratorAdapter> realOp,
                             Consumer<GeneratorAdapter> integerOp) {
            GeneratorAdapter mv = new GeneratorAdapter(ACC_PUBLIC + ACC_STATIC,
                    method(toBytecodeName(op), desc(returnType, long.class, long.class)), null, null, cw);

            isInteger(mv, 0);
            Label argOneIsLong = new Label();
            mv.ifZCmp(IFNE, argOneIsLong);
            asDouble(mv, 0);
            isInteger(mv, 1);
            Label argTwoIsLong = new Label();
            mv.ifZCmp(IFNE, argTwoIsLong);
            asDouble(mv, 1);
            Label doubleOperation = new Label();
            mv.goTo(doubleOperation);
            mv.visitLabel(argTwoIsLong);
            asLong(mv, 1);
            mv.visitInsn(L2D);
            mv.goTo(doubleOperation);
            mv.visitLabel(argOneIsLong);
            isInteger(mv, 1);
            Label longOperation = new Label();
            mv.ifZCmp(IFNE, longOperation);
            asLong(mv, 0);
            mv.visitInsn(L2D);
            asDouble(mv, 1);
            mv.visitLabel(doubleOperation);
            realOp.accept(mv);
            mv.returnValue();
            mv.visitLabel(longOperation);
            asLong(mv, 0);
            asLong(mv, 1);
            integerOp.accept(mv);
            mv.returnValue();
            mv.endMethod();
        }
View Full Code Here


            binaryOp(cw, op, long.class, realOp, integerOp);
        }

        static void binaryOp(ClassWriter cw, String op, Class<?> returnType, Consumer<GeneratorAdapter> realOp,
                             Consumer<GeneratorAdapter> integerOp) {
            GeneratorAdapter mv = new GeneratorAdapter(ACC_PUBLIC + ACC_STATIC,
                    method(toBytecodeName(op), desc(returnType, long.class, long.class)), null, null, cw);

            isInteger(mv, 0);
            Label argOneIsLong = new Label();
            mv.ifZCmp(IFNE, argOneIsLong);
            asDouble(mv, 0);
            isInteger(mv, 1);
            Label argTwoIsLong = new Label();
            mv.ifZCmp(IFNE, argTwoIsLong);
            asDouble(mv, 1);
            Label doubleOperation = new Label();
            mv.goTo(doubleOperation);
            mv.visitLabel(argTwoIsLong);
            asLong(mv, 1);
            mv.visitInsn(L2D);
            mv.goTo(doubleOperation);
            mv.visitLabel(argOneIsLong);
            isInteger(mv, 1);
            Label longOperation = new Label();
            mv.ifZCmp(IFNE, longOperation);
            asLong(mv, 0);
            mv.visitInsn(L2D);
            asDouble(mv, 1);
            mv.visitLabel(doubleOperation);
            realOp.accept(mv);
            mv.returnValue();
            mv.visitLabel(longOperation);
            asLong(mv, 0);
            asLong(mv, 1);
            integerOp.accept(mv);
            mv.returnValue();
            mv.endMethod();
        }
View Full Code Here

                throw uncheck(e);
            }
        }

        GeneratorAdapter generator(int access, jdk.internal.org.objectweb.asm.commons.Method method) {
            return new GeneratorAdapter(access, method, cw.visitMethod(access, method.getName(), method.getDescriptor(), null, null));
        }
View Full Code Here

            mv.returnValue();
            mv.endMethod();
        }

        void constructor() {
            GeneratorAdapter ctor = generator(ACC_PUBLIC, method("<init>", desc(void.class)));
            ctor.loadThis();
            ctor.invokeConstructor(getType(Object.class), method("<init>", desc(void.class)));
            ctor.returnValue();
            ctor.endMethod();
        }
View Full Code Here

                throw uncheck(e);
            }
        }

        GeneratorAdapter generator(int access, jdk.internal.org.objectweb.asm.commons.Method method) {
            return new GeneratorAdapter(access, method, cw.visitMethod(access, method.getName(), method.getDescriptor(), null, null));
        }
View Full Code Here

            mv.returnValue();
            mv.endMethod();
        }

        void constructor() {
            GeneratorAdapter ctor = generator(ACC_PUBLIC, method("<init>", desc(void.class)));
            ctor.loadThis();
            ctor.invokeConstructor(getType(Object.class), method("<init>", desc(void.class)));
            ctor.returnValue();
            ctor.endMethod();
        }
View Full Code Here

TOP

Related Classes of jdk.internal.org.objectweb.asm.commons.GeneratorAdapter

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.