You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stephan Michels <st...@apache.org> on 2004/03/29 20:25:53 UTC

Commited was Re: java continuations

Am Mo, den 29.03.2004 schrieb Torsten Curdt um 15:30:
> Dear friends and folks,
> 
> as already announce on the PMC list we now
> have another flow implementation for java!
> 
> Stephan completed my proof-of-concept and
> replaced the Brakes stuff by an own
> implementation. So we are now fully in
> ASL land.

Okay, the implementation is now in the CVS, and is ready to get
tested.

I should try to explain how is works. The java flow
use the bytecode pass3b verifier of BCEL to analyse the
the control flow of the bytecode sequence, and to analyse the
content of the current frame for every instruction.
Means, I know at every instruction which objects are in
the stack and in the local variables.
Next step is to add intercepting code for every method invocation,
which tests if the current invoction should be captured to continue
the invocation next time. To capure the invcation the complete
frame will be stored in the continuation.
To restore the invocation the frame will be restored and jumps
to the last invocation, and this will be done for every stack trace
element.

The implementation is rather simple. The core consists of 3 classes:
ContinuationClassLoader, Continuation and ContiationStack.
The ContinuationClassLoader adds the intercepting code to the classes,
the Continuation stores the information about the current running
continuation, and ContinuationStack stores the capured stack.