Package org.jruby.compiler.impl

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


        a.ldc(newIRModuleBody.getLineNumber());

        a.aload(0);
        a.aload(1);
        a.ldc(scopeString);
        a.invokestatic(p(RuntimeHelpers.class), "decodeScope", "(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/parser/StaticScope;Ljava/lang/String;)Lorg/jruby/parser/StaticScope;");

        // create module
        m.loadLocal(0);
        visit(definemoduleinstr.getContainer());
        m.invokeHelper("checkIsRubyModule", RubyModule.class, ThreadContext.class, Object.class);
View Full Code Here


        //// static scope
        a.aload(0);
        a.aload(1);
        a.ldc(scopeString);
        a.invokestatic(p(RuntimeHelpers.class), "decodeScope", "(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/parser/StaticScope;Ljava/lang/String;)Lorg/jruby/parser/StaticScope;");
        a.swap();

        // set into StaticScope
        a.dup2();
        a.invokevirtual(p(StaticScope.class), "setModule", sig(void.class, RubyModule.class));
View Full Code Here

        a.getstatic(jvm.clsData().clsName, method.getJittedName() + "_IRScope", ci(IRScope.class));
        jvmLoadLocal(DYNAMIC_SCOPE);
        jvmMethod().loadSelf();

        // add method
        a.invokestatic(p(IRRuntimeHelpers.class), "defCompiledInstanceMethod", defSignature);
    }

    public String pushHandlesForDef(String name, Map<Integer, MethodType> signatures, MethodType variable, String variableOnly, String variableAndSpecific) {
        String defSignature;
View Full Code Here

                    nextIndex++;
                }
            }

            // invoke stub
            method.invokestatic(p(BasicObjectStub.class), stub.getName(), sig(stub.getReturnType(), stub.getParameterTypes()));

            Class retType = stub.getReturnType();
            if (retType == void.class) {
                method.voidreturn();
            } else {
View Full Code Here

            }
            break;
        }

        if (Modifier.isStatic(method.getModifiers())) {
            m.invokestatic(p(method.getDeclaringClass()), method.getName(), sig(returnType, paramTypes));
        } else if (Modifier.isInterface(method.getDeclaringClass().getModifiers())) {
            m.invokeinterface(p(method.getDeclaringClass()), method.getName(), sig(returnType, paramTypes));
        } else {
            m.invokevirtual(p(method.getDeclaringClass()), method.getName(), sig(returnType, paramTypes));
        }
View Full Code Here

        if (returnType == void.class) {
            m.aconst_null();
        } else if (returnType.isPrimitive()) {
            Class boxType = getBoxType(returnType);
            m.invokestatic(p(boxType), "valueOf", sig(boxType, returnType));
        }
        m.areturn();
        m.end();

        if (needsArgsVersion) {
View Full Code Here

            mv.start();

            // check arity
            mv.aloadMany(0, 1, 4, 5); // method, context, name, args, required
            mv.pushInt(scope.getRequiredArgs());
            mv.invokestatic(p(JavaMethod.class), "checkArgumentCount", sig(void.class, JavaMethod.class, ThreadContext.class, String.class, IRubyObject[].class, int.class));

            mv.aloadMany(0, 1, 2, 3, 4);
            for (int i = 0; i < scope.getRequiredArgs(); i++) {
                mv.aload(5);
                mv.ldc(i);
View Full Code Here

            if (specificArity) {
                for (int i = 0; i < scope.getRequiredArgs(); i++) {
                    mv.aload(ARGS_INDEX + i);
                }
                mv.aload(ARGS_INDEX + scope.getRequiredArgs());
                mv.invokestatic(className, method, Helpers.getStaticMethodSignature(className, scope.getRequiredArgs()));
            } else {
                mv.aloadMany(ARGS_INDEX, BLOCK_INDEX);
                mv.invokestatic(className, method, Helpers.getStaticMethodSignature(className, 4));
            }
        }
View Full Code Here

                }
                mv.aload(ARGS_INDEX + scope.getRequiredArgs());
                mv.invokestatic(className, method, Helpers.getStaticMethodSignature(className, scope.getRequiredArgs()));
            } else {
                mv.aloadMany(ARGS_INDEX, BLOCK_INDEX);
                mv.invokestatic(className, method, Helpers.getStaticMethodSignature(className, 4));
            }
        }
        if (framed || heapScoped) {
            mv.label(tryEnd);
        }
View Full Code Here

        ClassWriter cw = createBlockCtor(mname, classname);
        SkinnyMethodAdapter mv = startBlockCall(cw);
        mv.aload(0);
        mv.getfield(mname, "$scriptObject", "L" + classname + ";");
        mv.aloadMany(1, 2, 3, 4);
        mv.invokestatic(classname, method, sig(
                IRubyObject.class, "L" + classname + ";", ThreadContext.class,
                        IRubyObject.class, IRubyObject.class, Block.class));
        mv.areturn();
        mv.end();
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.