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

From: Ganesh Sittampalam <ganesh@earth.li>
Date: Thu Mar 30 2006 - 02:01:49 BST

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 :-)

Cheers,

Ganesh
Received on Thu Mar 30 02:01:51 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 30 2006 - 02:20:05 BST