Skip to content

Commit db05a53

Browse files
committed
CogVM source as per VMMaker.oscog-eem.2877
Cogit: Fix a sign bug in addressIsInCodeZone: which could affect 32-bit VMs. Fix NumTrampolines for COGMTVM. COGMTVM: Nuke the old V3 MTVM. Nuke the old V3 GC lock hack. Use DisownVMForThreading as disown flag in primitiveFileReadPinningAndDisowning rather than DisownVMForFFICall because this flag is used for the fail-on-ffi-exceptin machinery. Change to Cogit>>tryLockVMOwnerTo: from tryLockVMOwner: & tryLockVMToIndex:. Interpreter: Fix the mis-assumption in postGCUpdateDisplayBits that Display bits is always an object (it could be a surface handle). Have print[Stack]CallStackOf: handle active process (suspendedContext isNil). AioPlugin as per VMConstruction-Plugins-AioPlugin.oscog-eem.26.
1 parent 4c31c55 commit db05a53

File tree

113 files changed

+11181
-121946
lines changed

Some content is hidden

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

113 files changed

+11181
-121946
lines changed

nsspur64src/vm/cogit.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099
2+
CCodeGenerator VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2
33
*/
44

55

@@ -124,9 +124,8 @@ extern usqIntptr_t (*ceGetSP)(void);
124124
extern void (*ceInvokeInterpret)(void);
125125
extern sqInt ceReturnToInterpreterTrampoline;
126126
#if COGMTVM
127-
extern usqIntptr_t (*ceTryLockVMOwner)(void);
128-
extern void (*ceUnlockVMOwner)(void);
129-
#endif /* COGMTVM */
127+
extern uintptr_t (*ceTryLockVMOwner)(uintptr_t);;
128+
#endif
130129
extern sqInt cFramePointerInUse;
131130
extern sqInt cmEntryOffset;
132131
extern sqInt cmNoCheckEntryOffset;
@@ -157,8 +156,7 @@ extern sqInt traceStores;
157156
#define recordOverflowTrace() (traceFlags & 32)
158157
#define recordPrimTrace() (traceFlags & 8)
159158
#define recordSendTrace() (traceFlags & 2)
160-
#define tryLockVMOwner(value) ceTryLockVMOwner(value)
161-
#define unlockVMOwner() ceUnlockVMOwner()
159+
#define tryLockVMOwnerTo(value) ceTryLockVMOwner(value)
162160
#define fullBlockEntryOffset() cbEntryOffset
163161
#define fullBlockNoContextSwitchEntryOffset() cbNoSwitchEntryOffset
164162

nsspur64src/vm/cogitARMv8.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099
2+
CCodeGenerator VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099
5-
CogARMv8Compiler ClosedVMMaker-eem.106 uuid: be383db6-00c1-4d74-ae5c-a4485319d44b
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2
5+
CogARMv8Compiler ClosedVMMaker-eem.109 uuid: 546907d1-5fff-4bb3-819c-0a9a5e11210e
66
*/
7-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099\n\
8-
CogARMv8Compiler ClosedVMMaker-eem.106 uuid: be383db6-00c1-4d74-ae5c-a4485319d44b " __DATE__ ;
7+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2\n\
8+
CogARMv8Compiler ClosedVMMaker-eem.109 uuid: 546907d1-5fff-4bb3-819c-0a9a5e11210e " __DATE__ ;
99
char *__cogitBuildInfo = __buildInfo;
1010

1111

@@ -325,7 +325,7 @@ char *__cogitBuildInfo = __buildInfo;
325325
#define NumSendTrampolines 4
326326
#define NumSpecialSelectors 32
327327
#define NumStoreTrampolines 5
328-
#define NumTrampolines 90
328+
#define NumTrampolines (85 + (COGMTVM ? 1 : 0) + (IMMUTABILITY ? 5 : 0))
329329
#define OrCqR 109
330330
#define OrCqRR 125
331331
#define OrCwR 117
@@ -2658,9 +2658,8 @@ usqIntptr_t (*ceGetFP)(void);
26582658
usqIntptr_t (*ceGetSP)(void);
26592659
void (*ceInvokeInterpret)(void);
26602660
#if COGMTVM
2661-
usqIntptr_t (*ceTryLockVMOwner)(void);
2662-
void (*ceUnlockVMOwner)(void);
2663-
#endif /* COGMTVM */
2661+
uintptr_t (*ceTryLockVMOwner)(uintptr_t);;
2662+
#endif
26642663
void (*realCECallCogCodePopReceiverAndClassRegs)(void);
26652664
void (*realCECallCogCodePopReceiverArg0Regs)(void);
26662665
void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void);
@@ -2728,8 +2727,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
27282727
#define reportError(n) warning("compilation error")
27292728
#define setHasMovableLiteral(b) (hasMovableLiteral = (b))
27302729
#define setHasYoungReferent(b) (hasYoungReferent = (b))
2731-
#define tryLockVMOwner(value) ceTryLockVMOwner(value)
2732-
#define unlockVMOwner() ceUnlockVMOwner()
2730+
#define tryLockVMOwnerTo(value) ceTryLockVMOwner(value)
27332731
#define varBaseAddress() varBaseAddress
27342732
#define nextOpenPIC methodObject
27352733
#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work
@@ -12835,7 +12833,7 @@ initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
1283512833
/* begin generateVMOwnerLockFunctions */
1283612834
# if COGMTVM
1283712835
/* begin allocateOpcodes:bytecodes: */
12838-
numberOfAbstractOpcodes2 = 9 /* numLowLevelLockOpcodes */;
12836+
numberOfAbstractOpcodes2 = 8 /* numLowLevelLockOpcodes */;
1283912837
numAbstractOpcodes = numberOfAbstractOpcodes2;
1284012838
opcodeSize2 = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
1284112839
fixupSize2 = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
@@ -12884,15 +12882,7 @@ initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
1288412882
l3: /* end generateLowLevelTryLock: */;
1288512883
outputInstructionsForGeneratedRuntimeAt(startAddress2);
1288612884
recordGeneratedRunTimeaddress("ceTryLockVMOwner", startAddress2);
12887-
ceTryLockVMOwner = ((usqIntptr_t (*)(void)) startAddress2);
12888-
zeroOpcodeIndex();
12889-
initialPC = 0;
12890-
endPC = numAbstractOpcodes - 1;
12891-
startAddress2 = methodZoneBase;
12892-
generateLowLevelUnlock(backEnd, vmOwnerAddress());
12893-
outputInstructionsForGeneratedRuntimeAt(startAddress2);
12894-
recordGeneratedRunTimeaddress("ceUnlockVMOwner", startAddress2);
12895-
ceUnlockVMOwner = ((void (*)(void)) startAddress2);
12885+
ceTryLockVMOwner = ((uintptr_t (*)(uintptr_t)) startAddress2);
1289612886
# endif /* COGMTVM */
1289712887
genGetLeafCallStackPointers();
1289812888
generateStackPointerCapture();
@@ -14810,8 +14800,11 @@ processorHasMultiplyAndMClassIsSmallInteger(void)
1481014800
static void NoDbgRegParms
1481114801
recordGeneratedRunTimeaddress(char *aString, sqInt address)
1481214802
{
14803+
assert((trampolineTableIndex + 2) <= (NumTrampolines * 2));
1481314804
trampolineAddresses[trampolineTableIndex] = aString;
1481414805
trampolineAddresses[trampolineTableIndex + 1] = (((char *) address));
14806+
14807+
/* self printTrampolineTable */
1481514808
trampolineTableIndex += 2;
1481614809
}
1481714810

nsspur64src/vm/cogitX64SysV.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099
2+
CCodeGenerator VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2 " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

@@ -290,7 +290,7 @@ char *__cogitBuildInfo = __buildInfo;
290290
#define NumSendTrampolines 4
291291
#define NumSpecialSelectors 32
292292
#define NumStoreTrampolines 5
293-
#define NumTrampolines 88
293+
#define NumTrampolines (83 + (COGMTVM ? 1 : 0) + (IMMUTABILITY ? 5 : 0))
294294
#define OrCqR 109
295295
#define OrCqRR 125
296296
#define OrCwR 117
@@ -2593,9 +2593,8 @@ usqIntptr_t (*ceGetFP)(void);
25932593
usqIntptr_t (*ceGetSP)(void);
25942594
void (*ceInvokeInterpret)(void);
25952595
#if COGMTVM
2596-
usqIntptr_t (*ceTryLockVMOwner)(void);
2597-
void (*ceUnlockVMOwner)(void);
2598-
#endif /* COGMTVM */
2596+
uintptr_t (*ceTryLockVMOwner)(uintptr_t);;
2597+
#endif
25992598
void (*realCECallCogCodePopReceiverAndClassRegs)(void);
26002599
void (*realCECallCogCodePopReceiverArg0Regs)(void);
26012600
void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void);
@@ -2658,8 +2657,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
26582657
#define reportError(n) warning("compilation error")
26592658
#define setHasMovableLiteral(b) (hasMovableLiteral = (b))
26602659
#define setHasYoungReferent(b) (hasYoungReferent = (b))
2661-
#define tryLockVMOwner(value) ceTryLockVMOwner(value)
2662-
#define unlockVMOwner() ceUnlockVMOwner()
2660+
#define tryLockVMOwnerTo(value) ceTryLockVMOwner(value)
26632661
#define varBaseAddress() varBaseAddress
26642662
#define nextOpenPIC methodObject
26652663
#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work
@@ -8563,7 +8561,7 @@ initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
85638561
/* begin generateVMOwnerLockFunctions */
85648562
# if COGMTVM
85658563
/* begin allocateOpcodes:bytecodes: */
8566-
numberOfAbstractOpcodes2 = 10 /* numLowLevelLockOpcodes */;
8564+
numberOfAbstractOpcodes2 = 6 /* numLowLevelLockOpcodes */;
85678565
numAbstractOpcodes = numberOfAbstractOpcodes2;
85688566
opcodeSize2 = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
85698567
fixupSize2 = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
@@ -8598,15 +8596,7 @@ initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
85988596
l6: /* end generateLowLevelTryLock: */;
85998597
outputInstructionsForGeneratedRuntimeAt(startAddress2);
86008598
recordGeneratedRunTimeaddress("ceTryLockVMOwner", startAddress2);
8601-
ceTryLockVMOwner = ((usqIntptr_t (*)(void)) startAddress2);
8602-
zeroOpcodeIndex();
8603-
initialPC = 0;
8604-
endPC = numAbstractOpcodes - 1;
8605-
startAddress2 = methodZoneBase;
8606-
generateLowLevelUnlock(backEnd, vmOwnerAddress());
8607-
outputInstructionsForGeneratedRuntimeAt(startAddress2);
8608-
recordGeneratedRunTimeaddress("ceUnlockVMOwner", startAddress2);
8609-
ceUnlockVMOwner = ((void (*)(void)) startAddress2);
8599+
ceTryLockVMOwner = ((uintptr_t (*)(uintptr_t)) startAddress2);
86108600
# endif /* COGMTVM */
86118601
genGetLeafCallStackPointers();
86128602
generateStackPointerCapture();
@@ -10501,8 +10491,11 @@ processorHasMultiplyAndMClassIsSmallInteger(void)
1050110491
static void NoDbgRegParms
1050210492
recordGeneratedRunTimeaddress(char *aString, sqInt address)
1050310493
{
10494+
assert((trampolineTableIndex + 2) <= (NumTrampolines * 2));
1050410495
trampolineAddresses[trampolineTableIndex] = aString;
1050510496
trampolineAddresses[trampolineTableIndex + 1] = (((char *) address));
10497+
10498+
/* self printTrampolineTable */
1050610499
trampolineTableIndex += 2;
1050710500
}
1050810501

@@ -25091,7 +25084,7 @@ isQuick(AbstractInstruction * self_in_isQuick, usqIntptr_t operand)
2509125084
for values in the interpreter or the object memory. Restrict our use of
2509225085
offsets to reference
2509325086
addresses within the method zone, rather than checking for a 32-bit
25094-
offset, si as to keep the
25087+
offset, so as to keep the
2509525088
simulator and real VM in sync. */
2509625089

2509725090
/* CogX64Compiler>>#isWithinMwOffsetRange: */
@@ -25100,7 +25093,7 @@ isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt
2510025093
{
2510125094
/* begin addressIsInCodeZone: */
2510225095
return ((((usqInt)anAddress)) >= codeBase)
25103-
&& (anAddress < limitAddress);
25096+
&& ((((usqInt)anAddress)) < limitAddress);
2510425097
}
2510525098

2510625099

nsspur64src/vm/cogitX64WIN64.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099
2+
CCodeGenerator VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2
33
from
4-
StackToRegisterMappingCogit VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099
4+
StackToRegisterMappingCogit VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2
55
*/
6-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2864 uuid: fe5cd24b-69ca-436c-80fb-04bb4f330099 " __DATE__ ;
6+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2876 uuid: e5dba4f0-62a2-4385-a1aa-67c8617b9fd2 " __DATE__ ;
77
char *__cogitBuildInfo = __buildInfo;
88

99

@@ -290,7 +290,7 @@ char *__cogitBuildInfo = __buildInfo;
290290
#define NumSendTrampolines 4
291291
#define NumSpecialSelectors 32
292292
#define NumStoreTrampolines 5
293-
#define NumTrampolines 88
293+
#define NumTrampolines (83 + (COGMTVM ? 1 : 0) + (IMMUTABILITY ? 5 : 0))
294294
#define OrCqR 109
295295
#define OrCqRR 125
296296
#define OrCwR 117
@@ -2593,9 +2593,8 @@ usqIntptr_t (*ceGetFP)(void);
25932593
usqIntptr_t (*ceGetSP)(void);
25942594
void (*ceInvokeInterpret)(void);
25952595
#if COGMTVM
2596-
usqIntptr_t (*ceTryLockVMOwner)(void);
2597-
void (*ceUnlockVMOwner)(void);
2598-
#endif /* COGMTVM */
2596+
uintptr_t (*ceTryLockVMOwner)(uintptr_t);;
2597+
#endif
25992598
void (*realCECallCogCodePopReceiverAndClassRegs)(void);
26002599
void (*realCECallCogCodePopReceiverArg0Regs)(void);
26012600
void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void);
@@ -2658,8 +2657,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
26582657
#define reportError(n) warning("compilation error")
26592658
#define setHasMovableLiteral(b) (hasMovableLiteral = (b))
26602659
#define setHasYoungReferent(b) (hasYoungReferent = (b))
2661-
#define tryLockVMOwner(value) ceTryLockVMOwner(value)
2662-
#define unlockVMOwner() ceUnlockVMOwner()
2660+
#define tryLockVMOwnerTo(value) ceTryLockVMOwner(value)
26632661
#define varBaseAddress() varBaseAddress
26642662
#define nextOpenPIC methodObject
26652663
#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work
@@ -8581,7 +8579,7 @@ initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
85818579
/* begin generateVMOwnerLockFunctions */
85828580
# if COGMTVM
85838581
/* begin allocateOpcodes:bytecodes: */
8584-
numberOfAbstractOpcodes2 = 10 /* numLowLevelLockOpcodes */;
8582+
numberOfAbstractOpcodes2 = 6 /* numLowLevelLockOpcodes */;
85858583
numAbstractOpcodes = numberOfAbstractOpcodes2;
85868584
opcodeSize2 = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
85878585
fixupSize2 = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
@@ -8616,15 +8614,7 @@ initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
86168614
l6: /* end generateLowLevelTryLock: */;
86178615
outputInstructionsForGeneratedRuntimeAt(startAddress2);
86188616
recordGeneratedRunTimeaddress("ceTryLockVMOwner", startAddress2);
8619-
ceTryLockVMOwner = ((usqIntptr_t (*)(void)) startAddress2);
8620-
zeroOpcodeIndex();
8621-
initialPC = 0;
8622-
endPC = numAbstractOpcodes - 1;
8623-
startAddress2 = methodZoneBase;
8624-
generateLowLevelUnlock(backEnd, vmOwnerAddress());
8625-
outputInstructionsForGeneratedRuntimeAt(startAddress2);
8626-
recordGeneratedRunTimeaddress("ceUnlockVMOwner", startAddress2);
8627-
ceUnlockVMOwner = ((void (*)(void)) startAddress2);
8617+
ceTryLockVMOwner = ((uintptr_t (*)(uintptr_t)) startAddress2);
86288618
# endif /* COGMTVM */
86298619
genGetLeafCallStackPointers();
86308620
generateStackPointerCapture();
@@ -10519,8 +10509,11 @@ processorHasMultiplyAndMClassIsSmallInteger(void)
1051910509
static void NoDbgRegParms
1052010510
recordGeneratedRunTimeaddress(char *aString, sqInt address)
1052110511
{
10512+
assert((trampolineTableIndex + 2) <= (NumTrampolines * 2));
1052210513
trampolineAddresses[trampolineTableIndex] = aString;
1052310514
trampolineAddresses[trampolineTableIndex + 1] = (((char *) address));
10515+
10516+
/* self printTrampolineTable */
1052410517
trampolineTableIndex += 2;
1052510518
}
1052610519

@@ -25113,7 +25106,7 @@ isQuick(AbstractInstruction * self_in_isQuick, usqIntptr_t operand)
2511325106
for values in the interpreter or the object memory. Restrict our use of
2511425107
offsets to reference
2511525108
addresses within the method zone, rather than checking for a 32-bit
25116-
offset, si as to keep the
25109+
offset, so as to keep the
2511725110
simulator and real VM in sync. */
2511825111

2511925112
/* CogX64Compiler>>#isWithinMwOffsetRange: */
@@ -25122,7 +25115,7 @@ isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt
2512225115
{
2512325116
/* begin addressIsInCodeZone: */
2512425117
return ((((usqInt)anAddress)) >= codeBase)
25125-
&& (anAddress < limitAddress);
25118+
&& ((((usqInt)anAddress)) < limitAddress);
2512625119
}
2512725120

2512825121

0 commit comments

Comments
 (0)