public Object run(IRScope scope) { return run(scope, false, false); }
public Object run(IRScope scope, boolean force) { return run(scope, force, false); }
public Object run(IRScope scope, boolean force) { return run(scope, force, false); }
public Object run(IRScope scope) { return run(scope, false, false); }
public Object run(IRScope scope) { return run(scope, false); }
public Object run(IRScope scope) { return run(scope, false); }
/** * For scopes that don't require a dynamic scope we can run DCE and some other passes which cannot * be stymied by escaped bindings. */ protected void optimizeIfSimpleScope(IRScope scope) { // We cannot pick the passes if we want an explicit set to run. if (RubyInstanceConfig.IR_COMPILER_PASSES != null) return; EnumSet<IRFlags> flags = scope.getFlags(); if (!scope.isUnsafeScope() && !flags.contains(REQUIRES_DYNSCOPE)) { if (flags.contains(RECEIVES_CLOSURE_ARG)) optimizeDelegationPass.run(scope); deadCodeEliminationPass.run(scope); optimizeDynScopesPass.run(scope); } }
/** * For scopes that don't require a dynamic scope we can run DCE and some other passes which cannot * be stymied by escaped bindings. */ protected void optimizeIfSimpleScope(IRScope scope) { // We cannot pick the passes if we want an explicit set to run. if (RubyInstanceConfig.IR_COMPILER_PASSES != null) return; EnumSet<IRFlags> flags = scope.getFlags(); if (!scope.isUnsafeScope() && !flags.contains(REQUIRES_DYNSCOPE)) { if (flags.contains(RECEIVES_CLOSURE_ARG)) optimizeDelegationPass.run(scope); deadCodeEliminationPass.run(scope); optimizeDynScopesPass.run(scope); } }
private void runCompilerPasses() { // SSS FIXME: Why is this again? Document this weirdness! // Forcibly clear out the shared eval-scope variable allocator each time this method executes initEvalScopeVariableAllocator(true); // SSS FIXME: We should configure different optimization levels // and run different kinds of analysis depending on time budget. Accordingly, we need to set // IR levels/states (basic, optimized, etc.) and the // ENEBO: If we use a MT optimization mechanism we cannot mutate CFG // while another thread is using it. This may need to happen on a clone() // and we may need to update the method to return the new method. Also, // if this scope is held in multiple locations how do we update all references? CompilerPassScheduler scheduler = getManager().schedulePasses(); for (CompilerPass pass: scheduler) { pass.run(this); } }
private void runCompilerPasses() { // SSS FIXME: Why is this again? Document this weirdness! // Forcibly clear out the shared eval-scope variable allocator each time this method executes initEvalScopeVariableAllocator(true); // SSS FIXME: We should configure different optimization levels // and run different kinds of analysis depending on time budget. Accordingly, we need to set // IR levels/states (basic, optimized, etc.) and the // ENEBO: If we use a MT optimization mechanism we cannot mutate CFG // while another thread is using it. This may need to happen on a clone() // and we may need to update the method to return the new method. Also, // if this scope is held in multiple locations how do we update all references? CompilerPassScheduler scheduler = getManager().schedulePasses(); for (CompilerPass pass: scheduler) { pass.run(this); } }
private Object makeSureDependencyHasRunOnce(Class<? extends CompilerPass> passClass, IRScope scope, boolean childScope) { CompilerPass pass = createPassInstance(passClass); Object data = pass.previouslyRun(scope); if (data == null) { data = pass.run(scope, childScope); } else { for (CompilerPassListener listener: scope.getManager().getListeners()) { listener.alreadyExecuted(pass, scope, data, childScope); } } return data; }
private Object makeSureDependencyHasRunOnce(Class<? extends CompilerPass> passClass, IRScope scope, boolean childScope) { CompilerPass pass = createPassInstance(passClass); Object data = pass.previouslyRun(scope); if (data == null) { data = pass.run(scope, false, childScope); } else { for (CompilerPassListener listener: scope.getManager().getListeners()) { listener.alreadyExecuted(pass, scope, data, childScope); } } return data; }
private Object makeSureDependencyHasRunOnce(Class<? extends CompilerPass> passClass, IRScope scope, boolean childScope) { CompilerPass pass = createPassInstance(passClass); Object data = pass.previouslyRun(scope); if (data == null) { data = pass.run(scope, false, childScope); } else { for (CompilerPassListener listener: scope.getManager().getListeners()) { listener.alreadyExecuted(pass, scope, data, childScope); } } return data; }
private Object makeSureDependencyHasRunOnce(Class<? extends CompilerPass> passClass, IRScope scope, boolean childScope) { CompilerPass pass = createPassInstance(passClass); Object data = pass.previouslyRun(scope); if (data == null) { data = pass.run(scope, childScope); } else { for (CompilerPassListener listener: scope.getManager().getListeners()) { listener.alreadyExecuted(pass, scope, data, childScope); } } return data; }
public void inlineMethod(IRScope method, RubyModule implClass, int classToken, BasicBlock basicBlock, CallBase call) { // Inline depends(cfg()); new CFGInliner(cfg).inlineMethod(method, implClass, classToken, basicBlock, call); // Reset state resetState(); // Re-run opts for (CompilerPass pass: getManager().getInliningCompilerPasses(this)) { pass.run(this); } }
public void inlineMethod(IRScope method, RubyModule implClass, int classToken, BasicBlock basicBlock, CallBase call) { // Inline depends(cfg()); new CFGInliner(cfg).inlineMethod(method, implClass, classToken, basicBlock, call); // Reset state resetState(); // Re-run opts for (CompilerPass pass: getManager().getInliningCompilerPasses(this)) { pass.run(this); } }
private void runCompilerPasses(List<CompilerPass> passes, IGVDumper dumper) { // All passes are disabled in scopes where BEGIN and END scopes might // screw around with escaped variables. Optimizing for them is not // worth the effort. It is simpler to just go fully safe in scopes // influenced by their presence. if (isUnsafeScope()) { passes = getManager().getSafePasses(this); } if (dumper != null) dumper.dump(getCFG(), "Start"); CompilerPassScheduler scheduler = IRManager.schedulePasses(passes); for (CompilerPass pass : scheduler) { pass.run(this); if (dumper != null) dumper.dump(getCFG(), pass.getShortLabel()); } if (RubyInstanceConfig.IR_UNBOXING) { CompilerPass pass = new UnboxingPass(); pass.run(this); if (dumper != null) dumper.dump(getCFG(), pass.getShortLabel()); } if (dumper != null) dumper.close(); }
private void runCompilerPasses(List<CompilerPass> passes, IGVDumper dumper) { // All passes are disabled in scopes where BEGIN and END scopes might // screw around with escaped variables. Optimizing for them is not // worth the effort. It is simpler to just go fully safe in scopes // influenced by their presence. if (isUnsafeScope()) { passes = getManager().getSafePasses(this); } if (dumper != null) dumper.dump(getCFG(), "Start"); CompilerPassScheduler scheduler = IRManager.schedulePasses(passes); for (CompilerPass pass : scheduler) { pass.run(this); if (dumper != null) dumper.dump(getCFG(), pass.getShortLabel()); } if (RubyInstanceConfig.IR_UNBOXING) { CompilerPass pass = new UnboxingPass(); pass.run(this); if (dumper != null) dumper.dump(getCFG(), pass.getShortLabel()); } if (dumper != null) dumper.close(); }