Skip to content

Commit 704a4df

Browse files
committed
CogVM source as per VMMaker.oscog-eem.2926
Include some more include files in the Cogits that are included by sq.h. Rename clone: to cloneObject: to avoid the clash with Unix pthread.h/sched.h's definition of clone, a variant of fork. Move declarations of the memory initialization functions from sq.h to sqMemoryAccess.h so that the cogits can see them now they don't include sq.h.
1 parent 49df9d2 commit 704a4df

File tree

96 files changed

+920
-856
lines changed

Some content is hidden

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

96 files changed

+920
-856
lines changed

build.macos64ARMv8/common/entitlements.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<true/>
1717
<key>com.apple.security.device.camera</key>
1818
<true/>
19+
<key>com.apple.security.files.all</key>
20+
<true/>
1921
<!-- Apparently this key allows an application to *be* a debugger,
2022
not to be debugged
2123
<key>com.apple.security.cs.debugger</key>

build.macos64x64/common/entitlements.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<true/>
1717
<key>com.apple.security.device.camera</key>
1818
<true/>
19+
<key>com.apple.security.files.all</key>
20+
<true/>
1921
<!-- Apparently this key allows an application to *be* a debugger,
2022
not to be debugged
2123
<key>com.apple.security.cs.debugger</key>

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.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
2+
CCodeGenerator VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
33
*/
44

55

nsspur64src/vm/cogitARMv8.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
2+
CCodeGenerator VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
55
CogARMv8Compiler ClosedVMMaker-nice.115 uuid: 3f822eda-99d6-4d6b-8404-171b7a9fa490
66
*/
7-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96\n\
7+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf\n\
88
CogARMv8Compiler ClosedVMMaker-nice.115 uuid: 3f822eda-99d6-4d6b-8404-171b7a9fa490 " __DATE__ ;
99
char *__cogitBuildInfo = __buildInfo;
1010

1111

1212

1313
#include <stddef.h>
14+
#include <stdio.h>
15+
#include <stdlib.h>
16+
#include <string.h>
1417
#include "sqConfig.h"
1518
#include "sqMemoryAccess.h"
1619
#include "sqCogStackAlignment.h"
@@ -6999,7 +7002,7 @@ rewriteImm19JumpBeforetarget(AbstractInstruction * self_in_rewriteImm19JumpBefor
69997002
static sqInt NoDbgRegParms
70007003
rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBeforetarget, sqInt followingAddress, sqInt targetAddress)
70017004
{
7002-
sqInt instrOpcode;
7005+
usqInt instrOpcode;
70037006
sqInt mcpc;
70047007
sqInt offset;
70057008

@@ -7009,7 +7012,7 @@ rewriteImm26JumpBeforetarget(AbstractInstruction * self_in_rewriteImm26JumpBefor
70097012
instrOpcode = ((instructionBeforeAddress(self_in_rewriteImm26JumpBeforetarget, followingAddress))) >> 26;
70107013
assert((instrOpcode == 5)
70117014
|| (instrOpcode == 37));
7012-
codeLong32Atput(mcpc, (((sqInt)((usqInt)(instrOpcode) << 26))) + (((offset) >> 2) & (0x3FFFFFF)));
7015+
codeLong32Atput(mcpc, (instrOpcode << 26) + (((offset) >> 2) & (0x3FFFFFF)));
70137016
return 4;
70147017
}
70157018

nsspur64src/vm/cogitX64SysV.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
2+
CCodeGenerator VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

1010

1111
#include <stddef.h>
12+
#include <stdio.h>
13+
#include <stdlib.h>
14+
#include <string.h>
1215
#include "sqConfig.h"
1316
#include "sqMemoryAccess.h"
1417
#include "sqCogStackAlignment.h"

nsspur64src/vm/cogitX64WIN64.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
2+
CCodeGenerator VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

1010

1111
#include <stddef.h>
12+
#include <stdio.h>
13+
#include <stdlib.h>
14+
#include <string.h>
1215
#include "sqConfig.h"
1316
#include "sqMemoryAccess.h"
1417
#include "sqCogStackAlignment.h"

nsspur64src/vm/cointerp.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
33
from
4-
CoInterpreter VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
4+
CoInterpreter VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
55
*/
6-
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96 " __DATE__ ;
6+
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf " __DATE__ ;
77
char *__interpBuildInfo = __buildInfo;
88

99

@@ -1079,7 +1079,7 @@ extern sqInt classUnsafeAlien(void);
10791079
extern sqInt classWordArray(void);
10801080
static void clearLeakMapAndMapAccessibleFreeSpace(void);
10811081
static sqInt NoDbgRegParms cloneInOldSpaceforPinning(sqInt objOop, sqInt forPinning);
1082-
extern sqInt clone(sqInt objOop);
1082+
extern sqInt cloneObject(sqInt objOop);
10831083
extern sqInt compactClassIndexOf(sqInt objOop);
10841084
static sqInt NoDbgRegParms copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endSeg, sqInt savedFirstFields, sqInt i);
10851085
extern void countMarkedAndUnmarkdObjects(sqInt printFlags);
@@ -1265,7 +1265,7 @@ extern sqInt nonIndexablePointerFormat(void);
12651265
static sqInt noUnscannedEphemerons(void);
12661266
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
12671267
extern sqInt numBytesOf(sqInt objOop);
1268-
extern usqInt numPointerSlotsOf(sqInt objOop);
1268+
extern sqInt numPointerSlotsOf(sqInt objOop);
12691269
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
12701270
extern usqInt numSlotsOf(sqInt objOop);
12711271
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
@@ -2628,7 +2628,7 @@ sqInt debugCallbackInvokes;
26282628
sqInt debugCallbackReturns;
26292629
sqInt ffiExceptionResponse;
26302630
sqInt checkedPluginName;
2631-
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2925";
2631+
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2926";
26322632
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
26332633
int displayWidth;
26342634
int displayDepth;
@@ -34284,7 +34284,7 @@ primitiveInvokeObjectAsMethod(void)
3428434284
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
3428534285
sqInt i;
3428634286
sqInt lookupClassTag;
34287-
sqInt runArgs;
34287+
usqInt runArgs;
3428834288
sqInt runReceiver;
3428934289
char *sp;
3429034290
char *sp1;
@@ -41059,7 +41059,7 @@ followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth)
4105941059
sqInt header1;
4106041060
sqInt i;
4106141061
sqInt numLiterals;
41062-
usqInt numSlots;
41062+
sqInt numSlots;
4106341063
usqInt numSlots1;
4106441064
sqInt oop;
4106541065
sqInt referent;
@@ -48500,9 +48500,9 @@ cloneInOldSpaceforPinning(sqInt objOop, sqInt forPinning)
4850048500
return newObj;
4850148501
}
4850248502

48503-
/* SpurMemoryManager>>#clone: */
48503+
/* SpurMemoryManager>>#cloneObject: */
4850448504
sqInt
48505-
clone(sqInt objOop)
48505+
cloneObject(sqInt objOop)
4850648506
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
4850748507
sqInt classIndex;
4850848508
sqInt classIndex1;
@@ -48681,7 +48681,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
4868148681
sqInt iLimiT;
4868248682
sqInt methodHeader;
4868348683
sqInt numLiterals;
48684-
usqInt numMediatedSlots;
48684+
sqInt numMediatedSlots;
4868548685
usqInt numSlots;
4868648686
usqInt numSlots1;
4868748687
sqInt oop;
@@ -54937,7 +54937,7 @@ numBytesOf(sqInt objOop)
5493754937
Works with CompiledMethods, as well as ordinary objects. */
5493854938

5493954939
/* SpurMemoryManager>>#numPointerSlotsOf: */
54940-
usqInt
54940+
sqInt
5494154941
numPointerSlotsOf(sqInt objOop)
5494254942
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
5494354943
sqInt contextSize;
@@ -55803,10 +55803,10 @@ outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag)
5580355803

5580455804
clone1 = (((longAt(obj1)) & (classIndexMask())) == ClassMethodContextCompactIndex
5580555805
? cloneContext(obj1)
55806-
: clone(obj1));
55806+
: cloneObject(obj1));
5580755807
clone2 = (((longAt(obj2)) & (classIndexMask())) == ClassMethodContextCompactIndex
5580855808
? cloneContext(obj2)
55809-
: clone(obj2));
55809+
: cloneObject(obj2));
5581055810
if (
5581155811
# if IMMUTABILITY
5581255812
(/* begin isImmutable: */
@@ -57932,7 +57932,7 @@ printReferencesTo(sqInt anOop)
5793257932
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
5793357933
contextSize = (sp >> 3);
5793457934
l9: /* end fetchStackPointerOf: */;
57935-
i = ((usqInt) (CtxtTempFrameStart + contextSize));
57935+
i = CtxtTempFrameStart + contextSize;
5793657936
goto l10;
5793757937
}
5793857938
/* begin numSlotsOf: */
@@ -57965,7 +57965,7 @@ printReferencesTo(sqInt anOop)
5796557965
/* begin literalCountOfMethodHeader: */
5796657966
assert((((header) & 7) == 1));
5796757967
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
57968-
i = ((usqInt) (numLiterals + LiteralStart));
57968+
i = numLiterals + LiteralStart;
5796957969
l10: /* end numPointerSlotsOf: */;
5797057970
while (((i -= 1)) >= 0) {
5797157971
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
@@ -61113,10 +61113,10 @@ updatePointers(void)
6111361113
sqInt numLiterals1;
6111461114
sqInt numLiterals2;
6111561115
sqInt numLiterals3;
61116-
usqInt numPointerSlots;
61117-
usqInt numPointerSlots1;
61118-
usqInt numPointerSlots2;
61119-
usqInt numPointerSlots3;
61116+
sqInt numPointerSlots;
61117+
sqInt numPointerSlots1;
61118+
sqInt numPointerSlots2;
61119+
sqInt numPointerSlots3;
6112061120
usqInt numSlots;
6112161121
usqInt numSlots1;
6112261122
usqInt numSlots11;
@@ -62272,7 +62272,7 @@ prepareForSnapshot(void)
6227262272
sqInt limit;
6227362273
sqInt newEndOfMemory;
6227462274
sqInt next;
62275-
sqInt node;
62275+
usqInt node;
6227662276
SpurSegmentInfo *seg;
6227762277
sqInt smallChild;
6227862278
sqInt treeNode;
@@ -76655,7 +76655,7 @@ primitiveClone(void)
7665576655
else {
7665676656
if ((GIV(argumentCount) == 0)
7665776657
|| (!(((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
76658-
newCopy = clone(rcvr);
76658+
newCopy = cloneObject(rcvr);
7665976659
}
7666076660
else {
7666176661
newCopy = 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.2925 uuid: bc30e1c2-363b-4238-ac06-0fc4bc0cfa96
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2926 uuid: 4f3cf7c5-7b78-41b7-8113-8e45970a4daf
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)