Package org.jruby.truffle.runtime.methods

Examples of org.jruby.truffle.runtime.methods.Arity


            optional = 0;
        } else {
            optional = methodDetails.getMethodAnnotation().optional();
        }

        final Arity arity = new Arity(required,  optional, methodDetails.getMethodAnnotation().argumentsAsArray());

        final List<RubyNode> argumentsNodes = new ArrayList<>();

        if (needsSelf) {
            RubyNode readSelfNode = new SelfNode(context, sourceSection);

            if (methodDetails.getMethodAnnotation().lowerFixnumSelf()) {
                readSelfNode = new FixnumLowerNode(readSelfNode);
            }

            argumentsNodes.add(readSelfNode);
        }

        if (methodDetails.getMethodAnnotation().argumentsAsArray()) {
            argumentsNodes.add(new ReadAllArgumentsNode(context, sourceSection));
        } else {
            for (int n = 0; n < arity.getRequired() + arity.getOptional(); n++) {
                RubyNode readArgumentNode = new ReadPreArgumentNode(context, sourceSection, n, MissingArgumentBehaviour.UNDEFINED);

                if (ArrayUtils.contains(methodDetails.getMethodAnnotation().lowerFixnumParameters(), n)) {
                    readArgumentNode = new FixnumLowerNode(readArgumentNode);
                }
View Full Code Here

TOP

Related Classes of org.jruby.truffle.runtime.methods.Arity

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.