MimP3.mesa
Copyright Ó 1985, 1986, 1987, 1990, 1991 by Xerox Corporation. All rights reserved.
Satterthwaite, June 17, 1986 2:44:31 pm PDT
Russ Atkinson (RRA) February 5, 1990 7:15:49 pm PST
JKF August 15, 1988 1:39:44 pm PDT
DIRECTORY
Alloc USING [Notifier],
MimosaCopier USING [SEToken],
OSMiscOps USING [WordAnd],
Symbols USING [BTIndex, Closure, CSEIndex, CTXIndex, HTIndex, IncludedCTXIndex, ISEIndex, MDIndex, RecordSEIndex, RefSEIndex, Type],
Tree USING [Index, Link, Map, Scan];
MimP3: DEFINITIONS
IMPORTS OSMiscOps = {
OPEN Symbols;
mark: BOOL = TRUE; -- mark in tree as set by pass 3
text literals
TextForm: TYPE = {text, rope, ropeText};
attributes
Attr: TYPE = MACHINE DEPENDENT RECORD [
noAssign: BOOL,
noXfer: BOOL,
const: BOOL,
either: BOOL];
emptyAttr: Attr = [noAssign: FALSE, noXfer: FALSE, const: FALSE, either: FALSE];
fullAttr: Attr = [noAssign: TRUE, noXfer: TRUE, const: TRUE, either: TRUE];
voidAttr: Attr = [noAssign: TRUE, noXfer: TRUE, const: FALSE, either: FALSE];
And: PROC [a1: Attr, a2: Attr] RETURNS [Attr] = INLINE {
RETURN [LOOPHOLE [OSMiscOps.WordAnd[LOOPHOLE[a1, WORD], LOOPHOLE[a2, WORD]]]];
};
safety (Cedar)
Safety: TYPE = {none, asserted, checked};
narrowing operations
NarrowOp: TYPE = RECORD [
error, indirect, rtTest, tagTest, computed, unImpl: BOOL ¬ FALSE];
variables exported from Pass3B
lockNode: Tree.Index;  -- lambda expr for monitor lock
checkedANY: Symbols.CSEIndex; -- typeANY in CHECKED code
parameter use bookkeeping (for subst by name)
NPUse: TYPE = {none, ref, set, refset, unsafe}; -- (name) param use
NPMap: TYPE = ARRAY NPUse OF ARRAY NPUse OF NPUse;
SetNP: ARRAY NPUse OF NPUse = [set, refset, set, refset, unsafe];
MergeNP: NPMap =
[[ none, ref, set, refset, unsafe],
[ ref, ref, unsafe, unsafe, unsafe],
[ set, unsafe, set, unsafe, unsafe],
[refset, unsafe, unsafe, unsafe, unsafe],
[unsafe, unsafe, unsafe, unsafe, unsafe]];
SequenceNP: NPMap =
[[ none, ref, set, refset, unsafe],
[ ref, ref, refset, refset, unsafe],
[ set, unsafe, set, unsafe, unsafe],
[refset, unsafe, refset, unsafe, unsafe],
[unsafe, unsafe, unsafe, unsafe, unsafe]];
BoundNP: NPMap =
[[ none, ref, set, refset, unsafe],
[ ref, ref, unsafe, refset, unsafe],
[ set, unsafe, set, refset, unsafe],
[refset, refset, refset, refset, unsafe],
[unsafe, unsafe, unsafe, unsafe, unsafe]];
notifiers
DeclNotify, MiscNotify, StmtNotify, VRNotify: Alloc.Notifier;
ExpANotify, ExpCNotify: Alloc.Notifier;
exported by Pass3B
SetDefaultImport: PROC [iCtx: IncludedCTXIndex, implicitOK: BOOL¬FALSE];
exported by Pass3D
DeclList: Tree.Scan;
FirstId: PROC [Tree.Index] RETURNS [ISEIndex];
InitialExp: PROC [Tree.Link, Type] RETURNS [v: Tree.Link, extended: BOOL];
MakeLongType: PROC [Type, Type] RETURNS [Type];
MakeRefType: PROC [cType, hint: Type, bits: NAT, readOnly, counted, var: BOOL¬FALSE]
RETURNS [RefSEIndex];
ResolveType: PROC [ISEIndex];
ResolveValue: PROC [ISEIndex];
TypeAppl: Tree.Map;
TypeExp: Tree.Map;
exported by Pass3I
IdInit: PROC;
IdReset: Tree.Scan;
ArrangeKeys: PROC
[expList: Tree.Link, nextKey: NextKeyProc, omittedValue: OmittedValueProc]
RETURNS [CARDINAL];
NextKeyProc: TYPE = PROC RETURNS [HTIndex];
OmittedValueProc: TYPE = PROC RETURNS [Tree.Link];
BaseTree: PROC [Tree.Link, Type] RETURNS [Tree.Link];
BindTree: PROC [Tree.Link, PROC [ISEIndex] RETURNS [Tree.Link]] RETURNS [Tree.Link];
BumpCount: PROC [ISEIndex];
CheckDisjoint: PROC [ctx1, ctx2: CTXIndex];
ClearRefStack: PROC [uvCheck: BOOL ¬ TRUE];
CloseBase: PROC [Tree.Link, HTIndex];
ClusterId: PROC [HTIndex, CTXIndex] RETURNS [found: BOOL, sei: ISEIndex];
CompleteRecord: PROC [rSei: RecordSEIndex, depth: Closure¬$unit];
CopyTree: Tree.Map;
EnterIdList: PROC [IncludedCTXIndex, Tree.Link];
EnterComposite: PROC [type: Type, t: Tree.Link, init: BOOL];
EnterType: PROC [type: Type, canonical: BOOL¬TRUE];
FieldId: PROC [HTIndex, RecordSEIndex] RETURNS [NAT, ISEIndex];
FindSe: PROC [HTIndex] RETURNS [symbol: ISEIndex, base: Tree.Link, indirect: BOOL];
Id: PROC [HTIndex] RETURNS [Tree.Link];
InterfaceId: PROC [HTIndex, CTXIndex] RETURNS [found: BOOL, sei: ISEIndex];
MainIncludedCtx: PROC [MDIndex] RETURNS [IncludedCTXIndex];
MakeIdTable: PROC [CARDINAL];
OpenBase: PROC [Tree.Link, HTIndex] RETURNS [Tree.Link];
OpenPointer: PROC [Tree.Link, Type] RETURNS [Tree.Link, CSEIndex];
PopCtx: PROC;
PushCtx: PROC [CTXIndex];
PushHtCtx: PROC [HTIndex, Tree.Link, BOOL];
PushRecordCtx: PROC [RecordSEIndex, Tree.Link, BOOL];
RecordLhs: PROC [ISEIndex];
RecordMention: PROC [ISEIndex];
SealRefStack: PROC;
SearchCtxList: PROC [HTIndex, CTXIndex] RETURNS [found: BOOL, sei: ISEIndex];
Shared: PROC [CTXIndex] RETURNS [BOOL];
TopCtx: PROC RETURNS [CTXIndex];
UnsealRefStack: PROC;
UpdateTreeAttr: PROC [Tree.Link] RETURNS [attr: Attr];
exported by Pass3M
CatchPhrase: PROC [Tree.Link] RETURNS [unwindCaught: BOOL];
Cons: PROC [Tree.Index, Type] RETURNS [Tree.Link];
CopyLock: PROC RETURNS [Tree.Link];
FindLockParams: PROC RETURNS [formal: ISEIndex, actual: ISEIndex];
InsertCatchLabel: SIGNAL [catchSeen: BOOL, exit: BOOL];
ItemType: PROC [Type] RETURNS [Type];
ListCons: PROC [Tree.Index, Type];
LockVar: PROC [Tree.Link] RETURNS [Tree.Link];
MakeFrameRecord: PROC [Tree.Link] RETURNS [CSEIndex];
MiscStmt: PROC [Tree.Index] RETURNS [Tree.Link];
MiscXfer: PROC [Tree.Index, Type] RETURNS [Tree.Link];
New: PROC [Tree.Index, Type];
TextRep: PROC [Type] RETURNS [TextForm];
XferForFrame: PROC [CTXIndex] RETURNS [CSEIndex];
exported by Pass3S
pathNP: VAR NPUse;
AssignDefaults: PROC [ctx: CTXIndex, copyable: BOOL ¬ FALSE] RETURNS [Tree.Link];
BodyList: PROC [firstBti: BTIndex];
BumpArgRefs: PROC [record: RecordSEIndex, write: BOOL];
Case: PROC [Tree.Index, Tree.Map];
CheckLocals: PROC [Tree.Link] RETURNS [localsOnly: BOOL];
SafetyAttr: PROC [Tree.Index] RETURNS [Safety];
SetSafety: PROC [Safety];
Scope: PROC [Tree.Index, Tree.Map];
Stmt: Tree.Map;
exported by Pass3V
DiscriminatedType: PROC [CSEIndex, Tree.Link] RETURNS [CSEIndex];
Discrimination: PROC [Tree.Index, Tree.Map];
Narrowing: PROC [type, target: Type] RETURNS [NarrowOp];
SelectVariantType: PROC [Type, HTIndex] RETURNS [ISEIndex];
SequenceField: PROC [RecordSEIndex] RETURNS [ISEIndex];
VariantUnionType: PROC [Type] RETURNS [CSEIndex];
exported by Pass3Xa
phraseNP: VAR NPUse;
All: PROC [node: Tree.Index, target: Type, init: BOOL¬FALSE];
Apply: PROC [Tree.Index, Type, BOOL] RETURNS [Tree.Index];
Assignment: PROC [Tree.Index];
CheckLength: PROC [Tree.Link, INTEGER];
CheckScope: PROC [Tree.Link, Type] RETURNS [Tree.Link];
Dot: PROC [Tree.Index, Type] RETURNS [Tree.Index];
Extract: PROC [Tree.Index];
FieldDefault: PROC [ISEIndex] RETURNS [Tree.Link];
FieldVoid: PROC [Tree.Link] RETURNS [Tree.Link];
Initialization: PROC [Tree.Link, Type] RETURNS [Tree.Link];
InterfaceCtx: PROC [CSEIndex, Tree.Link] RETURNS [CTXIndex];
KeyedList: PROC [Tree.Link] RETURNS [BOOL];
MatchFields: PROC
[record: RecordSEIndex, expList: Tree.Link, init: BOOL¬FALSE, scopeCheck: BOOL¬TRUE]
RETURNS [Tree.Link];
VoidComponent: PROC [Type];
exported by Pass3Xb
ClearType: PROC [type: Type, normalize: BOOL ¬ TRUE] RETURNS [CSEIndex];
Exp: PROC [Tree.Link, Type] RETURNS [Tree.Link];
ForceType: PROC [Tree.Link, Type] RETURNS [Tree.Link];
Interval: PROC [Tree.Link, Type, BOOL];
RAttr: PROC RETURNS [Attr];
RAttrPop: PROC RETURNS [Attr];
RAttr followed by RPop
Rhs: PROC [Tree.Link, Type] RETURNS [Tree.Link];
RPop: PROC;
RPush: PROC [Type, Attr];
RType: PROC RETURNS [Type];
SetType: PROC [Type];
UType: PROC RETURNS [CSEIndex];
VoidExp: Tree.Map;
exported by Pass3Xc
AddrOp: PROC [Tree.Index, Type];
Range: PROC [Tree.Link, Type] RETURNS [Tree.Link];
Span: PROC [CSEIndex] RETURNS [first, last: MimosaCopier.SEToken];
}.