Bug 531694 - Optimized code generation for joinpoint access variants
Summary: Optimized code generation for joinpoint access variants
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.9.0   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 1.9.0   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-26 15:58 EST by Andrew Clement CLA
Modified: 2018-03-12 11:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2018-02-26 15:58:23 EST
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.
Comment 1 Andrew Clement CLA 2018-02-26 16:04:07 EST
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
Comment 2 Andrew Clement CLA 2018-03-09 19:36:13 EST
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.
Comment 3 Andrew Clement CLA 2018-03-12 11:38:53 EDT
Changes are in.