[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] One target for intertype declarations

Hash: SHA1

David Pearce wrote:
> Hi Eric,
>> No, I guess that's a misinterpretation: The "bind" method creates
>> a new aspect instance for every argument object for which it does
>> not find yet a cached version:
> I don't think (correct me if I'm wrong) this answers the point I'm
> making.  That is, I observed the following in the files
> sootOutput/dava/src/test.java and sootOutput/dava/src/test2.java:  
>  > public class test implements taspect$ajcMightHaveAspect  > {
>  >    int testField;
>  >    private transient taspect ajc$taspect$perObjectField;
> and
>  > public class test2 extends test implements
>  taspect$ajcMightHaveAspect  > { >    int test2Field;
>  >    private transient taspect ajc$taspect$perObjectField;
> Therefore, it seems to me that any instance of test2 will contain
> two "ajc$taspect$perObjectField" fields, occupying a total of
> 2*word size space.  

With respect to code bloat this is correct (and should be removed in
future releases. With respect to footprint (runtime memory) you are
not, because either object of type test or test2 would have a field
ajc$taspect$perObjectField anyway (and would indeed need such field).
You are right, that the field in class test is superflous, but it has
absolutely no runtime impact. It's just overridden in test2, but that
makes no difference at all, since if it was not, it would just be
inherited from test2 anyway.

So in a nutshell you don't have two fields but two declarations of
one and the same field. (If the field had been static that would have
been a different thing)

Hope that helps,


- -- 
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University

Version: PGP 8.0.3