[ivy]<Satterthwaite>SML>SMLoad.mesa!17

SMLoad.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
last edit by Satterthwaite, May 12, 1986 11:59:11 am PDT
shared data definitions internal to the loader
DIRECTORY
BcdDefs: TYPE USING [BcdBase, EXPHandle, Link],
LoadState: TYPE USING [ConfigID, ModuleIndex, --nullConfig,-- nullModule],
PrincOps: TYPE USING [ControlLink, ControlModule, MaxNGfi, NullControl, NullLink],
TimeStamp: TYPE USING [Null, Stamp],
VM: TYPE USING [Interval, nullInterval];
SMLoad: CEDAR DEFINITIONS --IMPORTS LoadState-- ~ {
the modeller's representation of an interface record. Control link entries:
for a proc, [procedure[gfi~gfi, ep~ep, tag~TRUE]]
for an exported variable, @variable
for a module, GlobalFramePointer
IR: TYPE~REF InterfaceRecord;
InterfaceRecord: TYPE~RECORD[
name: ATOM←NIL,
stamp: TimeStamp.Stamp←TimeStamp.Null,
body: SEQUENCE size: NAT OF
RECORD[link: PrincOps.ControlLink←PrincOps.NullLink]-- the links
];
IRSeq: TYPE~REF IRSeqRecord;
IRSeqRecord: TYPE~RECORD[
body: SEQUENCE size: NAT OF IR -- ith element is IR associated with the ith import
];
LoadInfo: TYPE~REF LoadInfoRecord;
LoadInfoRecord: TYPE~RECORD[
bcdSpace: VM.Interval←VM.nullInterval,-- the mapped-in bcd
bcd: BcdDefs.BcdBase←NIL,-- for bcdSpace (redundant but convenient)
config: LoadState.ConfigID←,-- config for the containing model
moduleIndex: LoadState.ModuleIndex←LoadState.nullModule,-- dummy gfi in that config
nModules: NAT𡤀,-- (> 1 only for configs)
imports: IRSeq←NIL,-- [1 to bcdBase.nImports] (0 unused)
exports: IRSeq←NIL,-- exports[0] is the global frame
cm: PrincOps.ControlModule←PrincOps.NullControl,
linksResolved: BOOL←FALSE,-- accelerator
rtStarted: BOOL←FALSE -- types/literals acquired
];
the modeller's version of a dummy gfi relocation map
for importMap[0..bcdBase.nDummies),
importMap[gfi-importMap.bias] is the index into the import table for a dummy gfi
ImportMap: TYPE~REF ImportMapSeq;
ImportMapSeq: TYPE~RECORD[
bias: NAT←,-- the value of bcdBase.firstDummy
map: SEQUENCE maxSize: NAT OF RECORD[
index: NAT,-- to the import record
whichOne: [0..PrincOps.MaxNGfi)]
];
ReplaceResult: TYPE~ {
ok, configNotReplaceable, frameTooBig, nGfiTooBig, cantCopyOldBcd,
checkForMRFailed, compilerSaysNo};
RelocateLink: PROC[loadInfo: LoadInfo, bcdLink: BcdDefs.Link] -- bcdLink.gfi < firstdummy
RETURNS[PrincOps.ControlLink];
BuildInterface: PROC[loadInfo: LoadInfo, eth: BcdDefs.EXPHandle] RETURNS[IR];
BuildFramePtrInterface: PROC[loadInfo: LoadInfo] RETURNS[IR];
allocation/deallocation
AllocateIR: PROC[stamp: TimeStamp.Stamp, name: ATOM, size: NAT] RETURNS[IR];
FreeIR: PROC[ir: IR] RETURNS[IR];-- always gives NIL
}.