Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.2946
Browse files Browse the repository at this point in the history
Nuke the obsolete polling input primitives primitiveMouseButtons,
primitiveKbdNext et al.  These really are irrelevant to all images
that run on Cog VMs (unused since about Squeak 3.6).

Fix a couple of compiler warnings.
  • Loading branch information
eliotmiranda committed Mar 5, 2021
1 parent 04af39a commit 924a24b
Show file tree
Hide file tree
Showing 103 changed files with 690 additions and 7,835 deletions.
2 changes: 1 addition & 1 deletion nsspur64src/vm/cogit.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
CCodeGenerator VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
*/


Expand Down
12 changes: 6 additions & 6 deletions nsspur64src/vm/cogitARMv8.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
CCodeGenerator VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
from
StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
StackToRegisterMappingCogit VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -6986,7 +6986,7 @@ rewriteImm19JumpBeforetarget(AbstractInstruction * self_in_rewriteImm19JumpBefor
static sqInt NoDbgRegParms
rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBeforetarget, sqInt followingAddress, sqInt targetAddress)
{
usqInt instrOpcode;
sqInt instrOpcode;
sqInt mcpc;
sqInt offset;

Expand All @@ -6996,7 +6996,7 @@ rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBefor
instrOpcode = ((instructionBeforeAddress(self_in_rewriteImm26JumpBeforetarget, followingAddress))) >> 26;
assert((instrOpcode == 5)
|| (instrOpcode == 37));
codeLong32Atput(mcpc, (instrOpcode << 26) + (((offset) >> 2) & (0x3FFFFFF)));
codeLong32Atput(mcpc, (((sqInt)((usqInt)(instrOpcode) << 26))) + (((offset) >> 2) & (0x3FFFFFF)));
return 4;
}

Expand Down Expand Up @@ -16600,7 +16600,7 @@ cogMethodContaining(usqInt mcpc)
|| (mcpc == cePrimReturnEnterCogCodeProfiling));
return null;
}
assert(mcpc < (limitZony()));
assert(mcpc < (freeStart()));
cogMethod = ((CogMethod *) baseAddress);
while ((((usqInt)cogMethod)) < mcpc) {
prevMethod = cogMethod;
Expand Down
8 changes: 4 additions & 4 deletions nsspur64src/vm/cogitX64SysV.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
CCodeGenerator VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
from
StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
StackToRegisterMappingCogit VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -12115,7 +12115,7 @@ cogMethodContaining(usqInt mcpc)
|| (mcpc == cePrimReturnEnterCogCodeProfiling));
return null;
}
assert(mcpc < (limitZony()));
assert(mcpc < (freeStart()));
cogMethod = ((CogMethod *) baseAddress);
while ((((usqInt)cogMethod)) < mcpc) {
prevMethod = cogMethod;
Expand Down
8 changes: 4 additions & 4 deletions nsspur64src/vm/cogitX64WIN64.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
CCodeGenerator VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
from
StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
StackToRegisterMappingCogit VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -12133,7 +12133,7 @@ cogMethodContaining(usqInt mcpc)
|| (mcpc == cePrimReturnEnterCogCodeProfiling));
return null;
}
assert(mcpc < (limitZony()));
assert(mcpc < (freeStart()));
cogMethod = ((CogMethod *) baseAddress);
while ((((usqInt)cogMethod)) < mcpc) {
prevMethod = cogMethod;
Expand Down
204 changes: 12 additions & 192 deletions nsspur64src/vm/cointerp.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
from
CoInterpreter VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
CoInterpreter VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -809,8 +809,6 @@ static void primitiveInvokeObjectAsMethod(void);
EXPORT(sqInt) primitiveIsBigEnder(void);
static void primitiveIsPinned(void);
EXPORT(sqInt) primitiveIsWindowObscured(void);
static void primitiveKbdNext(void);
static void primitiveKbdPeek(void);
static void primitiveLessOrEqual(void);
EXPORT(void) primitiveLessOrEqualLargeIntegers(void);
static void primitiveLessThan(void);
Expand All @@ -828,8 +826,6 @@ static void primitiveMillisecondClock(void);
EXPORT(sqInt) primitiveMillisecondClockMask(void);
static void primitiveMod(void);
EXPORT(void) primitiveModLargeIntegers(void);
static void primitiveMouseButtons(void);
static void primitiveMousePoint(void);
static void primitiveMultiply(void);
EXPORT(void) primitiveMultiplyLargeIntegers(void);
static void primitiveNew(void);
Expand Down Expand Up @@ -2119,7 +2115,7 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = {
/* 87 */ primitiveResume,
/* 88 */ primitiveSuspend,
/* 89 */ primitiveFlushCache,
/* 90 */ primitiveMousePoint,
/* 90 */ (void (*)(void))0,
/* 91 */ primitiveTestDisplayDepth,
/* 92 */ primitiveSetDisplayMode,
/* 93 */ primitiveInputSemaphore,
Expand All @@ -2136,9 +2132,9 @@ static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 578 */])(void) = {
/* 104 */ (void (*)(void))0,
/* 105 */ primitiveStringReplace,
/* 106 */ primitiveScreenSize,
/* 107 */ primitiveMouseButtons,
/* 108 */ primitiveKbdNext,
/* 109 */ primitiveKbdPeek,
/* 107 */ (void (*)(void))0,
/* 108 */ (void (*)(void))0,
/* 109 */ (void (*)(void))0,
/* 110 */ primitiveIdentical,
/* 111 */ primitiveClass,
/* 112 */ primitiveBytesLeft,
Expand Down Expand Up @@ -2631,7 +2627,7 @@ sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt ffiExceptionResponse;
sqInt checkedPluginName;
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2945";
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2946";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
int displayWidth;
int displayDepth;
Expand Down Expand Up @@ -33111,7 +33107,7 @@ primitiveGetNextEvent(void)
}
fprintf(stderr, "Event%s/%" PRIdSQINT " @ %" PRIuSQINT "\t\t%" PRIdSQINT "/%" PRIxSQINT " %" PRIdSQINT "/%" PRIxSQINT "\n\t%" PRIdSQINT "/%" PRIxSQINT " %" PRIdSQINT "/%" PRIxSQINT "\t %" PRIdSQINT "/%" PRIxSQINT " %p\n", ((((evtBuf[0]) >= 0) && ((evtBuf[0]) <= 8))
? eventTypeNames[evtBuf[0]]
: "?"), evtBuf[0], evtBuf[1], evtBuf[2], evtBuf[2], evtBuf[3], evtBuf[3], evtBuf[4], evtBuf[4], evtBuf[5], evtBuf[5], evtBuf[6], evtBuf[6], evtBuf[7]);
: "?"), evtBuf[0], evtBuf[1], evtBuf[2], evtBuf[2], evtBuf[3], evtBuf[3], evtBuf[4], evtBuf[4], evtBuf[5], evtBuf[5], evtBuf[6], evtBuf[6], ((void *)(evtBuf[7])));
}
eventTypeIs = evtBuf[0];
/* begin storeInteger:ofObject:withValue: */
Expand Down Expand Up @@ -34413,66 +34409,6 @@ primitiveIsWindowObscured(void)
return 0;
}


/* Obsolete on virtually all platforms; old style input polling code.
Return the next keycode and remove it from the input buffer. The low byte
is the 8-bit ISO character. The next four bits are the Smalltalk modifier
bits <cmd><option><ctrl><shift>.
*/

/* InterpreterPrimitives>>#primitiveKbdNext */
static void
primitiveKbdNext(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt keystrokeWord;
char *sp;
char *sp1;

/* begin pop: */
GIV(stackPointer) += 1 * BytesPerWord;
keystrokeWord = ioGetKeystroke();
if (keystrokeWord >= 0) {
/* begin pushInteger: */
longAtput((sp1 = GIV(stackPointer) - BytesPerWord), (((usqInt)keystrokeWord << 3) | 1));
GIV(stackPointer) = sp1;
}
else {
/* begin push: */
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp;
}
}


/* Obsolete on virtually all platforms; old style input polling code.
Return the next keycode and without removing it from the input buffer. The
low byte is the 8-bit ISO character. The next four bits are the Smalltalk
modifier bits <cmd><option><ctrl><shift>.
*/

/* InterpreterPrimitives>>#primitiveKbdPeek */
static void
primitiveKbdPeek(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt keystrokeWord;
char *sp;
char *sp1;

/* begin pop: */
GIV(stackPointer) += 1 * BytesPerWord;
keystrokeWord = ioPeekKeystroke();
if (keystrokeWord >= 0) {
/* begin pushInteger: */
longAtput((sp1 = GIV(stackPointer) - BytesPerWord), (((usqInt)keystrokeWord << 3) | 1));
GIV(stackPointer) = sp1;
}
else {
/* begin push: */
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp;
}
}

/* InterpreterPrimitives>>#primitiveLessOrEqual */
static void
primitiveLessOrEqual(void)
Expand Down Expand Up @@ -35045,122 +34981,6 @@ primitiveModLargeIntegers(void)
}
}


/* Obsolete on virtually all platforms; old style input polling code.
Return the mouse button state. The low three bits encode the state of the
<red><yellow><blue> mouse buttons. The next four bits encode the Smalltalk
modifier bits <cmd><option><ctrl><shift>.
*/

/* InterpreterPrimitives>>#primitiveMouseButtons */
static void
primitiveMouseButtons(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt buttonWord;
char *sp;

/* begin pop: */
GIV(stackPointer) += 1 * BytesPerWord;
buttonWord = ioGetButtonState();
/* begin pushInteger: */
longAtput((sp = GIV(stackPointer) - BytesPerWord), (((usqInt)buttonWord << 3) | 1));
GIV(stackPointer) = sp;
}


/* Obsolete on virtually all platforms; old style input polling code.
Return a Point indicating current position of the mouse. Note that mouse
coordinates may be negative if the mouse moves above or to the left of the
top-left corner of the Smalltalk window.
*/

/* InterpreterPrimitives>>#primitiveMousePoint */
static void
primitiveMousePoint(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt classObj;
sqInt knownClassIndex;
usqInt newObj;
usqInt numBytes;
sqInt numSlots;
sqInt objFormat;
sqInt oop;
usqInt pointResult;
sqInt pointWord;
char *sp;
sqInt x;
sqInt y;

pointWord = ioMousePoint();
/* begin signExtend16: */
if ((((((usqInt)(pointWord)) >> 16) & 0xFFFF) & 0x8000) == 0) {
x = (((usqInt)(pointWord)) >> 16) & 0xFFFF;
goto l1;
}
else {
x = ((((usqInt)(pointWord)) >> 16) & 0xFFFF) - 0x10000;
goto l1;
}
l1: /* end signExtend16: */;
/* begin signExtend16: */
if (((pointWord & 0xFFFF) & 0x8000) == 0) {
y = pointWord & 0xFFFF;
goto l2;
}
else {
y = (pointWord & 0xFFFF) - 0x10000;
goto l2;
}
l2: /* end signExtend16: */;
/* begin pop:thenPush: */
classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
numSlots = YIndex + 1;
assert((rawHashBitsOf(classObj)) != 0);
/* begin eeInstantiateSmallClassIndex:format:numSlots: */
knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
/* begin instSpecOfClassFormat: */
objFormat = (((usqInt)((((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)))) >> (fixedFieldsFieldWidth())) & (formatMask());
assert((numSlots >= 0)
&& ((knownClassIndex != 0)
&& ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
assert(((objFormat < (firstByteFormat())
? objFormat
: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
/* begin allocateSmallNewSpaceSlots:format:classIndex: */
assert(numSlots < (numSlotsMask()));
newObj = GIV(freeStart);
numBytes = BaseHeaderSize + ((numSlots < 1
? 8 /* allocationUnit */
: numSlots * BytesPerOop));
assert((numBytes % (allocationUnit())) == 0);
assert((newObj % (allocationUnit())) == 0);
if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
if (!GIV(needGCFlag)) {
/* begin scheduleScavenge */
GIV(needGCFlag) = 1;
forceInterruptCheck();
}
if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
pointResult = 0;
goto l3;
}
}
long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
GIV(freeStart) += numBytes;
pointResult = newObj;
l3: /* end eeInstantiateSmallClass:numSlots: */;
/* begin storePointerUnchecked:ofObject:withValue: */
assert(!(isOopForwarded(pointResult)));
longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)x << 3) | 1));
/* begin storePointerUnchecked:ofObject:withValue: */
assert(!(isOopForwarded(pointResult)));
longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), (((usqInt)y << 3) | 1));
oop = pointResult;
longAtput((sp = GIV(stackPointer) + ((0) * BytesPerWord)), oop);
GIV(stackPointer) = sp;
}

/* InterpreterPrimitives>>#primitiveMultiply */
static void
primitiveMultiply(void)
Expand Down Expand Up @@ -62276,7 +62096,7 @@ prepareForSnapshot(void)
sqInt limit;
sqInt newEndOfMemory;
sqInt next;
sqInt node;
usqInt node;
SpurSegmentInfo *seg;
sqInt smallChild;
sqInt treeNode;
Expand Down Expand Up @@ -66093,8 +65913,8 @@ static sqInt
getErrorObjectFromPrimFailCode(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt classIndex;
usqInt clone;
usqInt errObj;
sqInt clone;
sqInt errObj;
sqInt fieldIndex;
sqInt i;
usqInt newObj;
Expand Down
2 changes: 1 addition & 1 deletion nsspur64src/vm/cointerp.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2946 uuid: 461911e1-d450-4f05-8a40-7b0470487041
*/


Expand Down

0 comments on commit 924a24b

Please sign in to comment.