Skip to content

Commit 960f683

Browse files
committed
CogVM source as per VMMaker.oscog-eem.3665
CoInterpreterMT: Replace the foreignCallbackProcessSlot with the ForeignCallbackProcess constant, insisting on a large enough specialObjectsArray at startup.
1 parent b8c7c7e commit 960f683

File tree

6 files changed

+62
-82
lines changed

6 files changed

+62
-82
lines changed

src/spur32.cog/cointerp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d
33
(Cog-eem.502, Compiler-eem.520)
44
*/
55

src/spur32.cog/cointerpmt.c

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d
33
(Cog-eem.502, Compiler-eem.520)
44
from
5-
CoInterpreterMT VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf
5+
CoInterpreterMT VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d
66
*/
7-
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf " __DATE__ ;
7+
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d " __DATE__ ;
88
char *__interpBuildInfo = __buildInfo;
99

1010

@@ -715,7 +715,7 @@ static NoDbgRegParms sqInt transferTofrom(sqInt newProcOrNil, sqInt sourceCode);
715715
static NoDbgRegParms void waitingPriorityIsAtLeast(sqInt minPriority);
716716
static NoDbgRegParms int frameIsMarked(sqInt theFPInt);
717717
#if VMInvestigations
718-
EXPORT(sqInt) primitiveAllMethodsCompiledToMachineCode(void);
718+
EXPORT(int) primitiveAllMethodsCompiledToMachineCode(void);
719719
#endif /* VMInvestigations */
720720
#if VMInvestigations
721721
EXPORT(void) primitiveBenchmarkFollowForwardersInStackZone(void);
@@ -1959,7 +1959,6 @@ _iss sqInt relinquishing;
19591959
_iss sqInt shrinkThreshold;
19601960
_iss sqInt statTenures;
19611961
_iss sqInt thisClassIndex;
1962-
_iss sqInt foreignCallbackProcessSlot;
19631962
_iss sqInt metaclassNumSlots;
19641963
_iss sqInt pendingFinalizationSignals;
19651964
_iss sqInt preemptionYields;
@@ -2802,7 +2801,7 @@ sqInt debugCallbackReturns;
28022801
sqInt suppressHeartbeatFlag;
28032802
sqInt cannotDeferDisplayUpdates;
28042803
sqInt checkedPluginName;
2805-
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3664]";
2804+
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3665]";
28062805
const char * leakCheckFlagsMeanings[] = {
28072806
"1: check full GC", "2: check new space GC", "4: check incremental GC", "8: check become",
28082807
"16: check image segment", "32: check free space", "64: check shorten", "128: check prim call",
@@ -21211,11 +21210,8 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea
2121121210
}
2121221211
GIV(metaAccessorDepth) = -2;
2121321212
sHEAFn = ioLoadFunctionFrom("secHasEnvironmentAccess", "SecurityPlugin");
21214-
if ((lengthOf(GIV(specialObjectsOop))) > ForeignCallbackProcess) {
21215-
GIV(foreignCallbackProcessSlot) = ForeignCallbackProcess;
21216-
}
21217-
else {
21218-
GIV(foreignCallbackProcessSlot) = NilObject;
21213+
if (!((lengthOf(GIV(specialObjectsOop))) > ForeignCallbackProcess)) {
21214+
error("The image is unsuitable for the MT VM because specialObjectsArray is too short to contain the foreign callback process.");
2121921215
}
2122021216
atomic_store((&GIV(maxWaitingPriority)), 0);
2122121217
initializeCodeZoneFromupTo(cogCodeBase, cogCodeBase + GIV(cogCodeSize));
@@ -23062,7 +23058,7 @@ disownVM(sqInt flags)
2306223058
assertCStackPointersBelongToCurrentThread();
2306323059
assertValidNewMethodPropertyFlags();
2306423060
if (((flags & DisownVMForProcessorRelinquish) != 0)) {
23065-
if (((proc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord())))))))) != GIV(nilObj)) {
23061+
if (((proc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord())))))))) != GIV(nilObj)) {
2306623062
/* begin quickFetchInteger:ofObject: */
2306723063
oop = longAt((void *)((proc + BaseHeaderSize) + ((((usqInt)(PriorityIndex) << (shiftForWord()))))));
2306823064
assert((oop & 1));
@@ -23591,9 +23587,9 @@ ownVMFromUnidentifiedThread(void)
2359123587
/* this is a callback from a known thread. Simply own the VM for that thread.
2359223588
If the current thread doesn't have an index it's new to the vm
2359323589
and we need to allocate a new threadInfo, failing if we can't.
23594-
We also need a process in the foreignCallbackProcessSlot upon
23590+
We also need a process in the ForeignCallbackProcess slot upon
2359523591
which to run the thread's eventual callback. */
23596-
while ((longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord()))))))) == GIV(nilObj)) {
23592+
while ((longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord()))))))) == GIV(nilObj)) {
2359723593
/* begin releaseVM */
2359823594
/* begin setVMOwner: */
2359923595
assert(((getVMOwner()) == -1)
@@ -23868,13 +23864,12 @@ ownVM(void *vmThreadHandle)
2386823864
sched = longAt((void *)(((longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(SchedulerAssociation) << (shiftForWord()))))))) + BaseHeaderSize) + ((((usqInt)(ValueIndex) << (shiftForWord()))))));
2386923865
activeProc = longAt((void *)((sched + BaseHeaderSize) + ((((usqInt)(ActiveProcessIndex) << (shiftForWord()))))));
2387023866
if (((flags & OwnVMForeignThreadFlag) != 0)) {
23871-
assert(GIV(foreignCallbackProcessSlot) == ForeignCallbackProcess);
23872-
myProc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord()))))));
23867+
myProc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord()))))));
2387323868
assert(myProc != (nilObject()));
2387423869

2387523870
/* begin splObj:put: */
2387623871
/* begin storePointer:ofObject:withValue: */
23877-
assert(validStorePointerArgs(GIV(foreignCallbackProcessSlot), GIV(specialObjectsOop), GIV(nilObj)));
23872+
assert(validStorePointerArgs(ForeignCallbackProcess, GIV(specialObjectsOop), GIV(nilObj)));
2387823873
assert(isNonImmediate(GIV(specialObjectsOop)));
2387923874
if (oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart))) {
2388023875
if (/* isYoung: */
@@ -23888,7 +23883,7 @@ ownVM(void *vmThreadHandle)
2388823883
}
2388923884

2389023885
/* most stores into young objects */
23891-
longAtput((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord()))))),GIV(nilObj));
23886+
longAtput((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord()))))),GIV(nilObj));
2389223887
}
2389323888
else {
2389423889
anAffinity = (vmThread->index);
@@ -26048,7 +26043,7 @@ frameIsMarked(sqInt theFPInt)
2604826043

2604926044
/* CoInterpreterPrimitives>>#primitiveAllMethodsCompiledToMachineCode */
2605026045
#if VMInvestigations
26051-
EXPORT(sqInt)
26046+
EXPORT(int)
2605226047
primitiveAllMethodsCompiledToMachineCode(void)
2605326048
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
2605426049
sqInt arrayObj;
@@ -37341,7 +37336,7 @@ primitiveInvokeObjectAsMethod(void)
3734137336
sqInt lookupClassTag;
3734237337
usqInt newObj;
3734337338
usqInt numBytes;
37344-
usqInt runArgs;
37339+
sqInt runArgs;
3734537340
sqInt runReceiver;
3734637341
char *sp;
3734737342
sqInt tagBits;
@@ -65902,7 +65897,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr)
6590265897
contextSize = (sp >> 1);
6590365898
/* end fetchStackPointerOf: */
6590465899
l2:
65905-
numPointerSlots = CtxtTempFrameStart + contextSize;
65900+
numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize));
6590665901
goto l3;
6590765902
}
6590865903

@@ -66448,7 +66443,7 @@ prepareForSnapshot(void)
6644866443
sqInt largeChild;
6644966444
sqInt newEndOfMemory;
6645066445
sqInt next;
66451-
sqInt node;
66446+
usqInt node;
6645266447
SpurSegmentInfo *seg;
6645366448
SpurSegmentInfo *selfOfSegSize;
6645466449
sqInt smallChild;

src/spur32.cog/gcc3x-cointerpmt.c

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33

44
/* Automatically generated by
5-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf
5+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d
66
(Cog-eem.502, Compiler-eem.520)
77
from
8-
CoInterpreterMT VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf
8+
CoInterpreterMT VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d
99
*/
10-
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf " __DATE__ ;
10+
static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d " __DATE__ ;
1111
char *__interpBuildInfo = __buildInfo;
1212

1313

@@ -718,7 +718,7 @@ static NoDbgRegParms sqInt transferTofrom(sqInt newProcOrNil, sqInt sourceCode);
718718
static NoDbgRegParms void waitingPriorityIsAtLeast(sqInt minPriority);
719719
static NoDbgRegParms int frameIsMarked(sqInt theFPInt);
720720
#if VMInvestigations
721-
EXPORT(sqInt) primitiveAllMethodsCompiledToMachineCode(void);
721+
EXPORT(int) primitiveAllMethodsCompiledToMachineCode(void);
722722
#endif /* VMInvestigations */
723723
#if VMInvestigations
724724
EXPORT(void) primitiveBenchmarkFollowForwardersInStackZone(void);
@@ -1962,7 +1962,6 @@ _iss sqInt relinquishing;
19621962
_iss sqInt shrinkThreshold;
19631963
_iss sqInt statTenures;
19641964
_iss sqInt thisClassIndex;
1965-
_iss sqInt foreignCallbackProcessSlot;
19661965
_iss sqInt metaclassNumSlots;
19671966
_iss sqInt pendingFinalizationSignals;
19681967
_iss sqInt preemptionYields;
@@ -2805,7 +2804,7 @@ sqInt debugCallbackReturns;
28052804
sqInt suppressHeartbeatFlag;
28062805
sqInt cannotDeferDisplayUpdates;
28072806
sqInt checkedPluginName;
2808-
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3664]";
2807+
const char *interpreterVersion = "Open Smalltalk Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.3665]";
28092808
const char * leakCheckFlagsMeanings[] = {
28102809
"1: check full GC", "2: check new space GC", "4: check incremental GC", "8: check become",
28112810
"16: check image segment", "32: check free space", "64: check shorten", "128: check prim call",
@@ -21218,11 +21217,8 @@ readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squea
2121821217
}
2121921218
GIV(metaAccessorDepth) = -2;
2122021219
sHEAFn = ioLoadFunctionFrom("secHasEnvironmentAccess", "SecurityPlugin");
21221-
if ((lengthOf(GIV(specialObjectsOop))) > ForeignCallbackProcess) {
21222-
GIV(foreignCallbackProcessSlot) = ForeignCallbackProcess;
21223-
}
21224-
else {
21225-
GIV(foreignCallbackProcessSlot) = NilObject;
21220+
if (!((lengthOf(GIV(specialObjectsOop))) > ForeignCallbackProcess)) {
21221+
error("The image is unsuitable for the MT VM because specialObjectsArray is too short to contain the foreign callback process.");
2122621222
}
2122721223
atomic_store((&GIV(maxWaitingPriority)), 0);
2122821224
initializeCodeZoneFromupTo(cogCodeBase, cogCodeBase + GIV(cogCodeSize));
@@ -23069,7 +23065,7 @@ disownVM(sqInt flags)
2306923065
assertCStackPointersBelongToCurrentThread();
2307023066
assertValidNewMethodPropertyFlags();
2307123067
if (((flags & DisownVMForProcessorRelinquish) != 0)) {
23072-
if (((proc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord())))))))) != GIV(nilObj)) {
23068+
if (((proc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord())))))))) != GIV(nilObj)) {
2307323069
/* begin quickFetchInteger:ofObject: */
2307423070
oop = longAt((void *)((proc + BaseHeaderSize) + ((((usqInt)(PriorityIndex) << (shiftForWord()))))));
2307523071
assert((oop & 1));
@@ -23598,9 +23594,9 @@ ownVMFromUnidentifiedThread(void)
2359823594
/* this is a callback from a known thread. Simply own the VM for that thread.
2359923595
If the current thread doesn't have an index it's new to the vm
2360023596
and we need to allocate a new threadInfo, failing if we can't.
23601-
We also need a process in the foreignCallbackProcessSlot upon
23597+
We also need a process in the ForeignCallbackProcess slot upon
2360223598
which to run the thread's eventual callback. */
23603-
while ((longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord()))))))) == GIV(nilObj)) {
23599+
while ((longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord()))))))) == GIV(nilObj)) {
2360423600
/* begin releaseVM */
2360523601
/* begin setVMOwner: */
2360623602
assert(((getVMOwner()) == -1)
@@ -23875,13 +23871,12 @@ ownVM(void *vmThreadHandle)
2387523871
sched = longAt((void *)(((longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(SchedulerAssociation) << (shiftForWord()))))))) + BaseHeaderSize) + ((((usqInt)(ValueIndex) << (shiftForWord()))))));
2387623872
activeProc = longAt((void *)((sched + BaseHeaderSize) + ((((usqInt)(ActiveProcessIndex) << (shiftForWord()))))));
2387723873
if (((flags & OwnVMForeignThreadFlag) != 0)) {
23878-
assert(GIV(foreignCallbackProcessSlot) == ForeignCallbackProcess);
23879-
myProc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord()))))));
23874+
myProc = longAt((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord()))))));
2388023875
assert(myProc != (nilObject()));
2388123876

2388223877
/* begin splObj:put: */
2388323878
/* begin storePointer:ofObject:withValue: */
23884-
assert(validStorePointerArgs(GIV(foreignCallbackProcessSlot), GIV(specialObjectsOop), GIV(nilObj)));
23879+
assert(validStorePointerArgs(ForeignCallbackProcess, GIV(specialObjectsOop), GIV(nilObj)));
2388523880
assert(isNonImmediate(GIV(specialObjectsOop)));
2388623881
if (oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart))) {
2388723882
if (/* isYoung: */
@@ -23895,7 +23890,7 @@ ownVM(void *vmThreadHandle)
2389523890
}
2389623891

2389723892
/* most stores into young objects */
23898-
longAtput((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(GIV(foreignCallbackProcessSlot)) << (shiftForWord()))))),GIV(nilObj));
23893+
longAtput((void *)((GIV(specialObjectsOop) + BaseHeaderSize) + ((((usqInt)(ForeignCallbackProcess) << (shiftForWord()))))),GIV(nilObj));
2389923894
}
2390023895
else {
2390123896
anAffinity = (vmThread->index);
@@ -26055,7 +26050,7 @@ frameIsMarked(sqInt theFPInt)
2605526050

2605626051
/* CoInterpreterPrimitives>>#primitiveAllMethodsCompiledToMachineCode */
2605726052
#if VMInvestigations
26058-
EXPORT(sqInt)
26053+
EXPORT(int)
2605926054
primitiveAllMethodsCompiledToMachineCode(void)
2606026055
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
2606126056
sqInt arrayObj;
@@ -37348,7 +37343,7 @@ primitiveInvokeObjectAsMethod(void)
3734837343
sqInt lookupClassTag;
3734937344
usqInt newObj;
3735037345
usqInt numBytes;
37351-
usqInt runArgs;
37346+
sqInt runArgs;
3735237347
sqInt runReceiver;
3735337348
char *sp;
3735437349
sqInt tagBits;
@@ -65909,7 +65904,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr)
6590965904
contextSize = (sp >> 1);
6591065905
/* end fetchStackPointerOf: */
6591165906
l2:
65912-
numPointerSlots = CtxtTempFrameStart + contextSize;
65907+
numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize));
6591365908
goto l3;
6591465909
}
6591565910

@@ -66455,7 +66450,7 @@ prepareForSnapshot(void)
6645566450
sqInt largeChild;
6645666451
sqInt newEndOfMemory;
6645766452
sqInt next;
66458-
sqInt node;
66453+
usqInt node;
6645966454
SpurSegmentInfo *seg;
6646066455
SpurSegmentInfo *selfOfSegSize;
6646166456
sqInt smallChild;

src/spur64.cog/cointerp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3664 uuid: bec3b39b-863c-43da-aa70-36c06b3b38bf
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3665 uuid: 9cd32573-c437-4720-9de2-db5b7c255d7d
33
(Cog-eem.502, Compiler-eem.520)
44
*/
55

0 commit comments

Comments
 (0)