Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3387
Browse files Browse the repository at this point in the history
Fix a regression in InterpreterPrimitives>>primitiveFractionalPart,
VMMaker.oscog-eem.3382, 6 June 2024, and have
InterpreterPrimitives>>primitiveTruncated match
InterpreterPrimitives>>primitiveFractionalPart

Fix slip in SpurMemoryManager>>printHeaderOf:
  • Loading branch information
eliotmiranda committed Jun 13, 2024
1 parent f79afa7 commit 766793f
Show file tree
Hide file tree
Showing 41 changed files with 835 additions and 879 deletions.
57 changes: 21 additions & 36 deletions src/spur32.cog.lowcode/cointerp.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3382 uuid: 936441c0-8b36-4f43-a893-4c90667b5b58
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3387 uuid: 2d109996-1f82-454f-886a-5adc7d0ca8ef
from
CoInterpreter VMMaker.oscog-eem.3382 uuid: 936441c0-8b36-4f43-a893-4c90667b5b58
CoInterpreter VMMaker.oscog-eem.3387 uuid: 2d109996-1f82-454f-886a-5adc7d0ca8ef
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3382 uuid: 936441c0-8b36-4f43-a893-4c90667b5b58 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3387 uuid: 2d109996-1f82-454f-886a-5adc7d0ca8ef " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2024,7 +2024,7 @@ static signed short primitiveMetadataTable[MaxPrimitiveIndex + 2 /* 584 */] = {
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*0*/ -256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-256,
/*20*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0x101, 0x101,
/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 259, 3, 3, 0, 3, 3, 3, 3,
/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 3, 3, 3, 3,
/*60*/ 0, 0, 0, 0, 0,-256,-256,-256, 0x100, 0x100, 0, 0, 0, 268, 0x100, 0, 0x100, 0,
/*78*/ 0, 0,
/*80*/ -256,-256,-256, 4, 4, 0, 0x100, 0, 0x200,-256,-256, 0, 0, 0, 0x100,-256, 0,-256,
Expand Down Expand Up @@ -2703,7 +2703,7 @@ sqInt debugCallbackReturns;
sqInt suppressHeartbeatFlag;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3382]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3387]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -39021,7 +39021,7 @@ printFrameWithSP(char *theFP, char *theSP)
usqInt index;
sqInt methodField;
usqInt numArgs;
usqInt numTemps;
sqInt numTemps;
char *rcvrAddress;
sqInt rcvrOrClosure;
CogBlockMethod * self_in_cmHomeMethod;
Expand Down Expand Up @@ -49676,7 +49676,7 @@ primitiveFractionalPart(void)
fetchFloatAtinto(rcvr + BaseHeaderSize, result);
doubleValue = result;
/* begin stackTopPut: */
aValue = floatObjectOf(modf(rcvr, (&trunc)));
aValue = floatObjectOf(modf(doubleValue, (&trunc)));
longAtPointerput(GIV(stackPointer), aValue);
}

Expand Down Expand Up @@ -51992,7 +51992,7 @@ primitiveInvokeObjectAsMethod(void)
sqInt i;
sqInt lookupClassTag;
sqInt objFormat;
usqInt runArgs;
sqInt runArgs;
sqInt runReceiver;
char *sp;
char *sp1;
Expand Down Expand Up @@ -57256,29 +57256,18 @@ primitiveTimesTwoPower(void)
static void
primitiveTruncated(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt isFloat;
sqInt oop;
double rcvr;
double doubleValue;
sqInt rcvr;
double result;
double trunc;

/* begin stackFloatValue: */
oop = longAt(GIV(stackPointer) + (0 * BytesPerWord));
isFloat = ((!(oop & (tagMask()))))
&& (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex);
if (isFloat) {
fetchFloatAtinto(oop + BaseHeaderSize, result);
rcvr = result;
goto l1;
}
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
rcvr = 0.0;
l1: /* end stackFloatValue: */;
rcvr = longAt(GIV(stackPointer));
/* begin noFailFloatValueOf: */
assert(isFloatInstance(rcvr));
fetchFloatAtinto(rcvr + BaseHeaderSize, result);
doubleValue = result;
if (!GIV(primFailCode)) {
modf(rcvr, (&trunc));
modf(doubleValue, (&trunc));
if (((trunc >= (((double) (MinSmallInteger) ))) && (trunc <= (((double) (MaxSmallInteger) ))))) {
longAtPointerput(GIV(stackPointer), (((usqInt)(((sqInt)trunc)) << 1) | 1));
}
Expand Down Expand Up @@ -74126,7 +74115,6 @@ printHeaderOf(sqInt objOop)
usqInt n4;
usqInt n5;
usqInt numSlots;
usqInt numSlots1;

fprintf(GIV(transcript),
"%p",
Expand All @@ -74135,10 +74123,7 @@ printHeaderOf(sqInt objOop)
/* begin print: */
fprintf(GIV(transcript), " hdr16 slotf ");
/* begin printHexnp: */
numSlots = byteAt((objOop - 8 /* allocationUnit */) + 7);
n = (numSlots == (numSlotsMask())
? longAt((objOop - 8 /* allocationUnit */) - BaseHeaderSize)
: numSlots);
n = byteAt(objOop + 7);
fprintf(GIV(transcript),
"%p",
((void *)n));
Expand All @@ -74156,10 +74141,10 @@ printHeaderOf(sqInt objOop)
/* begin print: */
fprintf(GIV(transcript), " hdr8 slots ");
/* begin printHexnp: */
numSlots1 = byteAt(objOop + 7);
n2 = (numSlots1 == (numSlotsMask())
numSlots = byteAt(objOop + 7);
n2 = (numSlots == (numSlotsMask())
? longAt(objOop - BaseHeaderSize)
: numSlots1);
: numSlots);
fprintf(GIV(transcript),
"%p",
((void *)n2));
Expand Down Expand Up @@ -79822,7 +79807,7 @@ prepareForSnapshot(void)
sqInt limit;
sqInt newEndOfMemory;
sqInt next;
sqInt node;
usqInt node;
SpurSegmentInfo *seg;
sqInt smallChild;
sqInt treeNode;
Expand Down
2 changes: 1 addition & 1 deletion src/spur32.cog.lowcode/cointerp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3382 uuid: 936441c0-8b36-4f43-a893-4c90667b5b58
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3387 uuid: 2d109996-1f82-454f-886a-5adc7d0ca8ef
*/


Expand Down
57 changes: 21 additions & 36 deletions src/spur32.cog.lowcode/gcc3x-cointerp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3382 uuid: 936441c0-8b36-4f43-a893-4c90667b5b58
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3387 uuid: 2d109996-1f82-454f-886a-5adc7d0ca8ef
from
CoInterpreter VMMaker.oscog-eem.3382 uuid: 936441c0-8b36-4f43-a893-4c90667b5b58
CoInterpreter VMMaker.oscog-eem.3387 uuid: 2d109996-1f82-454f-886a-5adc7d0ca8ef
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3382 uuid: 936441c0-8b36-4f43-a893-4c90667b5b58 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3387 uuid: 2d109996-1f82-454f-886a-5adc7d0ca8ef " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2027,7 +2027,7 @@ static signed short primitiveMetadataTable[MaxPrimitiveIndex + 2 /* 584 */] = {
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*0*/ -256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-256,
/*20*/ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0x101, 0x101,
/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 259, 3, 3, 0, 3, 3, 3, 3,
/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, 3, 3, 3, 3,
/*60*/ 0, 0, 0, 0, 0,-256,-256,-256, 0x100, 0x100, 0, 0, 0, 268, 0x100, 0, 0x100, 0,
/*78*/ 0, 0,
/*80*/ -256,-256,-256, 4, 4, 0, 0x100, 0, 0x200,-256,-256, 0, 0, 0, 0x100,-256, 0,-256,
Expand Down Expand Up @@ -2706,7 +2706,7 @@ sqInt debugCallbackReturns;
sqInt suppressHeartbeatFlag;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3382]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3387]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -39030,7 +39030,7 @@ printFrameWithSP(char *theFP, char *theSP)
usqInt index;
sqInt methodField;
usqInt numArgs;
usqInt numTemps;
sqInt numTemps;
char *rcvrAddress;
sqInt rcvrOrClosure;
CogBlockMethod * self_in_cmHomeMethod;
Expand Down Expand Up @@ -49685,7 +49685,7 @@ primitiveFractionalPart(void)
fetchFloatAtinto(rcvr + BaseHeaderSize, result);
doubleValue = result;
/* begin stackTopPut: */
aValue = floatObjectOf(modf(rcvr, (&trunc)));
aValue = floatObjectOf(modf(doubleValue, (&trunc)));
longAtPointerput(GIV(stackPointer), aValue);
}

Expand Down Expand Up @@ -52001,7 +52001,7 @@ primitiveInvokeObjectAsMethod(void)
sqInt i;
sqInt lookupClassTag;
sqInt objFormat;
usqInt runArgs;
sqInt runArgs;
sqInt runReceiver;
char *sp;
char *sp1;
Expand Down Expand Up @@ -57265,29 +57265,18 @@ primitiveTimesTwoPower(void)
static void
primitiveTruncated(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt isFloat;
sqInt oop;
double rcvr;
double doubleValue;
sqInt rcvr;
double result;
double trunc;

/* begin stackFloatValue: */
oop = longAt(GIV(stackPointer) + (0 * BytesPerWord));
isFloat = ((!(oop & (tagMask()))))
&& (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex);
if (isFloat) {
fetchFloatAtinto(oop + BaseHeaderSize, result);
rcvr = result;
goto l1;
}
/* begin primitiveFail */
if (!GIV(primFailCode)) {
GIV(primFailCode) = 1;
}
rcvr = 0.0;
l1: /* end stackFloatValue: */;
rcvr = longAt(GIV(stackPointer));
/* begin noFailFloatValueOf: */
assert(isFloatInstance(rcvr));
fetchFloatAtinto(rcvr + BaseHeaderSize, result);
doubleValue = result;
if (!GIV(primFailCode)) {
modf(rcvr, (&trunc));
modf(doubleValue, (&trunc));
if (((trunc >= (((double) (MinSmallInteger) ))) && (trunc <= (((double) (MaxSmallInteger) ))))) {
longAtPointerput(GIV(stackPointer), (((usqInt)(((sqInt)trunc)) << 1) | 1));
}
Expand Down Expand Up @@ -74135,7 +74124,6 @@ printHeaderOf(sqInt objOop)
usqInt n4;
usqInt n5;
usqInt numSlots;
usqInt numSlots1;

fprintf(GIV(transcript),
"%p",
Expand All @@ -74144,10 +74132,7 @@ printHeaderOf(sqInt objOop)
/* begin print: */
fprintf(GIV(transcript), " hdr16 slotf ");
/* begin printHexnp: */
numSlots = byteAt((objOop - 8 /* allocationUnit */) + 7);
n = (numSlots == (numSlotsMask())
? longAt((objOop - 8 /* allocationUnit */) - BaseHeaderSize)
: numSlots);
n = byteAt(objOop + 7);
fprintf(GIV(transcript),
"%p",
((void *)n));
Expand All @@ -74165,10 +74150,10 @@ printHeaderOf(sqInt objOop)
/* begin print: */
fprintf(GIV(transcript), " hdr8 slots ");
/* begin printHexnp: */
numSlots1 = byteAt(objOop + 7);
n2 = (numSlots1 == (numSlotsMask())
numSlots = byteAt(objOop + 7);
n2 = (numSlots == (numSlotsMask())
? longAt(objOop - BaseHeaderSize)
: numSlots1);
: numSlots);
fprintf(GIV(transcript),
"%p",
((void *)n2));
Expand Down Expand Up @@ -79831,7 +79816,7 @@ prepareForSnapshot(void)
sqInt limit;
sqInt newEndOfMemory;
sqInt next;
sqInt node;
usqInt node;
SpurSegmentInfo *seg;
sqInt smallChild;
sqInt treeNode;
Expand Down
Loading

0 comments on commit 766793f

Please sign in to comment.