/* Generated with C2C (Cedar To C)*/ /* Copyright (C) 1992 by Xerox Corporation. All rights reserved. */ /* time: August 31, 1992 9:14:45 am PDT */ /* C2C version: October 16, 1990 (native) */ /* ref-counting: off */ /* file: SafeStorageImpl, module: SafeStorageImpl */ /* switches: bcfhklnouw */ #include <cedar/InstallationSupport.h> #include <cedar/CedarExtra.h> static char versionStamp[] = "@(#)mob←version [722927241,3266122908] SafeStorageImpl"; typedef unsigned word, *ptr; typedef unsigned char byte, *bPt; typedef unsigned short half, *hPt; typedef word (*fPt)(); typedef struct {word f0, f1;} W2; #define SOURCE(p, l) /* source p, l */ #define SGNCK(i) ((int) (word) (i) < 0 ? XR←RaiseArithmeticFault(): i ) static void NoName←Q1992(); static void SafeStorageImpl←P0(); static word GetSystemZone←P60(); static word GetZone←P120(); static word New←P180(); static void Free←P240(); static word GetUntracedZone←P300(); static word UntracedNew←P360(); static word GetPermanentZone←P420(); static word SetCollectionInterval←P480(); static void ReclaimCollectibleObjects←P540(); static word CurrentByteCount←P600(); static word CurrentObjectCount←P660(); static word TotalByteCount←P720(); static word TotalObjectCount←P780(); static word HeapSize←P840(); static word GetCanonicalReferentType←P900(); static word EquivalentTypes←P960(); static word GetCanonicalType←P1020(); static word IsReferentType←P1080(); extern void XR←AssignRef(); extern void XR←AssignRefInit(); extern word XR←NewObject(); extern word XR←NewUntracedObject(); extern word XR←CheckProc(); extern word XR←Narrow(); extern word XR←GetReferentType(); extern void XR←AssignRefComposite(); extern void XR←AssignRefCompositeInit(); static struct {unsigned f; char r[16];} string1 = {851984, "\257\300\053\026\376\211\300\302\255\024\234\100\164\000\000"}; static struct {unsigned f; char r[4];} string2 = {131074, "\0040\000"}; static struct {unsigned f; char r[16];} string3 = {851984, "\257\300\277\374\326\303\300\302\136\022\175\100\150\000\000"}; static struct { word f0[12]; word f12; word f13; word f14; word f15; word f16; word f17; word f18; word f19; word f20; word f21; word f22; word f23; word f24; word f25; word f26; word f27; word f28; word f29; word f30; word f31; word f32; word f33; word f34; word f35; word f36; word f37; word f38; word f39; word f40; word f41; word f42; word f43; word f44; word f45; word f46; word f47; word f48; word f49; word f50; word f51; word f52; word f53; word f54; word f55; word f56; word f57; word f58; word f59; word f60; word f61; word f62; word f63; word f64; word f65; word f66; word f67[2]; } globalframe = { {0}, (word) XR←AssignRefCompositeInit, 0, (word) XR←AssignRefComposite, 0, (word) XR←GetReferentType, 0, (word) XR←Narrow, 0, (word) XR←CheckProc, 0, (word) XR←NewUntracedObject, 0, (word) XR←NewObject, 0, (word) XR←AssignRefInit, 0, (word) XR←AssignRef, 0, (word) IsReferentType←P1080, 0, (word) GetCanonicalType←P1020, 0, (word) EquivalentTypes←P960, 0, (word) GetCanonicalReferentType←P900, 0, (word) HeapSize←P840, 0, (word) TotalObjectCount←P780, 0, (word) TotalByteCount←P720, 0, (word) CurrentObjectCount←P660, 0, (word) CurrentByteCount←P600, 0, (word) ReclaimCollectibleObjects←P540, 0, (word) SetCollectionInterval←P480, 0, (word) GetPermanentZone←P420, 0, (word) UntracedNew←P360, 0, (word) GetUntracedZone←P300, 0, (word) Free←P240, 0, (word) New←P180, 0, (word) GetZone←P120, 0, (word) GetSystemZone←P60, 0, (word) SafeStorageImpl←P0, {0} }; static void NoName←Q1992() { register ptr gf←c0116 = (ptr) &globalframe; word var←c11748; (void) XR←DeclareGlobalFrame((word) "SafeStorageImpl", &globalframe, (word) XR←GetTypeIndex((word) &string1, 0, (word) &string2) , (word) (( (bPt) gf←c0116)+264)/* var←c11236 */ ); var←c11748 = (word) XR←ExportInterface((word) "SafeStorage", (word) XR←GetTypeIndexS((word) (&string3)), 27); (* (( (ptr) gf←c0116)+68)/* var←c11716 */ ) = var←c11748; (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+256)/* var←c11204 */ , 67108864); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+208)/* var←c11012 */ , 67109120); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+224)/* var←c11076 */ , 67109376); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+200)/* var←c10980 */ , 67372545); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+192)/* var←c10948 */ , 526082); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+184)/* var←c10916 */ , 67111680); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+176)/* var←c10884 */ , 67111936); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+168)/* var←c10852 */ , 67112192); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+160)/* var←c10820 */ , 67112448); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+152)/* var←c10788 */ , 67112704); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+64)/* var←c10436 */ , 67375105); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+144)/* var←c10756 */ , 67375361); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+136)/* var←c10724 */ , 67637762); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+128)/* var←c10692 */ , 67375873); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+120)/* var←c10660 */ , 67638274); (void) XR←ExportProcS(var←c11748, (word) (( (bPt) gf←c0116)+72)/* var←c10468 */ , 67638530); (void) XR←ExportVar(var←c11748, 22, (word) (( (bPt) gf←c0116)+28)); (void) XR←ExportVar(var←c11748, 23, (word) (( (bPt) gf←c0116)+32)); (void) XR←ExportVar(var←c11748, 24, (word) (( (bPt) gf←c0116)+36)); (void) XR←ExportVar(var←c11748, 25, (word) (( (bPt) gf←c0116)+40)); (void) XR←ExportVar(var←c11748, 26, (word) (( (bPt) gf←c0116)+44)); } static void SafeStorageImpl←P0(formal←c036, formal←c035) word formal←c036; word formal←c035; { register ptr gf←c11780 = (ptr) &globalframe; /* SafeStorageImpl: */ SOURCE(33, 6371) SOURCE(801, 37) (* (( (ptr) gf←c11780)+4)/* systemZone←v2636 */ ) = (word) GetZone←P120((word) (( (bPt) gf←c11780)+240)/* var←c11140 */ , (word) ( ( (bPt) gf←c11780)+232)/* var←c11108 */ ); } static word GetSystemZone←P60() { register ptr gf←c11812 = (ptr) &globalframe; word var←c4192; /* GetSystemZone: */ SOURCE(841, 64) SOURCE(887, 18) return((* (( (ptr) gf←c11812)+4)/* systemZone←v2636 */ )); } static word GetZone←P120(new←v4260, free←v4288) word new←v4260; word free←v4288; { word var←c4332; word zone←v7224; /* GetZone: */ SOURCE(910, 173) SOURCE(982, 56) zone←v7224 = (word) ( *( (fPt) ((* (ptr) new←v4260 ))))(0, 8, 0, new←v4260); SOURCE(1040, 19) (* (ptr) zone←v7224 ) = new←v4260; (* (( (ptr) zone←v7224)+1) ) = free←v4288; SOURCE(1061, 22) return(zone←v7224); } static word New←P180(self←v8816, units←v8844, type←v8872) word self←v8816; word units←v8844; word type←v8872; { word var←c8916; /* New: */ SOURCE(1087, 73) SOURCE(1104, 56) return((word) XR←NewObject(SGNCK(units←v8844), type←v8872)); } static void Free←P240(self←v8976, object←v9004) word self←v8976; word object←v9004; { /* Free: */ } static word GetUntracedZone←P300() { register ptr gf←c11844 = (ptr) &globalframe; word var←c4408; /* GetUntracedZone: */ SOURCE(1255, 151) SOURCE(1309, 45) if (((* (( (ptr) gf←c11844)+5)/* untracedZone←v2776 */ ) != 0)) { SOURCE(1334, 20) return((* (( (ptr) gf←c11844)+5)/* untracedZone←v2776 */ )); }; SOURCE(1356, 50) { word var←c11300; { word var←c11332; var←c11332 = (word) GetZone←P120((word) (( (bPt) gf←c11844)+216)/* var←c11044 */ , (word) (( (bPt) gf←c11844)+232)/* var←c11108 */ ) ; (* (( (ptr) gf←c11844)+5)/* untracedZone←v2776 */ ) = var←c11332; var←c11300 = var←c11332; }; return(var←c11300); }; } static word UntracedNew←P360(self←v9064, units←v9092, type←v9120) word self←v9064; word units←v9092; word type←v9120; { word var←c9164; word r←v7268; /* UntracedNew: */ SOURCE(1412, 191) SOURCE(1447, 65) r←v7268 = (word) XR←NewUntracedObject(SGNCK(units←v9092), type←v9120); SOURCE(1514, 77) (void) Basics←FillWords(r←v7268, (units←v9092 >> 2), 0); SOURCE(1593, 10) return(r←v7268); } static word GetPermanentZone←P420() { word var←c4476; /* GetPermanentZone: */ SOURCE(1607, 73) SOURCE(1656, 24) return((word) GetSystemZone←P60()); } static word SetCollectionInterval←P480(newInterval←v4544) word newInterval←v4544; { word previous←v4588; /* SetCollectionInterval: */ SOURCE(1686, 269) SOURCE(1902, 53) previous←v4588 = (word) XR←SetBytesAfterWhichToCollect(newInterval←v4544); SOURCE(1686, 269) return(previous←v4588); } static void ReclaimCollectibleObjects←P540(suspendMe←v4648, traceAndSweep←v4676) word suspendMe←v4648; word traceAndSweep←v4676; { /* ReclaimCollectibleObjects: */ SOURCE(1961, 179) SOURCE(2124, 16) (void) XR←GCollect(); } static word CurrentByteCount←P600() { word var←c4736; /* CurrentByteCount: */ SOURCE(2146, 135) SOURCE(2268, 13) return((word) XR←GCCurrentByteCount()); } static word CurrentObjectCount←P660() { word var←c4796; /* CurrentObjectCount: */ SOURCE(2285, 139) SOURCE(2411, 13) return((word) XR←GCCurrentObjectCount()); } static word TotalByteCount←P720() { word var←c4856; /* TotalByteCount: */ SOURCE(2428, 131) SOURCE(2546, 13) return((word) XR←GCTotalByteCount()); } static word TotalObjectCount←P780() { word var←c4916; /* TotalObjectCount: */ SOURCE(2563, 135) SOURCE(2685, 13) return((word) XR←GCTotalObjectCount()); } static word HeapSize←P840() { word var←c4976; /* HeapSize: */ SOURCE(2701, 119) SOURCE(2807, 13) return((word) XR←GCHeapSize()); } static word GetCanonicalReferentType←P900(ref←v5036) word ref←v5036; { word type←v5092; /* GetCanonicalReferentType: */ SOURCE(2897, 116) SOURCE(2985, 28) type←v5092 = (word) XR←GetReferentType(ref←v5036); SOURCE(2897, 116) return(type←v5092); } static word EquivalentTypes←P960(t1←v5152, t2←v5180) word t1←v5152; word t2←v5180; { word var←c5224; /* EquivalentTypes: */ SOURCE(3017, 124) SOURCE(3090, 51) return(((word) GetCanonicalType←P1020(t1←v5152) == (word) GetCanonicalType←P1020(t2←v5180))); } static word GetCanonicalType←P1020(type←v5284) word type←v5284; { word var←c5328; /* GetCanonicalType: */ SOURCE(3147, 97) SOURCE(3232, 12) return(type←v5284); } static word IsReferentType←P1080(ref←v5388, type←v5416) word ref←v5388; word type←v5416; { word var←c5472; /* IsReferentType: */ SOURCE(3250, 152) SOURCE(3334, 30) if ((ref←v5388 == 0)) { SOURCE(3352, 12) return(1); }; SOURCE(3366, 36) return((type←v5416 == (word) XR←GetReferentType(ref←v5388))); } extern void XR←AssignRef(dstPtr←v5800, src←v5828) word dstPtr←v5800; word src←v5828; { /* XRAssignRef: */ SOURCE(3691, 112) SOURCE(3789, 14) (* (ptr) dstPtr←v5800 ) = src←v5828; } extern void XR←AssignRefInit(dstPtr←v5924, src←v5952) word dstPtr←v5924; word src←v5952; { /* XRAssignRefInit: */ SOURCE(3807, 120) SOURCE(3913, 14) (* (ptr) dstPtr←v5924 ) = src←v5952; } extern word XR←NewObject(nAddressingUnits←v6048, type←v6076) word nAddressingUnits←v6048; word type←v6076; { register ptr gf←c11876 = (ptr) &globalframe; word new←v6120; word ptr←v8080; /* XRNewObject: */ SOURCE(3931, 362) SOURCE(3931, 362) new←v6120 = 0; SOURCE(4134, 54) ptr←v8080 = (word) GC←malloc((nAddressingUnits←v6048 + 8)); SOURCE(4190, 37) if ((ptr←v8080 == 0)) { SOURCE(4206, 21) (void) XR←RaiseError((word) (( (bPt) gf←c11876)+28), 0); }; SOURCE(4229, 38) new←v6120 = (ptr←v8080 + 8); SOURCE(4269, 24) { word ref←v10292; ref←v10292 = new←v6120; { word p←v8624; p←v8624 = (ref←v10292 - 4); SOURCE(5938, 9) (* (ptr) p←v8624 ) = type←v6076; }; }; SOURCE(3931, 362) return(new←v6120); } extern word XR←NewUntracedObject(nAddressingUnits←v6192, type←v6220) word nAddressingUnits←v6192; word type←v6220; { register ptr gf←c11908 = (ptr) &globalframe; word new←v6264; word ptr←v8268; /* XRNewUntracedObject: */ SOURCE(4297, 398) SOURCE(4297, 398) new←v6264 = 0; SOURCE(4530, 60) ptr←v8268 = (word) GC←malloc←atomic((nAddressingUnits←v6192 + 8)); SOURCE(4592, 37) if ((ptr←v8268 == 0)) { SOURCE(4608, 21) (void) XR←RaiseError((word) (( (bPt) gf←c11908)+28), 0); }; SOURCE(4631, 38) new←v6264 = (ptr←v8268 + 8); SOURCE(4671, 24) { word ref←v10216; ref←v10216 = new←v6264; { word p←v10248; p←v10248 = (ref←v10216 - 4); SOURCE(5938, 9) (* (ptr) p←v10248 ) = type←v6220; }; }; SOURCE(4297, 398) return(new←v6264); } extern word XR←CheckProc(proc←v6336) word proc←v6336; { register ptr gf←c11940 = (ptr) &globalframe; word var←c6396; word x←v8456; /* XRCheckProc: */ SOURCE(4699, 254) SOURCE(4819, 40) x←v8456 = proc←v6336; SOURCE(4861, 62) if ( ( (x←v8456 != 0) ? ((* (( (ptr) x←v8456)+1) ) == 1) : 0 ) ) { SOURCE(4890, 33) { word var←c095; var←c095 = proc←v6336; (void) (XR←RaiseSignal((word) (( (bPt) gf←c11940)+40), 0, (word) &var←c095)); }; }; SOURCE(4925, 28) return(proc←v6336); } extern word XR←Narrow(ref←v6456, type←v6484) word ref←v6456; word type←v6484; { register ptr gf←c11972 = (ptr) &globalframe; word var←c6540; word var←c11620; word ref←v10168; /* NarrowRef: */ SOURCE(4959, 202) SOURCE(5055, 27) if ((ref←v6456 == 0)) { SOURCE(5071, 11) return(ref←v6456); }; SOURCE(5084, 44) ref←v10168 = ref←v6456; { word p←v8584; p←v8584 = (ref←v10168 - 4); SOURCE(5760, 12) var←c11620 = (* (ptr) p←v8584 ); }; if ((type←v6484 == var←c11620)) { SOURCE(5117, 11) return(ref←v6456); }; SOURCE(5130, 31) { W2 var←c0102; (* (ptr) (word) &var←c0102 ) = ref←v6456; (* (( (ptr) (word) &var←c0102) + 1) ) = type←v6484; (void) XR←RaiseError((word) (( (bPt) gf←c11972)+36), (word) &var←c0102); }; } extern word XR←GetReferentType(ref←v6612) word ref←v6612; { word var←c6668; /* GetReferentType: */ SOURCE(5167, 158) SOURCE(5267, 29) if ((ref←v6612 == 0)) { SOURCE(5283, 13) return(0); }; SOURCE(5298, 27) { word var←c11684; word ref←v10092; ref←v10092 = ref←v6612; { word p←v10124; p←v10124 = (ref←v10092 - 4); SOURCE(5760, 12) var←c11684 = (* (ptr) p←v10124 ); }; return(var←c11684); }; } extern void XR←AssignRefComposite(dst←v6944, src←v6972, type←v7000, size←v7028) word dst←v6944; word src←v6972; word type←v7000; word size←v7028; { /* XRAssignRefComposite: */ SOURCE(5953, 210) SOURCE(6094, 69) (void) Basics←CopyWords(dst←v6944, src←v6972, size←v7028); } extern void XR←AssignRefCompositeInit(dst←v7100, src←v7128, type←v7156, size←v7184) word dst←v7100; word src←v7128; word type←v7156; word size←v7184; { /* XRAssignRefCompositeInit: */ SOURCE(6169, 214) SOURCE(6314, 69) (void) Basics←CopyWords(dst←v7100, src←v7128, size←v7184); } /* file: SafeStorageImpl, module: SafeStorageImpl, compiled at: August 31, 1992 9:14:44 am PDT */ extern void XR←install←SafeStorageImpl() { NoName←Q1992(); } extern void XR←run←SafeStorageImpl() { XR←Start(&globalframe); }