RE: [abc-dev] Delay initialization of JoinPoint -- maybe not true...

From: Isaac Yuen <>
Date: Thu Mar 30 2006 - 02:12:04 BST

I guess, a related question will be: if I have some aspects that happen to have common JP, then the thisJoinPoint object reference can be passed by
the aspects. However, the interesting is, each time the shadow() method initiated a new JP obj by calling the makeJP again and pass it to the inline code. How can I fix it?


-----Original Message-----
From: Majordomo list server on behalf of Ganesh Sittampalam
Sent: Wed 3/29/2006 8:01 PM
Subject: Re: [abc-dev] Delay initialization of JoinPoint -- maybe not true...
On Wed, 29 Mar 2006, Isaac Yuen wrote:

> I expect the JP not initialized until about the branching of the (c !=
> 0) , or not initialized at all

The delaying of the initialisation only applies to before the advice body
is called; no attempt is made to push this within the advice body itself.

So if you have some advice that uses thisJP that will only apply
conditionally, then the initialisation only happens if the advice is
actually called. However if the advice itself only uses thisJP
conditionally, it will still be initialised unconditionally.

It would certainly be interesting to investigate delaying it further, but
it's rather tricky because the only context with the information needed to
construct the object is the method where the original joinpoint occurred,
so once the advice body has been called things are much harder. Even if
the final code ends up inlined, abc's code generation strategy is first to
generate correct code, then to inline and fold things away.

As a very rough first thought, perhaps passing in the required information
as extra parameters to the advice body would work. The problem with makeJP
is that it is mostly opaque to the optimiser, so only specially modified
analyses like the NullAnalysis can do anything clever with it at all.
Passing in the data explicitly would make it obvious there are no side
effects. The problem would be that if the advice body wasn't inlined,
performance would probably suffer.

Constructing thisJP very late may also make it feasible to fold away
construction followed by call to method on it completely.

Sorry if the above isn't very clear, I can try and explain better when I'm
more awake :-)


Received on Thu Mar 30 02:14:56 2006

This archive was generated by hypermail 2.1.8 : Fri Mar 31 2006 - 23:50:06 BST