Package org.jruby.compiler.ir.operands

Examples of org.jruby.compiler.ir.operands.LocalVariable


        return newScope;
    }

    @Override
    public LocalVariable getLocalVariable(String name) {
        LocalVariable variable = localVariables.get(name);
        if (variable == null) {
            variable = new LocalVariable(name, nextLocalVariableSlot);
            localVariables.put(name, variable);
            nextLocalVariableSlot++;
        }

        return variable;
View Full Code Here


    public boolean canRaiseException() { return false; }

    @Interp
    @Override
    public Label interpret(InterpreterContext interp, IRubyObject self) {
        LocalVariable v = (LocalVariable)getResult();
        if (bindingSlot == -1)
            bindingSlot = sourceMethod.getBindingSlot(getSlotName());
        interp.setLocalVariable(v.getLocation(), interp.getSharedBindingVariable(bindingSlot));
        return null;
    }
View Full Code Here

    public StaticScope allocateStaticScope(StaticScope parent) {
        Iterator<LocalVariable> variables = getLiveLocalVariables();
        StaticScope scope = constructStaticScope(parent);

        while (variables.hasNext()) {
            LocalVariable variable = variables.next();
            int destination = scope.addVariable(variable.getName());
            System.out.println("Allocating " + variable + " to " + destination);

                    // Ick: Same Variable objects are not used for all references to the same variable.  S
                    // o setting destination on one will not set them on all
            variable.setLocation(destination);
        }

        return scope;
    }
View Full Code Here

    @Override
    public boolean canRaiseException() { return false; }

    @Override
    public Label interpret(InterpreterContext interp, IRubyObject self) {
      LocalVariable v = (LocalVariable) getArg();
        if (bindingSlot == -1)
            bindingSlot = targetMethod.getBindingSlot(v.getName());
        interp.setSharedBindingVariable(bindingSlot, interp.getLocalVariable(v.getLocation()));
        return null;
    }
View Full Code Here

TOP

Related Classes of org.jruby.compiler.ir.operands.LocalVariable

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.