diff --git a/src/vm/cointerp.c b/src/vm/cointerp.c index 5c4137ce73..6c05a09888 100644 --- a/src/vm/cointerp.c +++ b/src/vm/cointerp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 from - CoInterpreter VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CoInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2217,7 +2217,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Croquet Closure Cog[SqueakV3] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2570]"; +const char *interpreterVersion = "Croquet Closure Cog[SqueakV3] VM [CoInterpreterPrimitives VMMaker.oscog-nice.2572]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace; @@ -54293,6 +54293,7 @@ primitiveSignalAtMilliseconds(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ccIndex; sqLong deltaMsecs; + sqLong limit; usqInt msecs; sqInt msecsObj; sqInt oop; @@ -54316,10 +54317,18 @@ primitiveSignalAtMilliseconds(void) } longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema); deltaMsecs = msecs - ((ioMSecs()) & MillisecondClockMask); - if (deltaMsecs < 0) { - deltaMsecs = (deltaMsecs + MillisecondClockMask) + 1; + + /* Handle a roll-over that could happen in between image invocation of ioMSecs and this invocation. + This will limit the maximum relative duration to MillisecondClockMask/2, about 3 days currently. + Every delay longer than that limit may lead to undefined behavior (shorten delay, or no delay at all). + The maximum delay might be further limited by platform dependent nextWakeupUsecs handling. */ + limit = ((usqInt) MillisecondClockMask) >> 1; + if (deltaMsecs > limit) { + deltaMsecs -= MillisecondClockMask; + } + if (deltaMsecs > 0) { + GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); } - GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); /* begin pop: */ GIV(stackPointer) += 2 * BytesPerWord; return; diff --git a/src/vm/cointerp.h b/src/vm/cointerp.h index 020d7547a7..cab39fba5d 100644 --- a/src/vm/cointerp.h +++ b/src/vm/cointerp.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ diff --git a/src/vm/cointerpmt.c b/src/vm/cointerpmt.c index e7895fdc83..89b6eac1ed 100644 --- a/src/vm/cointerpmt.c +++ b/src/vm/cointerpmt.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 from - CoInterpreterMT VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CoInterpreterMT VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2311,7 +2311,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.2570]"; +const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-nice.2572]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace; @@ -34366,14 +34366,14 @@ eeInstantiateAndInitializeClassindexableSize(sqInt classPointer, sqInt size) sqInt binc; sqInt bm1; sqInt byteSize; - usqInt cClass; + sqInt cClass; sqInt classFormat; usqInt end; sqInt fillWord; sqInt format; usqInt hash; int hdrSize; - usqInt header1; + sqInt header1; sqInt header2; sqInt header3; usqInt i; @@ -34915,7 +34915,7 @@ eeInstantiateSmallClassnumSlots(sqInt classPointer, sqInt numSlots) { DECL_MAYBE_SQ_GLOBAL_STRUCT usqInt hash; int hdrSize; - usqInt header1; + sqInt header1; sqInt header2; usqInt newChunk; usqInt newFreeStart; @@ -40055,7 +40055,7 @@ instantiateClassindexableSize(sqInt classPointer, sqInt size) sqInt bm1; sqInt byteSize; sqInt byteSize1; - usqInt cClass; + sqInt cClass; sqInt classFormat; sqInt classOop; usqInt end; @@ -40064,7 +40064,7 @@ instantiateClassindexableSize(sqInt classPointer, sqInt size) sqInt format; usqInt hash; sqInt hdrSize; - usqInt header1; + sqInt header1; sqInt header3; usqInt i; sqInt minFree; @@ -56250,6 +56250,7 @@ primitiveSignalAtMilliseconds(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ccIndex; sqLong deltaMsecs; + sqLong limit; usqInt msecs; sqInt msecsObj; sqInt oop; @@ -56273,10 +56274,18 @@ primitiveSignalAtMilliseconds(void) } longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema); deltaMsecs = msecs - ((ioMSecs()) & MillisecondClockMask); - if (deltaMsecs < 0) { - deltaMsecs = (deltaMsecs + MillisecondClockMask) + 1; + + /* Handle a roll-over that could happen in between image invocation of ioMSecs and this invocation. + This will limit the maximum relative duration to MillisecondClockMask/2, about 3 days currently. + Every delay longer than that limit may lead to undefined behavior (shorten delay, or no delay at all). + The maximum delay might be further limited by platform dependent nextWakeupUsecs handling. */ + limit = ((usqInt) MillisecondClockMask) >> 1; + if (deltaMsecs > limit) { + deltaMsecs -= MillisecondClockMask; + } + if (deltaMsecs > 0) { + GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); } - GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); /* begin pop: */ GIV(stackPointer) += 2 * BytesPerWord; return; diff --git a/src/vm/cointerpmt.h b/src/vm/cointerpmt.h index c9d83abaae..47218d3486 100644 --- a/src/vm/cointerpmt.h +++ b/src/vm/cointerpmt.h @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ diff --git a/src/vm/gcc3x-cointerp.c b/src/vm/gcc3x-cointerp.c index eefddee1b1..84f68142c7 100644 --- a/src/vm/gcc3x-cointerp.c +++ b/src/vm/gcc3x-cointerp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 from - CoInterpreter VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CoInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2220,7 +2220,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Croquet Closure Cog[SqueakV3] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2570]"; +const char *interpreterVersion = "Croquet Closure Cog[SqueakV3] VM [CoInterpreterPrimitives VMMaker.oscog-nice.2572]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace; @@ -54302,6 +54302,7 @@ primitiveSignalAtMilliseconds(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ccIndex; sqLong deltaMsecs; + sqLong limit; usqInt msecs; sqInt msecsObj; sqInt oop; @@ -54325,10 +54326,18 @@ primitiveSignalAtMilliseconds(void) } longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema); deltaMsecs = msecs - ((ioMSecs()) & MillisecondClockMask); - if (deltaMsecs < 0) { - deltaMsecs = (deltaMsecs + MillisecondClockMask) + 1; + + /* Handle a roll-over that could happen in between image invocation of ioMSecs and this invocation. + This will limit the maximum relative duration to MillisecondClockMask/2, about 3 days currently. + Every delay longer than that limit may lead to undefined behavior (shorten delay, or no delay at all). + The maximum delay might be further limited by platform dependent nextWakeupUsecs handling. */ + limit = ((usqInt) MillisecondClockMask) >> 1; + if (deltaMsecs > limit) { + deltaMsecs -= MillisecondClockMask; + } + if (deltaMsecs > 0) { + GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); } - GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); /* begin pop: */ GIV(stackPointer) += 2 * BytesPerWord; return; diff --git a/src/vm/gcc3x-cointerpmt.c b/src/vm/gcc3x-cointerpmt.c index d316bd2f25..18486882b2 100644 --- a/src/vm/gcc3x-cointerpmt.c +++ b/src/vm/gcc3x-cointerpmt.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 from - CoInterpreterMT VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 + CoInterpreterMT VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.2570 uuid: b61e294a-cb2a-4d9a-9e7e-8cc17676c920 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -2314,7 +2314,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.2570]"; +const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-nice.2572]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace; @@ -34375,14 +34375,14 @@ eeInstantiateAndInitializeClassindexableSize(sqInt classPointer, sqInt size) sqInt binc; sqInt bm1; sqInt byteSize; - usqInt cClass; + sqInt cClass; sqInt classFormat; usqInt end; sqInt fillWord; sqInt format; usqInt hash; int hdrSize; - usqInt header1; + sqInt header1; sqInt header2; sqInt header3; usqInt i; @@ -34924,7 +34924,7 @@ eeInstantiateSmallClassnumSlots(sqInt classPointer, sqInt numSlots) { DECL_MAYBE_SQ_GLOBAL_STRUCT usqInt hash; int hdrSize; - usqInt header1; + sqInt header1; sqInt header2; usqInt newChunk; usqInt newFreeStart; @@ -40064,7 +40064,7 @@ instantiateClassindexableSize(sqInt classPointer, sqInt size) sqInt bm1; sqInt byteSize; sqInt byteSize1; - usqInt cClass; + sqInt cClass; sqInt classFormat; sqInt classOop; usqInt end; @@ -40073,7 +40073,7 @@ instantiateClassindexableSize(sqInt classPointer, sqInt size) sqInt format; usqInt hash; sqInt hdrSize; - usqInt header1; + sqInt header1; sqInt header3; usqInt i; sqInt minFree; @@ -56259,6 +56259,7 @@ primitiveSignalAtMilliseconds(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ccIndex; sqLong deltaMsecs; + sqLong limit; usqInt msecs; sqInt msecsObj; sqInt oop; @@ -56282,10 +56283,18 @@ primitiveSignalAtMilliseconds(void) } longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema); deltaMsecs = msecs - ((ioMSecs()) & MillisecondClockMask); - if (deltaMsecs < 0) { - deltaMsecs = (deltaMsecs + MillisecondClockMask) + 1; + + /* Handle a roll-over that could happen in between image invocation of ioMSecs and this invocation. + This will limit the maximum relative duration to MillisecondClockMask/2, about 3 days currently. + Every delay longer than that limit may lead to undefined behavior (shorten delay, or no delay at all). + The maximum delay might be further limited by platform dependent nextWakeupUsecs handling. */ + limit = ((usqInt) MillisecondClockMask) >> 1; + if (deltaMsecs > limit) { + deltaMsecs -= MillisecondClockMask; + } + if (deltaMsecs > 0) { + GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); } - GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); /* begin pop: */ GIV(stackPointer) += 2 * BytesPerWord; return; diff --git a/stacksrc/vm/gcc3x-interp.c b/stacksrc/vm/gcc3x-interp.c index 264d327710..438d854701 100644 --- a/stacksrc/vm/gcc3x-interp.c +++ b/stacksrc/vm/gcc3x-interp.c @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2568 uuid: baa0b804-06fa-40fd-a87d-a9267b00ef76 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 from - StackInterpreter VMMaker.oscog-eem.2568 uuid: baa0b804-06fa-40fd-a87d-a9267b00ef76 + StackInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.2568 uuid: baa0b804-06fa-40fd-a87d-a9267b00ef76 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1974,7 +1974,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.2568]"; +const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreterPrimitives VMMaker.oscog-nice.2572]"; volatile int sendTrace; sqInt suppressHeartbeatFlag; @@ -46332,6 +46332,7 @@ primitiveSignalAtMilliseconds(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ccIndex; sqLong deltaMsecs; + sqLong limit; usqInt msecs; sqInt msecsObj; sqInt oop; @@ -46355,10 +46356,18 @@ primitiveSignalAtMilliseconds(void) } longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema); deltaMsecs = msecs - ((ioMSecs()) & MillisecondClockMask); - if (deltaMsecs < 0) { - deltaMsecs = (deltaMsecs + MillisecondClockMask) + 1; + + /* Handle a roll-over that could happen in between image invocation of ioMSecs and this invocation. + This will limit the maximum relative duration to MillisecondClockMask/2, about 3 days currently. + Every delay longer than that limit may lead to undefined behavior (shorten delay, or no delay at all). + The maximum delay might be further limited by platform dependent nextWakeupUsecs handling. */ + limit = ((usqInt) MillisecondClockMask) >> 1; + if (deltaMsecs > limit) { + deltaMsecs -= MillisecondClockMask; + } + if (deltaMsecs > 0) { + GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); } - GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); /* begin pop: */ GIV(stackPointer) += 2 * BytesPerWord; return; diff --git a/stacksrc/vm/interp.c b/stacksrc/vm/interp.c index a2da01b6ef..d60926317c 100644 --- a/stacksrc/vm/interp.c +++ b/stacksrc/vm/interp.c @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2568 uuid: baa0b804-06fa-40fd-a87d-a9267b00ef76 + CCodeGeneratorGlobalStructure VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 from - StackInterpreter VMMaker.oscog-eem.2568 uuid: baa0b804-06fa-40fd-a87d-a9267b00ef76 + StackInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 */ -static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.2568 uuid: baa0b804-06fa-40fd-a87d-a9267b00ef76 " __DATE__ ; +static char __buildInfo[] = "StackInterpreter VMMaker.oscog-nice.2572 uuid: 3489e554-cf3d-44fb-bfac-638c04ecdcf2 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -1971,7 +1971,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = { 0 }; sqInt checkedPluginName; char expensiveAsserts = 0; -const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.2568]"; +const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreterPrimitives VMMaker.oscog-nice.2572]"; volatile int sendTrace; sqInt suppressHeartbeatFlag; @@ -46323,6 +46323,7 @@ primitiveSignalAtMilliseconds(void) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt ccIndex; sqLong deltaMsecs; + sqLong limit; usqInt msecs; sqInt msecsObj; sqInt oop; @@ -46346,10 +46347,18 @@ primitiveSignalAtMilliseconds(void) } longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((int)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema); deltaMsecs = msecs - ((ioMSecs()) & MillisecondClockMask); - if (deltaMsecs < 0) { - deltaMsecs = (deltaMsecs + MillisecondClockMask) + 1; + + /* Handle a roll-over that could happen in between image invocation of ioMSecs and this invocation. + This will limit the maximum relative duration to MillisecondClockMask/2, about 3 days currently. + Every delay longer than that limit may lead to undefined behavior (shorten delay, or no delay at all). + The maximum delay might be further limited by platform dependent nextWakeupUsecs handling. */ + limit = ((usqInt) MillisecondClockMask) >> 1; + if (deltaMsecs > limit) { + deltaMsecs -= MillisecondClockMask; + } + if (deltaMsecs > 0) { + GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); } - GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000); /* begin pop: */ GIV(stackPointer) += 2 * BytesPerWord; return;