Canonicalizable and @Input changes

Lukas Stadler lukas.stadler at oracle.com
Tue Jul 1 10:04:52 UTC 2014


Hi!

I just wanted to announce a two recent changes, to give you a hint in case you see assertions popping up in your code:

- The Canonicalizable interface now expects implementors to not change the graph in any way:
  No changes to inputs, successors or properties of any node are allowed, and no nodes can be added to the graph.
  Returning pre-existing or newly allocated (but not yet added) nodes or null is the only way to request changes.
  This allows the compiler to ask a node how it would canonicalize itself without actually committing the changes.
  If you need to do more, use the Simplifiable interface.
  The assertion you might see is “new node created while canonicalizing SomeNode: NewNode”.

- Node inputs can now be defined to allow null values by declaring them as @OptionalInput instead of @Input.
  @Input fields will be checked for null values by assertions during graph verification.
  The assertion you might see is “non-optional input fieldName cannot be null in SomeNode (fix nullness or use @OptionalInput)"”.

cheers,
 Lukas


More information about the graal-dev mailing list