Community
Participate
Working Groups
A while ago some improvements were made to code gen for thisJoinPoint (to do with using LDC rather than classloading at runtime) - these techniques should be extended to other joinpoint variants.
The previous changes are discussed in bug 323438 and there is a bit of doc in the readme: https://www.eclipse.org/aspectj/doc/released/README-1610.html
I've made the changes. New methods are introduced into Factory (in aspectjrt.jar) and the code generated in LazyClassGen makes use of LDC and invokes these new methods. This works for regular thisJoinPoint or thisEnclosingJoinPoint. Two downsides that I can see: - class load order may be disturbed because LDC is touching classes earlier - bytecode size will be different. I suspect overall size might be lower due to fewer long strings in the constant pool but the number of instructions in the generated clinit code will increase, more likely to break the 64k limit? For these reasons, it is optional in 1.9. If you wish to generate code targeting these runtime updates, then use: -Xajruntimetarget:1.9 (previously this was used to deliberately target the old 1.2 runtime) Also, because I can't recall if that option is supported by build plugins, you can set ASPECTJ_OPTS as a sys prop like you can set JAVA_OPTS: export ASPECTJ_OPTS="-Xajruntimetarget:1.9" and it'll be picked up.
Changes are in.