Module: Seafoam::Graal::Pi

Defined in:
lib/seafoam/graal/pi.rb

Overview

Routines for understanding pi nodes in Graal.

Constant Summary collapse

PI_NODES =

Pi nodes add type information.

[
  'org.graalvm.compiler.nodes.PiNode',
  'org.graalvm.compiler.nodes.PiArrayNode'
]

Class Method Summary collapse

Class Method Details

.follow_pi_object(node) ⇒ Object

Find the actual value behind potentially a chain of pi nodes.



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

def self.follow_pi_object(node)
  node = node.edges.find { |edge| edge.props[:name] == 'object' }.from while PI_NODES.include?(node.props.dig(:node_class, :node_class))
  node
end