jruby/docs BETA
Navigation
org.jruby.ir.passes 15
C AddCallProtocolInstructions
C AddLocalVarLoadStoreInstructions
C AddMissingInitsPass
C BasicCompilerPassListener
C CompilerPass
I CompilerPassListener
I CompilerPassScheduler
C DeadCodeElimination
C DominatorTreeBuilder
C EnsureTempsAssigned
C LiveVariableAnalysis
C LocalOptimizationPass
C OptimizeDelegationPass
C OptimizeDynScopesPass
C UnboxingPass
CompilerPass — members 14
C new()
M create_pass_instance(pass_class) CompilerPass
M create_pass_instance(pass_class_name) CompilerPass
M dependencies() CompilerPass>>
M equals(other) boolean
M execute(fic, dependency_data) Object
M get_passes_from_string(pass_list, default_pass_list) CompilerPass>
M hash_code() int
M invalidate(fic) boolean
M label() String
M previously_run(fic) Object
M run(fic, force) Object
M run(fic) Object
M short_label() String

org.jruby.ir.passes.CompilerPass

class abstract 14 members

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().

Constructors

new

new ( )
Java: <init>()

Class Methods

create_pass_instance

CompilerPass create_pass_instance ( Class<? extends CompilerPass> pass_class )
Java: createPassInstance(Class<? extends org.jruby.ir.passes.CompilerPass> passClass)

create_pass_instance

CompilerPass create_pass_instance ( String pass_class_name )
Java: createPassInstance(String passClassName)

get_passes_from_string

List<CompilerPass> get_passes_from_string ( String pass_list, String default_pass_list )
Java: getPassesFromString(String passList, String defaultPassList)

Instance Methods

dependencies

List<Class<? extends CompilerPass>> dependencies ( )
Java: getDependencies() · also: get_dependencies

equals

boolean equals ( Object other )
Java: equals(Object other)

execute

Object execute ( FullInterpreterContext fic, Object[] dependency_data )
Java: execute(org.jruby.ir.interpreter.FullInterpreterContext fic, Object[] dependencyData)

Meat of an individual pass. run will call this after dependency resolution.

nametypedescription
ficorg.jruby.ir.interpreter.FullInterpreterContextis the FullInterpreterContext to run this pass on
dependency_dataObject[]is the data supplied to this pass to use to execute the pass

hash_code

int hash_code ( )
Java: hashCode()

invalidate

boolean invalidate ( FullInterpreterContext fic )
Java: 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.

nametypedescription
ficorg.jruby.ir.interpreter.FullInterpreterContextis where the pass stores its data.

Returns: true if invalidation succeeded, false otherwise.

label

String label ( )
Java: getLabel() · also: get_label

What is the user-friendly name of this compiler pass

previously_run

Object previously_run ( FullInterpreterContext fic )
Java: 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

Object run ( FullInterpreterContext fic, boolean force )
Java: run(org.jruby.ir.interpreter.FullInterpreterContext fic, boolean force)

run

Object run ( FullInterpreterContext fic )
Java: run(org.jruby.ir.interpreter.FullInterpreterContext fic)

short_label

String short_label ( )
Java: getShortLabel() · also: get_short_label

Shorter label