Skip to content

Commit

Permalink
Generate source as per VMMaker.oscog-nice.1989
Browse files Browse the repository at this point in the history
Fix two forgotten C Compiler warnings about taking abs value of an unsigned integer.
Of course, we want to take absolute value of signed difference.

Fix inlining problem of shortPrintContext: - a side effect was eliminated on stack flavour.

Fix prototype of unlockSurfaceFn after recent platforms source file revision.
Also, the surfceID returned by primitiveCreateManualSurface is an int, so fits in signed32BitIntegerFor:.

Avoid passing a sqInt to Serial and Midi external functions when they expect a pointer.

Explicit a few conversions 64->32 bits to avoid compiler warnings in LargeIntegers.

Fix prototype of various SurfaceFn again to match those of platforms/Corss/plugins/SurfacePlugin/SurfacePlugin.h

These should be matching the prototypes:
fn_getSurfaceFormat
fn_lockSurface
fn_unlockSurface
fn_showSurface
  • Loading branch information
nicolas-cellier-aka-nice committed Nov 13, 2016
1 parent de6f1fe commit b6e47d7
Show file tree
Hide file tree
Showing 33 changed files with 578 additions and 555 deletions.
44 changes: 25 additions & 19 deletions nsspur64src/vm/cointerp.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-nice.1986 uuid: e06214fe-0e06-4c33-9132-03ffe9351cbb
CCodeGeneratorGlobalStructure VMMaker.oscog-nice.1989 uuid: 7e63fa13-3564-4b1b-8c0b-31378a87bc74
from
CoInterpreter VMMaker.oscog-nice.1986 uuid: e06214fe-0e06-4c33-9132-03ffe9351cbb
CoInterpreter VMMaker.oscog-nice.1989 uuid: 7e63fa13-3564-4b1b-8c0b-31378a87bc74
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-nice.1986 uuid: e06214fe-0e06-4c33-9132-03ffe9351cbb " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-nice.1989 uuid: 7e63fa13-3564-4b1b-8c0b-31378a87bc74 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2475,7 +2475,7 @@ static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 577 */]
};
sqInt checkedPluginName;
char expensiveAsserts = 0;
const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-nice.1986";
const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-nice.1989";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;

Expand Down Expand Up @@ -21637,7 +21637,7 @@ printFrameWithSP(char *theFP, char *theSP)
usqInt index;
sqInt methodField;
usqInt numArgs;
sqInt numTemps;
usqInt numTemps;
char *rcvrAddress;
sqInt rcvrOrClosure;
sqInt theMethod;
Expand Down Expand Up @@ -41161,9 +41161,9 @@ integerObjectOf(sqInt value)
sqInt
integerValueOf(sqInt oop)
{
return ((((usqInt) oop >> 63)) == 1
? ((((((-(numTagBits())) < 0) ? ((usqInt) oop >> -(-(numTagBits()))) : ((usqInt) oop << (-(numTagBits()))))) & 0x1FFFFFFFFFFFFFFFLL) - 0x1FFFFFFFFFFFFFFFLL) - 1
: (((-(numTagBits())) < 0) ? ((usqInt) oop >> -(-(numTagBits()))) : ((usqInt) oop << (-(numTagBits())))));
return ((((usqInt) oop) >> 0x3F) == 1
? (((((usqInt) oop) >> (numTagBits())) & 0x1FFFFFFFFFFFFFFFLL) - 0x1FFFFFFFFFFFFFFFLL) - 1
: ((usqInt) oop) >> (numTagBits()));
}

/* Spur64BitMemoryManager>>#isImmediateFloat: */
Expand Down Expand Up @@ -42569,7 +42569,7 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress)
usqInt numSlots1;
usqInt numSlots2;
sqInt obj;
usqInt ptr;
sqInt ptr;
usqInt slotBytes;

ptr = initialAddress;
Expand Down Expand Up @@ -47745,7 +47745,7 @@ eliminateAndFreeForwardersForPigCompact(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt address;
sqInt address1;
usqInt bytes;
sqInt bytes;
sqInt endOfFreeRun;
sqInt f;
sqInt firstOfFreeRun;
Expand Down Expand Up @@ -53942,7 +53942,7 @@ maybeSplObj(sqInt index)
static sqInt NoDbgRegParms
moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
usqInt chunkBytes;
sqInt chunkBytes;
sqInt classIndex;
sqInt classIndex1;
sqInt dest;
Expand Down Expand Up @@ -60041,7 +60041,7 @@ nextNonEmptySegmentAfter(sqInt i)
static void
postSnapshot(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
usqInt address;
sqInt address;
sqInt bytes;
usqInt freeChunk;
sqInt i;
Expand Down Expand Up @@ -60329,7 +60329,7 @@ shrinkObjectMemory(usqInt delta)
if ((shrinkage >= (((seg->segSize)) * 0.75))
&& ((SQABS((((sqInt) (((seg->segSize)) - shrinkage))))) < delta1)) {
best = seg;
delta1 = SQABS((((seg->segSize)) - shrinkage));
delta1 = SQABS((((sqInt) (((seg->segSize)) - shrinkage))));
}
}
}
Expand Down Expand Up @@ -60447,8 +60447,8 @@ writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSeg
{
usqLong firstSavedBridgeWord;
sqInt nWritten;
usqInt pier1;
usqInt pier2;
sqInt pier1;
sqInt pier2;
usqLong secondSavedBridgeWord;

pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);
Expand Down Expand Up @@ -62024,7 +62024,7 @@ displayBitsOfLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b)
return null;
}
}
((sqInt (*)(sqInt, sqInt, sqInt, sqInt, sqInt))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top);
((int (*)(sqIntptr_t, int, int, int, int))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top);
}
else {
assert(isNonImmediate(dispBits));
Expand Down Expand Up @@ -71132,7 +71132,7 @@ removeFirstLinkOfList(sqInt aList)
static sqInt
retryPrimitiveOnFailure(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt accessorDepth;
signed char accessorDepth;
sqInt canRetry;
sqInt firstBytecode;
sqInt followDone;
Expand Down Expand Up @@ -71674,6 +71674,7 @@ static sqInt NoDbgRegParms
shortPrintContext(sqInt aContext)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt home;
sqInt senderOop;
char *theFP;

if (!(((aContext & (tagMask())) == 0)
Expand All @@ -71687,13 +71688,18 @@ shortPrintContext(sqInt aContext)
printHex(aContext);
if (((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
if (checkIsStillMarriedContextcurrentFP(aContext, GIV(framePointer))) {
if (isMachineCodeFrame((theFP = frameOfMarriedContext(aContext)))) {
/* begin frameOfMarriedContext: */
senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
/* begin withoutSmallIntegerTags: */
assert((((senderOop) & 7) == 1));
theFP = pointerForOop(senderOop - 1);
if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
print(" M (");
}
else {
print(" I (");
}
printHex(((usqInt)theFP));
printHex(((usqIntptr_t)theFP));
print(") ");
}
else {
Expand Down
44 changes: 25 additions & 19 deletions nsspur64src/vm/gcc3x-cointerp.c
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-nice.1986 uuid: e06214fe-0e06-4c33-9132-03ffe9351cbb
CCodeGeneratorGlobalStructure VMMaker.oscog-nice.1989 uuid: 7e63fa13-3564-4b1b-8c0b-31378a87bc74
from
CoInterpreter VMMaker.oscog-nice.1986 uuid: e06214fe-0e06-4c33-9132-03ffe9351cbb
CoInterpreter VMMaker.oscog-nice.1989 uuid: 7e63fa13-3564-4b1b-8c0b-31378a87bc74
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-nice.1986 uuid: e06214fe-0e06-4c33-9132-03ffe9351cbb " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-nice.1989 uuid: 7e63fa13-3564-4b1b-8c0b-31378a87bc74 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2478,7 +2478,7 @@ static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 577 */]
};
sqInt checkedPluginName;
char expensiveAsserts = 0;
const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-nice.1986";
const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-nice.1989";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;

Expand Down Expand Up @@ -21646,7 +21646,7 @@ printFrameWithSP(char *theFP, char *theSP)
usqInt index;
sqInt methodField;
usqInt numArgs;
sqInt numTemps;
usqInt numTemps;
char *rcvrAddress;
sqInt rcvrOrClosure;
sqInt theMethod;
Expand Down Expand Up @@ -41170,9 +41170,9 @@ integerObjectOf(sqInt value)
sqInt
integerValueOf(sqInt oop)
{
return ((((usqInt) oop >> 63)) == 1
? ((((((-(numTagBits())) < 0) ? ((usqInt) oop >> -(-(numTagBits()))) : ((usqInt) oop << (-(numTagBits()))))) & 0x1FFFFFFFFFFFFFFFLL) - 0x1FFFFFFFFFFFFFFFLL) - 1
: (((-(numTagBits())) < 0) ? ((usqInt) oop >> -(-(numTagBits()))) : ((usqInt) oop << (-(numTagBits())))));
return ((((usqInt) oop) >> 0x3F) == 1
? (((((usqInt) oop) >> (numTagBits())) & 0x1FFFFFFFFFFFFFFFLL) - 0x1FFFFFFFFFFFFFFFLL) - 1
: ((usqInt) oop) >> (numTagBits()));
}

/* Spur64BitMemoryManager>>#isImmediateFloat: */
Expand Down Expand Up @@ -42578,7 +42578,7 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress)
usqInt numSlots1;
usqInt numSlots2;
sqInt obj;
usqInt ptr;
sqInt ptr;
usqInt slotBytes;

ptr = initialAddress;
Expand Down Expand Up @@ -47754,7 +47754,7 @@ eliminateAndFreeForwardersForPigCompact(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt address;
sqInt address1;
usqInt bytes;
sqInt bytes;
sqInt endOfFreeRun;
sqInt f;
sqInt firstOfFreeRun;
Expand Down Expand Up @@ -53951,7 +53951,7 @@ maybeSplObj(sqInt index)
static sqInt NoDbgRegParms
moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
usqInt chunkBytes;
sqInt chunkBytes;
sqInt classIndex;
sqInt classIndex1;
sqInt dest;
Expand Down Expand Up @@ -60050,7 +60050,7 @@ nextNonEmptySegmentAfter(sqInt i)
static void
postSnapshot(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
usqInt address;
sqInt address;
sqInt bytes;
usqInt freeChunk;
sqInt i;
Expand Down Expand Up @@ -60338,7 +60338,7 @@ shrinkObjectMemory(usqInt delta)
if ((shrinkage >= (((seg->segSize)) * 0.75))
&& ((SQABS((((sqInt) (((seg->segSize)) - shrinkage))))) < delta1)) {
best = seg;
delta1 = SQABS((((seg->segSize)) - shrinkage));
delta1 = SQABS((((sqInt) (((seg->segSize)) - shrinkage))));
}
}
}
Expand Down Expand Up @@ -60456,8 +60456,8 @@ writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSeg
{
usqLong firstSavedBridgeWord;
sqInt nWritten;
usqInt pier1;
usqInt pier2;
sqInt pier1;
sqInt pier2;
usqLong secondSavedBridgeWord;

pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);
Expand Down Expand Up @@ -62033,7 +62033,7 @@ displayBitsOfLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b)
return null;
}
}
((sqInt (*)(sqInt, sqInt, sqInt, sqInt, sqInt))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top);
((int (*)(sqIntptr_t, int, int, int, int))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top);
}
else {
assert(isNonImmediate(dispBits));
Expand Down Expand Up @@ -71141,7 +71141,7 @@ removeFirstLinkOfList(sqInt aList)
static sqInt
retryPrimitiveOnFailure(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt accessorDepth;
signed char accessorDepth;
sqInt canRetry;
sqInt firstBytecode;
sqInt followDone;
Expand Down Expand Up @@ -71683,6 +71683,7 @@ static sqInt NoDbgRegParms
shortPrintContext(sqInt aContext)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt home;
sqInt senderOop;
char *theFP;

if (!(((aContext & (tagMask())) == 0)
Expand All @@ -71696,13 +71697,18 @@ shortPrintContext(sqInt aContext)
printHex(aContext);
if (((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
if (checkIsStillMarriedContextcurrentFP(aContext, GIV(framePointer))) {
if (isMachineCodeFrame((theFP = frameOfMarriedContext(aContext)))) {
/* begin frameOfMarriedContext: */
senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
/* begin withoutSmallIntegerTags: */
assert((((senderOop) & 7) == 1));
theFP = pointerForOop(senderOop - 1);
if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
print(" M (");
}
else {
print(" I (");
}
printHex(((usqInt)theFP));
printHex(((usqIntptr_t)theFP));
print(") ");
}
else {
Expand Down

0 comments on commit b6e47d7

Please sign in to comment.