Class ContextPtr


			
class ContextPtr : public ObjectPtr
Programmer: Matt Splett

Description:

To facilitate accessing specific slots of a SmallTalk Context. Also to aid in the creation of them.

Public Methods:

static ObjectPtr create ( ObjectPtr & receiver, MethodPtr & meth, ArrayPtr & args );
create a context from a given receiver, compiled method and array of arguments

ObjectPtr blockCopy ( );
used to create a block context out of the active context.

static ContextPtr convert (ObjectPtr);
veryify the class type of the object pointer before casting to a context pointer.

ContextPtr ( const ObjectPtr &);
Conversion constructor from base class

ObjectPtr & receiver ();
slot 0 : Object

MethodPtr & method ();
slot 1 : Compiled Method

IntegerPtr & ip ();
slot 3 : integer - Instruction Pointer

ObjectPtr & tempFrame ( UInteger );
returns a reference to the indexed element of the tempFrame.

UInteger tempFrameSize ( );
returns the number of elements in the tempFrame.

void appendTempFrame ( ArrayPtr & );
Used to extend the tempFrame.

void shrinkTempFrame ( );
Used when returning from a block to discard the insertion variables, a.k.a. frame extension.

Byte opCode ();
current instruction or single byte argument.

BigByte bigOpCode ();
current double byte argument. SIDE EFFECT: also calls advance() once!

Boolean advance ( SInteger skip = 1L );
move ip forward one opcode. TESTING

Protected Methods:

ContextPtr ( );
default constructor - never implemented.

ArrayPtr & tempFrame ();
slot 2 : Array Because tempFrame is a little twisted, this should only be used internally. tempFrame( UInteger ) for access into the frame, and tempFrameSize().

static ClassPtr & klassPtr ();


Protected Members: