Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3355
Browse files Browse the repository at this point in the history
Fix checkImageHeaderFromBytes:AndSize:; the headerSize field in a header
is 32 bits, not wordSize.
  • Loading branch information
eliotmiranda committed Mar 22, 2024
1 parent 6641c9d commit ac6ca33
Show file tree
Hide file tree
Showing 39 changed files with 305 additions and 305 deletions.
14 changes: 7 additions & 7 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.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
from
CoInterpreter VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CoInterpreter VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2027,7 +2027,7 @@ static signed short primitiveMetadataTable[MaxPrimitiveIndex + 2 /* 584 */] = {
/*78*/ 0, 0,
/*80*/ -256,-256,-256, 4, 4, 0, 0x100, 0, 0x200,-256,-256, 0, 0, 0, 0x100,-256, 0,-256,
/*98*/ 0, 0,
/*100*/ 260, 0x200, 0x100, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256,
/*100*/ 260, 0x200, 0x200, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256,
/*115*/ 0x100, 0, 12, 260, 0,
/*120*/ 524, 0x100,-256,-256, 1, 0, 0, 0, 0,-255,-256,-256, 0, 0, 0,-256, 0,-256,-256,
/*139*/ 0,
Expand Down Expand Up @@ -2701,7 +2701,7 @@ sqInt debugCallbackReturns;
sqInt suppressHeartbeatFlag;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3354]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3355]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -82252,8 +82252,8 @@ checkImageHeaderFromBytesAndSize(char *bytes, sqInt totalSize)
return 0;
}
version = long32At(bytes);
headerSize = longAt(bytes + 4);
dataSize = longAt((bytes + 4) + BytesPerWord);
headerSize = long32At(bytes + 4);
dataSize = longAt(bytes + 8);
if (!((((version | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
if (!(((((SQ_SWAP_4_BYTES(version)) | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
return 0;
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.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
*/


Expand Down
14 changes: 7 additions & 7 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.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
from
CoInterpreter VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CoInterpreter VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2030,7 +2030,7 @@ static signed short primitiveMetadataTable[MaxPrimitiveIndex + 2 /* 584 */] = {
/*78*/ 0, 0,
/*80*/ -256,-256,-256, 4, 4, 0, 0x100, 0, 0x200,-256,-256, 0, 0, 0, 0x100,-256, 0,-256,
/*98*/ 0, 0,
/*100*/ 260, 0x200, 0x100, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256,
/*100*/ 260, 0x200, 0x200, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256,
/*115*/ 0x100, 0, 12, 260, 0,
/*120*/ 524, 0x100,-256,-256, 1, 0, 0, 0, 0,-255,-256,-256, 0, 0, 0,-256, 0,-256,-256,
/*139*/ 0,
Expand Down Expand Up @@ -2704,7 +2704,7 @@ sqInt debugCallbackReturns;
sqInt suppressHeartbeatFlag;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3354]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3355]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -82261,8 +82261,8 @@ checkImageHeaderFromBytesAndSize(char *bytes, sqInt totalSize)
return 0;
}
version = long32At(bytes);
headerSize = longAt(bytes + 4);
dataSize = longAt((bytes + 4) + BytesPerWord);
headerSize = long32At(bytes + 4);
dataSize = longAt(bytes + 8);
if (!((((version | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
if (!(((((SQ_SWAP_4_BYTES(version)) | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
return 0;
Expand Down
30 changes: 15 additions & 15 deletions src/spur32.cog/cointerp.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
from
CoInterpreter VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CoInterpreter VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2676,7 +2676,7 @@ sqInt debugCallbackReturns;
sqInt suppressHeartbeatFlag;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3354]";
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3355]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -19156,7 +19156,7 @@ mnuMethodOrNilFor(sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt currentClass;
sqInt dictionary;
sqInt index;
usqInt index;
usqInt length;
sqInt mask;
sqInt methodArray;
Expand Down Expand Up @@ -19205,7 +19205,7 @@ mnuMethodOrNilFor(sqInt rcvr)
wrapAround = 0;
while (1) {
/* begin fetchPointer:ofObject: */
nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord())));
if (nextSelector == GIV(nilObj)) {
mnuMethod = null;
goto l11;
Expand All @@ -19223,7 +19223,7 @@ mnuMethodOrNilFor(sqInt rcvr)
}
methodArray = objOop;
/* begin followField:ofObject: */
objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord())));
if (((!(objOop1 & (tagMask()))))
&& ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) {
objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1);
Expand Down Expand Up @@ -33385,7 +33385,7 @@ primitiveInvokeObjectAsMethod(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt i;
sqInt lookupClassTag;
usqInt runArgs;
sqInt runArgs;
sqInt runReceiver;
char *sp;
char *sp1;
Expand Down Expand Up @@ -62284,8 +62284,8 @@ checkImageHeaderFromBytesAndSize(char *bytes, sqInt totalSize)
return 0;
}
version = long32At(bytes);
headerSize = longAt(bytes + 4);
dataSize = longAt((bytes + 4) + BytesPerWord);
headerSize = long32At(bytes + 4);
dataSize = longAt(bytes + 8);
if (!((((version | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
if (!(((((SQ_SWAP_4_BYTES(version)) | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
return 0;
Expand Down Expand Up @@ -65084,8 +65084,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 Expand Up @@ -67237,7 +67237,7 @@ lookupSelectorinClass(sqInt selector, sqInt class)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt currentClass;
sqInt dictionary;
sqInt index;
usqInt index;
usqInt length;
sqInt mask;
sqInt meth;
Expand Down Expand Up @@ -67281,7 +67281,7 @@ lookupSelectorinClass(sqInt selector, sqInt class)
wrapAround = 0;
while (1) {
/* begin fetchPointer:ofObject: */
nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord())));
if (nextSelector == GIV(nilObj)) {
meth = null;
goto l8;
Expand All @@ -67299,7 +67299,7 @@ lookupSelectorinClass(sqInt selector, sqInt class)
}
methodArray = objOop2;
/* begin followField:ofObject: */
objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord())));
if (((!(objOop1 & (tagMask()))))
&& ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) {
objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1);
Expand Down
2 changes: 1 addition & 1 deletion src/spur32.cog/cointerp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
*/


Expand Down
32 changes: 16 additions & 16 deletions src/spur32.cog/cointerpmt.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
from
CoInterpreterMT VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CoInterpreterMT VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
*/
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2 " __DATE__ ;
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2102,7 +2102,7 @@ static signed short primitiveMetadataTable[MaxPrimitiveIndex + 2 /* 584 */] = {
/*78*/ 0, 0,
/*80*/ -256,-256,-256, 4, 4, 0, 0x100, 0, 0x200,-256,-256, 0, 0, 0, 0x100,-256, 0,-256,
/*98*/ 0, 0,
/*100*/ 260, 0x200, 0x200, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256,
/*100*/ 260, 0x200, 0x100, 0x200,-256, 513,-256,-256,-256,-256, 0, 0x100, 0, 0,-256,
/*115*/ 0x100, 0, 12, 260, 0,
/*120*/ 524, 0x100,-256,-256, 1, 0, 0, 0, 0,-255,-256,-256, 0, 0, 0,-256, 0,-256,-256,
/*139*/ 0,
Expand Down Expand Up @@ -2778,7 +2778,7 @@ sqInt debugCallbackReturns;
sqInt suppressHeartbeatFlag;
sqInt cannotDeferDisplayUpdates;
sqInt checkedPluginName;
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3354]";
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3355]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char expensiveAsserts = 0;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
Expand Down Expand Up @@ -19682,7 +19682,7 @@ mnuMethodOrNilFor(sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt currentClass;
sqInt dictionary;
sqInt index;
usqInt index;
usqInt length;
sqInt mask;
sqInt methodArray;
Expand Down Expand Up @@ -19731,7 +19731,7 @@ mnuMethodOrNilFor(sqInt rcvr)
wrapAround = 0;
while (1) {
/* begin fetchPointer:ofObject: */
nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord())));
if (nextSelector == GIV(nilObj)) {
mnuMethod = null;
goto l11;
Expand All @@ -19749,7 +19749,7 @@ mnuMethodOrNilFor(sqInt rcvr)
}
methodArray = objOop;
/* begin followField:ofObject: */
objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord())));
if (((!(objOop1 & (tagMask()))))
&& ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) {
objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1);
Expand Down Expand Up @@ -36510,7 +36510,7 @@ primitiveInvokeObjectAsMethod(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt i;
sqInt lookupClassTag;
sqInt runArgs;
usqInt runArgs;
sqInt runReceiver;
char *sp;
char *sp1;
Expand Down Expand Up @@ -65266,8 +65266,8 @@ checkImageHeaderFromBytesAndSize(char *bytes, sqInt totalSize)
return 0;
}
version = long32At(bytes);
headerSize = longAt(bytes + 4);
dataSize = longAt((bytes + 4) + BytesPerWord);
headerSize = long32At(bytes + 4);
dataSize = longAt(bytes + 8);
if (!((((version | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
if (!(((((SQ_SWAP_4_BYTES(version)) | MultipleBytecodeSetsBitmask) - MultipleBytecodeSetsBitmask)) == 6521 /* imageFormatVersion */)) {
return 0;
Expand Down Expand Up @@ -68018,8 +68018,8 @@ static sqInt
getErrorObjectFromPrimFailCode(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt classIndex;
sqInt clone;
sqInt errObj;
usqInt clone;
usqInt errObj;
sqInt fieldIndex;
sqInt i;
usqInt newObj;
Expand Down Expand Up @@ -70141,7 +70141,7 @@ lookupSelectorinClass(sqInt selector, sqInt class)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt currentClass;
sqInt dictionary;
sqInt index;
usqInt index;
usqInt length;
sqInt mask;
sqInt meth;
Expand Down Expand Up @@ -70185,7 +70185,7 @@ lookupSelectorinClass(sqInt selector, sqInt class)
wrapAround = 0;
while (1) {
/* begin fetchPointer:ofObject: */
nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
nextSelector = longAt((dictionary + BaseHeaderSize) + (index << (shiftForWord())));
if (nextSelector == GIV(nilObj)) {
meth = null;
goto l8;
Expand All @@ -70203,7 +70203,7 @@ lookupSelectorinClass(sqInt selector, sqInt class)
}
methodArray = objOop2;
/* begin followField:ofObject: */
objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
objOop1 = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << (shiftForWord())));
if (((!(objOop1 & (tagMask()))))
&& ((!((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) {
objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1);
Expand Down
2 changes: 1 addition & 1 deletion src/spur32.cog/cointerpmt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3354 uuid: 67b625b4-ae15-4b1d-a144-7fd52510caf2
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3355 uuid: c384a960-5652-4118-b6ab-563e95c1bc74
*/


Expand Down

0 comments on commit ac6ca33

Please sign in to comment.