Class: Seafoam::Annotators::GraalAnnotator

Inherits:
Seafoam::Annotator show all
Defined in:
lib/seafoam/annotators/graal.rb

Overview

The Graal annotator applies if it looks like it was compiled by Graal or Truffle.

Constant Summary

Constants inherited from Seafoam::Annotator

Seafoam::Annotator::SUBCLASSES

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Seafoam::Annotator

#applies?, inherited, #initialize

Constructor Details

This class inherits a constructor from Seafoam::Annotator

Class Method Details

.applies?(graph) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
# File 'lib/seafoam/annotators/graal.rb', line 6

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

Instance Method Details

#annotate(graph) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/seafoam/annotators/graal.rb', line 12

def annotate(graph)
  annotate_nodes graph
  annotate_edges graph
  hide_frame_state graph if @options[:hide_frame_state]
  hide_floating graph if @options[:hide_floating]
  reduce_edges graph if @options[:reduce_edges]
  hide_unused_nodes graph
end