Package org.jruby.compiler.impl

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


        throw new RuntimeException("Unsupported method signature for dynamic call: " + site.type());
    }
   
    public static void installBytecode(MethodVisitor method, String classname) {
        SkinnyMethodAdapter clinitMethod = new SkinnyMethodAdapter(method);
        clinitMethod.ldc(c(classname));
        clinitMethod.invokestatic(p(Class.class), "forName", sig(Class.class, params(String.class)));
        clinitMethod.ldc(Type.getType(InvokeDynamicSupport.class));
        clinitMethod.ldc("bootstrap");
        clinitMethod.getstatic(p(Linkage.class), "BOOTSTRAP_METHOD_TYPE", ci(MethodType.class));
        clinitMethod.invokestatic(p(MethodHandles.class), "findStatic", sig(MethodHandle.class, Class.class, String.class, MethodType.class));
View Full Code Here


   
    public static void installBytecode(MethodVisitor method, String classname) {
        SkinnyMethodAdapter clinitMethod = new SkinnyMethodAdapter(method);
        clinitMethod.ldc(c(classname));
        clinitMethod.invokestatic(p(Class.class), "forName", sig(Class.class, params(String.class)));
        clinitMethod.ldc(Type.getType(InvokeDynamicSupport.class));
        clinitMethod.ldc("bootstrap");
        clinitMethod.getstatic(p(Linkage.class), "BOOTSTRAP_METHOD_TYPE", ci(MethodType.class));
        clinitMethod.invokestatic(p(MethodHandles.class), "findStatic", sig(MethodHandle.class, Class.class, String.class, MethodType.class));
        clinitMethod.invokestatic(p(Linkage.class), "registerBootstrapMethod", sig(void.class, Class.class, MethodHandle.class));
    }
View Full Code Here

    public static void installBytecode(MethodVisitor method, String classname) {
        SkinnyMethodAdapter clinitMethod = new SkinnyMethodAdapter(method);
        clinitMethod.ldc(c(classname));
        clinitMethod.invokestatic(p(Class.class), "forName", sig(Class.class, params(String.class)));
        clinitMethod.ldc(Type.getType(InvokeDynamicSupport.class));
        clinitMethod.ldc("bootstrap");
        clinitMethod.getstatic(p(Linkage.class), "BOOTSTRAP_METHOD_TYPE", ci(MethodType.class));
        clinitMethod.invokestatic(p(MethodHandles.class), "findStatic", sig(MethodHandle.class, Class.class, String.class, MethodType.class));
        clinitMethod.invokestatic(p(Linkage.class), "registerBootstrapMethod", sig(void.class, Class.class, MethodHandle.class));
    }
View Full Code Here

                    mv.pop();
                    // exit monitor before making call
                    // FIXME: this not being in a finally is a little worrisome
                    mv.aload(0);
                    mv.getfield(pathName, "self", ci(IRubyObject.class));
                    mv.ldc(simpleName);
                    coerceArgumentsToRuby(mv, paramTypes, pathName);
                    mv.invokestatic(p(RuntimeHelpers.class), "invokeMethodMissing", sig(IRubyObject.class, IRubyObject.class, String.class, IRubyObject[].class));
                    mv.go_to(end);
               
                    // perform the dispatch
View Full Code Here

               
                    // load self, class, and name
                    mv.aload(0);
                    mv.getfield(pathName, "self", ci(IRubyObject.class));
                    mv.getstatic(pathName, "rubyClass", ci(RubyClass.class));
                    mv.ldc(simpleName);
               
                    // coerce arguments
                    coerceArgumentsToRuby(mv, paramTypes, pathName);
               
                    // load null block
View Full Code Here

                mv.getstatic(name, simpleName, ci(DynamicMethod.class));
                mv.dup();
                mv.ifnonnull(dispatch);
                mv.pop();
                mv.getstatic(name, "rubyClass", ci(RubyClass.class));
                mv.ldc("method_missing");
                mv.invokevirtual(p(RubyClass.class), "searchMethod", sig(DynamicMethod.class, String.class));
                mv.label(dispatch);
               
                // get current context
                mv.getstatic(name, "ruby", ci(Ruby.class));
View Full Code Here

               
                // load self, class, and name
                mv.aload(0);
                mv.getfield(name, "self", ci(IRubyObject.class));
                mv.getstatic(name, "rubyClass", ci(RubyClass.class));
                mv.ldc(simpleName);
               
                // load arguments into IRubyObject[] for dispatch
                if (method.getParameterTypes().length != 0) {
                    mv.pushInt(method.getParameterTypes().length);
                    mv.anewarray(p(IRubyObject.class));
View Full Code Here

                    mv.label(tryStart);

                    mv.aload(0);
                    mv.getfield(pathName, "self", ci(IRubyObject.class));
                    for (String eachName : nameSet) {
                        mv.ldc(eachName);
                    }
                    mv.invokestatic(p(MiniJava.class), "searchMethod", sig(DynamicMethod.class, params(IRubyObject.class, String.class, nameSet.size())));
                    mv.dup();
               
                    // if it's not undefined...
View Full Code Here

                        mv.aload(2);
                        mv.aload(3);
                        mv.aload(4);
                        for (int i = 0; i < scope.getRequiredArgs(); i++) {
                            mv.aload(5);
                            mv.ldc(i);
                            mv.arrayload();
                        }
                        mv.aload(6);

                        switch (scope.getRequiredArgs()) {
View Full Code Here

                    // if we fall off the switch, error.
                    mv.label(defaultCase);
                    mv.aload(THREADCONTEXT_INDEX);
                    mv.invokevirtual(p(ThreadContext.class), "getRuntime", sig(Ruby.class));
                    mv.ldc("Error: fell off switched invoker for class: " + implementationClass.getBaseName());
                    mv.invokevirtual(p(Ruby.class), "newRuntimeError", sig(RaiseException.class, String.class));
                    mv.athrow();

                    c = endCall(cw, mv, generatedClassName);
                }
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.