Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.1970
Browse files Browse the repository at this point in the history
Genuflect to Slang in that last fix.
  • Loading branch information
eliotmiranda committed Oct 28, 2016
1 parent e992ad1 commit b64b148
Show file tree
Hide file tree
Showing 41 changed files with 917 additions and 727 deletions.
2 changes: 1 addition & 1 deletion nsspur64src/vm/cogit.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CCodeGenerator VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
*/


Expand Down
26 changes: 15 additions & 11 deletions nsspur64src/vm/cointerp.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
from
CoInterpreter VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CoInterpreter VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


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

Expand Down Expand Up @@ -17750,7 +17750,7 @@ checkStackIntegrity(void)
sqInt i;
sqInt methodField;
sqInt ok;
sqInt oop;
usqInt oop;
char *theFP;
StackPage *thePage;
char *theSP;
Expand Down Expand Up @@ -42612,7 +42612,7 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress)
usqInt numSlots1;
usqInt numSlots2;
sqInt obj;
sqInt ptr;
usqInt ptr;
usqInt slotBytes;

ptr = initialAddress;
Expand Down Expand Up @@ -47788,7 +47788,7 @@ eliminateAndFreeForwardersForPigCompact(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt address;
sqInt address1;
sqInt bytes;
usqInt bytes;
sqInt endOfFreeRun;
sqInt f;
sqInt firstOfFreeRun;
Expand Down Expand Up @@ -53985,7 +53985,7 @@ maybeSplObj(sqInt index)
static sqInt NoDbgRegParms
moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt chunkBytes;
usqInt chunkBytes;
sqInt classIndex;
sqInt classIndex1;
sqInt dest;
Expand Down Expand Up @@ -60084,7 +60084,7 @@ nextNonEmptySegmentAfter(sqInt i)
static void
postSnapshot(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt address;
usqInt address;
sqInt bytes;
usqInt freeChunk;
sqInt i;
Expand Down Expand Up @@ -67928,7 +67928,11 @@ popthenPush(sqInt nItems, sqInt oop)
static sqInt NoDbgRegParms
positiveMachineIntegerFor(unsigned long value)
{
return positive64BitIntegerFor(value);
sqInt resultObj;

resultObj = positive64BitIntegerFor(value);

return resultObj;
}


Expand Down Expand Up @@ -71171,7 +71175,7 @@ removeFirstLinkOfList(sqInt aList)
static sqInt
retryPrimitiveOnFailure(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
signed char accessorDepth;
sqInt accessorDepth;
sqInt canRetry;
sqInt firstBytecode;
sqInt followDone;
Expand Down
2 changes: 1 addition & 1 deletion nsspur64src/vm/cointerp.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
*/


Expand Down
26 changes: 15 additions & 11 deletions nsspur64src/vm/gcc3x-cointerp.c
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
from
CoInterpreter VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CoInterpreter VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


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

Expand Down Expand Up @@ -17759,7 +17759,7 @@ checkStackIntegrity(void)
sqInt i;
sqInt methodField;
sqInt ok;
sqInt oop;
usqInt oop;
char *theFP;
StackPage *thePage;
char *theSP;
Expand Down Expand Up @@ -42621,7 +42621,7 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress)
usqInt numSlots1;
usqInt numSlots2;
sqInt obj;
sqInt ptr;
usqInt ptr;
usqInt slotBytes;

ptr = initialAddress;
Expand Down Expand Up @@ -47797,7 +47797,7 @@ eliminateAndFreeForwardersForPigCompact(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt address;
sqInt address1;
sqInt bytes;
usqInt bytes;
sqInt endOfFreeRun;
sqInt f;
sqInt firstOfFreeRun;
Expand Down Expand Up @@ -53994,7 +53994,7 @@ maybeSplObj(sqInt index)
static sqInt NoDbgRegParms
moveARunOfObjectsStartingAtupTo(usqInt startAddress, usqInt limit)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt chunkBytes;
usqInt chunkBytes;
sqInt classIndex;
sqInt classIndex1;
sqInt dest;
Expand Down Expand Up @@ -60093,7 +60093,7 @@ nextNonEmptySegmentAfter(sqInt i)
static void
postSnapshot(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt address;
usqInt address;
sqInt bytes;
usqInt freeChunk;
sqInt i;
Expand Down Expand Up @@ -67937,7 +67937,11 @@ popthenPush(sqInt nItems, sqInt oop)
static sqInt NoDbgRegParms
positiveMachineIntegerFor(unsigned long value)
{
return positive64BitIntegerFor(value);
sqInt resultObj;

resultObj = positive64BitIntegerFor(value);

return resultObj;
}


Expand Down Expand Up @@ -71180,7 +71184,7 @@ removeFirstLinkOfList(sqInt aList)
static sqInt
retryPrimitiveOnFailure(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
signed char accessorDepth;
sqInt accessorDepth;
sqInt canRetry;
sqInt firstBytecode;
sqInt followDone;
Expand Down
2 changes: 1 addition & 1 deletion nsspursrc/vm/cogit.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CCodeGenerator VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
*/


Expand Down
107 changes: 59 additions & 48 deletions nsspursrc/vm/cointerp.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
from
CoInterpreter VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CoInterpreter VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


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

Expand Down Expand Up @@ -41080,7 +41080,7 @@ scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress)
usqInt numSlots1;
usqInt numSlots2;
sqInt obj;
usqInt ptr;
sqInt ptr;
usqInt slotBytes;

ptr = initialAddress;
Expand Down Expand Up @@ -52415,7 +52415,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 @@ -58314,7 +58314,7 @@ static void NoDbgRegParms
bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil)
{
usqInt bridgeSpan;
usqInt clifton;
sqInt clifton;
usqInt segEnd;

segEnd = ((aSegment->segSize)) + ((aSegment->segStart));
Expand Down Expand Up @@ -58495,7 +58495,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 @@ -58901,8 +58901,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 @@ -66445,45 +66445,56 @@ positiveMachineIntegerFor(unsigned long value)
usqInt newObj;
usqInt numBytes;
sqInt objFormat;
sqInt resultObj;

return (/* begin positive32BitIntegerFor: */
(/* begin maybeInlinePositive32BitIntegerFor: */
assert(!((hasSixtyFourBitImmediates()))),
((((unsigned int) value)) <= (MaxSmallInteger)
? (((value << 1) | 1),
goto l3)
: 0),
/* begin eeInstantiateSmallClassIndex:format:numSlots: */
(objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1))),
assert(ClassLargePositiveIntegerCompactIndex != 0),
assert(((objFormat < (firstByteFormat())
? objFormat
: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)))),
/* begin allocateSmallNewSpaceSlots:format:classIndex: */
assert(1 < (numSlotsMask())),
(newObj = GIV(freeStart)),
(numBytes = BaseHeaderSize + (8)),
assert((numBytes % (allocationUnit())) == 0),
assert((newObj % (allocationUnit())) == 0),
((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)
? ((!(GIV(needGCFlag))
? (/* begin scheduleScavenge */
(GIV(needGCFlag) = 1),
forceInterruptCheck())
: 0),
((GIV(freeStart) + numBytes) > (((eden()).limit))
? (error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:"),
(newLargeInteger = 0),
goto l2)
: 0))
: 0),
long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex),
(GIV(freeStart) += numBytes),
(newLargeInteger = newObj),
l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */,
(long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), SQ_SWAP_4_BYTES_IF_BIGENDIAN(value)),
long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0)),
l3: /* end maybeInlinePositive32BitIntegerFor: */));
/* begin positive32BitIntegerFor: */
/* begin maybeInlinePositive32BitIntegerFor: */
assert(!((hasSixtyFourBitImmediates())));
if ((((unsigned int) value)) <= (MaxSmallInteger)) {
resultObj = ((value << 1) | 1);
goto l4;
}
/* begin eeInstantiateSmallClassIndex:format:numSlots: */
objFormat = (firstByteFormat()) + ((8 - 4) & (BytesPerWord - 1));
assert(ClassLargePositiveIntegerCompactIndex != 0);
assert(((objFormat < (firstByteFormat())
? objFormat
: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex))));
/* begin allocateSmallNewSpaceSlots:format:classIndex: */
assert(1 < (numSlotsMask()));
newObj = GIV(freeStart);
numBytes = BaseHeaderSize + (8);
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:");
newLargeInteger = 0;
goto l2;
}
}
long64Atput(newObj, (((((usqLong) 1)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex);
GIV(freeStart) += numBytes;
newLargeInteger = newObj;
l2: /* end allocateSmallNewSpaceSlots:format:classIndex: */;

/* Memory is 8 byte aligned in Spur, make sure that oversized bytes are set to zero */
/* eem 4/28/2016 questionable; they should never be read */
long32Atput((newLargeInteger + BaseHeaderSize) + (0U << 2), SQ_SWAP_4_BYTES_IF_BIGENDIAN(value));
long32Atput((newLargeInteger + BaseHeaderSize) + (1U << 2), 0);

resultObj = newLargeInteger;
l4: /* end maybeInlinePositive32BitIntegerFor: */;
goto l1;

l1: /* end positive32BitIntegerFor: */;

return resultObj;
}


Expand Down
2 changes: 1 addition & 1 deletion nsspursrc/vm/cointerp.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1969 uuid: 3c083018-276e-4aae-9714-958e2720a038
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1970 uuid: 13eb69a8-2a8a-4c6c-86c1-fc4e4dc27c67
*/


Expand Down

0 comments on commit b64b148

Please sign in to comment.