Skip to content

Commit 9799385

Browse files
committed
CogVM source as per VMMaker.oscog-eem.2968
In rare circumstances the Display bits oop can be nil post GC. Avoid an assert failure and unnecessary work if it is.
1 parent 3d077a1 commit 9799385

39 files changed

+371
-343
lines changed

spur64src/vm/cointerp.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
33
from
4-
CoInterpreter VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
4+
CoInterpreter VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
55
*/
6-
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621 " __DATE__ ;
6+
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f " __DATE__ ;
77
char *__interpBuildInfo = __buildInfo;
88

99

@@ -1247,7 +1247,7 @@ extern sqInt nonIndexablePointerFormat(void);
12471247
static sqInt noUnscannedEphemerons(void);
12481248
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
12491249
extern sqInt numBytesOf(sqInt objOop);
1250-
extern usqInt numPointerSlotsOf(sqInt objOop);
1250+
extern sqInt numPointerSlotsOf(sqInt objOop);
12511251
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
12521252
extern usqInt numSlotsOf(sqInt objOop);
12531253
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
@@ -2597,7 +2597,7 @@ sqInt debugCallbackInvokes;
25972597
sqInt debugCallbackReturns;
25982598
sqInt ffiExceptionResponse;
25992599
sqInt checkedPluginName;
2600-
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2967]";
2600+
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2968]";
26012601
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
26022602
int displayWidth;
26032603
int displayDepth;
@@ -32526,7 +32526,7 @@ primitiveInvokeObjectAsMethod(void)
3252632526
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
3252732527
sqInt i;
3252832528
sqInt lookupClassTag;
32529-
sqInt runArgs;
32529+
usqInt runArgs;
3253032530
sqInt runReceiver;
3253132531
char *sp;
3253232532
char *sp1;
@@ -39087,7 +39087,7 @@ followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth)
3908739087
sqInt header1;
3908839088
sqInt i;
3908939089
sqInt numLiterals;
39090-
usqInt numSlots;
39090+
sqInt numSlots;
3909139091
usqInt numSlots1;
3909239092
sqInt oop;
3909339093
sqInt referent;
@@ -46705,7 +46705,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
4670546705
sqInt iLimiT;
4670646706
sqInt methodHeader;
4670746707
sqInt numLiterals;
46708-
usqInt numMediatedSlots;
46708+
sqInt numMediatedSlots;
4670946709
usqInt numSlots;
4671046710
usqInt numSlots1;
4671146711
sqInt oop;
@@ -52980,7 +52980,7 @@ numBytesOf(sqInt objOop)
5298052980
Works with CompiledMethods, as well as ordinary objects. */
5298152981

5298252982
/* SpurMemoryManager>>#numPointerSlotsOf: */
52983-
usqInt
52983+
sqInt
5298452984
numPointerSlotsOf(sqInt objOop)
5298552985
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
5298652986
sqInt contextSize;
@@ -56062,7 +56062,7 @@ printReferencesTo(sqInt anOop)
5606256062
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
5606356063
contextSize = (sp >> 3);
5606456064
l9: /* end fetchStackPointerOf: */;
56065-
i = ((usqInt) (CtxtTempFrameStart + contextSize));
56065+
i = CtxtTempFrameStart + contextSize;
5606656066
goto l10;
5606756067
}
5606856068
/* begin numSlotsOf: */
@@ -56095,7 +56095,7 @@ printReferencesTo(sqInt anOop)
5609556095
/* begin literalCountOfMethodHeader: */
5609656096
assert((((header) & 7) == 1));
5609756097
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
56098-
i = ((usqInt) (numLiterals + LiteralStart));
56098+
i = numLiterals + LiteralStart;
5609956099
l10: /* end numPointerSlotsOf: */;
5610056100
while (((i -= 1)) >= 0) {
5610156101
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
@@ -59257,10 +59257,10 @@ updatePointers(void)
5925759257
sqInt numLiterals1;
5925859258
sqInt numLiterals2;
5925959259
sqInt numLiterals3;
59260-
usqInt numPointerSlots;
59261-
usqInt numPointerSlots1;
59262-
usqInt numPointerSlots2;
59263-
usqInt numPointerSlots3;
59260+
sqInt numPointerSlots;
59261+
sqInt numPointerSlots1;
59262+
sqInt numPointerSlots2;
59263+
sqInt numPointerSlots3;
5926459264
usqInt numSlots;
5926559265
usqInt numSlots1;
5926659266
usqInt numSlots11;
@@ -67339,7 +67339,8 @@ postGCUpdateDisplayBits(void)
6733967339
}
6734067340
/* begin fetchPointer:ofObject: */
6734167341
bitsOop = longAt((displayObj + BaseHeaderSize) + (0U << (shiftForWord())));
67342-
if ((((bitsOop) & 7) == 1)) {
67342+
if ((bitsOop == GIV(nilObj))
67343+
|| ((((bitsOop) & 7) == 1))) {
6734367344

6734467345
/* It's a surface; our work here is done... */
6734567346
return 1;

spur64src/vm/cointerp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
33
*/
44

55

@@ -244,7 +244,7 @@ extern sqInt minSlotsForShortening(void);
244244
extern sqInt nilObject(void);
245245
extern sqInt nonIndexablePointerFormat(void);
246246
extern sqInt numBytesOf(sqInt objOop);
247-
extern usqInt numPointerSlotsOf(sqInt objOop);
247+
extern sqInt numPointerSlotsOf(sqInt objOop);
248248
extern usqInt numSlotsOf(sqInt objOop);
249249
extern sqInt numStrongSlotsOfWeakling(sqInt objOop);
250250
extern sqInt objectAfter(sqInt objOop);

spur64src/vm/cointerpmt.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
33
from
4-
CoInterpreterMT VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
4+
CoInterpreterMT VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
55
*/
6-
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621 " __DATE__ ;
6+
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f " __DATE__ ;
77
char *__interpBuildInfo = __buildInfo;
88

99

@@ -1327,7 +1327,7 @@ extern sqInt nonIndexablePointerFormat(void);
13271327
static sqInt noUnscannedEphemerons(void);
13281328
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
13291329
extern sqInt numBytesOf(sqInt objOop);
1330-
extern sqInt numPointerSlotsOf(sqInt objOop);
1330+
extern usqInt numPointerSlotsOf(sqInt objOop);
13311331
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
13321332
extern usqInt numSlotsOf(sqInt objOop);
13331333
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
@@ -2690,7 +2690,7 @@ sqInt debugCallbackInvokes;
26902690
sqInt debugCallbackReturns;
26912691
sqInt ffiExceptionResponse;
26922692
sqInt checkedPluginName;
2693-
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.2967]";
2693+
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.2968]";
26942694
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
26952695
int displayWidth;
26962696
int displayDepth;
@@ -20223,7 +20223,7 @@ printFrameWithSP(char *theFP, char *theSP)
2022320223
usqInt index;
2022420224
sqInt methodField;
2022520225
usqInt numArgs;
20226-
sqInt numTemps;
20226+
usqInt numTemps;
2022720227
char *rcvrAddress;
2022820228
sqInt rcvrOrClosure;
2022920229
CogBlockMethod * self_in_cmHomeMethod;
@@ -41523,7 +41523,7 @@ followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth)
4152341523
sqInt header1;
4152441524
sqInt i;
4152541525
sqInt numLiterals;
41526-
sqInt numSlots;
41526+
usqInt numSlots;
4152741527
usqInt numSlots1;
4152841528
sqInt oop;
4152941529
sqInt referent;
@@ -49141,7 +49141,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
4914149141
sqInt iLimiT;
4914249142
sqInt methodHeader;
4914349143
sqInt numLiterals;
49144-
sqInt numMediatedSlots;
49144+
usqInt numMediatedSlots;
4914549145
usqInt numSlots;
4914649146
usqInt numSlots1;
4914749147
sqInt oop;
@@ -55434,7 +55434,7 @@ numBytesOf(sqInt objOop)
5543455434
Works with CompiledMethods, as well as ordinary objects. */
5543555435

5543655436
/* SpurMemoryManager>>#numPointerSlotsOf: */
55437-
sqInt
55437+
usqInt
5543855438
numPointerSlotsOf(sqInt objOop)
5543955439
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
5544055440
sqInt contextSize;
@@ -58516,7 +58516,7 @@ printReferencesTo(sqInt anOop)
5851658516
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
5851758517
contextSize = (sp >> 3);
5851858518
l9: /* end fetchStackPointerOf: */;
58519-
i = CtxtTempFrameStart + contextSize;
58519+
i = ((usqInt) (CtxtTempFrameStart + contextSize));
5852058520
goto l10;
5852158521
}
5852258522
/* begin numSlotsOf: */
@@ -58549,7 +58549,7 @@ printReferencesTo(sqInt anOop)
5854958549
/* begin literalCountOfMethodHeader: */
5855058550
assert((((header) & 7) == 1));
5855158551
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
58552-
i = numLiterals + LiteralStart;
58552+
i = ((usqInt) (numLiterals + LiteralStart));
5855358553
l10: /* end numPointerSlotsOf: */;
5855458554
while (((i -= 1)) >= 0) {
5855558555
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
@@ -61711,10 +61711,10 @@ updatePointers(void)
6171161711
sqInt numLiterals1;
6171261712
sqInt numLiterals2;
6171361713
sqInt numLiterals3;
61714-
sqInt numPointerSlots;
61715-
sqInt numPointerSlots1;
61716-
sqInt numPointerSlots2;
61717-
sqInt numPointerSlots3;
61714+
usqInt numPointerSlots;
61715+
usqInt numPointerSlots1;
61716+
usqInt numPointerSlots2;
61717+
usqInt numPointerSlots3;
6171861718
usqInt numSlots;
6171961719
usqInt numSlots1;
6172061720
usqInt numSlots11;
@@ -62289,7 +62289,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr)
6228962289
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj)));
6229062290
contextSize = (sp >> 3);
6229162291
l6: /* end fetchStackPointerOf: */;
62292-
numPointerSlots = CtxtTempFrameStart + contextSize;
62292+
numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize));
6229362293
goto l10;
6229462294
}
6229562295
/* begin numSlotsOf: */
@@ -62319,7 +62319,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr)
6231962319
/* begin literalCountOfMethodHeader: */
6232062320
assert((((header) & 7) == 1));
6232162321
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
62322-
numPointerSlots = numLiterals + LiteralStart;
62322+
numPointerSlots = ((usqInt) (numLiterals + LiteralStart));
6232362323
l10: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */;
6232462324
if ((fmt <= 5 /* lastPointerFormat */)
6232562325
&& (numPointerSlots > 0)) {
@@ -69468,7 +69468,8 @@ postGCUpdateDisplayBits(void)
6946869468
}
6946969469
/* begin fetchPointer:ofObject: */
6947069470
bitsOop = longAt((displayObj + BaseHeaderSize) + (0U << (shiftForWord())));
69471-
if ((((bitsOop) & 7) == 1)) {
69471+
if ((bitsOop == GIV(nilObj))
69472+
|| ((((bitsOop) & 7) == 1))) {
6947269473

6947369474
/* It's a surface; our work here is done... */
6947469475
return 1;

spur64src/vm/cointerpmt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
33
*/
44

55

@@ -248,7 +248,7 @@ extern sqInt minSlotsForShortening(void);
248248
extern sqInt nilObject(void);
249249
extern sqInt nonIndexablePointerFormat(void);
250250
extern sqInt numBytesOf(sqInt objOop);
251-
extern sqInt numPointerSlotsOf(sqInt objOop);
251+
extern usqInt numPointerSlotsOf(sqInt objOop);
252252
extern usqInt numSlotsOf(sqInt objOop);
253253
extern sqInt numStrongSlotsOfWeakling(sqInt objOop);
254254
extern sqInt objectAfter(sqInt objOop);

spur64src/vm/gcc3x-cointerp.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33

44
/* Automatically generated by
5-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
5+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
66
from
7-
CoInterpreter VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621
7+
CoInterpreter VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f
88
*/
9-
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2967 uuid: 57b9e5f9-0212-436d-acaf-4e501e470621 " __DATE__ ;
9+
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2968 uuid: f7018c3a-ddc0-4f70-aa66-8f8f6b17f40f " __DATE__ ;
1010
char *__interpBuildInfo = __buildInfo;
1111

1212

@@ -1250,7 +1250,7 @@ extern sqInt nonIndexablePointerFormat(void);
12501250
static sqInt noUnscannedEphemerons(void);
12511251
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
12521252
extern sqInt numBytesOf(sqInt objOop);
1253-
extern usqInt numPointerSlotsOf(sqInt objOop);
1253+
extern sqInt numPointerSlotsOf(sqInt objOop);
12541254
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
12551255
extern usqInt numSlotsOf(sqInt objOop);
12561256
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
@@ -2600,7 +2600,7 @@ sqInt debugCallbackInvokes;
26002600
sqInt debugCallbackReturns;
26012601
sqInt ffiExceptionResponse;
26022602
sqInt checkedPluginName;
2603-
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2967]";
2603+
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2968]";
26042604
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
26052605
int displayWidth;
26062606
int displayDepth;
@@ -32535,7 +32535,7 @@ primitiveInvokeObjectAsMethod(void)
3253532535
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
3253632536
sqInt i;
3253732537
sqInt lookupClassTag;
32538-
sqInt runArgs;
32538+
usqInt runArgs;
3253932539
sqInt runReceiver;
3254032540
char *sp;
3254132541
char *sp1;
@@ -39096,7 +39096,7 @@ followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth)
3909639096
sqInt header1;
3909739097
sqInt i;
3909839098
sqInt numLiterals;
39099-
usqInt numSlots;
39099+
sqInt numSlots;
3910039100
usqInt numSlots1;
3910139101
sqInt oop;
3910239102
sqInt referent;
@@ -46714,7 +46714,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
4671446714
sqInt iLimiT;
4671546715
sqInt methodHeader;
4671646716
sqInt numLiterals;
46717-
usqInt numMediatedSlots;
46717+
sqInt numMediatedSlots;
4671846718
usqInt numSlots;
4671946719
usqInt numSlots1;
4672046720
sqInt oop;
@@ -52989,7 +52989,7 @@ numBytesOf(sqInt objOop)
5298952989
Works with CompiledMethods, as well as ordinary objects. */
5299052990

5299152991
/* SpurMemoryManager>>#numPointerSlotsOf: */
52992-
usqInt
52992+
sqInt
5299352993
numPointerSlotsOf(sqInt objOop)
5299452994
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
5299552995
sqInt contextSize;
@@ -56071,7 +56071,7 @@ printReferencesTo(sqInt anOop)
5607156071
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
5607256072
contextSize = (sp >> 3);
5607356073
l9: /* end fetchStackPointerOf: */;
56074-
i = ((usqInt) (CtxtTempFrameStart + contextSize));
56074+
i = CtxtTempFrameStart + contextSize;
5607556075
goto l10;
5607656076
}
5607756077
/* begin numSlotsOf: */
@@ -56104,7 +56104,7 @@ printReferencesTo(sqInt anOop)
5610456104
/* begin literalCountOfMethodHeader: */
5610556105
assert((((header) & 7) == 1));
5610656106
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
56107-
i = ((usqInt) (numLiterals + LiteralStart));
56107+
i = numLiterals + LiteralStart;
5610856108
l10: /* end numPointerSlotsOf: */;
5610956109
while (((i -= 1)) >= 0) {
5611056110
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
@@ -59266,10 +59266,10 @@ updatePointers(void)
5926659266
sqInt numLiterals1;
5926759267
sqInt numLiterals2;
5926859268
sqInt numLiterals3;
59269-
usqInt numPointerSlots;
59270-
usqInt numPointerSlots1;
59271-
usqInt numPointerSlots2;
59272-
usqInt numPointerSlots3;
59269+
sqInt numPointerSlots;
59270+
sqInt numPointerSlots1;
59271+
sqInt numPointerSlots2;
59272+
sqInt numPointerSlots3;
5927359273
usqInt numSlots;
5927459274
usqInt numSlots1;
5927559275
usqInt numSlots11;
@@ -67348,7 +67348,8 @@ postGCUpdateDisplayBits(void)
6734867348
}
6734967349
/* begin fetchPointer:ofObject: */
6735067350
bitsOop = longAt((displayObj + BaseHeaderSize) + (0U << (shiftForWord())));
67351-
if ((((bitsOop) & 7) == 1)) {
67351+
if ((bitsOop == GIV(nilObj))
67352+
|| ((((bitsOop) & 7) == 1))) {
6735267353

6735367354
/* It's a surface; our work here is done... */
6735467355
return 1;

0 commit comments

Comments
 (0)