Skip to content

Commit 0750af2

Browse files
committed
CogVM source as per VMMaker.oscog-eem.3719
Slang for Cogit: Improve super send expansions so that assigned super sends don't add a new variable. Transform pointerVar := expr ifTrue: [value] into ifTrue:ifFalse: where the ifFalse is a properly cast null. Have TSendNode>>replaceChild:with:simplifyingAddingElisionsTo:in: inline nullary block expansions to generate better code down-stream. Have TAssignmentNode>>replaceChild:with:simplifyingAddingElisionsTo:in: push down assignments into returning ifs.
1 parent a55fdce commit 0750af2

60 files changed

Lines changed: 1077 additions & 1136 deletions

Some content is hidden

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

src/plugins/CroquetPlugin/CroquetPlugin.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
VMPluginCodeGenerator VMMaker.oscog-eem.3676 uuid: ff00f25e-75c0-4e00-b807-0d490f1f338a
3-
(* Compiler-eem.523)
2+
VMPluginCodeGenerator VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5
3+
(Compiler-eem.527)
44
from
5-
CroquetPlugin VMMaker.oscog-eem.3676 uuid: ff00f25e-75c0-4e00-b807-0d490f1f338a
5+
CroquetPlugin VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5
66
*/
7-
static char __buildInfo[] = "CroquetPlugin VMMaker.oscog-eem.3676 uuid: ff00f25e-75c0-4e00-b807-0d490f1f338a " __DATE__ ;
7+
static char __buildInfo[] = "CroquetPlugin VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5 " __DATE__ ;
88

99

1010
#include "config.h"
@@ -103,7 +103,7 @@ extern sqInt storePointerofObjectwithValue(sqInt index, sqInt oop, sqInt valuePo
103103
extern
104104
#endif
105105
struct VirtualMachine* interpreterProxy;
106-
static const char *moduleName = "CroquetPlugin VMMaker.oscog-eem.3676 " INT_EXT;
106+
static const char *moduleName = "CroquetPlugin VMMaker.oscog-eem.3719 " INT_EXT;
107107

108108

109109
/*** Methods ***/
@@ -353,7 +353,7 @@ primitiveInplaceHouseHolderInvert(void)
353353
rcvr = ((isWords(oop))
354354
&& ((slotSizeOf(oop)) == 16)
355355
? firstIndexableField(oop)
356-
: 0);
356+
: ((float *) null));
357357
if (!rcvr) {
358358
return primitiveFail();
359359
}
@@ -664,7 +664,7 @@ primitiveTransformDirection(void)
664664
matrix = ((isWords(oop))
665665
&& ((slotSizeOf(oop)) == 16)
666666
? firstIndexableField(oop)
667-
: 0);
667+
: ((float *) null));
668668
v3Oop = stackValue(0);
669669
if (!((matrix)
670670
&& ((isWords(v3Oop))
@@ -714,21 +714,21 @@ primitiveTransformMatrixWithInto(void)
714714
m3 = ((isWords(oop))
715715
&& ((slotSizeOf(oop)) == 16)
716716
? firstIndexableField(oop)
717-
: 0);
717+
: ((float *) null));
718718

719719
/* begin stackMatrix: */
720720
oop = stackValue(1);
721721
m2 = ((isWords(oop))
722722
&& ((slotSizeOf(oop)) == 16)
723723
? firstIndexableField(oop)
724-
: 0);
724+
: ((float *) null));
725725

726726
/* begin stackMatrix: */
727727
oop = stackValue(2);
728728
m1 = ((isWords(oop))
729729
&& ((slotSizeOf(oop)) == 16)
730730
? firstIndexableField(oop)
731-
: 0);
731+
: ((float *) null));
732732
if ((!m1)
733733
|| ((!m2)
734734
|| ((!m3)
@@ -781,7 +781,7 @@ primitiveTransformVector3(void)
781781
matrix = ((isWords(oop))
782782
&& ((slotSizeOf(oop)) == 16)
783783
? firstIndexableField(oop)
784-
: 0);
784+
: ((float *) null));
785785
v3Oop = stackValue(0);
786786
if (!((matrix)
787787
&& ((isWords(v3Oop))
@@ -884,35 +884,35 @@ primitiveTriBoxIntersects(void)
884884
v2 = ((isWords(oop))
885885
&& ((slotSizeOf(oop)) == 3)
886886
? firstIndexableField(oop)
887-
: 0);
887+
: ((float *) null));
888888

889889
/* begin stackVector3: */
890890
oop = stackValue(1);
891891
v1 = ((isWords(oop))
892892
&& ((slotSizeOf(oop)) == 3)
893893
? firstIndexableField(oop)
894-
: 0);
894+
: ((float *) null));
895895

896896
/* begin stackVector3: */
897897
oop = stackValue(2);
898898
v0 = ((isWords(oop))
899899
&& ((slotSizeOf(oop)) == 3)
900900
? firstIndexableField(oop)
901-
: 0);
901+
: ((float *) null));
902902

903903
/* begin stackVector3: */
904904
oop = stackValue(3);
905905
maxCorner = ((isWords(oop))
906906
&& ((slotSizeOf(oop)) == 3)
907907
? firstIndexableField(oop)
908-
: 0);
908+
: ((float *) null));
909909

910910
/* begin stackVector3: */
911911
oop = stackValue(4);
912912
minCorner = ((isWords(oop))
913913
&& ((slotSizeOf(oop)) == 3)
914914
? firstIndexableField(oop)
915-
: 0);
915+
: ((float *) null));
916916
if ((!v0)
917917
|| ((!v1)
918918
|| ((!v2)

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.3717 uuid: 22f7663b-7db7-47b4-b831-1548469ef709
2+
CCodeGenerator VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5
33
(* Cog-eem.507, Compiler-eem.527)
44
*/
55

src/spur32.cog.lowcode/cogitARMv5.c

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.3717 uuid: 22f7663b-7db7-47b4-b831-1548469ef709
2+
CCodeGenerator VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5
33
(* Cog-eem.507, Compiler-eem.527)
44
from
5-
StackToRegisterMappingCogit VMMaker.oscog-eem.3717 uuid: 22f7663b-7db7-47b4-b831-1548469ef709
5+
StackToRegisterMappingCogit VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5
66
*/
7-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3717 uuid: 22f7663b-7db7-47b4-b831-1548469ef709 " __DATE__ ;
7+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5 " __DATE__ ;
88
char *__cogitBuildInfo = __buildInfo;
99

1010

@@ -6715,14 +6715,19 @@ genDivRRQuoRem(AbstractInstruction *self_in_CogARMCompiler, sqInt abstractRegDiv
67156715
/* MoveR:R: */
67166716
genoperandoperand(MoveRR, SPReg, spareCalleeSavedReg);
67176717
}
6718-
lastInst = /* begin CallAnyFixedRT: */
6719-
(isWithinCallRange(backEnd, ((usqInt)divRemFunctionAddr))
6720-
? ((callTargetSqInt = ((usqIntptr_t)divRemFunctionAddr)),
6721-
/* begin CallRT: */
6722-
(abstractInstruction = genoperand(Call, callTargetSqInt)),
6723-
(abstractInstruction->annotation = IsRelativeCall),
6724-
abstractInstruction)
6725-
: checkLiteralforInstruction(((usqIntptr_t)divRemFunctionAddr), genoperand(CallFull, ((usqIntptr_t)divRemFunctionAddr))));
6718+
6719+
/* begin CallAnyFixedRT: */
6720+
if (isWithinCallRange(backEnd, ((usqInt)divRemFunctionAddr))) {
6721+
callTargetSqInt = ((usqIntptr_t)divRemFunctionAddr);
6722+
6723+
/* begin CallRT: */
6724+
abstractInstruction = genoperand(Call, callTargetSqInt);
6725+
(abstractInstruction->annotation = IsRelativeCall);
6726+
lastInst = abstractInstruction;
6727+
}
6728+
else {
6729+
lastInst = checkLiteralforInstruction(((usqIntptr_t)divRemFunctionAddr), genoperand(CallFull, ((usqIntptr_t)divRemFunctionAddr)));
6730+
}
67266731
if (mustSaveSPReg) {
67276732
lastInst = genoperandoperand(MoveRR, spareCalleeSavedReg, SPReg);
67286733
}
@@ -47451,14 +47456,14 @@ genSpecialSelectorArithmetic(void)
4745147456
else {
4745247457
marshallSendArguments(1);
4745347458
}
47454-
jumpNotSmallInts = (!(rcvrIsInt
47455-
&& (argIsInt))
47456-
? (argIsInt
47459+
jumpNotSmallInts = (rcvrIsInt
47460+
&& (argIsInt)
47461+
? ((AbstractInstruction *) null)
47462+
: (argIsInt
4745747463
? genJumpNotSmallInteger(ReceiverResultReg)
4745847464
: (rcvrIsInt
4745947465
? genJumpNotSmallInteger(Arg0Reg)
47460-
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg)))
47461-
: 0);
47466+
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg))));
4746247467
switch ((primDescriptor->opcode)) {
4746347468
case AddRR:
4746447469
if (argIsInt) {
@@ -47551,7 +47556,7 @@ genSpecialSelectorArithmetic(void)
4755147556
}
4755247557
jumpContinue = (jumpNotSmallInts
4755347558
? genoperand(Jump, ((sqInt)0))
47554-
: 0);
47559+
: ((AbstractInstruction *) null));
4755547560
break;
4755647561
case OrRR:
4755747562
if (argIsInt) {
@@ -47568,7 +47573,7 @@ genSpecialSelectorArithmetic(void)
4756847573
}
4756947574
jumpContinue = (jumpNotSmallInts
4757047575
? genoperand(Jump, ((sqInt)0))
47571-
: 0);
47576+
: ((AbstractInstruction *) null));
4757247577
break;
4757347578
default:
4757447579
error("Case not found and no otherwise clause");
@@ -47740,14 +47745,14 @@ genSpecialSelectorComparison(void)
4774047745
else {
4774147746
marshallSendArguments(1);
4774247747
}
47743-
jumpNotSmallInts = (!(rcvrIsInt
47744-
&& (argIsIntConst))
47745-
? (argIsIntConst
47748+
jumpNotSmallInts = (rcvrIsInt
47749+
&& (argIsIntConst)
47750+
? ((AbstractInstruction *) null)
47751+
: (argIsIntConst
4774647752
? genJumpNotSmallInteger(ReceiverResultReg)
4774747753
: (rcvrIsInt
4774847754
? genJumpNotSmallInteger(Arg0Reg)
47749-
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg)))
47750-
: 0);
47755+
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg))));
4775147756
if (argIsIntConst) {
4775247757
/* begin CmpCq:R: */
4775347758
/* begin gen:quickConstant:operand: */

src/spur32.cog.lowcode/cogitIA32.c

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* Automatically generated by
2-
CCodeGenerator VMMaker.oscog-eem.3717 uuid: 22f7663b-7db7-47b4-b831-1548469ef709
2+
CCodeGenerator VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5
33
(* Cog-eem.507, Compiler-eem.527)
44
from
5-
StackToRegisterMappingCogit VMMaker.oscog-eem.3717 uuid: 22f7663b-7db7-47b4-b831-1548469ef709
5+
StackToRegisterMappingCogit VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5
66
*/
7-
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3717 uuid: 22f7663b-7db7-47b4-b831-1548469ef709 " __DATE__ ;
7+
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3719 uuid: f4458ee4-33dc-4863-bb54-db8205fa6cf5 " __DATE__ ;
88
char *__cogitBuildInfo = __buildInfo;
99

1010

@@ -977,7 +977,7 @@ static sqInt genPrimitiveStringAtPut(void);
977977
static NoDbgRegParms sqInt genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg);
978978
static NoDbgRegParms sqInt genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg);
979979
static NoDbgRegParms sqInt getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt inBytes, sqInt litCountReg, sqInt scratchReg);
980-
static NoDbgRegParms usqInt inlineCacheTagForInstance(sqInt oop);
980+
static NoDbgRegParms sqInt inlineCacheTagForInstance(sqInt oop);
981981
static NoDbgRegParms AbstractInstruction * jumpNotSmallIntegerUnsignedValueInRegister(sqInt reg);
982982
static NoDbgRegParms sqInt markAndTraceCacheTagLiteralinatpc(sqInt literal, CogMethod *cogMethodOrNil, usqInt address);
983983
static sqInt numSmallIntegerBits(void);
@@ -8212,7 +8212,7 @@ callCogCodePopReceiverAndClassRegs(void)
82128212
static NoDbgRegParms sqInt
82138213
ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver)
82148214
{
8215-
usqInt cacheTag;
8215+
sqInt cacheTag;
82168216
int errorSelectorOrNil;
82178217
sqInt methodOrSelectorIndex;
82188218
sqInt newTargetMethodOrNil;
@@ -8345,7 +8345,7 @@ ceMalloc(size_t size)
83458345
static NoDbgRegParms sqInt
83468346
ceSICMiss(sqInt receiver)
83478347
{
8348-
usqInt cacheTag;
8348+
sqInt cacheTag;
83498349
int errorSelectorOrNil;
83508350
sqInt extent;
83518351
usqInt innerReturn;
@@ -13879,7 +13879,7 @@ void
1387913879
linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver)
1388013880
{
1388113881
sqInt extent;
13882-
usqInt inlineCacheTag;
13882+
sqInt inlineCacheTag;
1388313883

1388413884
assert((theEntryOffset == cmEntryOffset)
1388513885
|| (theEntryOffset == cmNoCheckEntryOffset));
@@ -22751,7 +22751,7 @@ getLiteralCountOfplusOneinBytesintoscratch(sqInt methodReg, sqInt plusOne, sqInt
2275122751
c.f. getInlineCacheClassTagFrom:into: & inlineCacheTagForClass: */
2275222752

2275322753
/* CogObjectRepresentationFor32BitSpur>>#inlineCacheTagForInstance: */
22754-
static NoDbgRegParms usqInt
22754+
static NoDbgRegParms sqInt
2275522755
inlineCacheTagForInstance(sqInt oop)
2275622756
{
2275722757
return (isImmediate(oop)
@@ -25513,6 +25513,8 @@ genPrimitiveStringReplace(void)
2551325513
genoperandoperand(CmpRR, TempReg, arrayReg);
2551425514
jmpDestYoung = genConditionalBranchoperand(JumpBelow, ((sqInt)0));
2551525515
jmpAlreadyRemembered = genCheckRememberedBitOfscratch(arrayReg, TempReg);
25516+
25517+
/* saveAndRestoreLinkRegAround: */
2551625518
callStoreCheckTrampoline();
2551725519
jmpTarget(jmpDestYoung, genoperandoperand(Label, (labelCounter += 1), bytecodePC));
2551825520
jmpTarget(jmpAlreadyRemembered, genoperandoperand(Label, (labelCounter += 1), bytecodePC));
@@ -42795,14 +42797,14 @@ genSpecialSelectorArithmetic(void)
4279542797
else {
4279642798
marshallSendArguments(1);
4279742799
}
42798-
jumpNotSmallInts = (!(rcvrIsInt
42799-
&& (argIsInt))
42800-
? (argIsInt
42800+
jumpNotSmallInts = (rcvrIsInt
42801+
&& (argIsInt)
42802+
? ((AbstractInstruction *) null)
42803+
: (argIsInt
4280142804
? genJumpNotSmallInteger(ReceiverResultReg)
4280242805
: (rcvrIsInt
4280342806
? genJumpNotSmallInteger(Arg0Reg)
42804-
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg)))
42805-
: 0);
42807+
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg))));
4280642808
switch ((primDescriptor->opcode)) {
4280742809
case AddRR:
4280842810
if (argIsInt) {
@@ -42871,7 +42873,7 @@ genSpecialSelectorArithmetic(void)
4287142873
}
4287242874
jumpContinue = (jumpNotSmallInts
4287342875
? genoperand(Jump, ((sqInt)0))
42874-
: 0);
42876+
: ((AbstractInstruction *) null));
4287542877
break;
4287642878
case OrRR:
4287742879
if (argIsInt) {
@@ -42884,7 +42886,7 @@ genSpecialSelectorArithmetic(void)
4288442886
}
4288542887
jumpContinue = (jumpNotSmallInts
4288642888
? genoperand(Jump, ((sqInt)0))
42887-
: 0);
42889+
: ((AbstractInstruction *) null));
4288842890
break;
4288942891
default:
4289042892
error("Case not found and no otherwise clause");
@@ -43051,14 +43053,14 @@ genSpecialSelectorComparison(void)
4305143053
else {
4305243054
marshallSendArguments(1);
4305343055
}
43054-
jumpNotSmallInts = (!(rcvrIsInt
43055-
&& (argIsIntConst))
43056-
? (argIsIntConst
43056+
jumpNotSmallInts = (rcvrIsInt
43057+
&& (argIsIntConst)
43058+
? ((AbstractInstruction *) null)
43059+
: (argIsIntConst
4305743060
? genJumpNotSmallInteger(ReceiverResultReg)
4305843061
: (rcvrIsInt
4305943062
? genJumpNotSmallInteger(Arg0Reg)
43060-
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg)))
43061-
: 0);
43063+
: genJumpNotSmallIntegersInandscratch(ReceiverResultReg, Arg0Reg, TempReg))));
4306243064
if (argIsIntConst) {
4306343065
/* #CmpCq:R: #gen:quickConstant:operand: #checkQuickConstant:forInstruction: */
4306443066
genoperandoperand(CmpCqR, argInt, ReceiverResultReg);

0 commit comments

Comments
 (0)