Package org.jruby.compiler.ir

Examples of org.jruby.compiler.ir.IRScope


public class Interpreter {
    private static boolean debug = Boolean.parseBoolean(System.getProperty("jruby.ir.debug", "false"));
   
    public static IRubyObject interpret(Ruby runtime, Node rootNode, IRubyObject self) {
        IRScope scope = new IRBuilder().buildRoot((RootNode) rootNode);
        scope.prepareForInterpretation();
//        scope.runCompilerPass(new CallSplitter());

        return interpretTop(runtime, scope, self);
    }
View Full Code Here


    @Override
    public Label interpret(InterpreterContext interp, IRubyObject self) {
        Ruby       runtime   = interp.getRuntime();
        ClassMetaObject cmo  = (ClassMetaObject)getOperand1();
        IRScope    scope     = cmo.scope;
        RubyModule container = cmo.getContainer(interp, runtime);
        RubyModule module;
        if (scope instanceof IRMetaClass) {
            module = container.getMetaClass();
        } else {
            RubyClass sc = (RubyClass)getOperand2().retrieve(interp);
            module = container.defineOrGetClassUnder(scope.getName(), sc == null ? runtime.getObject() : sc);
        }

        cmo.interpretBody(interp, interp.getContext(), module);
        return null;
    }
View Full Code Here

    @Override
    public Label interpret(InterpreterContext interp, IRubyObject self) {
        Ruby       runtime   = interp.getRuntime();
        ModuleMetaObject mmo = (ModuleMetaObject)getArg();
        IRScope    scope     = mmo.scope;
        RubyModule container = mmo.getContainer(interp, runtime);
        RubyModule module    = container.defineOrGetModuleUnder(scope.getName());

        mmo.interpretBody(interp, interp.getContext(), module);
        return null;
    }
View Full Code Here

            Operand object = getReceiver();

            // Unknown receiver -- could be Proc!!
            if (!(object instanceof MetaObject)) return true;

            IRScope c = ((MetaObject) object).scope;

            if ((c instanceof IRClass) && c.getName().equals("Proc")) return true;
        }
       
        // SSS FIXME: Are all bases covered?
        return false// All checks done -- dont need one
    }
View Full Code Here

    public Operand simplifyAndGetResult(Map<Operand, Operand> valueMap) {
        simplifyOperands(valueMap);
        if (!(getSource() instanceof MetaObject)) return null;

      // SSS FIXME: Isn't this always going to be an IR Module?
        IRScope s = ((MetaObject) getSource()).scope;
      return (s instanceof IRModule) ? ((IRModule)s).getConstantValue(getName()) : null;
    }
View Full Code Here

    public Operand simplifyAndGetResult(Map<Operand, Operand> valueMap) {
        simplifyOperands(valueMap);
        if (!(getSource() instanceof MetaObject)) return null;

      // SSS FIXME: Isn't this always going to be an IR Module?
        IRScope s = ((MetaObject) getSource()).scope;
      return (s instanceof IRModule) ? ((IRModule)s).getConstantValue(getName()) : null;
    }
View Full Code Here

TOP

Related Classes of org.jruby.compiler.ir.IRScope

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.