GuardingPiNode, where it can and shouldn't be used

Miguel Garcia Gutierrez miguel.m.garcia at oracle.com
Mon Apr 7 11:26:07 UTC 2014


I have a philosophical question about GuardingPiNode, in connection with its canonicalization.

GuardingPiNode is a GuardingNode, and as such a GuardingPiNode instance may be given as the guard of a PiNode.

A prototype I'm working on runs into the situation where:
  (a) a GuardingPiNode is canonicalized (as expected) upon its condition becoming a constant
  (b) as a consequence, the payload of the GuardingPiNode (ie the canonical value) is replaced at all usages of the GuardingPiNode (also as expected)

That's all fine, and fits the pattern where such usages were expecting the payload that the GuardingPiNode wraps.

However, coming back to the example of the PiNode taking a GuardingPiNode instance as guard-input and not as object-input.

Applying (a) and (b) in that case results in attempting to assign the payload to the PiNode's guard, which in general results in ClassCastException (the payload in general doesn't implement GuardingNode).

I can think of some workarounds. Is there anything like a general solution?


Miguel



More information about the graal-dev mailing list