[vector] modifier discipline
John Rose
john.r.rose at oracle.com
Fri Jun 28 06:45:36 UTC 2019
The idea behind my last couple of pushes is to regularize our use of
the modifiers abstract and final, and the @ForceInline annotation.
The net result is that every vector method is fully specialized
(as a ‘final @ForceInline’ method) from a clearly marked template
method. This, I hope, will make it easier to avoid the performance
pitfall of running the JIT over generic code which doesn’t know its
exact vector type.
The enforced pattern is this:
* A vector superclass has an abstract method foo.
* The implementation of foo is in a separate final/@FI
method called fooTemplate.
* The only use of fooTemplate a call from a final/@FI
foo method defined in a vector leaf class.
As a result, the JIT only compiles fooTemplate methods
in contexts where the vector shape is fully known.
This pattern anticipates ideas coming from Valhalla,
where template methods might work in similar ways,
but without so much conscious pattern-following.
— John
More information about the panama-dev
mailing list