Package org.jruby.internal.runtime.methods

Examples of org.jruby.internal.runtime.methods.CompiledIRMethod


        RubyModule containingClass = IRRuntimeHelpers.findInstanceMethodContainer(context, currDynScope, self).getMethodLocation();
        Visibility currVisibility = context.getCurrentVisibility();
        Visibility newVisibility = Helpers.performNormalMethodChecksAndDetermineVisibility(runtime, containingClass, rubyName, currVisibility);

        DynamicMethod method = new CompiledIRMethod(handle, irScope, newVisibility, containingClass);

        Helpers.addInstanceMethod(containingClass, rubyName, method, currVisibility, context, runtime);
    }
View Full Code Here


        if (obj.isFrozen()) throw runtime.newFrozenError("object");

        RubyClass containingClass = obj.getSingletonClass();

        DynamicMethod method = new CompiledIRMethod(handle, irScope, Visibility.PUBLIC, containingClass);

        containingClass.addMethod(rubyName, method);

        obj.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(rubyName));
    }
View Full Code Here

    }

    @JIT
    public static DynamicMethod newCompiledModuleBody(ThreadContext context, MethodHandle handle, IRScope irModule, Object rubyContainer) {
        RubyModule newRubyModule = newRubyModuleFromIR(context, irModule, rubyContainer);
        return new CompiledIRMethod(handle, irModule, Visibility.PUBLIC, newRubyModule);
    }
View Full Code Here

    @JIT
    public static DynamicMethod newCompiledClassBody(ThreadContext context, MethodHandle handle, IRScope irClassBody, Object container, Object superClass) {
        RubyModule newRubyClass = newRubyClassFromIR(context.runtime, irClassBody, superClass, container);

        return new CompiledIRMethod(handle, irClassBody, Visibility.PUBLIC, newRubyClass);
    }
View Full Code Here

    @JIT
    public static void defCompiledClassMethod(ThreadContext context, MethodHandle handle, IRScope method, IRubyObject obj) {
        RubyClass rubyClass = checkClassForDef(context, method, obj);

        rubyClass.addMethod(method.getName(), new CompiledIRMethod(handle, method, Visibility.PUBLIC, rubyClass));
        obj.callMethod(context, "singleton_method_added", context.runtime.fastNewSymbol(method.getName()));
    }
View Full Code Here

    @JIT
    public static void defCompiledClassMethod(ThreadContext context, MethodHandle variable, MethodHandle specific, int specificArity, IRScope method, IRubyObject obj) {
        RubyClass rubyClass = checkClassForDef(context, method, obj);

        rubyClass.addMethod(method.getName(), new CompiledIRMethod(variable, specific, specificArity, method, Visibility.PUBLIC, rubyClass));
        obj.callMethod(context, "singleton_method_added", context.runtime.fastNewSymbol(method.getName()));
    }
View Full Code Here

        RubyModule clazz = findInstanceMethodContainer(context, currDynScope, self);

        Visibility currVisibility = context.getCurrentVisibility();
        Visibility newVisibility = Helpers.performNormalMethodChecksAndDetermineVisibility(runtime, clazz, method.getName(), currVisibility);

        DynamicMethod newMethod = new CompiledIRMethod(handle, method, newVisibility, clazz);

        Helpers.addInstanceMethod(clazz, method.getName(), newMethod, currVisibility, context, runtime);
    }
View Full Code Here

        RubyModule clazz = findInstanceMethodContainer(context, currDynScope, self);

        Visibility currVisibility = context.getCurrentVisibility();
        Visibility newVisibility = Helpers.performNormalMethodChecksAndDetermineVisibility(runtime, clazz, method.getName(), currVisibility);

        DynamicMethod newMethod = new CompiledIRMethod(variable, specific, specificArity, method, newVisibility, clazz);

        Helpers.addInstanceMethod(clazz, method.getName(), newMethod, currVisibility, context, runtime);
    }
View Full Code Here

                Map<Integer, MethodType> signatures = ((IRMethod)method.getIRMethod()).getNativeSignatures();
                String jittedName = ((IRMethod)method.getIRMethod()).getJittedName();
                if (signatures.size() == 1) {
                    // only variable-arity
                    method.switchToJitted(
                            new CompiledIRMethod(
                                    MethodHandles.publicLookup().findStatic(sourceClass, jittedName, signatures.get(-1)),
                                    method.getIRMethod(),
                                    method.getVisibility(),
                                    method.getImplementationClass()));
                } else {
                    // also specific-arity
                    for (Map.Entry<Integer, MethodType> entry : signatures.entrySet()) {
                        if (entry.getKey() == -1) continue; // variable arity handle pushed above

                        method.switchToJitted(
                                new CompiledIRMethod(
                                        MethodHandles.publicLookup().findStatic(sourceClass, jittedName, signatures.get(-1)),
                                        MethodHandles.publicLookup().findStatic(sourceClass, jittedName, entry.getValue()),
                                        entry.getKey(),
                                        method.getIRMethod(),
                                        method.getVisibility(),
View Full Code Here

TOP

Related Classes of org.jruby.internal.runtime.methods.CompiledIRMethod

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.