Class: Seafoam::Passes::TrufflePass

Inherits:
Seafoam::Pass show all
Defined in:
lib/seafoam/passes/truffle.rb

Overview

The Truffle pass applies if it looks like it was compiled by Truffle.

Constant Summary

Constants inherited from Seafoam::Pass

Seafoam::Pass::SUBCLASSES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Seafoam::Pass

#applies?, inherited, #initialize

Constructor Details

This class inherits a constructor from Seafoam::Pass

Class Method Details

.applies?(graph) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/seafoam/passes/truffle.rb', line 10

def applies?(graph)
  graph.props.values.any? do |v|
    TRIGGERS.any? { |t| v.to_s.include?(t) }
  end
end

Instance Method Details

#apply(graph) ⇒ Object



17
18
19
20
21
# File 'lib/seafoam/passes/truffle.rb', line 17

def apply(graph)
  simplify_truffle_args(graph) if @options[:simplify_truffle_args]
  simplify_alloc(graph) if @options[:simplify_alloc]
  hide_reachability_fences(graph) if @options[:hide_reachability_fences]
end