Skip to content

Commit e3be599

Browse files
committed
CogVM source as per VMMaker.oscog-eem.2945
If sqMemoryAccess.h is to define EXPORT et al then sqPlatformSpecific.h, which provides platform-specific overrides, must precede it. This affects the cogit files. Add explicit variables for the handler and unwind primitive markers (PrimNumberHandlerMarker & PrimNumberUnwindMarker), and add 123 as the no-context-switch marker (PrimNumberNoContextSwitchMarker).
1 parent 6d74c4b commit e3be599

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1313
-1052
lines changed

nsspur64src/vm/cogit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
2+
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
33
*/
44

55

nsspur64src/vm/cogitARMv8.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
2+
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

@@ -13,8 +13,8 @@ char *__cogitBuildInfo = __buildInfo;
1313
#include <stdlib.h>
1414
#include <string.h>
1515
#include "sqConfig.h"
16-
#include "sqMemoryAccess.h"
1716
#include "sqPlatformSpecific.h"
17+
#include "sqMemoryAccess.h"
1818
#include "sqCogStackAlignment.h"
1919
#include "dispdbg.h"
2020
#include "cogmethod.h"
@@ -6986,7 +6986,7 @@ rewriteImm19JumpBeforetarget(AbstractInstruction * self_in_rewriteImm19JumpBefor
69866986
static sqInt NoDbgRegParms
69876987
rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBeforetarget, sqInt followingAddress, sqInt targetAddress)
69886988
{
6989-
sqInt instrOpcode;
6989+
usqInt instrOpcode;
69906990
sqInt mcpc;
69916991
sqInt offset;
69926992

@@ -6996,7 +6996,7 @@ rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBefor
69966996
instrOpcode = ((instructionBeforeAddress(self_in_rewriteImm26JumpBeforetarget, followingAddress))) >> 26;
69976997
assert((instrOpcode == 5)
69986998
|| (instrOpcode == 37));
6999-
codeLong32Atput(mcpc, (((sqInt)((usqInt)(instrOpcode) << 26))) + (((offset) >> 2) & (0x3FFFFFF)));
6999+
codeLong32Atput(mcpc, (instrOpcode << 26) + (((offset) >> 2) & (0x3FFFFFF)));
70007000
return 4;
70017001
}
70027002

nsspur64src/vm/cogitX64SysV.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
2+
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

@@ -13,8 +13,8 @@ char *__cogitBuildInfo = __buildInfo;
1313
#include <stdlib.h>
1414
#include <string.h>
1515
#include "sqConfig.h"
16-
#include "sqMemoryAccess.h"
1716
#include "sqPlatformSpecific.h"
17+
#include "sqMemoryAccess.h"
1818
#include "sqCogStackAlignment.h"
1919
#include "dispdbg.h"
2020
#include "cogmethod.h"

nsspur64src/vm/cogitX64WIN64.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
2+
CCodeGenerator VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

@@ -13,8 +13,8 @@ char *__cogitBuildInfo = __buildInfo;
1313
#include <stdlib.h>
1414
#include <string.h>
1515
#include "sqConfig.h"
16-
#include "sqMemoryAccess.h"
1716
#include "sqPlatformSpecific.h"
17+
#include "sqMemoryAccess.h"
1818
#include "sqCogStackAlignment.h"
1919
#include "dispdbg.h"
2020
#include "cogmethod.h"

nsspur64src/vm/cointerp.c

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
33
from
4-
CoInterpreter VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
4+
CoInterpreter VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
55
*/
6-
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2 " __DATE__ ;
6+
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1 " __DATE__ ;
77
char *__interpBuildInfo = __buildInfo;
88

99

@@ -281,10 +281,13 @@ warningat(const char *s, int l) { /* ditto with line number. */
281281
#define PrimNumberDoPrimitive 118
282282
#define PrimNumberExternalCall 117
283283
#define PrimNumberFFICall 120
284+
#define PrimNumberHandlerMarker 199
284285
#define PrimNumberHashMultiply 159
285286
#define PrimNumberInstVarAt 73
287+
#define PrimNumberNoContextSwitchMarker 123
286288
#define PrimNumberShallowCopy 148
287289
#define PrimNumberSlotAt 173
290+
#define PrimNumberUnwindMarker 198
288291
#define PrimTraceLogSize 256
289292
#define PriorityIndex 2
290293
#define ProcessListsIndex 0
@@ -1265,7 +1268,7 @@ extern sqInt nonIndexablePointerFormat(void);
12651268
static sqInt noUnscannedEphemerons(void);
12661269
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
12671270
extern sqInt numBytesOf(sqInt objOop);
1268-
extern usqInt numPointerSlotsOf(sqInt objOop);
1271+
extern sqInt numPointerSlotsOf(sqInt objOop);
12691272
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
12701273
extern usqInt numSlotsOf(sqInt objOop);
12711274
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
@@ -2628,7 +2631,7 @@ sqInt debugCallbackInvokes;
26282631
sqInt debugCallbackReturns;
26292632
sqInt ffiExceptionResponse;
26302633
sqInt checkedPluginName;
2631-
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2936";
2634+
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2945";
26322635
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
26332636
int displayWidth;
26342637
int displayDepth;
@@ -41060,7 +41063,7 @@ followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth)
4106041063
sqInt header1;
4106141064
sqInt i;
4106241065
sqInt numLiterals;
41063-
usqInt numSlots;
41066+
sqInt numSlots;
4106441067
usqInt numSlots1;
4106541068
sqInt oop;
4106641069
sqInt referent;
@@ -48682,7 +48685,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
4868248685
sqInt iLimiT;
4868348686
sqInt methodHeader;
4868448687
sqInt numLiterals;
48685-
usqInt numMediatedSlots;
48688+
sqInt numMediatedSlots;
4868648689
usqInt numSlots;
4868748690
usqInt numSlots1;
4868848691
sqInt oop;
@@ -54938,7 +54941,7 @@ numBytesOf(sqInt objOop)
5493854941
Works with CompiledMethods, as well as ordinary objects. */
5493954942

5494054943
/* SpurMemoryManager>>#numPointerSlotsOf: */
54941-
usqInt
54944+
sqInt
5494254945
numPointerSlotsOf(sqInt objOop)
5494354946
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
5494454947
sqInt contextSize;
@@ -57933,7 +57936,7 @@ printReferencesTo(sqInt anOop)
5793357936
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
5793457937
contextSize = (sp >> 3);
5793557938
l9: /* end fetchStackPointerOf: */;
57936-
i = ((usqInt) (CtxtTempFrameStart + contextSize));
57939+
i = CtxtTempFrameStart + contextSize;
5793757940
goto l10;
5793857941
}
5793957942
/* begin numSlotsOf: */
@@ -57966,7 +57969,7 @@ printReferencesTo(sqInt anOop)
5796657969
/* begin literalCountOfMethodHeader: */
5796757970
assert((((header) & 7) == 1));
5796857971
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
57969-
i = ((usqInt) (numLiterals + LiteralStart));
57972+
i = numLiterals + LiteralStart;
5797057973
l10: /* end numPointerSlotsOf: */;
5797157974
while (((i -= 1)) >= 0) {
5797257975
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
@@ -61114,10 +61117,10 @@ updatePointers(void)
6111461117
sqInt numLiterals1;
6111561118
sqInt numLiterals2;
6111661119
sqInt numLiterals3;
61117-
usqInt numPointerSlots;
61118-
usqInt numPointerSlots1;
61119-
usqInt numPointerSlots2;
61120-
usqInt numPointerSlots3;
61120+
sqInt numPointerSlots;
61121+
sqInt numPointerSlots1;
61122+
sqInt numPointerSlots2;
61123+
sqInt numPointerSlots3;
6112161124
usqInt numSlots;
6112261125
usqInt numSlots1;
6112361126
usqInt numSlots11;
@@ -62273,7 +62276,7 @@ prepareForSnapshot(void)
6227362276
sqInt limit;
6227462277
sqInt newEndOfMemory;
6227562278
sqInt next;
62276-
usqInt node;
62279+
sqInt node;
6227762280
SpurSegmentInfo *seg;
6227862281
sqInt smallChild;
6227962282
sqInt treeNode;
@@ -63085,16 +63088,18 @@ callbackLeave(sqInt cbID)
6308563088

6308663089

6308763090
/* Context switch should not be allowed on every method activation. In
63088-
particular the implementation of ensure: and ifCurtailed: depends on there
63089-
being no
63090-
suspension point on failing primitive 198 (primitiveMarkUnwindMethod).
63091-
slowPrimitiveResponse states
63091+
particular the
63092+
implementation of ensure: and ifCurtailed: depends on there being no
63093+
suspension point
63094+
on failing primitive 198 (primitiveMarkUnwindMethod,
63095+
primitiveMarkUnwindMethod). slowPrimitiveResponse used to state
6309263096
``N.B. This means there is no suspension point on primitive failure
6309363097
which methods such as ensure: and ifCurtailed: rely on.''
6309463098
Rather than prevent context switch on all primitives but the ones we
6309563099
really need
6309663100
to be suspension points (primitiveSignal et al) we choose to allow context
63097-
switch for all but primitiveMarkUnwindMethod. */
63101+
switch for all but primitiveMarkUnwindMethod and
63102+
PrimNumberNoContextSwitch. */
6309863103

6309963104
/* StackInterpreter>>#canContextSwitchIfActivating:header: */
6310063105
sqInt
@@ -63113,7 +63118,8 @@ canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader)
6311363118
}
6311463119
return
6311563120
# if 1
63116-
primitiveIndex != 198
63121+
(primitiveIndex != PrimNumberUnwindMarker)
63122+
&& (primitiveIndex != PrimNumberNoContextSwitchMarker)
6311763123
# else
6311863124
(primitiveIndex == 0)
6311963125
|| ((((primitiveIndex >= 85) && (primitiveIndex <= 88)))
@@ -65736,9 +65742,9 @@ findSPOfon(char *theFP, StackPage *thePage)
6573665742

6573765743

6573865744
/* Search for either an unwind-protect (activation of method with primitive
65739-
198) or homeContext along the sender chain, which ever is found first.
65740-
Return values:
65741-
0 home context was found on sender chain with no intervening
65745+
198, PrimNumberUnwindMarker)
65746+
or homeContext along the sender chain, which ever is found first. Return
65747+
values: 0 home context was found on sender chain with no intervening
6574265748
unwind-protects nilObj home context could not be found => cannotReturn
6574365749
context the context of an intervening unwind-protect implies home context
6574465750
was found */
@@ -65785,7 +65791,7 @@ findUnwindThroughContext(sqInt homeContext)
6578565791
theMethod1 = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
6578665792
? ((mframeHomeMethod(theFP))->methodObject)
6578765793
: longAt(theFP + FoxMethod));
65788-
if ((primitiveIndexOfMethodheader(theMethod1, methodHeaderOf(theMethod1))) == 198) {
65794+
if ((primitiveIndexOfMethodheader(theMethod1, methodHeaderOf(theMethod1))) == PrimNumberUnwindMarker) {
6578965795
if (theFP == theFPAbove) {
6579065796
theSP = findSPOfon(theFP, stackPageFor(theFP));
6579165797
}
@@ -65825,14 +65831,14 @@ findUnwindThroughContext(sqInt homeContext)
6582565831
ctxtOrNilOrZero = GIV(nilObj);
6582665832
goto l4;
6582765833
}
65828-
ctxtOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, senderContext, homeContext);
65834+
ctxtOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(PrimNumberUnwindMarker, senderContext, homeContext);
6582965835
l4: /* end findMethodWithPrimitive:FromFP:UpToContext: */;
6583065836
assert(!((onSamePage
6583165837
&& (ctxtOrNilOrZero == (nilObject())))));
6583265838
if (ctxtOrNilOrZero == 0) {
6583365839
/* begin fetchPointer:ofObject: */
6583465840
theMethod = longAt((homeContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
65835-
if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) {
65841+
if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == PrimNumberUnwindMarker) {
6583665842
return homeContext;
6583765843
}
6583865844
return 0;
@@ -66087,8 +66093,8 @@ static sqInt
6608766093
getErrorObjectFromPrimFailCode(void)
6608866094
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
6608966095
sqInt classIndex;
66090-
sqInt clone;
66091-
sqInt errObj;
66096+
usqInt clone;
66097+
usqInt errObj;
6609266098
sqInt fieldIndex;
6609366099
sqInt i;
6609466100
usqInt newObj;
@@ -78252,7 +78258,7 @@ primitiveFindHandlerContext(void)
7825278258
(GIV(stackPage)->headFP = GIV(framePointer));
7825378259
(GIV(stackPage)->headSP = GIV(stackPointer));
7825478260
assert(pageListIsWellFormed());
78255-
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(199, longAt(GIV(stackPointer)), GIV(nilObj));
78261+
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(PrimNumberHandlerMarker, longAt(GIV(stackPointer)), GIV(nilObj));
7825678262
if (handlerOrNilOrZero == 0) {
7825778263
/* begin nilObject */
7825878264
handlerOrNilOrZero = GIV(nilObj);
@@ -78324,7 +78330,7 @@ primitiveFindNextUnwindContext(void)
7832478330
assert((((senderOop) & 7) == 1));
7832578331
theFP = pointerForOop(senderOop - 1);
7832678332
if ((longAt(theFP + FoxSavedFP)) == 0) {
78327-
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, frameCallerContext(theFP), stopContext);
78333+
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(PrimNumberUnwindMarker, frameCallerContext(theFP), stopContext);
7832878334
}
7832978335
else {
7833078336
/* begin findMethodWithPrimitive:FromFP:UpToContext: */
@@ -78345,7 +78351,7 @@ primitiveFindNextUnwindContext(void)
7834578351
theMethod = ((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
7834678352
? ((mframeHomeMethod(theFP1))->methodObject)
7834778353
: longAt(theFP1 + FoxMethod));
78348-
if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) {
78354+
if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == PrimNumberUnwindMarker) {
7834978355
if (theFP1 == theFPAbove) {
7835078356
theSP = findSPOfon(theFP1, stackPageFor(theFP1));
7835178357
}
@@ -78385,7 +78391,7 @@ primitiveFindNextUnwindContext(void)
7838578391
handlerOrNilOrZero = GIV(nilObj);
7838678392
goto l9;
7838778393
}
78388-
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, senderContext, stopContext);
78394+
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(PrimNumberUnwindMarker, senderContext, stopContext);
7838978395
l9: /* end findMethodWithPrimitive:FromFP:UpToContext: */;
7839078396
}
7839178397
}
@@ -78394,7 +78400,7 @@ primitiveFindNextUnwindContext(void)
7839478400
startContext = longAt((calleeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
7839578401
if (((startContext & (tagMask())) == 0)
7839678402
&& (((longAt(startContext)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
78397-
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, startContext, stopContext);
78403+
handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(PrimNumberUnwindMarker, startContext, stopContext);
7839878404
}
7839978405
else {
7840078406
handlerOrNilOrZero = 0;

nsspur64src/vm/cointerp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2936 uuid: 69233536-ece4-4ea1-b523-c28c4aa7d4c2
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2945 uuid: 5eae7a41-7349-4d77-87cc-fba72c5d8fd1
33
*/
44

55

@@ -256,7 +256,7 @@ extern sqInt minSlotsForShortening(void);
256256
extern sqInt nilObject(void);
257257
extern sqInt nonIndexablePointerFormat(void);
258258
extern sqInt numBytesOf(sqInt objOop);
259-
extern usqInt numPointerSlotsOf(sqInt objOop);
259+
extern sqInt numPointerSlotsOf(sqInt objOop);
260260
extern usqInt numSlotsOf(sqInt objOop);
261261
extern sqInt numStrongSlotsOfWeakling(sqInt objOop);
262262
extern sqInt objectAfter(sqInt objOop);

0 commit comments

Comments
 (0)