Bug 292584 - When annotation-style around advice is inlined, abstract methods are called using invokespecial instead of invokevirtual
Summary: When annotation-style around advice is inlined, abstract methods are called u...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P2 major (vote)
Target Milestone: 1.6.9M1   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-16 18:02 EDT by Aaron Marcuse-Kubitza CLA
Modified: 2010-04-16 13:10 EDT (History)
2 users (show)

See Also:


Attachments
Test case to reproduce the bug, which includes README file with more details about the bug. (18.02 KB, application/zip)
2009-10-16 18:05 EDT, Aaron Marcuse-Kubitza CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Marcuse-Kubitza CLA 2009-10-16 18:02:36 EDT
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: AspectJ Compiler 1.6.6 - Eclipse Compiler 0.785_R33x, 3.3

An AbstractMethodError is generated when inlined around advice from an abstract annotation-style aspect (annotation_style.AbstractAspect in the attached file `test_case.zip') tries to call an abstract method of the aspect (getValueReplacement()), which has been implemented in a concrete subclass of the aspect (annotation_style.ConcreteAspect). This problem does not occur in aspect-style aspects.

Disassembling the two AbstractAspect classes shows different instructions used to call the abstract method (getValueReplacement()): invokespecial in the annotation-style aspect, and invokevirtual in the aspect-style aspect.

This bug can be worked around by specifying the -XnoInline compiler option.

More information is available in the README file in the attached file `test_case.zip'.


Reproducible: Always

Steps to Reproduce:
1. Download and extract the attached file `test_case.zip'.
2. At the command line, change to the directory of the extracted files.
3. Run `./run'.
4. To recompile with the -XnoInline compiler option, run `make clean; make AJCFLAGS=-XnoInline'.

More information is available in the README file.
Comment 1 Aaron Marcuse-Kubitza CLA 2009-10-16 18:05:08 EDT
Created attachment 149801 [details]
Test case to reproduce the bug, which includes README file with more details about the bug.
Comment 2 Andrew Clement CLA 2010-01-25 17:51:23 EST
thanks for the great testcase!

The problem is that in code style the modified eclipse compiler generates the accessor method (ajc$inlineAccessMethod$XXX), whilst in annotation style the weaver generates it.  The compiler gets it right but the weaver gets it wrong.  Changing the weaver to generate the right instruction fixes the testcase.