[PATCH] Use #valueOf()-methods in Unsafe-based FieldAccessors
forax at univ-mlv.fr
Tue May 1 21:54:43 UTC 2012
On 05/01/2012 09:33 PM, Andrej Golovnin wrote:
> Hi all,
your far from Swing :)
(I remember you from the glorious appframework time)
> Is there some reason for not using #valueOf-methods from wrapper classes
> in Unsafe-based FieldAccessors in sun.reflect-package (see the attached patch)?
The main reason, I think, is that these code was written during 1.4 time
and not updated for 1.5.
And the mailer deamon (or mailer imp ?) remove attachment, so you have
to repost it inlined.
> The main motivation for this patch is to reduce memory consumption in applications
> which make heavy use of reflection API (e.g. apps which use ORM solutions).
and your ORM doesn't use neither field.getInt() (and variants) instead
nor do bytecode enhancement ?
Also, because currently the escape analysis done by Hotspot is a little
you may introduce a slowdown/more memory consumption because the JIT
may be able to remove new Integer()/Integer.intValue() pair but not
But I know that someone is working on this :)
> The patch does not modify Unsafe-based FieldAccessors for double and float
> fields as the wrapper classes does not provide caching for fields of this types.
> Best regards
> Andrej Golovnin
More information about the core-libs-dev