Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Patch name: continuation.patch

The patch hasn't been checked in yet as of Sep 16, 2010. Until it is checked into the MLVM repositories, they are also available from:

http://cr.openjdk.java.net/~hiroshi/webrevs/continuation-hotspot/
http://cr.openjdk.java.net/~hiroshi/webrevs/continuation-jdk/

Background

This experimental implementation of continuation is an extension to the old version of callcc.patch (http://hg.openjdk.java.net/mlvm/mlvm/hotspot/rev/99e6c3830f6d). It is not based on the latest version of callcc.patch.

...

The current API looks like the following Javadoc style documentation.

Code Block
borderStylesolid
titlesun/misc/Continuation.javaborderStylesolid
/**
 * The Continuation class. The API design is still in progress.
 */
class Continuation {
    /**
     * Marks the beginning of a new 'scope' in preparation for stack
     * save/resume.  Executes the given Runnable.
     *
     * @param data any user defined data to be passed from this call
     *             site to the point where {@link #resume} is called
     *             for convenience.
     * @return the Continuation object after the scope was saved
     *         into a Continuation object or null if it wasn't and
     *         simply returned
     */
    public static Object enter(Runnable r, Object data);

    /**
     * Copies the stack frames in the current scope, and stores them
     * in this object.  This method must be called in an enclosing
     * scope. Calling this method causes the stack frames in the
     * scope to suspend (including the current frame) and the enter
     * call at the entry of the current scope to return.
     *
     * @return the parameter passed to the resume call when the saved stack
     *         frames are resumed in the future.
     */
    public Object save();

    /**
     * Reactivates the stack frames saved in this object on the
     * current thread.  Overwrites the stack frames in the current
     * scope with the saved stack frames.  This method must be
     * called in an enclosing scope. Calling this method causes the
     * suspended save call to resume from the point where it was
     * suspended.
     *
     * @param rv the value to be returned from the resumed save call site.
     */
    public void resume(Object rv);
}

...