-- JaMInternal.mesa
-- Last edit by Doug Wyatt,  1-Oct-81 15:26:43

DIRECTORY
  JaMBasic USING [Object, Tuple];

JaMInternal: DEFINITIONS = {
OPEN JaMBasic;

-- Types

Frame: TYPE = LONG POINTER TO FrameRecord;
FrameRecord: TYPE = RECORD[
  link: Frame, -- next frame in list of all frames
  opstk: Stack, -- operand stack
  execstk: Stack, -- execution stack
  dictstk: Stack, -- dictionary stack
  cache: Cache, -- dictionary cache
  locals: Locals, -- local variables
  abort: BOOLEAN, -- abort flag
  stepflag,astepflag: BOOLEAN -- single step flags
  ];

Stack: TYPE = LONG POINTER TO StackRecord;
StackRecord: TYPE = RECORD[
  head: Node, -- top of stack
  free: Node, -- top of free list
  nodes: LONG POINTER TO NodeSequence -- array of nodes
  ];

Node: TYPE = LONG POINTER TO NodeRecord;
NodeRecord: TYPE = RECORD[next: Node, ob: Object];
NodeSequence: TYPE = RECORD[SEQUENCE size: CARDINAL OF NodeRecord];

TupleSequence: TYPE = RECORD[SEQUENCE COMPUTED CARDINAL OF Tuple];
HashSequence: TYPE = RECORD[SEQUENCE COMPUTED CARDINAL OF CARDINAL];

Cache: TYPE = LONG POINTER TO CacheRecord;
CacheRecord: TYPE = RECORD [
  curlen,maxlen,size: CARDINAL,
  hash: LONG POINTER TO HashSequence,
  table: LONG POINTER TO TupleSequence,
  clears, probes, hits: LONG INTEGER
  ];

Locals: TYPE = LONG POINTER TO LocalsRecord;
LocalsRecord: TYPE = RECORD[ -- export to JaMOps
  curlen,maxlen: CARDINAL,
  array: LONG POINTER TO TupleSequence
  ];

}.