public boolean canReceiveNonlocalReturns() { computeScopeFlags(); return flags.contains(CAN_RECEIVE_NONLOCAL_RETURNS); }
public boolean canReceiveNonlocalReturns() { computeScopeFlags(); return flags.contains(CAN_RECEIVE_NONLOCAL_RETURNS); }
@Override public Object execute(IRScope scope, Object... data) { // Make sure flags are computed scope.computeScopeFlags(); // Cannot run this on scopes that require dynamic scopes if (scope.getExecutionContext().getFlags().contains(IRFlags.REQUIRES_DYNSCOPE)) return null; eliminateLocalVars(scope); // SSS FIXME: Why null? Return a non-null value so that we don't // run this repeatedly on the same scope. return null; }
@Override public Object execute(IRScope scope, Object... data) { // Make sure flags are computed scope.computeScopeFlags(); // Cannot run this on scopes that require dynamic scopes if (scope.getExecutionContext().getFlags().contains(IRFlags.REQUIRES_DYNSCOPE)) return null; eliminateLocalVars(scope); // SSS FIXME: Why null? Return a non-null value so that we don't // run this repeatedly on the same scope. return null; }
@Override public Object execute(IRScope s, Object... data) { // This let us compute execute scope flags for a method based on what all nested closures do for (IRClosure c: s.getClosures()) { run(c, true); } for (BasicBlock b: ((CFG) data[0]).getBasicBlocks()) { runLocalOptsOnInstrList(s, b.getInstrs().listIterator(), false); } // Only after running local opts, compute various execution scope flags s.computeScopeFlags(); // Mark done locallyOptimized = true; return null; }
@Override public Object execute(IRScope s, Object... data) { // This let us compute execute scope flags for a method based on what all nested closures do for (IRClosure c: s.getClosures()) { run(c, true); } for (BasicBlock b: ((CFG) data[0]).getBasicBlocks()) { runLocalOptsOnInstrList(s, b.getInstrs().listIterator(), false); } // Only after running local opts, compute various execution scope flags s.computeScopeFlags(); // Mark done locallyOptimized = true; return null; }
computeScopeFlags(false, getInstrs()); } else { boolean receivesClosureArg = false; for (BasicBlock b: cfg.getBasicBlocks()) { receivesClosureArg = computeScopeFlags(receivesClosureArg, b.getInstrs());
computeScopeFlags(false, getInstrs()); } else { boolean receivesClosureArg = false; for (BasicBlock b: cfg.getBasicBlocks()) { receivesClosureArg = computeScopeFlags(receivesClosureArg, b.getInstrs());
@Override public Object execute(IRScope s, Object... data) { for (BasicBlock b: s.getCFG().getBasicBlocks()) { runLocalOptsOnBasicBlock(s, b); } // SSS FIXME: What is this about? // Why 'Only after running local opts'? Figure out and document. // // Only after running local opts, compute various execution scope flags. s.computeScopeFlags(); // LVA information is no longer valid after this pass // Currently, we don't run this after LVA, but just in case ... // // FIXME: Grrr ... this seems broken to have to create a new object to invalidate (new LiveVariableAnalysis()).invalidate(s); return null; }
@Override public Object execute(IRScope scope, Object... data) { // Make sure flags are computed scope.computeScopeFlags(); LiveVariablesProblem lvp = new LiveVariablesProblem(scope); if (scope instanceof IRClosure) { // We have to conservatively assume that any dirtied variables // that belong to an outer scope are live on exit. Set<LocalVariable> nlVars = new HashSet<LocalVariable>(); EnumSet<IRFlags> flags = scope.getExecutionContext().getFlags(); collectNonLocalDirtyVars((IRClosure)scope, nlVars, flags.contains(IRFlags.DYNSCOPE_ELIMINATED) ? -1 : 0); // Init DF vars from this set for (Variable v: nlVars) { lvp.addDFVar(v); } lvp.setVarsLiveOnScopeExit(nlVars); } lvp.compute_MOP_Solution(); scope.putLiveVariablesProblem(lvp); return lvp; }
@Override public Object execute(IRScope scope, Object... data) { // Make sure flags are computed scope.computeScopeFlags(); LiveVariablesProblem lvp = new LiveVariablesProblem(scope); if (scope instanceof IRClosure) { // We have to conservatively assume that any dirtied variables // that belong to an outer scope are live on exit. Set<LocalVariable> nlVars = new HashSet<LocalVariable>(); EnumSet<IRFlags> flags = scope.getExecutionContext().getFlags(); collectNonLocalDirtyVars((IRClosure)scope, nlVars, flags.contains(IRFlags.DYNSCOPE_ELIMINATED) ? -1 : 0); // Init DF vars from this set for (Variable v: nlVars) { lvp.addDFVar(v); } lvp.setVarsLiveOnScopeExit(nlVars); } lvp.compute_MOP_Solution(); scope.putLiveVariablesProblem(lvp); return lvp; }
@Override public Object execute(IRScope s, Object... data) { for (BasicBlock b: s.getCFG().getBasicBlocks()) { runLocalOptsOnBasicBlock(s, b); } // SSS FIXME: What is this about? // Why 'Only after running local opts'? Figure out and document. // // Only after running local opts, compute various execution scope flags. s.computeScopeFlags(); // LVA information is no longer valid after this pass // Currently, we don't run this after LVA, but just in case ... // // FIXME: Grrr ... this seems broken to have to create a new object to invalidate (new LiveVariableAnalysis()).invalidate(s); return null; }
@Override public Object execute(IRScope scope, Object... data) { scope.computeScopeFlags();
@Override public Object execute(IRScope scope, Object... data) { scope.computeScopeFlags();