A mechanism for executing code against an IRScope or transforming the IRScopes dependent data. A Compiler pass may or may not affect the state of an IRScope (possibly including any child IRScopes) and it may or may not depend on other compiler passes to execute first. For dependencies between compiler passes, getDependencies will return a list of all dependent passes. Those passes in turn will end up having their own dependencies. The order of execution is depth-first, but if the pass recognizes that the data it depends on already exists, then it does not run the pass. It will just return the existing data. If you want to guarantee (re)execution, then you should call invalidate().
<init>()createPassInstance(Class<? extends org.jruby.ir.passes.CompilerPass> passClass)createPassInstance(String passClassName)getPassesFromString(String passList, String defaultPassList)getDependencies() · also: get_dependenciesequals(Object other)execute(org.jruby.ir.interpreter.FullInterpreterContext fic, Object[] dependencyData)Meat of an individual pass. run will call this after dependency resolution.
| name | type | description |
|---|---|---|
| fic | org.jruby.ir.interpreter.FullInterpreterContext | is the FullInterpreterContext to run this pass on |
| dependency_data | Object[] | is the data supplied to this pass to use to execute the pass |
hashCode()invalidate(org.jruby.ir.interpreter.FullInterpreterContext fic)The data that this pass is responsible for will get invalidated so that if this pass is then executed it will generate new pass data. Note that some data will destructively manipulate dependent compiler pass data. In that case, the pass may wipe more than just it's data. In that case, an execute() should still rebuild everything fine because all compiler passes list their dependencies.
| name | type | description |
|---|---|---|
| fic | org.jruby.ir.interpreter.FullInterpreterContext | is where the pass stores its data. |
Returns: true if invalidation succeeded, false otherwise.
getLabel() · also: get_labelWhat is the user-friendly name of this compiler pass
previouslyRun(org.jruby.ir.interpreter.FullInterpreterContext fic)If this pass has been previous run, then return the data from that last run. Specific scopes can override this behavior.
Returns: data or null if it needs to be run
run(org.jruby.ir.interpreter.FullInterpreterContext fic, boolean force)run(org.jruby.ir.interpreter.FullInterpreterContext fic)getShortLabel() · also: get_short_labelShorter label