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",
  "jdk.graal.compiler.nodes.PiNode",
  "jdk.graal.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.



9
10
11
12
# File 'lib/seafoam/graal/pi.rb', line 9

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