Revision: 3365 Author: eliot Date: 2015-06-01 17:20:23 -0700 (Mon, 01 Jun 2015) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.1332
Newspeak Cogit: Fix the regression in implicit receiver sends caused by VMMaker.oscog-eem.1317 (fix to performance regression caused by using XCHG on x86).
The implicit receiver cache uses SendNumArgsReg to refer to the cache object. Hence we must use TempReg for genPushRegisterArgsForNumArgs: in this case. So refactor to genPushRegisterArgsForNumArgs:scratchReg:, passing either TempReg or SendNumArgsReg as approprate.
Modified Paths: -------------- branches/Cog/nsspursrc/vm/cogit.h branches/Cog/nsspursrc/vm/cogitARMv5.c branches/Cog/nsspursrc/vm/cogitIA32.c branches/Cog/platforms/Mac OS/vm/sqMacMain.c branches/Cog/platforms/unix/vm/sqUnixMain.c branches/Cog/spursistasrc/vm/cogit.h branches/Cog/spursistasrc/vm/cogitARMv5.c branches/Cog/spursistasrc/vm/cogitIA32.c branches/Cog/spursrc/vm/cogit.h branches/Cog/spursrc/vm/cogitARMv5.c branches/Cog/spursrc/vm/cogitIA32.c branches/Cog/src/vm/cogit.h branches/Cog/src/vm/cogitARMv5.c branches/Cog/src/vm/cogitIA32.c
Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nsspursrc/vm/cogit.h =================================================================== --- branches/Cog/nsspursrc/vm/cogit.h 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/nsspursrc/vm/cogit.h 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */
Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c =================================================================== --- branches/Cog/nsspursrc/vm/cogitARMv5.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/nsspursrc/vm/cogitARMv5.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -462,7 +462,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static AbstractInstruction * genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static AbstractInstruction * genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -6263,9 +6263,9 @@ NOTA BENE: we do NOT push the return address here, which means it must be dealt with later. */
- /* CogARMCompiler>>#genPushRegisterArgsForNumArgs: */ + /* CogARMCompiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) { if (numArgs <= 2) { assert((numRegArgs()) <= 2); @@ -6280,7 +6280,7 @@ } } } - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
@@ -9912,7 +9912,7 @@ { sqInt classIndex; sqInt i; - sqInt pc; + usqInt pc;
pc = (((((usqInt)cPIC)) + firstCPICCaseOffset) + cPICCaseSize) - (jumpLongConditionalByteSize(backEnd)); for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { @@ -11094,7 +11094,8 @@ genoperand(JumpR, TempReg); jmpTarget(jumpMiss, gLabel()); genEnsureObjInRegNotForwardedscratchRegupdatingMwr(ReceiverResultReg, TempReg, FoxMFReceiver, FPReg); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, TempReg); + return genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 1, ReceiverResultReg, 1); }
@@ -21816,7 +21817,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -22588,7 +22589,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -23254,7 +23255,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 2 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -24268,7 +24269,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 2))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -24415,7 +24416,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 3, regOrConst0, regOrConst1, regOrConst2, null, 0, 1, null, 1); return startAddress; } @@ -24433,7 +24434,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
Modified: branches/Cog/nsspursrc/vm/cogitIA32.c =================================================================== --- branches/Cog/nsspursrc/vm/cogitIA32.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/nsspursrc/vm/cogitIA32.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -439,7 +439,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static sqInt genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static sqInt genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -5458,7 +5458,7 @@
/* Ensure that the register args are pushed before the retpc for arity <= self numRegArgs. This - won't be as clumsy on a RISC. But putting the receiver and args above the + isn't as clumsy on a RISC. But putting the receiver and args above the return address means the CoInterpreter has a single machine-code frame format which saves us a lot of work. @@ -5470,9 +5470,9 @@ use SendNumArgsReg because it is only live in sends of arity >= (NumSendTrampolines - 1). */
- /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs: */ + /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) { assert((numRegArgs()) < (NumSendTrampolines - 1)); if (numArgs <= 2) { @@ -5483,7 +5483,7 @@ but XCHG is slow. */
/* begin MoveMw:r:R: */ - genoperandoperandoperand(MoveMwrR, 0, SPReg, SendNumArgsReg); + genoperandoperandoperand(MoveMwrR, 0, SPReg, scratchReg); /* begin MoveR:Mw:r: */ genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg); if (numArgs > 0) { @@ -5495,10 +5495,10 @@ } } /* begin PushR: */ - genoperand(PushR, SendNumArgsReg); + genoperand(PushR, scratchReg);
} - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
/* CogIA32Compiler>>#genRemoveNArgsFromStack: */ @@ -9865,7 +9865,8 @@ genoperand(JumpR, TempReg); jmpTarget(jumpMiss, gLabel()); genEnsureObjInRegNotForwardedscratchRegupdatingMwr(ReceiverResultReg, TempReg, FoxMFReceiver, FPReg); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, TempReg); + return genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 1, ReceiverResultReg, 1); }
@@ -20585,7 +20586,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -21359,7 +21360,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -22022,7 +22023,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 2 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -23036,7 +23037,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 2))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -23183,7 +23184,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 3, regOrConst0, regOrConst1, regOrConst2, null, 0, 1, null, 1); return startAddress; } @@ -23201,7 +23202,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h ___________________________________________________________________ Modified: checkindate - Mon Jun 1 11:53:22 PDT 2015 + Mon Jun 1 17:18:50 PDT 2015
Modified: branches/Cog/platforms/Mac OS/vm/sqMacMain.c =================================================================== --- branches/Cog/platforms/Mac OS/vm/sqMacMain.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/platforms/Mac OS/vm/sqMacMain.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -291,7 +291,7 @@
printf("blocking e.g. to allow attaching debugger\n"); printf("pid: %d pwd: %s vm:%s\n", - (int)getpid(), argVec[0], getcwd(pwd,PATH_MAX+1)); + (int)getpid(), getcwd(pwd,PATH_MAX+1), argVec[0]); while (1) { while_away_the_hours.tv_sec = 3600; nanosleep(&while_away_the_hours, 0);
Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c =================================================================== --- branches/Cog/platforms/unix/vm/sqUnixMain.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/platforms/unix/vm/sqUnixMain.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -939,7 +939,7 @@
printf("blocking e.g. to allow attaching debugger\n"); printf("pid: %d pwd: %s vm:%s\n", - (int)getpid(), argVec[0], getcwd(pwd,MAXPATHLEN+1)); + (int)getpid(), getcwd(pwd,MAXPATHLEN+1), argVec[0]); while (1) { while_away_the_hours.tv_sec = 3600; nanosleep(&while_away_the_hours, 0);
Modified: branches/Cog/spursistasrc/vm/cogit.h =================================================================== --- branches/Cog/spursistasrc/vm/cogit.h 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/spursistasrc/vm/cogit.h 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */
Modified: branches/Cog/spursistasrc/vm/cogitARMv5.c =================================================================== --- branches/Cog/spursistasrc/vm/cogitARMv5.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/spursistasrc/vm/cogitARMv5.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -461,7 +461,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static AbstractInstruction * genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static AbstractInstruction * genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -6264,9 +6264,9 @@ NOTA BENE: we do NOT push the return address here, which means it must be dealt with later. */
- /* CogARMCompiler>>#genPushRegisterArgsForNumArgs: */ + /* CogARMCompiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) { if (numArgs <= 2) { assert((numRegArgs()) <= 2); @@ -6281,7 +6281,7 @@ } } } - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
@@ -9822,7 +9822,7 @@ { sqInt classIndex; sqInt i; - sqInt pc; + usqInt pc;
pc = (((((usqInt)cPIC)) + firstCPICCaseOffset) + cPICCaseSize) - (jumpLongConditionalByteSize(backEnd)); for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) { @@ -22828,7 +22828,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -23600,7 +23600,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -24152,7 +24152,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 2 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -25195,7 +25195,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 2))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -25297,7 +25297,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
Modified: branches/Cog/spursistasrc/vm/cogitIA32.c =================================================================== --- branches/Cog/spursistasrc/vm/cogitIA32.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/spursistasrc/vm/cogitIA32.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -438,7 +438,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static sqInt genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static sqInt genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -5458,7 +5458,7 @@
/* Ensure that the register args are pushed before the retpc for arity <= self numRegArgs. This - won't be as clumsy on a RISC. But putting the receiver and args above the + isn't as clumsy on a RISC. But putting the receiver and args above the return address means the CoInterpreter has a single machine-code frame format which saves us a lot of work. @@ -5470,9 +5470,9 @@ use SendNumArgsReg because it is only live in sends of arity >= (NumSendTrampolines - 1). */
- /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs: */ + /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) { assert((numRegArgs()) < (NumSendTrampolines - 1)); if (numArgs <= 2) { @@ -5483,7 +5483,7 @@ but XCHG is slow. */
/* begin MoveMw:r:R: */ - genoperandoperandoperand(MoveMwrR, 0, SPReg, SendNumArgsReg); + genoperandoperandoperand(MoveMwrR, 0, SPReg, scratchReg); /* begin MoveR:Mw:r: */ genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg); if (numArgs > 0) { @@ -5495,10 +5495,10 @@ } } /* begin PushR: */ - genoperand(PushR, SendNumArgsReg); + genoperand(PushR, scratchReg);
} - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
/* CogIA32Compiler>>#genRemoveNArgsFromStack: */ @@ -21583,7 +21583,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -22357,7 +22357,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -22906,7 +22906,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 2 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -23949,7 +23949,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 2))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -24051,7 +24051,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
Modified: branches/Cog/spursrc/vm/cogit.h =================================================================== --- branches/Cog/spursrc/vm/cogit.h 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/spursrc/vm/cogit.h 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */
Modified: branches/Cog/spursrc/vm/cogitARMv5.c =================================================================== --- branches/Cog/spursrc/vm/cogitARMv5.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/spursrc/vm/cogitARMv5.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -458,7 +458,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static AbstractInstruction * genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static AbstractInstruction * genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -5939,9 +5939,9 @@ NOTA BENE: we do NOT push the return address here, which means it must be dealt with later. */
- /* CogARMCompiler>>#genPushRegisterArgsForNumArgs: */ + /* CogARMCompiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) { if (numArgs <= 2) { assert((numRegArgs()) <= 2); @@ -5956,7 +5956,7 @@ } } } - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
@@ -19661,7 +19661,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -20433,7 +20433,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -21010,7 +21010,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 2 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -21985,7 +21985,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 2))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -22076,7 +22076,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
Modified: branches/Cog/spursrc/vm/cogitIA32.c =================================================================== --- branches/Cog/spursrc/vm/cogitIA32.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/spursrc/vm/cogitIA32.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -435,7 +435,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static sqInt genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static sqInt genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -5133,7 +5133,7 @@
/* Ensure that the register args are pushed before the retpc for arity <= self numRegArgs. This - won't be as clumsy on a RISC. But putting the receiver and args above the + isn't as clumsy on a RISC. But putting the receiver and args above the return address means the CoInterpreter has a single machine-code frame format which saves us a lot of work. @@ -5145,9 +5145,9 @@ use SendNumArgsReg because it is only live in sends of arity >= (NumSendTrampolines - 1). */
- /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs: */ + /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) { assert((numRegArgs()) < (NumSendTrampolines - 1)); if (numArgs <= 2) { @@ -5158,7 +5158,7 @@ but XCHG is slow. */
/* begin MoveMw:r:R: */ - genoperandoperandoperand(MoveMwrR, 0, SPReg, SendNumArgsReg); + genoperandoperandoperand(MoveMwrR, 0, SPReg, scratchReg); /* begin MoveR:Mw:r: */ genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg); if (numArgs > 0) { @@ -5170,10 +5170,10 @@ } } /* begin PushR: */ - genoperand(PushR, SendNumArgsReg); + genoperand(PushR, scratchReg);
} - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
/* CogIA32Compiler>>#genRemoveNArgsFromStack: */ @@ -18418,7 +18418,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -19192,7 +19192,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -19766,7 +19766,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 2 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -20741,7 +20741,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 2))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -20832,7 +20832,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
Modified: branches/Cog/src/vm/cogit.h =================================================================== --- branches/Cog/src/vm/cogit.h 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/src/vm/cogit.h 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */
Modified: branches/Cog/src/vm/cogitARMv5.c =================================================================== --- branches/Cog/src/vm/cogitARMv5.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/src/vm/cogitARMv5.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -463,7 +463,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static AbstractInstruction * genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static AbstractInstruction * genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -5903,9 +5903,9 @@ NOTA BENE: we do NOT push the return address here, which means it must be dealt with later. */
- /* CogARMCompiler>>#genPushRegisterArgsForNumArgs: */ + /* CogARMCompiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt ignored) { if (numArgs <= 1) { assert((numRegArgs()) <= 2); @@ -5920,7 +5920,7 @@ } } } - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
@@ -17930,7 +17930,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -18230,7 +18230,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -18786,7 +18786,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 1 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -19763,7 +19763,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 1))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -19854,7 +19854,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
Modified: branches/Cog/src/vm/cogitIA32.c =================================================================== --- branches/Cog/src/vm/cogitIA32.c 2015-06-01 18:53:32 UTC (rev 3364) +++ branches/Cog/src/vm/cogitIA32.c 2015-06-02 00:20:23 UTC (rev 3365) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + CCodeGenerator VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e + StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1331 uuid: 2da6f9fc-7921-4c8b-8c78-dd47f9ddd76e " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1332 uuid: 528336b3-25ab-41f7-b788-2b9155e5d980 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -439,7 +439,7 @@ static sqInt genPassConstasArgument(AbstractInstruction * self_in_genPassConstasArgument, sqInt constant, sqInt zeroRelativeArgIndex) NoDbgRegParms; static sqInt genPassRegasArgument(AbstractInstruction * self_in_genPassRegasArgument, sqInt abstractRegister, sqInt zeroRelativeArgIndex) NoDbgRegParms; static AbstractInstruction * genPushRegisterArgsForAbortMissNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForAbortMissNumArgs, sqInt numArgs) NoDbgRegParms; -static AbstractInstruction * genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) NoDbgRegParms; +static AbstractInstruction * genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) NoDbgRegParms; static sqInt genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n) NoDbgRegParms; static sqInt genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs) NoDbgRegParms; static sqInt genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg) NoDbgRegParms; @@ -5096,7 +5096,7 @@
/* Ensure that the register args are pushed before the retpc for arity <= self numRegArgs. This - won't be as clumsy on a RISC. But putting the receiver and args above the + isn't as clumsy on a RISC. But putting the receiver and args above the return address means the CoInterpreter has a single machine-code frame format which saves us a lot of work. @@ -5108,9 +5108,9 @@ use SendNumArgsReg because it is only live in sends of arity >= (NumSendTrampolines - 1). */
- /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs: */ + /* CogIA32Compiler>>#genPushRegisterArgsForNumArgs:scratchReg: */ static AbstractInstruction * -genPushRegisterArgsForNumArgs(AbstractInstruction * self_in_genPushRegisterArgsForNumArgs, sqInt numArgs) +genPushRegisterArgsForNumArgsscratchReg(AbstractInstruction * self_in_genPushRegisterArgsForNumArgsscratchReg, sqInt numArgs, sqInt scratchReg) { assert((numRegArgs()) < (NumSendTrampolines - 1)); if (numArgs <= 1) { @@ -5121,7 +5121,7 @@ but XCHG is slow. */
/* begin MoveMw:r:R: */ - genoperandoperandoperand(MoveMwrR, 0, SPReg, SendNumArgsReg); + genoperandoperandoperand(MoveMwrR, 0, SPReg, scratchReg); /* begin MoveR:Mw:r: */ genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg); if (numArgs > 0) { @@ -5133,10 +5133,10 @@ } } /* begin PushR: */ - genoperand(PushR, SendNumArgsReg); + genoperand(PushR, scratchReg);
} - return self_in_genPushRegisterArgsForNumArgs; + return self_in_genPushRegisterArgsForNumArgsscratchReg; }
/* CogIA32Compiler>>#genRemoveNArgsFromStack: */ @@ -16701,7 +16701,7 @@ /* begin JumpZero: */ genoperand(JumpZero, ((sqInt)itsAHit)); jmpTarget(jumpSelectorMiss, gLabel()); - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genSmalltalkToCStackSwitch(1); addDependent(methodLabel, annotateAbsolutePCRef(gMoveCwR(((sqInt)methodLabel), SendNumArgsReg))); compileCallFornumArgsargargargargresultRegsaveRegs(ceSendFromInLineCacheMiss, 1, SendNumArgsReg, null, null, null, null, 0); @@ -17003,7 +17003,7 @@ if (!(preOpCheckOrNil == null)) { jmpTarget(jumpFailCheck, getJmpTarget(jumpFailClass)); } - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); /* begin Jump: */ jumpFailClass = genoperand(Jump, ((sqInt)0)); jmpTarget(jumpImmediate, gLabel()); @@ -17556,7 +17556,7 @@ /* N.B. a closed PIC jumps to the miss routine, not calls it, so there is only one retpc on the stack. */
opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceCPICMissreceiver, trampolineNamenumArgs("cePICMiss", (numArgs <= 1 ? numArgs : -1)), 2, ClassReg, ReceiverResultReg, null, null, 0, 1, null, 1); @@ -18533,7 +18533,7 @@ { if (!(regArgsHaveBeenPushed || (methodOrBlockNumArgs > 1))) { - genPushRegisterArgsForNumArgs(backEnd, methodOrBlockNumArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, methodOrBlockNumArgs, SendNumArgsReg); regArgsHaveBeenPushed = 1; } } @@ -18624,7 +18624,7 @@
startAddress = methodZoneBase; opcodeIndex = 0; - genPushRegisterArgsForNumArgs(backEnd, numArgs); + genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg); genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 4, regOrConst0, regOrConst1, regOrConst2, regOrConst3, 0, 1, null, 1); return startAddress; }
vm-dev@lists.squeakfoundation.org