<> <> <> <> <> <> <> DIRECTORY BcdDefs USING[SGIndex, SGNull, BcdBase], RCMap USING[Index, nullIndex, Limit], Rope USING[ROPE], SafeStorage USING[TypeIndex, Type, nullType], RTSymbolDefs USING[SymbolTableHandle, nullHandle, SymbolIndex, nullSymbolIndex], TimeStamp USING[Stamp], TypeHash USING [TypeKey], TypeStrings USING[TypeString]; RTTypesBasicPrivate: DEFINITIONS = BEGIN <> MapTiTd: TMapTiTd; -- The Runtime Type Table: maps SafeStorage.TypeIndex to TypeDesc RMapTiTd: TYPE = RECORD[ptds: SEQUENCE length: NAT OF PTypeDesc]; TMapTiTd: TYPE = LONG POINTER TO RMapTiTd; PTypeDesc: TYPE = LONG POINTER TO TypeDesc; TypeDesc: TYPE = MACHINE DEPENDENT RECORD[ equivalentTypePad: [0..3] _ 0, equivalentType: SafeStorage.Type _ SafeStorage.nullType, -- nullType means not "canonicalized" finalized: BOOL _ FALSE, numberPackageRefs: NAT _ 0, -- ucode does not depend on stuff below rcmx: RCMap.Index _ RCMap.nullIndex, fill: [0..LAST[CARDINAL]/RCMap.Limit] _ 0, utf: UniqueTypeFinger, symbolAccess: SymbolAccess, next: PTypeDesc _ NIL, -- link in list of types with the same ts hash myTypePad: [0..3] _ 0, myType: SafeStorage.Type, -- a back pointer(logically) typekey: TypeHash.TypeKey, extension: PTypeExtension _ NIL -- LOOPHOLE ]; SymbolAccess: TYPE = RECORD[ sti: SymbolTableIndex _ 0, sei: RTSymbolDefs.SymbolIndex _ RTSymbolDefs.nullSymbolIndex ]; SymbolTableIndex: TYPE = NAT; -- index into MapStiStd PTypeExtension: TYPE = LONG POINTER TO TypeExtension; -- LOOPHOLE RTypeExtension: TYPE = REF TypeExtension; TypeExtension: TYPE = RECORD [ next: RTypeExtension, -- link in the list of them; stay honest finalizationSet: REF _ NIL, attachment: REF ANY _ NIL ]; <<>> <> MapStiStd: TMapStiStd; -- The map from SymbolTableIndex to STDesc. DELICATE intialization. TMapStiStd: TYPE = REF RMapStiStd; RMapStiStd: TYPE = RECORD[stiv: SEQUENCE length: SymbolTableIndex OF RSTDesc]; LOOPHOLEDTMapStiStd: TYPE = LONG POINTER TO LOOPHOLEDRMapStiStd; LOOPHOLEDRMapStiStd: TYPE = RECORD[ stiv: SEQUENCE length: SymbolTableIndex OF PSTDesc]; InitialSTIRangeSize: CARDINAL = 4000B; <<>> RSTDesc: TYPE = REF STDesc; PSTDesc: TYPE = LONG POINTER TO STDesc; STDesc: TYPE = RECORD[ symbolsStamp: TimeStamp.Stamp, bcd: BcdDefs.BcdBase _ NIL, sgi: BcdDefs.SGIndex _ BcdDefs.SGNull, sth: RTSymbolDefs.SymbolTableHandle _ RTSymbolDefs.nullHandle ]; <> <> <> <> TypeStructure: TYPE = TypeStrings.TypeString; <<>> <> <<>> UniqueTypeFinger: TYPE = RECORD[ umid: TimeStamp.Stamp, -- of original defining module seIndex: RTSymbolDefs.SymbolIndex -- type seIndex therein ]; useCanonicalTypeMicroCode: BOOL; -- exported variable <> GetLastTypeIndex: PROC RETURNS[SafeStorage.TypeIndex]; NumberPackageRefs: PROC[type: SafeStorage.Type] RETURNS[NAT] = INLINE { RETURN[MapTiTd[type].numberPackageRefs]; }; MapTiRcmx: PROC[ti: SafeStorage.TypeIndex] RETURNS[RCMap.Index] = INLINE { RETURN[MapTiTd[ti].rcmx]; }; PutForFinalization: PROC[type: SafeStorage.Type, ref: REF ANY] RETURNS[done: BOOLEAN]; AssignComposite: PROC[rhs, lhs: LONG POINTER, type: SafeStorage.Type, nwords: CARDINAL]; AssignCompositeNew: PROC[rhs, lhs: LONG POINTER, type: SafeStorage.Type, nwords: CARDINAL]; FreeCollectibleObject: PROC[refObj: REF ANY]; -- nilifies REFs within MapRefs: PROC[ptr: LONG POINTER, rcmx: RCMap.Index, procLeaf: PROC[p: REF ANY]]; MapRefOffsets: PROC[ref: REF ANY, procLeaf: PROC[offset: LONG CARDINAL]]; DoFREEify: PROC[ptr: LONG POINTER, rcmx: RCMap.Index, procLeaf: PROC[p: REF ANY]]; GetMapTiTd: PROC RETURNS[TMapTiTd]; NotifyAtomRecType: PROC[type: SafeStorage.Type]; AcquireTypeForLoader: PROC[utf: UniqueTypeFinger, std: STDesc, sei: RTSymbolDefs.SymbolIndex, ts: TypeStrings.TypeString, rcmi: RCMap.Index, canonicalize: BOOLEAN _ FALSE, initializing: BOOL _ FALSE -- TRUE => create MapStiStd entry from uncounted storage ] RETURNS[SafeStorage.Type]; <<>> <<>> <> MakeNewType: PROC[utf: UniqueTypeFinger, std: STDesc, sei: RTSymbolDefs.SymbolIndex, ts: TypeStrings.TypeString, rcmx: RCMap.Index, canonicalize: BOOLEAN _ FALSE, initializing: BOOLEAN _ FALSE, -- i.e. create MapStiStd entry from uncounted storage type: SafeStorage.Type _ SafeStorage.nullType] RETURNS[SafeStorage.Type]; FindSTI: PROC[std: STDesc, initializing: BOOL _ FALSE] RETURNS[i: SymbolTableIndex]; < create MapStiStd entry from uncounted storage>> BlessMapStiStd: PROC; -- copy initial (uncounted) MapStiStd to counted storage FindCanonicalPTD: PROC[ts: TypeStrings.TypeString] RETURNS[ptd: PTypeDesc]; FindPTD: PROC[utf: UniqueTypeFinger, ts: TypeStrings.TypeString _ NIL] RETURNS[ptd: PTypeDesc]; Enter: PROC[inner: PROC]; <> NotImplemented: ERROR[msg: Rope.ROPE]; END. CHANGE LOG <> <> <<>>