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

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.

I guess that, looking at the code for "taspect$ajcMightHaveAspect", it seems that polymorphism will ensure only one of the fields is ever actually used. So, is this right or have I missed something?

Cheers,

Dave

    public static void ajc$perObjectBind(java.lang.Object r0)
    {
        if (r0 instanceof taspect$ajcMightHaveAspect != false)
        {
            if (((taspect$ajcMightHaveAspect)
r0).ajc$taspect$perObjectGet() == null)
            {
/*HERE*/           ((taspect$ajcMightHaveAspect)
r0).ajc$taspect$perObjectSet(new taspect());
            }
        }

        return;
    }

Eric

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

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

iQA/AwUBQaHvzMwiFCm7RlWCEQLJgwCeLWqsPBUkNPOC1vwXaNyB4XsgogQAoNHs
yF/rPEJy68gKQjyD9A9KAGWl
=HozS
-----END PGP SIGNATURE-----


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

Attachment: pertargetTest.tgz
Description: Binary data


Back to the top