Bug 38168 - insertion of lots of advice code can make branch offset for if too large
Summary: insertion of lots of advice code can make branch offset for if too large
Status: RESOLVED DUPLICATE of bug 70201
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 1.2.1   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-27 14:24 EDT by Jim Hugunin CLA
Modified: 2004-10-21 04:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Hugunin CLA 2003-05-27 14:24:34 EDT
If you have an if-clause with a large body and then you put a very large
number of pieces of advice on the code within this body you can exceed the
maximum size of an if branch (32768 bytes).  This will show up only slightly 
before a general limitation on the code size of a method (65536 bytes).

This is a knownLimitation of the 1.1 compiler with a test case in 
bugs/WideJumps.java.  The severity of this bug can be reduced by improving the 
code generation for advice to optimize better for code size.  This 
optimization work is strongly recommended for the 1.2 weaver.

The ultimate theoretical solution is to detect these cases at code generation 
time and split single methods into multiple methods.  It's unclear that this 
optimization would be worth the effort involved as any time a method is 
approaching these limits it probably indicates something is wrong with the 
advice that is being applied.

In general, the right solution to this bug is to examine and improve the 
efficiency of the aspects in your system, i.e. by changing call pcds to 
execution pcds when that can be done without compromising functionality.

This bug report is based on a bug submitted privately by Rich Price.
Comment 1 Adrian Colyer CLA 2004-03-18 12:15:56 EST
defered to post 1.2.
Comment 2 Andrew Clement CLA 2004-08-06 05:43:22 EDT
Resolving bug as dup, 70201 has a nice juicy stack trace and example of this to
look at.

*** This bug has been marked as a duplicate of 70201 ***
Comment 3 Adrian Colyer CLA 2004-10-21 04:31:47 EDT
Fix released as part of AspectJ 1.2.1