End of the storage hints model ?
Remi Forax
forax at univ-mlv.fr
Fri Jul 22 16:16:51 UTC 2022
I've found where the storage hints model does not work well.
The storage hints model as its own name says works on implementations, but it does not work on functional interface types.
By example, we have functional interfaces in java.util.function where the same interface say j.u.f.Function is used sometime with the return/parameter values being nullable sometimes it is used with the return/parameter values that we hope to be non-nullable. For example, the function in stream.map(function) wants to be non-nullable but the function in map.compute(function) allows nullable values.
Thus when declaring j.u.f.Function we can not decide if the parameter type / return type should be annotated by the .flat storage hint or not.
Which means that the storage hints model will not provide enough information for the VM to compute the precise calling convention.
So the storage hints model is not dead dead but a model based on the type propagation is more efficient.
Rémi
More information about the valhalla-spec-experts
mailing list