Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3482
Browse files Browse the repository at this point in the history
Spur:
Refactor ephemeron firing so that fireEphemeron: is a method on
SpurMemoryManager, not StackInterpreter.

Make sure that queued/fired ephemerons are made to look unqueued/unfired
in a snapshot (since snapshots don't save the mourn queue).

Fix an invalid assert in markAllUnscannedEphemerons. It could indeed be that
there are no unscanned ephemerons on invoking markAllUnscannedEphemerons.

Fix a slip in the validImage leak checker which produced a spurious cr
for each bad object when run without -verbose.

Add ephemeron and weakling printing routines.

Interpreter:
Given that MULTIPLEBYTECODESETS is translation time only, don't use
cppIf: MULTIPLEBYTECODESETS, use MULTIPLEBYTECODESETS ifTrue: ...

Fix the Gnuifier for this change which was including an

Fix primitiveBytecodeSetsAvailable for the case of
MUTLIPLEBYTECODESETS being false.

Have primitiveGetenv use stackEphemeralStringValue: and methodReturnString:.
  • Loading branch information
eliotmiranda committed Dec 17, 2024
1 parent 8509ed1 commit 239bdc9
Show file tree
Hide file tree
Showing 75 changed files with 12,638 additions and 5,222 deletions.
2 changes: 1 addition & 1 deletion src/spur32.cog.lowcode/cogit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3471 uuid: c3abaac1-cda5-44ec-81c1-55154ab54aef
CCodeGenerator VMMaker.oscog-eem.3482 uuid: 361722fc-fb12-4419-8419-880fe062da35
(Compiler-eem.512)
*/

Expand Down
42 changes: 21 additions & 21 deletions src/spur32.cog.lowcode/cogitARMv5.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3471 uuid: c3abaac1-cda5-44ec-81c1-55154ab54aef
CCodeGenerator VMMaker.oscog-eem.3482 uuid: 361722fc-fb12-4419-8419-880fe062da35
(Compiler-eem.512)
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3471 uuid: c3abaac1-cda5-44ec-81c1-55154ab54aef
StackToRegisterMappingCogit VMMaker.oscog-eem.3482 uuid: 361722fc-fb12-4419-8419-880fe062da35
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3471 uuid: c3abaac1-cda5-44ec-81c1-55154ab54aef " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3482 uuid: 361722fc-fb12-4419-8419-880fe062da35 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -8322,7 +8322,7 @@ bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod)
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -8349,11 +8349,11 @@ bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod)
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpc = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpc = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -10044,7 +10044,7 @@ collectCogMethodConstituent(CogMethod *cogMethod)
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -10071,11 +10071,11 @@ collectCogMethodConstituent(CogMethod *cogMethod)
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpc = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpc = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -11580,7 +11580,7 @@ endPCOf(sqInt aMethod)
return pc - 1;
}
}
bsOffset = /* begin bytecodeSetOffsetFor: */
bsOffset = /* bytecodeSetOffsetFor: */
(methodUsesAlternateBytecodeSet(aMethod)
? 0x100
: 0);
Expand Down Expand Up @@ -15045,7 +15045,7 @@ mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *co
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -15072,11 +15072,11 @@ mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *co
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpcSqInt = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpcSqInt = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -30744,7 +30744,7 @@ genSpecialSelectorSend(void)
sqInt index;
sqInt numArgs;

index = byte0 - (/* begin firstSpecialSelectorBytecodeOffset */
index = byte0 - (/* firstSpecialSelectorBytecodeOffset */
(bytecodeSetOffset == 0x100
? AltFirstSpecialSelector + 0x100
: FirstSpecialSelector));
Expand Down Expand Up @@ -30956,7 +30956,7 @@ mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj)
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -30983,11 +30983,11 @@ mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj)
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpc = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpc = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -31101,8 +31101,8 @@ static sqInt
numSpecialSelectors(void)
{
return (bytecodeSetOffset == 0x100
? AltNumSpecialSelectors
: NumSpecialSelectors);
? AltNumSpecialSelectors
: NumSpecialSelectors);
}


Expand Down Expand Up @@ -45596,7 +45596,7 @@ genSpecialSelectorArithmetic(void)
(anInstruction->dependent = locateLiteral(argInt));
}
}
index = byte0 - (/* begin firstSpecialSelectorBytecodeOffset */
index = byte0 - (/* firstSpecialSelectorBytecodeOffset */
(bytecodeSetOffset == 0x100
? AltFirstSpecialSelector + 0x100
: FirstSpecialSelector));
Expand Down Expand Up @@ -45790,7 +45790,7 @@ genSpecialSelectorComparison(void)
(anInstruction->dependent = locateLiteral(argInt));
}
}
index = byte0 - (/* begin firstSpecialSelectorBytecodeOffset */
index = byte0 - (/* firstSpecialSelectorBytecodeOffset */
(bytecodeSetOffset == 0x100
? AltFirstSpecialSelector + 0x100
: FirstSpecialSelector));
Expand Down
42 changes: 21 additions & 21 deletions src/spur32.cog.lowcode/cogitIA32.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3471 uuid: c3abaac1-cda5-44ec-81c1-55154ab54aef
CCodeGenerator VMMaker.oscog-eem.3482 uuid: 361722fc-fb12-4419-8419-880fe062da35
(Compiler-eem.512)
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3471 uuid: c3abaac1-cda5-44ec-81c1-55154ab54aef
StackToRegisterMappingCogit VMMaker.oscog-eem.3482 uuid: 361722fc-fb12-4419-8419-880fe062da35
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3471 uuid: c3abaac1-cda5-44ec-81c1-55154ab54aef " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3482 uuid: 361722fc-fb12-4419-8419-880fe062da35 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -8163,7 +8163,7 @@ bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod)
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -8190,11 +8190,11 @@ bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod)
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpc = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpc = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -9859,7 +9859,7 @@ collectCogMethodConstituent(CogMethod *cogMethod)
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -9886,11 +9886,11 @@ collectCogMethodConstituent(CogMethod *cogMethod)
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpc = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpc = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -11422,7 +11422,7 @@ endPCOf(sqInt aMethod)
return pc - 1;
}
}
bsOffset = /* begin bytecodeSetOffsetFor: */
bsOffset = /* bytecodeSetOffsetFor: */
(methodUsesAlternateBytecodeSet(aMethod)
? 0x100
: 0);
Expand Down Expand Up @@ -14701,7 +14701,7 @@ mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *co
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -14728,11 +14728,11 @@ mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *co
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpcSqInt = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpcSqInt = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -27566,7 +27566,7 @@ genSpecialSelectorSend(void)
sqInt index;
sqInt numArgs;

index = byte0 - (/* begin firstSpecialSelectorBytecodeOffset */
index = byte0 - (/* firstSpecialSelectorBytecodeOffset */
(bytecodeSetOffset == 0x100
? AltFirstSpecialSelector + 0x100
: FirstSpecialSelector));
Expand Down Expand Up @@ -27785,7 +27785,7 @@ mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj)
latestContinuation = startbcpc;
aMethodObj = (homeMethod->methodObject);
endbcpc = (numBytesOf(aMethodObj)) - 1;
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand All @@ -27812,11 +27812,11 @@ mapPCDataForinto(CogMethod *cogMethod, sqInt arrayObj)
/* skip fiducial; i.e. the map entry for the pc immediately following the method header. */
map -= 1;
aMethodObj = (homeMethod->methodObject);
bcpc = startbcpc - (/* begin blockCreationBytecodeSizeForHeader: */
bcpc = startbcpc - (/* blockCreationBytecodeSizeForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? AltBlockCreationBytecodeSize
: BlockCreationBytecodeSize));
bsOffset = /* begin bytecodeSetOffsetForHeader: */
bsOffset = /* bytecodeSetOffsetForHeader: */
(headerIndicatesAlternateBytecodeSet((homeMethod->methodHeader))
? 0x100
: 0);
Expand Down Expand Up @@ -27930,8 +27930,8 @@ static sqInt
numSpecialSelectors(void)
{
return (bytecodeSetOffset == 0x100
? AltNumSpecialSelectors
: NumSpecialSelectors);
? AltNumSpecialSelectors
: NumSpecialSelectors);
}


Expand Down Expand Up @@ -41376,7 +41376,7 @@ genSpecialSelectorArithmetic(void)
/* #MoveCq:R: #gen:quickConstant:operand: #checkQuickConstant:forInstruction: */
genoperandoperand(MoveCqR, argInt, Arg0Reg);
}
index = byte0 - (/* begin firstSpecialSelectorBytecodeOffset */
index = byte0 - (/* firstSpecialSelectorBytecodeOffset */
(bytecodeSetOffset == 0x100
? AltFirstSpecialSelector + 0x100
: FirstSpecialSelector));
Expand Down Expand Up @@ -41561,7 +41561,7 @@ genSpecialSelectorComparison(void)
/* #MoveCq:R: #gen:quickConstant:operand: #checkQuickConstant:forInstruction: */
genoperandoperand(MoveCqR, argInt, Arg0Reg);
}
index = byte0 - (/* begin firstSpecialSelectorBytecodeOffset */
index = byte0 - (/* firstSpecialSelectorBytecodeOffset */
(bytecodeSetOffset == 0x100
? AltFirstSpecialSelector + 0x100
: FirstSpecialSelector));
Expand Down
Loading

0 comments on commit 239bdc9

Please sign in to comment.