Package org.jruby.truffle.runtime.core

Examples of org.jruby.truffle.runtime.core.RubyClass


    protected void lookup(VirtualFrame frame) {
        CompilerAsserts.neverPartOfCompilation();

        // TODO: this is wrong, we need the lexically enclosing method (or define_method)'s module
        final RubyModule declaringModule = RubyCallStack.getCurrentMethod().getDeclaringModule();
        final RubyClass selfMetaClass = getContext().getCoreLibrary().box(RubyArguments.getSelf(frame.getArguments())).getMetaClass();

        method = ModuleOperations.lookupSuperMethod(declaringModule, name, selfMetaClass);

        if (method == null || method.isUndefined()) {
            method = null;
View Full Code Here


        if (constant != null) {
            return constant;
        }

        // Look in lexical scope
        final RubyClass objectClass = context.getCoreLibrary().getObjectClass();

        if (lexicalScope != null) {
            if (lexicalScope != context.getRootLexicalScope()) {
                // Already looked in the top lexical scope, which is module.
                lexicalScope = lexicalScope.getParent();
            }

            while (lexicalScope != context.getRootLexicalScope()) {
                constant = lexicalScope.getLiveModule().getConstants().get(name);

                if (constant != null) {
                    return constant;
                }

                lexicalScope = lexicalScope.getParent();
            }
        }

        // Look in ancestors
        for (RubyModule ancestor : module.parentAncestors()) {
            constant = ancestor.getConstants().get(name);

            if (constant != null) {
                return constant;
            }
        }

        // Look in Object and its included modules
        if (module.isOnlyAModule()) {
            for (RubyModule ancestor : objectClass.selfAndIncludedModules()) {
                constant = ancestor.getConstants().get(name);

                if (constant != null) {
                    return constant;
                }
View Full Code Here

            bytesToIntNode = prev.bytesToIntNode;
        }

        @Specialization
        public RubyObject allocate_sized(VirtualFrame frame, RubyObject bytes) {
            RubyClass self = (RubyClass) RubyArguments.getSelf(frame.getArguments());
            return RubiniusByteArray.allocate_sized(this, self, TypeConversionUtils.convertToLong(this, bytesToIntNode, frame, bytes));
        }
View Full Code Here

TOP

Related Classes of org.jruby.truffle.runtime.core.RubyClass

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.