public IRBuilder newIRBuilder(IRManager manager) { if (is2_0()) { return new IRBuilder20(manager); } else if (is1_9()) { return new IRBuilder19(manager); } else { return new IRBuilder(manager); } }
@Override public LocalVariable findExistingLocalVariable(String name, int scopeDepth) { LocalVariable lvar = localVars.getVariable(name); if (lvar != null) return lvar; int newDepth = isForLoopBody ? scopeDepth : scopeDepth - 1; return newDepth >= 0 ? getLexicalParent().findExistingLocalVariable(name, newDepth) : null; }
@Override public InterpreterContext ensureInstrsReady() { // FIXME: duplicated from MixedModeIRMethod if (method instanceof IRMethod) { return ((IRMethod) method).lazilyAcquireInterpreterContext(); } InterpreterContext ic = method.getInterpreterContext(); return ic; }
private Operand dynamicPiece(Node pieceNode) { Operand piece = pieceNode instanceof StrNode ? buildStrRaw((StrNode) pieceNode) : build(pieceNode); if (piece instanceof StringLiteral) { piece = ((StringLiteral)piece).frozenString; } return piece == null ? manager.getNil() : piece; }
private Operand searchConstInInheritanceHierarchy(IRScope s, Operand startingModule, String name) { Variable constVal = s.getNewTemporaryVariable(); genInheritanceSearchInstrs(s, startingModule, constVal, s.getNewLabel(), true, name); return constVal; }
public synchronized BasicBlock[] prepareForCompilation() { if (!hasBeenBuilt()) lazilyAcquireInterpreterContext(); BasicBlock[] bbs = super.prepareForCompilation(); return bbs; }
@Override public int getNextClosureId() { return getLexicalParent().getNextClosureId(); }
@Override public String toString() { return "Script: file: " + getFileName() + super.toString(); }
public boolean canReceiveNonlocalReturns() { if (this.canReceiveNonlocalReturns) { return true; } boolean canReceiveNonlocalReturns = false; for (IRClosure cl : getClosures()) { if (cl.hasNonlocalReturns || cl.canReceiveNonlocalReturns()) { canReceiveNonlocalReturns = true; } } return canReceiveNonlocalReturns; }
public DefineClassInstr(Variable result, IRClassBody newIRClassBody, Operand container, Operand superClass) { super(Operation.DEF_CLASS); assert result != null: "DefineClassInstr result is null"; this.container = container; this.superClass = superClass == null ? newIRClassBody.getManager().getNil() : superClass; this.newIRClassBody = newIRClassBody; this.result = result; }
@Override public LocalVariable findExistingLocalVariable(String name, int scopeDepth) { // Look in the nearest non-eval scope's shared eval scope vars first. // If you dont find anything there, look in the nearest non-eval scope's regular vars. LocalVariable lvar = nearestNonEvalScope.evalScopeVars.getVariable(name); if ((lvar != null) || scopeDepth == 0) return lvar; else return nearestNonEvalScope.findExistingLocalVariable(name, scopeDepth-nearestNonEvalScopeDepth-1); }
public IRBuilder newIRBuilder(IRManager manager) { if (is2_0()) { return new IRBuilder20(manager); } else if (is1_9()) { return new IRBuilder19(manager); } else { return new IRBuilder(manager); } }
@Override public LocalVariable findExistingLocalVariable(String name, int scopeDepth) { LocalVariable lvar = localVars.getVariable(name); if (lvar != null) return lvar; int newDepth = isForLoopBody ? scopeDepth : scopeDepth - 1; return newDepth >= 0 ? getLexicalParent().findExistingLocalVariable(name, newDepth) : null; }
private Operand dynamicPiece(Node pieceNode) { Operand piece = pieceNode instanceof StrNode ? buildStrRaw((StrNode) pieceNode) : build(pieceNode); if (piece instanceof StringLiteral) { piece = ((StringLiteral)piece).frozenString; } return piece == null ? manager.getNil() : piece; }
private Operand searchConstInInheritanceHierarchy(IRScope s, Operand startingModule, String name) { Variable constVal = s.getNewTemporaryVariable(); genInheritanceSearchInstrs(s, startingModule, constVal, s.getNewLabel(), true, name); return constVal; }
public synchronized BasicBlock[] prepareForCompilation() { if (!hasBeenBuilt()) lazilyAcquireInterpreterContext(); BasicBlock[] bbs = super.prepareForCompilation(); return bbs; }
public boolean canReceiveNonlocalReturns() { if (this.canReceiveNonlocalReturns) { return true; } boolean canReceiveNonlocalReturns = false; for (IRClosure cl : getClosures()) { if (cl.hasNonlocalReturns || cl.canReceiveNonlocalReturns()) { canReceiveNonlocalReturns = true; } } return canReceiveNonlocalReturns; }
public DefineClassInstr(Variable result, IRClassBody newIRClassBody, Operand container, Operand superClass) { super(Operation.DEF_CLASS); assert result != null: "DefineClassInstr result is null"; this.container = container; this.superClass = superClass == null ? newIRClassBody.getManager().getNil() : superClass; this.newIRClassBody = newIRClassBody; this.result = result; }
@Override public LocalVariable findExistingLocalVariable(String name, int scopeDepth) { // Look in the nearest non-eval scope's shared eval scope vars first. // If you dont find anything there, look in the nearest non-eval scope's regular vars. LocalVariable lvar = nearestNonEvalScope.evalScopeVars.getVariable(name); if ((lvar != null) || scopeDepth == 0) return lvar; else return nearestNonEvalScope.findExistingLocalVariable(name, scopeDepth-nearestNonEvalScopeDepth-1); }
@Override public InterpreterContext ensureInstrsReady() { // FIXME: duplicated from MixedModeIRMethod if (method instanceof IRMethod) { return ((IRMethod) method).lazilyAcquireInterpreterContext(); } InterpreterContext ic = method.getInterpreterContext(); return ic; }