MimCode.mesa
Copyright Ó 1985, 1986, 1987, 1988, 1991 by Xerox Corporation. All rights reserved.
Sweet, May 31, 1986 4:27:24 pm PDT
Satterthwaite, October 10, 1985 1:50:49 pm PDT
Russ Atkinson (RRA) August 18, 1988 10:10:30 pm PDT
DIRECTORY
Alloc USING [Base, Notifier],
IntCodeDefs USING [Label, Node, NodeList],
SourceMap USING [Loc],
Symbols USING [ContextLevel, CTXIndex, HTIndex, ISEIndex, RecordSEIndex, Type, UNSPEC],
Target: TYPE MachineParms USING [bitsPerWord];
MimCode: DEFINITIONS
= BEGIN OPEN IntCodeDefs, Symbols, Target;
Most of this stuff is exported by MimDriver.
Info: TYPE = Symbols.UNSPEC;
Target data bit lengths
BitAddress: TYPE = INT;
BitCount: TYPE = INT;
BitIndex: TYPE = [0..bitsPerWord);
firstMappedAddress: CARD = 8*1024;
Needs to be better parameterized
Base: TYPE = Alloc.Base;
z: ZONE;
The zone used during code generation (exported by MimDriver)
CodeList: TYPE = REF CodeListRep;
CodeListRep: TYPE = RECORD [head, tail: IntCodeDefs.NodeList ¬ NIL];
VLoc: TYPE = RECORD [disp: INT, size: BitCount];
Note: disp < 0 is legal
LabelInfo: TYPE = REF LabelInfoRecord;
labelInfoNull: LabelInfo = NIL;
LabelInfoRecord: TYPE = RECORD [
free: BOOL ¬ FALSE,
thread: LabelInfo,
catchLevel: [0..37777b],
body: SELECT tag: * FROM
named => [hti: HTIndex, cci: IntCodeDefs.Label],
loop => [exit, loop: IntCodeDefs.Label],
stmt => [retry, continue: IntCodeDefs.Label]
ENDCASE];
NamedLabelInfo: TYPE = REF LabelInfoRecord.named;
StoreOptions: TYPE = MACHINE DEPENDENT RECORD [
expr: BOOL ¬ FALSE,
init: BOOL ¬ FALSE,
counted: BOOL ¬ FALSE,
skipZeros: BOOL ¬ FALSE];
ConsDestination: TYPE = RECORD [
cl: CodeList ¬ NIL,
destNode: IntCodeDefs.Node ¬ NIL,
ignoreSafen: BOOL ¬ FALSE,
options: StoreOptions ¬ []];
RegisterNotifier: PROC [notifier: Alloc.Notifier];
the following variables are shared among the code generation modules
curctxlvl: Symbols.ContextLevel;
bodyRetLabel, bodyComRetLabel: Label;
bodyInRecord, bodyOutRecord: Symbols.RecordSEIndex;
mainBody: BOOL;
tailJumpOK: BOOL;
caseCV: Node;
caseType: Type;
fileLoc, inlineFileLoc: SourceMap.Loc;
catchcount: CARDINAL;
catchoutrecord: Symbols.RecordSEIndex;
tempcontext: Symbols.CTXIndex;
xtracting: BOOL;
xtractNode: Node;
xtractsei: Symbols.ISEIndex;
nC0, nC1: Node;
constants for 0 & 1
trueNode, falseNode: Node;
constants for TRUE & FALSE
CodeNotImplemented: SIGNAL;
CodePassInconsistency: SIGNAL;
END.