Continuation Base

struct FLX_EXCEPTIONS_EXTERN con_t ///< abstract base for mutable continuations
{
  FLX_PC_DECL               ///< interior program counter
  struct _uctor_ *p_svc;           ///< pointer to service request

  con_t();                  ///< initialise pc, p_svc to 0
  virtual con_t *resume()=0;///< method to perform a computational step
  virtual ~con_t();
  con_t * _caller;          ///< callers continuation (return address)
};

Abstract Representation of Procedural Continuations

Service Address

Address of a service request, usually NULL.

Callers Continuation

Pointer to the calling procedure’s continuation, or NULL if there isn’t one.

Program Counter

A location in the code set when the continuation is suspended to allow resumption from the suspension point.

Display

An array of pointers to continuations consisting of the activation records of the parent, grandparent, great grandparent, etc, through to the outermost procedure at the time this continuation is created.

Thread Frame

A pointer to the thread frame, which is a global record shared by all threads of the current process. It contains at least a pointer to the system garbage collector, the program arguments, and pointers to the standard input, output and error streams and possibly some other technical data. The rest of the frame contains the global level variables.

Local Variables

The local variables of the procedure.

Notes

The return address of a procedure consists of a pointer to the calling continuation and the program counter stored in that continuation (not in the current one).

Optimisation

Function and procedure objects are generally allocated on the heap. However if it is safe, Felix can allocate them on the machines stack.

Furthermore, it may also replace them with actual C++ functions.

Finally, it can also inline functions so they may not exist at all as discrete objects. Within certain bounds direct calls and applications are inlined.