[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] LTW and instrumentation


Pascal,

Certainly using ASM allows you to generate code which _may_ offer a runtime performance advantage. However you will be doing assembler programming by proxy. Is this the kind of code you or your colleagues want to be maintaining and debugging in 6 months or a year's time?

Chained agents are problematic: everyone wants to be first. Agents that come later see join points created earlier in the chain. However according to the documentation you can specify multiple agents.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx

http://w3.hursley.ibm.com/~websterm/

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:        aspectj-users-bounces@xxxxxxxxxxx

To:        <aspectj-users@xxxxxxxxxxx>
cc:        
Subject:        RE: [aspectj-users] LTW and instrumentation


Yes, using an ITD in a general case like this would require using
reflection. Now Java reflection has become pretty efficient (e.g., Hibernate
and other popular O/R mapping tools use it extensively). Certainly in the
article's case, to implement, toString, it would be natural to use an ITD.
If you need bytecode generation for efficiency, then an ITD wouldn't help.

To the question of chaining agents, I have been thinking about this issue
and I think there's a need for a ChainedAgent jvmti agent, that would let
you register multiple JVMTI javaagent's to run in a specified order. I bet
if you wrote a good one of those, you'd have a lot of interest in using what
you produced.

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Pascal Felber
Sent: Monday, October 31, 2005 11:13 AM
To: aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] LTW and instrumentation

But then, it would require using reflection, right? In fact, I need to do
something slightly different from the article I cited: for each field of
primitive type in a class, I need to declare a "backup" field of the same
type and create checkpointing functions to save/restore the object's state.
These functions are called quite often and must be very efficient (using
reflection would be too slow for that purpose). ASM seems to be appropriate
for transparently generating them, assuming it can be combined with LTW, but
I'd love to hear other suggestions. Thanks.

Pascal

> It looks to me like the code from the article you cited could
> be written more cleanly with an inter-type declaration,
> instead of mucking around with ASM.
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Pascal Felber
> Sent: Saturday, October 29, 2005 4:39 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] LTW and instrumentation
>
> Hi,
>
> I have an aspectj application that uses LTW (aspectjweaver
> agent) to weave aspects at load time. In addition, I have to
> instrument some of my classes along the same lines as
> described at
> http://www-128.ibm.com/developerworks/java/library/j-cwt06075/
index.html
> (functionality that cannot be added using AOP).
> Instrumentation is performed using ASM and I am currently
> using a java transformation agent. The problem is, I haven't
> been able to used both agents (aspectjweaver and my own
> agent) at the same time. I would like my agent to get a
> chance to instrument the classes before they are (or right
> after they have been) processed by the aspectj load-time
> weaver. Is that possible? Does aspectj allow custom
> instrumentation of classes during the weaving process?
>
> Thanks,
>
> Pascal
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>

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

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