Skip to content

Commit 256c50e

Browse files
committed
CogVM source as per VMMaker.oscog-eem.3643
primitiveFunctionPointerAddress needs to join the primitiveCogStaticSymbols party.
1 parent 571ad98 commit 256c50e

25 files changed

Lines changed: 826 additions & 582 deletions

src/spur32.cog.lowcode/cointerp.c

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3642 uuid: 9bca0bb6-caab-46af-8301-659fa897bed9
3-
(Cog-eem.494, * Compiler-ct.519)
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3643 uuid: c23d3475-7c4f-4a38-b3c6-a6cfb954ff3e
3+
(Cog-eem.495, * Compiler-ct.519)
44
from
5-
CoInterpreter VMMaker.oscog-eem.3642 uuid: 9bca0bb6-caab-46af-8301-659fa897bed9
5+
CoInterpreter VMMaker.oscog-eem.3643 uuid: c23d3475-7c4f-4a38-b3c6-a6cfb954ff3e
66
*/
7-
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3642 uuid: 9bca0bb6-caab-46af-8301-659fa897bed9 " __DATE__ ;
7+
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3643 uuid: c23d3475-7c4f-4a38-b3c6-a6cfb954ff3e " __DATE__ ;
88
char *__interpBuildInfo = __buildInfo;
99

1010

@@ -622,7 +622,7 @@ extern char * whereIs(sqInt anOop);
622622
static NoDbgRegParms NeverInline void widowOrForceToBytecodePC(sqInt ctxt);
623623
static NoDbgRegParms int frameIsMarked(sqInt theFPInt);
624624
#if VMInvestigations
625-
EXPORT(int) primitiveAllMethodsCompiledToMachineCode(void);
625+
EXPORT(sqInt) primitiveAllMethodsCompiledToMachineCode(void);
626626
#endif /* VMInvestigations */
627627
#if VMInvestigations
628628
EXPORT(void) primitiveBenchmarkFollowForwardersInStackZone(void);
@@ -2708,7 +2708,7 @@ sqInt debugCallbackReturns;
27082708
sqInt suppressHeartbeatFlag;
27092709
sqInt cannotDeferDisplayUpdates;
27102710
sqInt checkedPluginName;
2711-
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3642]";
2711+
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3643]";
27122712
const char * leakCheckFlagsMeanings[] = {
27132713
"1: check full GC", "2: check new space GC", "4: check incremental GC", "8: check become",
27142714
"16: check image segment", "32: check free space", "64: check shorten", "128: check prim call",
@@ -37443,7 +37443,7 @@ frameIsMarked(sqInt theFPInt)
3744337443

3744437444
/* CoInterpreterPrimitives>>#primitiveAllMethodsCompiledToMachineCode */
3744537445
#if VMInvestigations
37446-
EXPORT(int)
37446+
EXPORT(sqInt)
3744737447
primitiveAllMethodsCompiledToMachineCode(void)
3744837448
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
3744937449
sqInt arrayObj;
@@ -37714,7 +37714,7 @@ primitiveCogStaticSymbols(void)
3771437714
sqInt symbols;
3771537715
sqInt valuePointer;
3771637716

37717-
symbols = instantiateClassindexableSize(longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ClassArray) << (shiftForWord())))))), 46);
37717+
symbols = instantiateClassindexableSize(longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ClassArray) << (shiftForWord())))))), 48);
3771837718
valuePointer = stringForCString("ISA");
3771937719

3772037720
/* begin storePointerUnchecked:ofObject:withValue: */
@@ -37941,109 +37941,123 @@ primitiveCogStaticSymbols(void)
3794137941
&& (!(isForwarded(symbols))));
3794237942
assert(validStorePointerUncheckedArgs(0x1F, symbols, valuePointer));
3794337943
longAtput((void *)((symbols + BaseHeaderSize) + (0x1FU << (shiftForWord()))),valuePointer);
37944-
valuePointer = stringForCString("nil");
37944+
valuePointer = stringForCString("primitiveFunctionPointer");
3794537945

3794637946
/* begin storePointerUnchecked:ofObject:withValue: */
3794737947
assert((isNonImmediate(symbols))
3794837948
&& (!(isForwarded(symbols))));
3794937949
assert(validStorePointerUncheckedArgs(32, symbols, valuePointer));
3795037950
longAtput((void *)((symbols + BaseHeaderSize) + (32U << (shiftForWord()))),valuePointer);
37951-
valuePointer = positiveMachineIntegerFor(GIV(nilObj));
37951+
valuePointer = positiveMachineIntegerFor(((usqInt)((&primitiveFunctionPointer))));
3795237952

3795337953
/* begin storePointerUnchecked:ofObject:withValue: */
3795437954
assert((isNonImmediate(symbols))
3795537955
&& (!(isForwarded(symbols))));
3795637956
assert(validStorePointerUncheckedArgs(33, symbols, valuePointer));
3795737957
longAtput((void *)((symbols + BaseHeaderSize) + (33U << (shiftForWord()))),valuePointer);
37958-
valuePointer = stringForCString("false");
37958+
valuePointer = stringForCString("nil");
3795937959

3796037960
/* begin storePointerUnchecked:ofObject:withValue: */
3796137961
assert((isNonImmediate(symbols))
3796237962
&& (!(isForwarded(symbols))));
3796337963
assert(validStorePointerUncheckedArgs(34, symbols, valuePointer));
3796437964
longAtput((void *)((symbols + BaseHeaderSize) + (34U << (shiftForWord()))),valuePointer);
37965-
valuePointer = positiveMachineIntegerFor(GIV(falseObj));
37965+
valuePointer = positiveMachineIntegerFor(GIV(nilObj));
3796637966

3796737967
/* begin storePointerUnchecked:ofObject:withValue: */
3796837968
assert((isNonImmediate(symbols))
3796937969
&& (!(isForwarded(symbols))));
3797037970
assert(validStorePointerUncheckedArgs(35, symbols, valuePointer));
3797137971
longAtput((void *)((symbols + BaseHeaderSize) + (35U << (shiftForWord()))),valuePointer);
37972-
valuePointer = stringForCString("true");
37972+
valuePointer = stringForCString("false");
3797337973

3797437974
/* begin storePointerUnchecked:ofObject:withValue: */
3797537975
assert((isNonImmediate(symbols))
3797637976
&& (!(isForwarded(symbols))));
3797737977
assert(validStorePointerUncheckedArgs(36, symbols, valuePointer));
3797837978
longAtput((void *)((symbols + BaseHeaderSize) + (36U << (shiftForWord()))),valuePointer);
37979-
valuePointer = positiveMachineIntegerFor(GIV(trueObj));
37979+
valuePointer = positiveMachineIntegerFor(GIV(falseObj));
3798037980

3798137981
/* begin storePointerUnchecked:ofObject:withValue: */
3798237982
assert((isNonImmediate(symbols))
3798337983
&& (!(isForwarded(symbols))));
3798437984
assert(validStorePointerUncheckedArgs(37, symbols, valuePointer));
3798537985
longAtput((void *)((symbols + BaseHeaderSize) + (37U << (shiftForWord()))),valuePointer);
37986-
valuePointer = stringForCString("classTableRootObj");
37986+
valuePointer = stringForCString("true");
3798737987

3798837988
/* begin storePointerUnchecked:ofObject:withValue: */
3798937989
assert((isNonImmediate(symbols))
3799037990
&& (!(isForwarded(symbols))));
3799137991
assert(validStorePointerUncheckedArgs(38, symbols, valuePointer));
3799237992
longAtput((void *)((symbols + BaseHeaderSize) + (38U << (shiftForWord()))),valuePointer);
37993-
valuePointer = positiveMachineIntegerFor(GIV(hiddenRootsObj));
37993+
valuePointer = positiveMachineIntegerFor(GIV(trueObj));
3799437994

3799537995
/* begin storePointerUnchecked:ofObject:withValue: */
3799637996
assert((isNonImmediate(symbols))
3799737997
&& (!(isForwarded(symbols))));
3799837998
assert(validStorePointerUncheckedArgs(39, symbols, valuePointer));
3799937999
longAtput((void *)((symbols + BaseHeaderSize) + (39U << (shiftForWord()))),valuePointer);
38000-
valuePointer = stringForCString("methodZoneBase");
38000+
valuePointer = stringForCString("classTableRootObj");
3800138001

3800238002
/* begin storePointerUnchecked:ofObject:withValue: */
3800338003
assert((isNonImmediate(symbols))
3800438004
&& (!(isForwarded(symbols))));
3800538005
assert(validStorePointerUncheckedArgs(40, symbols, valuePointer));
3800638006
longAtput((void *)((symbols + BaseHeaderSize) + (40U << (shiftForWord()))),valuePointer);
38007-
valuePointer = positiveMachineIntegerFor(getMethodZoneBase());
38007+
valuePointer = positiveMachineIntegerFor(GIV(hiddenRootsObj));
3800838008

3800938009
/* begin storePointerUnchecked:ofObject:withValue: */
3801038010
assert((isNonImmediate(symbols))
3801138011
&& (!(isForwarded(symbols))));
3801238012
assert(validStorePointerUncheckedArgs(41, symbols, valuePointer));
3801338013
longAtput((void *)((symbols + BaseHeaderSize) + (41U << (shiftForWord()))),valuePointer);
38014-
valuePointer = stringForCString("checkForAndFollowForwardedPrimitiveState");
38014+
valuePointer = stringForCString("methodZoneBase");
3801538015

3801638016
/* begin storePointerUnchecked:ofObject:withValue: */
3801738017
assert((isNonImmediate(symbols))
3801838018
&& (!(isForwarded(symbols))));
3801938019
assert(validStorePointerUncheckedArgs(42, symbols, valuePointer));
3802038020
longAtput((void *)((symbols + BaseHeaderSize) + (42U << (shiftForWord()))),valuePointer);
38021-
valuePointer = positiveMachineIntegerFor(((usqInt)checkForAndFollowForwardedPrimitiveState));
38021+
valuePointer = positiveMachineIntegerFor(getMethodZoneBase());
3802238022

3802338023
/* begin storePointerUnchecked:ofObject:withValue: */
3802438024
assert((isNonImmediate(symbols))
3802538025
&& (!(isForwarded(symbols))));
3802638026
assert(validStorePointerUncheckedArgs(43, symbols, valuePointer));
3802738027
longAtput((void *)((symbols + BaseHeaderSize) + (43U << (shiftForWord()))),valuePointer);
38028-
valuePointer = stringForCString("ceCheckAndMaybeRetryPrimitive:");
38028+
valuePointer = stringForCString("checkForAndFollowForwardedPrimitiveState");
3802938029

3803038030
/* begin storePointerUnchecked:ofObject:withValue: */
3803138031
assert((isNonImmediate(symbols))
3803238032
&& (!(isForwarded(symbols))));
3803338033
assert(validStorePointerUncheckedArgs(44, symbols, valuePointer));
3803438034
longAtput((void *)((symbols + BaseHeaderSize) + (44U << (shiftForWord()))),valuePointer);
38035-
valuePointer = positiveMachineIntegerFor(((usqInt)ceCheckAndMaybeRetryPrimitive));
38035+
valuePointer = positiveMachineIntegerFor(((usqInt)checkForAndFollowForwardedPrimitiveState));
3803638036

3803738037
/* begin storePointerUnchecked:ofObject:withValue: */
3803838038
assert((isNonImmediate(symbols))
3803938039
&& (!(isForwarded(symbols))));
3804038040
assert(validStorePointerUncheckedArgs(45, symbols, valuePointer));
3804138041
longAtput((void *)((symbols + BaseHeaderSize) + (45U << (shiftForWord()))),valuePointer);
38042+
valuePointer = stringForCString("ceCheckAndMaybeRetryPrimitive:");
38043+
38044+
/* begin storePointerUnchecked:ofObject:withValue: */
38045+
assert((isNonImmediate(symbols))
38046+
&& (!(isForwarded(symbols))));
38047+
assert(validStorePointerUncheckedArgs(46, symbols, valuePointer));
38048+
longAtput((void *)((symbols + BaseHeaderSize) + (46U << (shiftForWord()))),valuePointer);
38049+
valuePointer = positiveMachineIntegerFor(((usqInt)ceCheckAndMaybeRetryPrimitive));
38050+
38051+
/* begin storePointerUnchecked:ofObject:withValue: */
38052+
assert((isNonImmediate(symbols))
38053+
&& (!(isForwarded(symbols))));
38054+
assert(validStorePointerUncheckedArgs(47, symbols, valuePointer));
38055+
longAtput((void *)((symbols + BaseHeaderSize) + (47U << (shiftForWord()))),valuePointer);
3804238056

3804338057
/* these are needed because they are not annotated and hence not identified as exports by primitiveCogitMethod
3804438058
this is needed to distinguish linked/unlinked sends
3804538059
these two show up in Spur primitives, but maybe absolute calls, which won't show up in exports */
38046-
for (i = 0; i <= 45; i += 1) {
38060+
for (i = 0; i <= 47; i += 1) {
3804738061
if (!(longAt((void *)((symbols + BaseHeaderSize) + ((((usqInt)(i) << (shiftForWord())))))))) {
3804838062
return (GIV(primFailCode) = PrimErrNoMemory);
3804938063
}
@@ -82468,13 +82482,14 @@ static sqInt
8246882482
getErrorObjectFromPrimFailCode(void)
8246982483
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
8247082484
sqInt classIndex;
82471-
sqInt clone;
82472-
sqInt errObj;
82485+
usqInt clone;
82486+
usqInt errObj;
8247382487
sqInt i;
8247482488
usqInt newObj;
8247582489
usqInt numBytes;
8247682490
usqInt numSlots;
8247782491
usqInt numSlotsUsqInt;
82492+
sqInt objOop;
8247882493
sqInt table;
8247982494
sqInt valuePointer;
8248082495

@@ -82486,12 +82501,13 @@ getErrorObjectFromPrimFailCode(void)
8248682501
? longAt((void *)(table - BaseHeaderSize))
8248782502
: numSlots)))) {
8248882503
/* begin followField:ofObject: */
82489-
errObj = longAt((void *)((table + BaseHeaderSize) + ((((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))));
82504+
objOop = longAt((void *)((table + BaseHeaderSize) + ((((usqInt)((GIV(primFailCode) - 1)) << (shiftForWord()))))));
8249082505
if (/* isOopForwarded: */
82491-
((!(errObj & (tagMask()))))
82492-
&& ((!((longAt((void *)(errObj))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) {
82493-
errObj = fixFollowedFieldofObjectwithInitialValue(GIV(primFailCode) - 1, table, errObj);
82506+
((!(objOop & (tagMask()))))
82507+
&& ((!((longAt((void *)(objOop))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun())))))) {
82508+
objOop = fixFollowedFieldofObjectwithInitialValue(GIV(primFailCode) - 1, table, objOop);
8249482509
}
82510+
errObj = objOop;
8249582511

8249682512
/* If there's a clonable object in the table at that index,
8249782513
answer a clone of the error object with the second slot set to the value of secondaryErrorCode. */

src/spur32.cog.lowcode/cointerp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3642 uuid: 9bca0bb6-caab-46af-8301-659fa897bed9
3-
(Cog-eem.494, * Compiler-ct.519)
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3643 uuid: c23d3475-7c4f-4a38-b3c6-a6cfb954ff3e
3+
(Cog-eem.495, * Compiler-ct.519)
44
*/
55

66

0 commit comments

Comments
 (0)