Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Parameter construction pointcut?

Eric Bodden wrote:
> what if any of the methods have side-effects?

Irrelevant.  The point is to match the pointcut before the function's
arguments (the expressions in parentheses) are about to be evaluated.
In bytecode, there would need to be some kind of no-op marker that
indicates that "we are about to evaluate the arguments in order to make
a call to function f" (note: I am _not_ attempting to match on the
evaluation of _any_ expression on which the call f to depends).  If
compiler optimizations interleave these evaluations arbitrarily with
other unrelated stuff before making the actual call to f, then I concede
that this is not possible.  However, in light of the fact that
expressions _can_ have side-effects in Java, I would not expect the
compiler to do anything risky like that.  In my example

f( g( h(), i( j() ) ), k() );

I would expect the bytecode to look like

Call h
Call j
Call i
Call g
Call k
Call f

or

Call k
Call h
Call j
Call i
Call g
Call f

or some other topological sort of the partial order.  In any case,
markers would be necessary:

:precall f
:precall g
:precall h
Call h
:precall i
:precall j
Call j
Call i
Call g
:precall k
Call k
Call f

Josh


Back to the top