Package org.jruby.compiler.impl

Examples of org.jruby.compiler.impl.SkinnyMethodAdapter.line()


                int rubyIndex = baseIndex + 1;

                SkinnyMethodAdapter mv = new SkinnyMethodAdapter(
                        cw, ACC_PUBLIC, simpleName, sig(returnType, paramTypes), null, null);
                mv.start();
                mv.line(1);

                // TODO: this code should really check if a Ruby equals method is implemented or not.
                if(simpleName.equals("equals") && paramTypes.length == 1 && paramTypes[0] == Object.class && returnType == Boolean.TYPE) {
                    mv.line(2);
                    mv.aload(0);
View Full Code Here


                mv.start();
                mv.line(1);

                // TODO: this code should really check if a Ruby equals method is implemented or not.
                if(simpleName.equals("equals") && paramTypes.length == 1 && paramTypes[0] == Object.class && returnType == Boolean.TYPE) {
                    mv.line(2);
                    mv.aload(0);
                    mv.aload(1);
                    mv.invokespecial(p(Object.class), "equals", sig(Boolean.TYPE, params(Object.class)));
                    mv.ireturn();
                } else if(simpleName.equals("hashCode") && paramTypes.length == 0 && returnType == Integer.TYPE) {
View Full Code Here

                    mv.aload(0);
                    mv.aload(1);
                    mv.invokespecial(p(Object.class), "equals", sig(Boolean.TYPE, params(Object.class)));
                    mv.ireturn();
                } else if(simpleName.equals("hashCode") && paramTypes.length == 0 && returnType == Integer.TYPE) {
                    mv.line(3);
                    mv.aload(0);
                    mv.invokespecial(p(Object.class), "hashCode", sig(Integer.TYPE));
                    mv.ireturn();
                } else if(simpleName.equals("toString") && paramTypes.length == 0 && returnType == String.class) {
                    mv.line(4);
View Full Code Here

                    mv.line(3);
                    mv.aload(0);
                    mv.invokespecial(p(Object.class), "hashCode", sig(Integer.TYPE));
                    mv.ireturn();
                } else if(simpleName.equals("toString") && paramTypes.length == 0 && returnType == String.class) {
                    mv.line(4);
                    mv.aload(0);
                    mv.invokespecial(p(Object.class), "toString", sig(String.class));
                    mv.areturn();
                } else {
                    mv.line(5);
View Full Code Here

        cw.visit(V1_5, ACC_PUBLIC + ACC_SUPER, classname, null, p(Object.class), new String[] {p(Unsafe.class)});
        cw.visitSource("<generated>", null);
       
        SkinnyMethodAdapter method = new SkinnyMethodAdapter(cw, ACC_PUBLIC, "<init>", sig(void.class), null, null);
        method.start();
        method.line(0);
        method.aload(0);
        method.invokespecial(p(Object.class), "<init>", sig(void.class));
        method.voidreturn();
        method.end();
       
View Full Code Here

        method.invokespecial(p(Object.class), "<init>", sig(void.class));
        method.voidreturn();
        method.end();
       
        method = new SkinnyMethodAdapter(cw, ACC_PUBLIC, "throwException", sig(void.class, Throwable.class), null, null);
        method.line(0);
        method.start();
        method.aload(1);
        method.athrow();
        method.end();
       
View Full Code Here

                        int rubyIndex = selfIndex + 1;

                        SkinnyMethodAdapter mv = new SkinnyMethodAdapter(
                                cw, ACC_PUBLIC, simpleName, sig(returnType, paramTypes), null, null);
                        mv.start();
                        mv.line(1);

                        // TODO: this code should really check if a Ruby equals method is implemented or not.
                        if (simpleName.equals("equals") && paramTypes.length == 1 && paramTypes[0] == Object.class && returnType == Boolean.TYPE) {
                            mv.line(2);
                            mv.aload(0);
View Full Code Here

                        mv.start();
                        mv.line(1);

                        // TODO: this code should really check if a Ruby equals method is implemented or not.
                        if (simpleName.equals("equals") && paramTypes.length == 1 && paramTypes[0] == Object.class && returnType == Boolean.TYPE) {
                            mv.line(2);
                            mv.aload(0);
                            mv.aload(1);
                            mv.invokespecial(p(Object.class), "equals", sig(Boolean.TYPE, params(Object.class)));
                            mv.ireturn();
                        } else if (simpleName.equals("hashCode") && paramTypes.length == 0 && returnType == Integer.TYPE) {
View Full Code Here

                            mv.aload(0);
                            mv.aload(1);
                            mv.invokespecial(p(Object.class), "equals", sig(Boolean.TYPE, params(Object.class)));
                            mv.ireturn();
                        } else if (simpleName.equals("hashCode") && paramTypes.length == 0 && returnType == Integer.TYPE) {
                            mv.line(3);
                            mv.aload(0);
                            mv.invokespecial(p(Object.class), "hashCode", sig(Integer.TYPE));
                            mv.ireturn();
                        } else if (simpleName.equals("toString") && paramTypes.length == 0 && returnType == String.class) {
                            mv.line(4);
View Full Code Here

                            mv.line(3);
                            mv.aload(0);
                            mv.invokespecial(p(Object.class), "hashCode", sig(Integer.TYPE));
                            mv.ireturn();
                        } else if (simpleName.equals("toString") && paramTypes.length == 0 && returnType == String.class) {
                            mv.line(4);
                            mv.aload(0);
                            mv.invokespecial(p(Object.class), "toString", sig(String.class));
                            mv.areturn();
                        } else if (simpleName.equals("__ruby_object") && paramTypes.length == 0 && returnType == IRubyObject.class) {
                            mv.aload(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.