classes/sub.pmc - Subroutine


These are the vtable functions for the Sub (subroutine) base class

Functions ^


Print name and location of subroutine, This should finally use the label name of the frozen Sub PMC image for now locate the Sub name in the globals.

void init()

Initializes the subroutine.

void destroy()

Destroys the subroutine.

STRING *get_string()

Returns the name of the subroutine.

void set_pointer(void *value)

Sets the pointer to the actual subroutine.

void *get_pointer()

Returns the pointer to the actual subroutine.

INTVAL get_integer_keyed(PMC *key)

This just unconditionally returns the start of bytecode. It's wrong, wrong, wrong, *WRONG*. And there's no other good way, so it's here for now. -DRS

INTVAL defined()

INTVAL get_bool()

Returns whether the subroutine is defined.

void *invoke(void *next)

Invokes the subroutine.

PMC *clone()

Creates and returns a clone of the subroutine.

void mark()

Marks the continuation as live.

void set_same(PMC *value)

Sets the subroutine to *value.

INTVAL is_equal(PMC *value)

Returns whether the two subroutines are equal.

void freeze(visit_info *info)

Archives the subroutine.

void thaw(visit_info *info)

Unarchives the subroutine.

void thawfinish(visit_info *info)

Called after the subroutine as been unarchived.


Initial version by Melvin on 2002/06/6.