Class: Seafoam::Graal::GraphDescription
- Inherits:
-
Object
- Object
- Seafoam::Graal::GraphDescription
- Defined in:
- lib/seafoam/graal/graph_description.rb
Overview
Provides a high level description of a Graal graph’s features.
Constant Summary collapse
- ATTRIBUTES =
[:branches, :calls, :deopts, :linear, :loops]
Instance Attribute Summary collapse
-
#node_counts ⇒ Object
readonly
Returns the value of attribute node_counts.
Instance Method Summary collapse
-
#initialize ⇒ GraphDescription
constructor
A new instance of GraphDescription.
- #linear ⇒ Object
- #sorted_node_counts ⇒ Object
Constructor Details
#initialize ⇒ GraphDescription
Returns a new instance of GraphDescription.
12 13 14 15 16 17 18 |
# File 'lib/seafoam/graal/graph_description.rb', line 12 def initialize @branches = false @calls = false @deopts = false @loops = false @node_counts = Hash.new(0) end |
Instance Attribute Details
#node_counts ⇒ Object (readonly)
Returns the value of attribute node_counts.
10 11 12 |
# File 'lib/seafoam/graal/graph_description.rb', line 10 def node_counts @node_counts end |
Instance Method Details
#linear ⇒ Object
20 21 22 |
# File 'lib/seafoam/graal/graph_description.rb', line 20 def linear !branches && !loops end |
#sorted_node_counts ⇒ Object
24 25 26 |
# File 'lib/seafoam/graal/graph_description.rb', line 24 def sorted_node_counts @node_counts.to_a.sort_by { |node_class, count| [-count, node_class] }.to_h end |