Skip to main content

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

 
-----BEGIN PGP SIGNED MESSAGE-----
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


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

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQaO8h8wiFCm7RlWCEQLN2ACbBvDjTxGOY9+KeM9/e5c/yCpzKdYAni7u
hfeM9v7sDLNJOs23PRmt0gvw
=dpSs
-----END PGP SIGNATURE-----




Back to the top