Give concise functions a specialized translation, instead of forwarding to a lambda in a global. This allows the implementation of a concise function, like regular functions, to live in its own class with an invoke method. This makes it practical to call concise functions from java code (e.g. in the LSP implementation), and direct calls to can be optimized to call invoke directly without creating an intermediate NodeFactory. This also seems to give a slight performance boost, but I haven't tried measuring it carefully.
I went ahead and tackled this since it is blocking #822, which I would like to merge soon before any other branches are made from the current version of Silver, to avoid merge conflicts.
Documentation
This doesn't affect the (already documented) behavior of this feature at all.
Testing
Existing tests for concise functions cover this adequately.
Changes
Give concise functions a specialized translation, instead of forwarding to a lambda in a global. This allows the implementation of a concise function, like regular functions, to live in its own class with an
invoke
method. This makes it practical to call concise functions from java code (e.g. in the LSP implementation), and direct calls to can be optimized to callinvoke
directly without creating an intermediateNodeFactory
. This also seems to give a slight performance boost, but I haven't tried measuring it carefully.I went ahead and tackled this since it is blocking #822, which I would like to merge soon before any other branches are made from the current version of Silver, to avoid merge conflicts.
Documentation
This doesn't affect the (already documented) behavior of this feature at all.
Testing
Existing tests for concise functions cover this adequately.