Bug 149802 - Support inlining of all eligible around advice
Summary: Support inlining of all eligible around advice
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-06 06:26 EDT by Matthew Webster CLA
Modified: 2013-06-24 11:07 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Webster CLA 2006-07-06 06:26:40 EDT
See Bug 148880 ([ltw] loadtime weaving is not inlining around advice) for discussion. Offline all aspects are always woven upfront before other types. However there are consequences associated with doing this for LTW where pre-empting activities that are usually performed lazily can have unwanted side-effects:
1.	We may never define (as opposed to register and resolve) and therefore weave an aspect either because it doesn’t match anything or woven join points are never reached.
2.	An aspect may have a large number of dependencies that must be resolved for weaving to take place which will impact weaver initialization.

We _could_ have an LTW option e.g. –XweaveAllAspects to make this enhanced behaviour optional but I am reluctant to clutter the public interface to solve a problem in a single system i.e. WebSphere.
Comment 1 Matthew Webster CLA 2006-08-17 17:49:43 EDT
I’m not sure we can do this for that same reason that we have problems implementing Bug 133770 “[ltw] Problem with Declare Parents and Call Munger in Load-Time Weaving”. As a weaver just because I can see 2 aspects that will weave the classes that my ClassLoader defines does not mean that the aspects will necessarily weave each other. The only thing we can be sure of is that an aspect can weave itself. 

Some examples:

1.	Loader1(Class, Aspect1, Aspect2): the aspects weave each other
2.	Loader1(Class) -> Loader2(Aspect1, Aspect2): same as 1. above
3.	Loader1(Class) -> Loader2(Aspect1) -> Loader3(Aspect2): Aspect2 _may_ weave Aspect1 but not vice versa!

There is also another problem with the solution to Bug 119657 “IllegalAccessError with around advice on interface method call”. If we inherit a concrete aspect we will use the unwoven byte-code. However we will never weave it and hence never inline any around advice! This is because when we define aspects during weaver initialization we have no idea who has or will actually define them as types. We only have the byte-code.
Comment 2 Matthew Webster CLA 2006-09-25 07:50:33 EDT
Won't make 1.5.3.
Comment 3 Andrew Clement CLA 2013-06-24 11:07:05 EDT
unsetting the target field which is currently set for something already released