Package org.jruby.internal.runtime.methods

Examples of org.jruby.internal.runtime.methods.DynamicMethod.call()


            IRubyObject arg0, IRubyObject arg1) {
        DynamicMethod method = searchMethod(name);
        if (shouldCallMethodMissing(method)) {
            return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, Block.NULL_BLOCK);
        }
        return method.call(context, self, this, name, arg0, arg1);
    }
   
    public IRubyObject invoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType) {
        DynamicMethod method = searchMethod(name);
View Full Code Here


        DynamicMethod method = searchMethod(name);
        IRubyObject caller = context.getFrameSelf();
        if (shouldCallMethodMissing(method, name, caller, callType)) {
            return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, callType, arg0, arg1, arg2, Block.NULL_BLOCK);
        }
        return method.call(context, self, this, name, arg0, arg1, arg2);
    }
   
    public IRubyObject finvoke(ThreadContext context, IRubyObject self, String name,
            IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) {
        DynamicMethod method = searchMethod(name);
View Full Code Here

            IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) {
        DynamicMethod method = searchMethod(name);
        if (shouldCallMethodMissing(method)) {
            return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), name, CallType.FUNCTIONAL, arg0, arg1, arg2, Block.NULL_BLOCK);
        }
        return method.call(context, self, this, name, arg0, arg1, arg2);
    }

    private void dumpReifiedClass(String dumpDir, String javaPath, byte[] classBytes) {
        if (dumpDir != null) {
            if (dumpDir.equals("")) {
View Full Code Here

        if (method.isUndefined()) {
            return RuntimeHelpers.callMethodMissing(context, self, method.getVisibility(), "inherited", CallType.FUNCTIONAL, Block.NULL_BLOCK);
        }

        return method.call(context, self, getMetaClass(), "inherited", subclass, Block.NULL_BLOCK);
    }

    /** rb_class_new_instance
    *
    */
 
View Full Code Here

        } else {
            DynamicMethod method = searchMethod("respond_to?");
            if (method != runtime.getRespondToMethod() && !method.isUndefined()) {

                // custom respond_to?, cache nothing and use slow path
                if (method.call(context, target, this, "respond_to?", runtime.newSymbol("marshal_load")).isTrue()) {
                    target.callMethod(context, "marshal_load", data);
                    return target;
                } else {
                    throw runtime.newTypeError("class " + getName() + " needs to have method `marshal_load'");
                }
View Full Code Here

        } else {
            DynamicMethod method = getSingletonClass().searchMethod("respond_to?");
            if (method != runtime.getRespondToMethod() && !method.isUndefined()) {

                // custom respond_to?, cache nothing and use slow path
                if (method.call(context, this, getSingletonClass(), "respond_to?", runtime.newSymbol("_load")).isTrue()) {
                    return callMethod(context, "_load", data);
                } else {
                    throw runtime.newTypeError("class " + getName() + " needs to have method `_load'");
                }
View Full Code Here

                return ((JavaProxy)recv).object == null;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", args, block);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, args, block);
                return proxy;
            }

            @Override
View Full Code Here

                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, Block block) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", block);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, block);
                return proxy;
            }

            @Override
View Full Code Here

                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, Block block) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0, block);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, arg0, block);

                return proxy;
            }
View Full Code Here

                return proxy;
            }

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg0, IRubyObject arg1, Block block) {
                IRubyObject proxy = oldNew.call(context, self, clazz, "new_proxy", arg0, arg1, block);
                if (needsCreate(proxy)) jcreateSite.call(context, proxy, proxy, arg0, arg1, block);
                return proxy;
            }

            @Override
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.