public LocalVariable getLocalVariable(RubySymbol name, int scopeDepth) { return scope.getLocalVariable(name, scopeDepth); }
protected LocalVariable getBlockArgVariable(IRScope cl, String name, int depth) { return cl.getLocalVariable(name, depth); }
public LocalVariable getLocalVariable(RubySymbol name, int scopeDepth) { return scope.getLocalVariable(name, scopeDepth); }
protected LocalVariable getBlockArgVariable(IRScope cl, String name, int depth) { return cl.getLocalVariable(name, depth); }
public LocalVariable getNewFlipStateVariable() { return getLocalVariable("%flip_" + allocateNextPrefixedName("%flip"), 0); }
public LocalVariable getNewFlipStateVariable() { return getLocalVariable("%flip_" + allocateNextPrefixedName("%flip"), 0); }
public Operand buildLocalVar(LocalVarNode node, IRScope s) { return s.getLocalVariable(node.getName(), node.getDepth()); }
protected LocalVariable getArgVariable(IRScope s, String name, int depth) { // For non-loops, this name will override any name that exists in outer scopes return s.isForLoopBody() ? s.getLocalVariable(name, depth) : s.getNewLocalVariable(name, 0); }
protected LocalVariable getArgVariable(IRScope s, String name, int depth) { // For non-loops, this name will override any name that exists in outer scopes return s.isForLoopBody() ? s.getLocalVariable(name, depth) : s.getNewLocalVariable(name, 0); }
public Operand buildDVar(DVarNode node, IRScope s) { return s.getLocalVariable(node.getName(), node.getDepth()); }
public Variable getNewInlineVariable(String inlinePrefix, Variable v) { if (v instanceof LocalVariable) { LocalVariable lv = (LocalVariable)v; return getLocalVariable(inlinePrefix + lv.getName(), lv.getScopeDepth()); } else { return getNewTemporaryVariable(); } }
public Variable getNewInlineVariable(String inlinePrefix, Variable v) { if (v instanceof LocalVariable) { LocalVariable lv = (LocalVariable)v; return getLocalVariable(inlinePrefix + lv.getName(), lv.getScopeDepth()); } else { return getNewTemporaryVariable(); } }
public static LocalVariable decode(IRReaderDecoder d) { return d.getCurrentScope().getLocalVariable(d.decodeSymbol(), d.decodeInt()); }
public static LocalVariable decode(IRReaderDecoder d) { return d.getCurrentScope().getLocalVariable(d.decodeSymbol(), d.decodeInt()); }
@Override public LocalVariable getLocalVariable(String name, int scopeDepth) { if (isForLoopBody) return getLexicalParent().getLocalVariable(name, scopeDepth); LocalVariable lvar = findExistingLocalVariable(name, scopeDepth); if (lvar == null) lvar = getNewLocalVariable(name, scopeDepth); // Create a copy of the variable usable at the right depth if (lvar.getScopeDepth() != scopeDepth) lvar = lvar.cloneForDepth(scopeDepth); return lvar; }
@Override public LocalVariable getLocalVariable(String name, int scopeDepth) { if (isForLoopBody) return getLexicalParent().getLocalVariable(name, scopeDepth); LocalVariable lvar = findExistingLocalVariable(name, scopeDepth); if (lvar == null) lvar = getNewLocalVariable(name, scopeDepth); // Create a copy of the variable usable at the right depth if (lvar.getScopeDepth() != scopeDepth) lvar = lvar.cloneForDepth(scopeDepth); return lvar; }
public LocalVariable getNewFlipStateVariable() { ByteList flip = FLIP.dup(); flip.append(allocateNextPrefixedName("%flip")); return getLocalVariable(getManager().getRuntime().newSymbol(flip) , 0); }
public LocalVariable getNewFlipStateVariable() { ByteList flip = FLIP.dup(); flip.append(allocateNextPrefixedName("%flip")); return getLocalVariable(getManager().getRuntime().newSymbol(flip) , 0); }
protected Variable getRenamedVariableSimple(Variable v) { if (isClosure) { // when inlining a closure, // - local var depths are reduced by 1 (to move them to the host scope) // - tmp vars are reallocated in the host scope if (v instanceof LocalVariable) { LocalVariable lv = (LocalVariable) v; int depth = lv.getScopeDepth(); return getHostScope().getLocalVariable(lv.getName(), depth > 1 ? depth - 1 : 0); } return getHostScope().createTemporaryVariable(); } // METHOD_INLINE return getHostScope().getNewInlineVariable(inlineVarPrefix, v); }
private void receiveMethodClosureArg(ArgsNode argsNode, IRScope s) { Variable blockVar = null; if (argsNode.getBlock() != null) { String blockArgName = argsNode.getBlock().getName(); blockVar = s.getLocalVariable(blockArgName, 0); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("block", blockArgName); s.addInstr(new ReceiveClosureInstr(blockVar)); } // SSS FIXME: This instruction is only needed if there is an yield instr somewhere! // In addition, store the block argument in an implicit block variable Variable implicitBlockArg = s.getImplicitBlockArg(); if (blockVar == null) s.addInstr(new ReceiveClosureInstr(implicitBlockArg)); else s.addInstr(new CopyInstr(implicitBlockArg, blockVar)); }