Package org.jruby.truffle.runtime

Examples of org.jruby.truffle.runtime.RubyConstant


            return newDispatch.executeDispatch(frame, methodReceiverObject, lexicalScope, receiverObject,
                    methodName, blockObject, argumentsObjects, dispatchAction);

        } else if (dispatchAction == Dispatch.DispatchAction.READ_CONSTANT) {
            final RubyModule module = (RubyModule) boxedReceiverObject;
            final RubyConstant constant = lookupConstant(lexicalScope, module, methodName.toString(),
                    ignoreVisibility, dispatchAction);

            if (constant == null) {
                final DispatchNode newDispatch = createConstantMissingNode(methodName, callerClass, module, dispatchAction);
                return newDispatch.executeDispatch(frame, methodReceiverObject, lexicalScope, module,
                        methodName, blockObject, argumentsObjects, dispatchAction);
            }

            // The module, the "receiver" is an instance of its singleton class.
            // But we want to check the module assumption, not its singleton class assumption.
            final DispatchNode newDispatch = CachedBoxedDispatchNodeFactory.create(getContext(), methodName, first,
                    module.getSingletonClass(null), module.getUnmodifiedAssumption(), constant.getValue(),
                    null, indirect, null, null, null, null, null, null, null);

            first.replace(newDispatch);
            return newDispatch.executeDispatch(frame, methodReceiverObject, lexicalScope, receiverObject,
                    methodName, blockObject, argumentsObjects, dispatchAction);
View Full Code Here


            LexicalScope lexicalScope,
            RubyModule module,
            String name,
            boolean ignoreVisibility,
            Dispatch.DispatchAction dispatchAction) {
        RubyConstant constant = ModuleOperations.lookupConstant(getContext(), lexicalScope, module, name);

        // If no constant was found, use #const_missing
        if (constant == null) {
            return null;
        }

        if (!ignoreVisibility && !constant.isVisibleTo(getContext(), lexicalScope, module)) {
            throw new RaiseException(getContext().getCoreLibrary().nameErrorPrivateConstant(module, name, this));
        }

        return constant;
    }
View Full Code Here

            RubyModule receiverObject,
            Object constantName,
            Object blockObject,
            Object argumentsObjects,
            Dispatch.DispatchAction dispatchAction) {
        final RubyConstant constant = lookupConstant(lexicalScope, receiverObject,
                toJavaStringNode.executeJavaString(frame, constantName), ignoreVisibility, dispatchAction);

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

        constantMissingProfile.enter();

        final RubyClass callerClass = ignoreVisibility ? null : box.box(RubyArguments.getSelf(frame.getArguments())).getMetaClass();
View Full Code Here

TOP

Related Classes of org.jruby.truffle.runtime.RubyConstant

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.