Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3193
Browse files Browse the repository at this point in the history
Fix regressions in ImageLeakChecker after not so recent changes.
  • Loading branch information
eliotmiranda committed Jun 18, 2022
1 parent 959f3fe commit 27657fe
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
29 changes: 20 additions & 9 deletions src/spur32.stack/validImage.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3187 uuid: 409db813-9691-40ab-8d5b-8960d3b50fbc
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3193 uuid: 1e6f2357-e233-4291-bdce-2b9a24fc617d
from
ImageLeakChecker VMMaker.oscog-eem.3187 uuid: 409db813-9691-40ab-8d5b-8960d3b50fbc
ImageLeakChecker VMMaker.oscog-eem.3193 uuid: 1e6f2357-e233-4291-bdce-2b9a24fc617d
*/
static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3187 uuid: 409db813-9691-40ab-8d5b-8960d3b50fbc " __DATE__ ;
static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3193 uuid: 1e6f2357-e233-4291-bdce-2b9a24fc617d " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -53,8 +53,12 @@ warningat(const char *s, int l) { /* ditto with line number. */
#pragma auto_inline(on)

#define readImageFromFileHeapSizeStartingAt readImageFromFile
#if !defined(PharoVM)
# define PharoVM 0
#endif


void error(char *msg) {
void error(const char *msg) {
warning(msg);
abort();
}
Expand Down Expand Up @@ -116,7 +120,6 @@ void error(char *msg) {
#define LiteralStart 1
#define LongStoreBytecode 129
#define MarkStackRootIndex 0x1000
#define MaxExternalPrimitiveTableSize 4096
#define MethodCacheSize 4096
#define MethodDictionaryIndex 1
#define MethodHeaderArgCountShift 25
Expand Down Expand Up @@ -652,6 +655,7 @@ extern sqInt methodClassOf(sqInt methodPointer);
static char * NoDbgRegParms nameOfClass(sqInt classOop);
static char * NoDbgRegParms nameOfClasslengthInto(sqInt classOop, sqInt *lengthPtr);
extern sqInt objCouldBeClassObj(sqInt objOop);
static sqInt NoDbgRegParms objectequalsStringofSize(sqInt anOop, char *aCString, sqInt aCStringStrlen);
extern sqInt penultimateLiteralOf(sqInt aMethodOop);
extern sqInt primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader);
extern sqInt primitiveIndexOf(sqInt methodPointer);
Expand Down Expand Up @@ -915,9 +919,7 @@ static struct foo * foo = &fum;
# endif
#endif
static void *primitiveCalloutPointer = (void *)-1;
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
static void (*interruptCheckChain)(void) = 0;
static sqInt (* const pcPreviousToFunction)(sqInt,sqInt) = pcPreviousToinSqueakV3PlusClosuresOrSistaV1Method;
static void (*primitiveFunctionPointer)();
static int (*sHEAFn)() = 0;
sqInt checkForLeaks;
Expand All @@ -944,7 +946,7 @@ sqInt extraVMMemory;
sqInt ffiExceptionResponse;
sqInt inIOProcessEvents;
struct VirtualMachine* interpreterProxy;
const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3187]";
const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3193]";
sqInt suppressHeartbeatFlag;
char expensiveAsserts = 0;
volatile int sendTrace;
Expand Down Expand Up @@ -10602,7 +10604,7 @@ initializeExtraClassInstVarIndices(void)
GIV(classNameIndex) = 6;
for (i = (InstanceSpecificationIndex + 1), iLimiT = (numSlotsOf(classArrayObj)); i <= iLimiT; i += 1) {
oop = fetchPointerofObject(i - 1, classArrayObj);
if (objectequalsString(oop, "Array")) {
if (objectequalsStringofSize(oop, "Array", strlen("Array"))) {
GIV(classNameIndex) = i - 1;
}
}
Expand Down Expand Up @@ -10943,6 +10945,15 @@ objCouldBeClassObj(sqInt objOop)
&& (((fetchPointerofObject(InstanceSpecificationIndex, objOop)) & 1)))))));
}

/* StackInterpreter>>#object:equalsString:ofSize: */
static sqInt NoDbgRegParms
objectequalsStringofSize(sqInt anOop, char *aCString, sqInt aCStringStrlen)
{
return (isBytes(anOop))
&& (((numBytesOfBytes(anOop)) == aCStringStrlen)
&& ((strncmp(aCString, firstIndexableField(anOop), aCStringStrlen)) == 0));
}

/* StackInterpreter>>#penultimateLiteralOf: */
sqInt
penultimateLiteralOf(sqInt aMethodOop)
Expand Down
29 changes: 20 additions & 9 deletions src/spur64.stack/validImage.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3187 uuid: 409db813-9691-40ab-8d5b-8960d3b50fbc
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3193 uuid: 1e6f2357-e233-4291-bdce-2b9a24fc617d
from
ImageLeakChecker VMMaker.oscog-eem.3187 uuid: 409db813-9691-40ab-8d5b-8960d3b50fbc
ImageLeakChecker VMMaker.oscog-eem.3193 uuid: 1e6f2357-e233-4291-bdce-2b9a24fc617d
*/
static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3187 uuid: 409db813-9691-40ab-8d5b-8960d3b50fbc " __DATE__ ;
static char __buildInfo[] = "ImageLeakChecker VMMaker.oscog-eem.3193 uuid: 1e6f2357-e233-4291-bdce-2b9a24fc617d " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -53,8 +53,12 @@ warningat(const char *s, int l) { /* ditto with line number. */
#pragma auto_inline(on)

#define readImageFromFileHeapSizeStartingAt readImageFromFile
#if !defined(PharoVM)
# define PharoVM 0
#endif


void error(char *msg) {
void error(const char *msg) {
warning(msg);
abort();
}
Expand Down Expand Up @@ -116,7 +120,6 @@ void error(char *msg) {
#define LiteralStart 1
#define LongStoreBytecode 129
#define MarkStackRootIndex 0x1000
#define MaxExternalPrimitiveTableSize 4096
#define MethodCacheSize 4096
#define MethodDictionaryIndex 1
#define MethodHeaderArgCountShift 27
Expand Down Expand Up @@ -660,6 +663,7 @@ extern sqInt methodClassOf(sqInt methodPointer);
static char * NoDbgRegParms nameOfClass(sqInt classOop);
static char * NoDbgRegParms nameOfClasslengthInto(sqInt classOop, sqInt *lengthPtr);
extern sqInt objCouldBeClassObj(sqInt objOop);
static sqInt NoDbgRegParms objectequalsStringofSize(sqInt anOop, char *aCString, sqInt aCStringStrlen);
extern sqInt penultimateLiteralOf(sqInt aMethodOop);
extern sqInt primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader);
extern sqInt primitiveIndexOf(sqInt methodPointer);
Expand Down Expand Up @@ -923,9 +927,7 @@ static struct foo * foo = &fum;
# endif
#endif
static void *primitiveCalloutPointer = (void *)-1;
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
static void (*interruptCheckChain)(void) = 0;
static sqInt (* const pcPreviousToFunction)(sqInt,sqInt) = pcPreviousToinSqueakV3PlusClosuresOrSistaV1Method;
static void (*primitiveFunctionPointer)();
static int (*sHEAFn)() = 0;
sqInt checkForLeaks;
Expand All @@ -949,7 +951,7 @@ sqInt extraVMMemory;
sqInt ffiExceptionResponse;
sqInt inIOProcessEvents;
struct VirtualMachine* interpreterProxy;
const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3187]";
const char *interpreterVersion = "Open Smalltalk ImageChecker VM [ImageLeakChecker VMMaker.oscog-eem.3193]";
sqInt suppressHeartbeatFlag;
int displayDepth;
int displayHeight;
Expand Down Expand Up @@ -10773,7 +10775,7 @@ initializeExtraClassInstVarIndices(void)
GIV(classNameIndex) = 6;
for (i = (InstanceSpecificationIndex + 1), iLimiT = (numSlotsOf(classArrayObj)); i <= iLimiT; i += 1) {
oop = fetchPointerofObject(i - 1, classArrayObj);
if (objectequalsString(oop, "Array")) {
if (objectequalsStringofSize(oop, "Array", strlen("Array"))) {
GIV(classNameIndex) = i - 1;
}
}
Expand Down Expand Up @@ -11117,6 +11119,15 @@ objCouldBeClassObj(sqInt objOop)
&& (((((fetchPointerofObject(InstanceSpecificationIndex, objOop))) & 7) == 1)))))));
}

/* StackInterpreter>>#object:equalsString:ofSize: */
static sqInt NoDbgRegParms
objectequalsStringofSize(sqInt anOop, char *aCString, sqInt aCStringStrlen)
{
return (isBytes(anOop))
&& (((numBytesOfBytes(anOop)) == aCStringStrlen)
&& ((strncmp(aCString, firstIndexableField(anOop), aCStringStrlen)) == 0));
}

/* StackInterpreter>>#penultimateLiteralOf: */
sqInt
penultimateLiteralOf(sqInt aMethodOop)
Expand Down

0 comments on commit 27657fe

Please sign in to comment.