Module: Seafoam::Passes
- Defined in:
- lib/seafoam/passes.rb,
lib/seafoam/passes/graal.rb,
lib/seafoam/passes/truffle.rb,
lib/seafoam/passes/fallback.rb,
lib/seafoam/passes/truffle_translators/default.rb,
lib/seafoam/passes/truffle_translators/translators.rb,
lib/seafoam/passes/truffle_translators/truffleruby.rb
Overview
Passes are routines to read the graph and apply properties which tools, such as the render command, can use to show more understandable output.
Defined Under Namespace
Modules: TruffleTranslators Classes: FallbackPass, GraalPass, TrufflePass
Class Method Summary collapse
-
.apply(graph, options = {}) ⇒ Object
Apply all applicable passes to a graph.
-
.passes ⇒ Object
Get a list of all passes in the system.
Class Method Details
.apply(graph, options = {}) ⇒ Object
Apply all applicable passes to a graph.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/seafoam/passes.rb', line 9 def apply(graph, = {}) passes.each do |pass| next unless pass.applies?(graph) # Record for information that the pass was applied this graph. passes_applied = graph.props[:passes_applied] ||= [] passes_applied.push(pass) # Run the pass. instance = pass.new() instance.apply(graph) end end |
.passes ⇒ Object
Get a list of all passes in the system.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/seafoam/passes.rb', line 24 def passes # We have a defined order for passes to run - these passes at the start. pre_passes = [ TrufflePass, GraalPass, ] # The fallback pass runs last. post_passes = [ FallbackPass, ] # Any extra passes in the middle. extra_passes = Pass::SUBCLASSES.dup - pre_passes - post_passes pre_passes + extra_passes + post_passes end |