CodeDefs.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Sweet, June 1, 1986 11:06:39 pm PDT
Satterthwaite, November 26, 1985 9:46:09 am PST
Russ Atkinson (RRA) March 6, 1985 11:02:19 pm PST
DIRECTORY
Alloc USING [Base, Notifier],
IntCodeDefs,
PrincOps USING [MaxFrameSize],
SourceMap USING [Loc],
Symbols USING [BitCount, ContextLevel, HTIndex, ISEIndex, RecordSEIndex],
SymbolSegment USING [Tables],
Table USING [Selector];
CodeDefs: DEFINITIONS = {
OPEN Symbols;
WordSize: NAT = 32;
PtrSize: NAT = 32;
CharSize: NAT = 8;
ProcSize: NAT = WordSize;
SignalSize: NAT = WordSize;
ProcessSize: NAT = PtrSize;
Byte: TYPE = [0..256);
bitsPerWord: NAT = 16;
OpWordCount: TYPE = CARDINAL; -- size of operands for builtins
Base: TYPE = Alloc.Base;
Limit: CARDINAL = 77777B;
z: ZONE;
NodeRep: TYPE = IntCodeDefs.NodeRep;
Node: TYPE = IntCodeDefs.Node;
NodeList: TYPE = IntCodeDefs.NodeList;
Var: TYPE = IntCodeDefs.Var;
ConstNode: TYPE = REF const NodeRep;
AllNode: TYPE = REF all NodeRep;
BlockNode: TYPE = REF block NodeRep;
DeclNode: TYPE = REF decl NodeRep;
EnableNode: TYPE = REF enable NodeRep;
AssignNode: TYPE = REF assign NodeRep;
CondNode: TYPE = REF cond NodeRep;
LabelNode: TYPE = REF label NodeRep;
GotoNode: TYPE = REF goto NodeRep;
ApplyNode: TYPE = REF apply NodeRep;
LambdaNode: TYPE = REF lambda NodeRep;
ReturnNode: TYPE = REF return NodeRep;
OperNode: TYPE = REF oper NodeRep;
MachineCodeNode: TYPE = REF machineCode NodeRep;
ModuleNode: TYPE = REF module NodeRep;
SourceNode: TYPE = REF source NodeRep;
CommentNode: TYPE = REF comment NodeRep;
LocationRep: TYPE = IntCodeDefs.LocationRep;
Location: TYPE = IntCodeDefs.Location;
SystemLocation: TYPE = REF system LocationRep;
GlobalVarLocation: TYPE = REF globalVar LocationRep;
LocalVarLocation: TYPE = REF localVar LocationRep;
RegisterLocation: TYPE = REF register LocationRep;
LinkLocation: TYPE = REF link LocationRep;
StackLocation: TYPE = REF stack LocationRep;
DerefLocation: TYPE = REF deref LocationRep;
IndexedLocation: TYPE = REF indexed LocationRep;
FieldLocation: TYPE = REF field LocationRep;
UpLevelLocation: TYPE = REF upLevel LocationRep;
CompositeLocation: TYPE = REF composite LocationRep;
CodeLocation: TYPE = REF code LocationRep;
EscapeLocation: TYPE = REF escape LocationRep;
DummyLocation: TYPE = REF dummy LocationRep;
CodeList: TYPE = REF CodeListRep;
CodeListRep: TYPE = RECORD [head, tail: NodeList ← NIL];
ArithTypeIndex: TYPE = {shortSigned, longSigned, shortUnsigned, longUnsigned, shortReal, longReal};
VLoc: TYPE = RECORD [disp: INT, size: Symbols.BitCount];
RelativePC: TYPE = [0..177777B];
RelSourceLoc: TYPE = [0..7777B];
CompareClass: TYPE = {word, byte};
LabelInfoRecord: TYPE = RECORD [
free: BOOLFALSE,
thread: LabelInfoIndex,
catchLevel: [0..37777b],
body: SELECT tag:* FROM
named => [hti: HTIndex, cci: IntCodeDefs.Label],
loop => [exit, loop: IntCodeDefs.Label],
stmt => [retry, continue: IntCodeDefs.Label]
ENDCASE];
LabelInfoIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO LabelInfoRecord;
NamedLabelInfoIndex: TYPE = Base RELATIVE POINTER [0..Limit) TO LabelInfoRecord.named;
LabelInfoNull: LabelInfoIndex = LabelInfoIndex.LAST;
TempAddr: TYPE = [0..PrincOps.MaxFrameSize);
TempSize: TYPE = [0..PrincOps.MaxFrameSize);
TempStateRecord: TYPE = RECORD[pendtemplist, heaplist: ISEIndex];
FrameStateRecord: TYPE = RECORD[
pendtemplist, heaplist: ISEIndex,
tempctxlvl: ContextLevel,
firstTemp, tempstart, framesz: INTEGER];
CaseCVState: TYPE = {single, singleLoaded, multi, none};
StoreOptions: TYPE = RECORD [
expr: BOOLFALSE,
init: BOOLFALSE,
counted: BOOLFALSE,
composite: BOOLFALSE];
ConsDestination: TYPE = RECORD [
ignoreSafen: BOOLFALSE,
cl: CodeList ← NIL,
destNode: IntCodeDefs.Node ← NIL,
options: StoreOptions ← []];
StatementStateRecord: TYPE = RECORD [
retLabel, comRetLabel: IntCodeDefs.Label,
outRecord: RecordSEIndex,
pendtemplist: ISEIndex,
stkPtr: UNSPECIFIED,
inlineFileLoc: SourceMap.Loc];
ChunkIndex: TYPE = Base RELATIVE POINTER [0..Limit);
codeType: Table.Selector = SymbolSegment.Tables.LAST+1;
AddressNotify, CallsNotify, ConstructorNotify, CountingNotify,
CrossJumpNotify, DJumpsNotify, ExpressionNotify, FinalNotify,
FlowNotify, FlowExpressionNotify, OutCodeNotify, PeepholeNotify,
StatementNotify, SelectionNotify, StoreNotify, TempNotify,
VarBasicsNotify, VarMoveNotify, VarUtilsNotify:
Alloc.Notifier;
}.