Skip to content

Commit 661387c

Browse files
committed
CogVM source as per VMMaker.oscog-eem.3652
investigationTargetForEntryPoint:in:'s cPIC formal must be properly typed. Slang: Relax inlinability restrictions on actual parameters of mustBeInlined sends, allowing any actual parameter whose formal is used once or less in the mustBeInlined target to be inlined. Necessary to allow positiveMachineIntegerFor: to always be inlined.
1 parent 0e29f5e commit 661387c

Some content is hidden

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

60 files changed

+917
-1099
lines changed

image/Slang Test Workspace.text

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/spur32.cog.lowcode/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.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
2+
CCodeGenerator VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
33
(Cog-eem.499, * Compiler-ct.519)
44
*/
55

src/spur32.cog.lowcode/cogitARMv5.c

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
2+
CCodeGenerator VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
33
(Cog-eem.499, * Compiler-ct.519)
44
from
5-
StackToRegisterMappingCogit VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
5+
StackToRegisterMappingCogit VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
66
*/
7-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878 " __DATE__ ;
7+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d " __DATE__ ;
88
char *__cogitBuildInfo = __buildInfo;
99

1010

@@ -12731,7 +12731,6 @@ static void
1273112731
generateClosedPICPrototype(void)
1273212732
{
1273312733
AbstractInstruction *anInstruction;
12734-
AbstractInstruction *anInstruction1;
1273512734
CogMethod *cPIC;
1273612735
AbstractInstruction * cPICEndOfCodeLabel;
1273712736
sqInt endAddress;
@@ -12786,16 +12785,14 @@ generateClosedPICPrototype(void)
1278612785

1278712786
/* begin MoveUniqueCw:R: */
1278812787
/* begin gen:uniqueLiteral:operand: */
12789-
anInstruction1 = genoperandoperand(MoveCwR, wordConstant, SendNumArgsReg);
12790-
assert(usesOutOfLineLiteral(anInstruction1));
12791-
(anInstruction1->dependent = allocateLiteral(wordConstant));
12788+
anInstruction = genoperandoperand(MoveCwR, wordConstant, SendNumArgsReg);
12789+
assert(usesOutOfLineLiteral(anInstruction));
12790+
(anInstruction->dependent = allocateLiteral(wordConstant));
1279212791

1279312792
/* 16rBABE1F15+h is the class tag for the Nth case */
1279412793

12795-
/* begin CmpC32:R: */
12796-
/* begin gen:literal32:operand: */
12797-
anInstruction = ((sqInt) (genoperandoperand(CmpCwR, 0xBABE1F15U + h, TempReg)));
12798-
checkLiteralforInstruction(0xBABE1F15U + h, anInstruction);
12794+
/* #CmpC32:R: #gen:literal32:operand: #checkLiteral32:forInstruction: */
12795+
checkLiteralforInstruction(0xBABE1F15U + h, genoperandoperand(CmpCwR, 0xBABE1F15U + h, TempReg));
1279912796
jumpTarget = ((((methodZoneBase + (youngReferrers)) / 2) - 13262352) + 13262352) + (h * 16);
1280012797

1280112798
/* begin JumpLongZero: */
@@ -16509,7 +16506,7 @@ storeCogMethodDataImportspcpointer(sqInt annotation, char *mcpc, usqInt **import
1650916506
if (annotation == IsRelativeCall) {
1651016507
if ((import = stringForEntryPointexistingImportslimit(((char *)(callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)))), ((sqInt)(importsPtrPtr[1])), importsPtr))) {
1651116508
importsPtr[0] = ((((usqInt)(mcpc - (((char *)enumeratingCogMethod))) << 1) | 1));
16512-
importsPtr[1] = (positiveMachineIntegerFor(callTargetFromReturnAddress(backEnd, ((sqInt)mcpc))));
16509+
importsPtr[1] = (positive32BitIntegerFor(callTargetFromReturnAddress(backEnd, ((sqInt)mcpc))));
1651316510
importsPtr[2] = import;
1651416511
}
1651516512
else {
@@ -29705,7 +29702,7 @@ cogMethodImportsintodetailCPICs(CogMethod *cogMethod, sqInt data, sqInt detailCP
2970529702
storePointerUncheckedofObjectwithValue(4, importsArray, positive32BitIntegerFor((cogMethod->selector)));
2970629703
storePointerUncheckedofObjectwithValue(5, importsArray, (cogMethod->selector));
2970729704
storePointerUncheckedofObjectwithValue(6, importsArray, (((usqInt)missOffset << 1) | 1));
29708-
storePointerUncheckedofObjectwithValue(7, importsArray, positiveMachineIntegerFor(callTargetFromReturnAddress(backEnd, (((usqInt)cogMethod)) + missOffset)));
29705+
storePointerUncheckedofObjectwithValue(7, importsArray, positive32BitIntegerFor(callTargetFromReturnAddress(backEnd, (((usqInt)cogMethod)) + missOffset)));
2970929706
storePointerUncheckedofObjectwithValue(8, importsArray, stringForCString(codeEntryNameFor(abort)));
2971029707

2971129708
/* the first and second entries are the methodObject and selector in the CogMethod header
@@ -30860,15 +30857,11 @@ genExtNopBytecode(void)
3086030857
static sqInt
3086130858
genExtPushCharacterBytecode(void)
3086230859
{
30863-
sqInt literal;
3086430860
sqInt value;
3086530861

3086630862
value = byte1 + ((((usqInt)(extA) << 8)));
3086730863
extA = 0;
30868-
literal = characterObjectOf(value);
30869-
30870-
/* begin genPushLiteral: */
30871-
return ssPushConstant(literal);
30864+
return ssPushConstant(characterObjectOf(value));
3087230865
}
3087330866

3087430867

src/spur32.cog.lowcode/cogitIA32.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
2+
CCodeGenerator VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
33
(Cog-eem.499, * Compiler-ct.519)
44
from
5-
StackToRegisterMappingCogit VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
5+
StackToRegisterMappingCogit VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
66
*/
7-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878 " __DATE__ ;
7+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d " __DATE__ ;
88
char *__cogitBuildInfo = __buildInfo;
99

1010

@@ -973,7 +973,7 @@ static sqInt genPrimitiveStringAtPut(void);
973973
static NoDbgRegParms sqInt genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg);
974974
static NoDbgRegParms sqInt genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg);
975975
static NoDbgRegParms sqInt getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg);
976-
static NoDbgRegParms usqInt inlineCacheTagForInstance(sqInt oop);
976+
static NoDbgRegParms sqInt inlineCacheTagForInstance(sqInt oop);
977977
static NoDbgRegParms AbstractInstruction * jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg);
978978
static NoDbgRegParms sqInt markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address);
979979
static sqInt numSmallIntegerBits(void);
@@ -8254,7 +8254,7 @@ callCogCodePopReceiverAndClassRegs(void)
82548254
static NoDbgRegParms sqInt
82558255
ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver)
82568256
{
8257-
usqInt cacheTag;
8257+
sqInt cacheTag;
82588258
int errorSelectorOrNil;
82598259
sqInt methodOrSelectorIndex;
82608260
sqInt newTargetMethodOrNil;
@@ -8389,7 +8389,7 @@ ceMalloc(size_t size)
83898389
static NoDbgRegParms sqInt
83908390
ceSICMiss(sqInt receiver)
83918391
{
8392-
usqInt cacheTag;
8392+
sqInt cacheTag;
83938393
sqInt entryPoint;
83948394
int errorSelectorOrNil;
83958395
sqInt extent;
@@ -13927,7 +13927,7 @@ void
1392713927
linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver)
1392813928
{
1392913929
sqInt extent;
13930-
usqInt inlineCacheTag;
13930+
sqInt inlineCacheTag;
1393113931

1393213932
assert((theEntryOffset == cmEntryOffset)
1393313933
|| (theEntryOffset == cmNoCheckEntryOffset));
@@ -16012,7 +16012,7 @@ storeCogMethodDataImportspcpointer(sqInt annotation, char *mcpc, usqInt **import
1601216012
if (annotation == IsRelativeCall) {
1601316013
if ((import = stringForEntryPointexistingImportslimit(((char *)(callTargetFromReturnAddress(backEnd, ((sqInt)mcpc)))), ((sqInt)(importsPtrPtr[1])), importsPtr))) {
1601416014
importsPtr[0] = ((((usqInt)(mcpc - (((char *)enumeratingCogMethod))) << 1) | 1));
16015-
importsPtr[1] = (positiveMachineIntegerFor(callTargetFromReturnAddress(backEnd, ((sqInt)mcpc))));
16015+
importsPtr[1] = (positive32BitIntegerFor(callTargetFromReturnAddress(backEnd, ((sqInt)mcpc))));
1601616016
importsPtr[2] = import;
1601716017
}
1601816018
else {
@@ -22172,7 +22172,7 @@ getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt
2217222172
c.f. getInlineCacheClassTagFrom:into: & inlineCacheTagForClass: */
2217322173

2217422174
/* CogObjectRepresentationFor32BitSpur>>#inlineCacheTagForInstance: */
22175-
static NoDbgRegParms usqInt
22175+
static NoDbgRegParms sqInt
2217622176
inlineCacheTagForInstance(sqInt oop)
2217722177
{
2217822178
return (isImmediate(oop)
@@ -26367,7 +26367,7 @@ cogMethodImportsintodetailCPICs(CogMethod *cogMethod, sqInt data, sqInt detailCP
2636726367
storePointerUncheckedofObjectwithValue(4, importsArray, positive32BitIntegerFor((cogMethod->selector)));
2636826368
storePointerUncheckedofObjectwithValue(5, importsArray, (cogMethod->selector));
2636926369
storePointerUncheckedofObjectwithValue(6, importsArray, (((usqInt)missOffset << 1) | 1));
26370-
storePointerUncheckedofObjectwithValue(7, importsArray, positiveMachineIntegerFor(callTargetFromReturnAddress(backEnd, (((usqInt)cogMethod)) + missOffset)));
26370+
storePointerUncheckedofObjectwithValue(7, importsArray, positive32BitIntegerFor(callTargetFromReturnAddress(backEnd, (((usqInt)cogMethod)) + missOffset)));
2637126371
storePointerUncheckedofObjectwithValue(8, importsArray, stringForCString(codeEntryNameFor(abort)));
2637226372

2637326373
/* the first and second entries are the methodObject and selector in the CogMethod header
@@ -27513,15 +27513,11 @@ genExtNopBytecode(void)
2751327513
static sqInt
2751427514
genExtPushCharacterBytecode(void)
2751527515
{
27516-
sqInt literal;
2751727516
sqInt value;
2751827517

2751927518
value = byte1 + ((((usqInt)(extA) << 8)));
2752027519
extA = 0;
27521-
literal = characterObjectOf(value);
27522-
27523-
/* begin genPushLiteral: */
27524-
return ssPushConstant(literal);
27520+
return ssPushConstant(characterObjectOf(value));
2752527521
}
2752627522

2752727523

src/spur32.cog.lowcode/cointerp.c

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
33
(Cog-eem.499, * Compiler-ct.519)
44
from
5-
CoInterpreter VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
5+
CoInterpreter VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
66
*/
7-
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878 " __DATE__ ;
7+
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d " __DATE__ ;
88
char *__interpBuildInfo = __buildInfo;
99

1010

@@ -622,7 +622,7 @@ extern char * whereIs(sqInt anOop);
622622
static NoDbgRegParms NeverInline void widowOrForceToBytecodePC(sqInt ctxt);
623623
static NoDbgRegParms int frameIsMarked(sqInt theFPInt);
624624
#if VMInvestigations
625-
EXPORT(sqInt) primitiveAllMethodsCompiledToMachineCode(void);
625+
EXPORT(int) primitiveAllMethodsCompiledToMachineCode(void);
626626
#endif /* VMInvestigations */
627627
#if VMInvestigations
628628
EXPORT(void) primitiveBenchmarkFollowForwardersInStackZone(void);
@@ -2707,7 +2707,7 @@ sqInt debugCallbackReturns;
27072707
sqInt suppressHeartbeatFlag;
27082708
sqInt cannotDeferDisplayUpdates;
27092709
sqInt checkedPluginName;
2710-
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3650]";
2710+
const char *interpreterVersion = "Open Smalltalk Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.3651]";
27112711
const char * leakCheckFlagsMeanings[] = {
27122712
"1: check full GC", "2: check new space GC", "4: check incremental GC", "8: check become",
27132713
"16: check image segment", "32: check free space", "64: check shorten", "128: check prim call",
@@ -37442,7 +37442,7 @@ frameIsMarked(sqInt theFPInt)
3744237442

3744337443
/* CoInterpreterPrimitives>>#primitiveAllMethodsCompiledToMachineCode */
3744437444
#if VMInvestigations
37445-
EXPORT(sqInt)
37445+
EXPORT(int)
3744637446
primitiveAllMethodsCompiledToMachineCode(void)
3744737447
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
3744837448
sqInt arrayObj;
@@ -56890,9 +56890,9 @@ allWeakSurvivorsOnWeakList(void)
5689056890
/* begin nextCorpseOrNil: */
5689156891
assert(isYoung(corpse));
5689256892
listOffset = ((((usqInt)(((long32At((void *)(corpse + 4))) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((byteAt((void *)(corpse + (formatFieldByteOffset())))) & (formatMask()));
56893-
corpse = ((sqInt) ((listOffset
56894-
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
56895-
: 0)));
56893+
corpse = (listOffset
56894+
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
56895+
: 0);
5689656896
}
5689756897
return 0;
5689856898
return 0;
@@ -57731,9 +57731,9 @@ processEphemerons(void)
5773157731
/* begin nextCorpseOrNil: */
5773257732
assert(isYoung(ephemeronCorpse));
5773357733
listOffset = ((((usqInt)(((long32At((void *)(ephemeronCorpse + 4))) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((byteAt((void *)(ephemeronCorpse + (formatFieldByteOffset())))) & (formatMask()));
57734-
ephemeronCorpse = ((sqInt) ((listOffset
57735-
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57736-
: 0)));
57734+
ephemeronCorpse = (listOffset
57735+
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57736+
: 0);
5773757737
}
5773857738
/* end fireEphemeronsOnEphemeronList */
5773957739
l1:;
@@ -57805,9 +57805,9 @@ processWeaklings(void)
5780557805
/* begin nextCorpseOrNil: */
5780657806
assert(isYoung(weakCorpse));
5780757807
listOffset = ((((usqInt)(((long32At((void *)(weakCorpse + 4))) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((byteAt((void *)(weakCorpse + (formatFieldByteOffset())))) & (formatMask()));
57808-
weakCorpse = ((sqInt) ((listOffset
57809-
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57810-
: 0)));
57808+
weakCorpse = (listOffset
57809+
? ((((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart)
57810+
: 0);
5781157811
}
5781257812
GIV(weakList) = null;
5781357813
}
@@ -96354,9 +96354,8 @@ primitiveVMParameter(void)
9635496354
char *theFrame;
9635596355
StackPage *thePage;
9635696356
sqInt top;
96357-
usqIntptr_t value;
96357+
sqInt value;
9635896358
sqInt valuePointer;
96359-
sqInt valueSqInt;
9636096359

9636196360
paramsArraySize = 76;
9636296361
if (!GIV(argumentCount)) {
@@ -96379,12 +96378,11 @@ primitiveVMParameter(void)
9637996378
&& (!(isForwarded(resultSqInt))));
9638096379
assert(validStorePointerUncheckedArgs(1, resultSqInt, valuePointer));
9638196380
longAtput((void *)((resultSqInt + BaseHeaderSize) + (1U << (shiftForWord()))),valuePointer);
96382-
value = (newSpaceCapacity()) + ((/* begin totalOldSpaceSize */
96381+
valuePointer = positive32BitIntegerFor((newSpaceCapacity()) + ((/* begin totalOldSpaceSize */
9638396382
assert((totalBytesInSegments()) == GIV(totalHeapSizeIncludingBridges)),
96384-
GIV(totalHeapSizeIncludingBridges)));
96383+
GIV(totalHeapSizeIncludingBridges))));
9638596384

96386-
/* begin positiveMachineIntegerFor: */
96387-
valuePointer = positive32BitIntegerFor(value);
96385+
/* begin storePointerUnchecked:ofObject:withValue: */
9638896386
assert((isNonImmediate(resultSqInt))
9638996387
&& (!(isForwarded(resultSqInt))));
9639096388
assert(validStorePointerUncheckedArgs(2, resultSqInt, valuePointer));
@@ -96919,10 +96917,9 @@ GIV(totalHeapSizeIncludingBridges)));
9691996917
goto l1;
9692096918
break;
9692196919
case 3:
96922-
value = (newSpaceCapacity()) + ((/* begin totalOldSpaceSize */
96920+
result = positive32BitIntegerFor((newSpaceCapacity()) + ((/* begin totalOldSpaceSize */
9692396921
assert((totalBytesInSegments()) == GIV(totalHeapSizeIncludingBridges)),
96924-
GIV(totalHeapSizeIncludingBridges)));
96925-
result = positive32BitIntegerFor(value);
96922+
GIV(totalHeapSizeIncludingBridges))));
9692696923
goto l1;
9692796924
break;
9692896925
case 6:
@@ -97271,16 +97268,16 @@ GIV(totalHeapSizeIncludingBridges)));
9727197268
case 67:
9727297269
/* begin positiveMachineIntegerValueOf: */
9727397270
if ((argOop & 1)) {
97274-
valueSqInt = (argOop >> 1);
97275-
if (valueSqInt < 0) {
97271+
value = (argOop >> 1);
97272+
if (value < 0) {
9727697273
/* begin primitiveFail */
9727797274
if (!GIV(primFailCode)) {
9727897275
GIV(primFailCode) = 1;
9727997276
}
9728097277
arg = ((usqIntptr_t) null);
9728197278
goto l2;
9728297279
}
97283-
arg = ((usqIntptr_t) valueSqInt);
97280+
arg = ((usqIntptr_t) value);
9728497281
goto l2;
9728597282
}
9728697283

src/spur32.cog.lowcode/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.3650 uuid: 9f414618-9699-4df7-a365-1d65702d5878
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3651 uuid: 458bd6a5-d007-40a7-a740-b675bf61101d
33
(Cog-eem.499, * Compiler-ct.519)
44
*/
55

0 commit comments

Comments
 (0)