specializing generic methods
maurizio.cimadamore at oracle.com
Fri Aug 29 22:51:02 UTC 2014
On 29/08/14 23:11, Dan Smith wrote:
> But, back to my first sentence: who cares? If the bytecode says that test1 invokes 'm(double)double', then the specialized code_should not_ mimic test2. It should continue to invoke 'm(double)double' instead.
More on this; while I understand where you are coming from, I think that
such a behavior (specialization stuck with m(double)) would be
surprising in a bad way. And perhaps, if we want to stick to our
original design principle to make specialization as mechanic as
possible, this means that there's a sweet spot in the design space of
specialization where we can get around by means of simple
type-substitution - that's probably where we need to ultimately land.
Any step further and, as your example clearly shows, we are in a gray
area where none of the alternatives look particularly compelling.
More information about the valhalla-dev