Revision: 2939 Author: eliot Date: 2014-06-02 08:09:52 -0700 (Mon, 02 Jun 2014) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.747
In the indirection vector initialization peephole check that the store temp index matches the indirect temp store index and accept long store temp bytecodes.
Modified Paths: -------------- branches/Cog/nscogsrc/vm/cogit.c branches/Cog/nscogsrc/vm/cogit.h branches/Cog/nscogsrc/vm/cogmethod.h branches/Cog/nsspursrc/vm/cogit.c branches/Cog/nsspursrc/vm/cogit.h branches/Cog/nsspursrc/vm/cogmethod.h branches/Cog/sistasrc/vm/cogit.c branches/Cog/sistasrc/vm/cogit.h branches/Cog/sistasrc/vm/cogmethod.h branches/Cog/spursistasrc/vm/cogit.c branches/Cog/spursistasrc/vm/cogit.h branches/Cog/spursistasrc/vm/cogmethod.h branches/Cog/spursrc/vm/cogit.c branches/Cog/spursrc/vm/cogit.h branches/Cog/spursrc/vm/cogmethod.h branches/Cog/src/vm/cogit.c branches/Cog/src/vm/cogit.h branches/Cog/src/vm/cogmethod.h
Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nscogsrc/vm/cogit.c =================================================================== --- branches/Cog/nscogsrc/vm/cogit.c 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/nscogsrc/vm/cogit.c 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 from - StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -21593,15 +21593,18 @@ }
-/* Try and collapse +/* If the sequence of bytecodes is push: (Array new: 1) popIntoTemp: tempIndex pushConstant: const or pushTemp: n popIntoTemp: 0 inVectorAt: tempIndex - into - tempAt: tempIndex put: {const}. + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. One might think that we should look for a sequence of more than - one pushes and pops but this is extremely rare. */ + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */
static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) @@ -21609,8 +21612,10 @@ BytecodeDescriptor *pushArrayDesc; BytecodeDescriptor *pushValueDesc; sqInt reg; + sqInt remoteTempIndex; BytecodeDescriptor *storeArrayDesc; BytecodeDescriptor *storeValueDesc; + sqInt tempIndex;
if (slots != 1) { return 0; @@ -21618,17 +21623,25 @@ pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); - if (((storeArrayDesc->generator)) != genStoreAndPopTemporaryVariableBytecode) { - return 0; + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); - if ((((pushValueDesc->generator)) != genPushLiteralConstantBytecode) - && ((((pushValueDesc->generator)) != genPushQuickIntegerConstantBytecode) - && (((pushValueDesc->generator)) != genPushTemporaryVariableBytecode))) { + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { return 0; } storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); - if (((storeValueDesc->generator)) != genStoreAndPopRemoteTempLongBytecode) { + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { return 0; } genNewArrayOfSizeinitialized(1, 0);
Modified: branches/Cog/nscogsrc/vm/cogit.h =================================================================== --- branches/Cog/nscogsrc/vm/cogit.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/nscogsrc/vm/cogit.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
Modified: branches/Cog/nscogsrc/vm/cogmethod.h =================================================================== --- branches/Cog/nscogsrc/vm/cogmethod.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/nscogsrc/vm/cogmethod.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
typedef struct {
Modified: branches/Cog/nsspursrc/vm/cogit.c =================================================================== --- branches/Cog/nsspursrc/vm/cogit.c 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/nsspursrc/vm/cogit.c 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 from - StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -22958,15 +22958,18 @@ }
-/* Try and collapse +/* If the sequence of bytecodes is push: (Array new: 1) popIntoTemp: tempIndex pushConstant: const or pushTemp: n popIntoTemp: 0 inVectorAt: tempIndex - into - tempAt: tempIndex put: {const}. + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. One might think that we should look for a sequence of more than - one pushes and pops but this is extremely rare. */ + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */
static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) @@ -22974,8 +22977,10 @@ BytecodeDescriptor *pushArrayDesc; BytecodeDescriptor *pushValueDesc; sqInt reg; + sqInt remoteTempIndex; BytecodeDescriptor *storeArrayDesc; BytecodeDescriptor *storeValueDesc; + sqInt tempIndex;
if (slots != 1) { return 0; @@ -22983,17 +22988,25 @@ pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); - if (((storeArrayDesc->generator)) != genStoreAndPopTemporaryVariableBytecode) { - return 0; + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); - if ((((pushValueDesc->generator)) != genPushLiteralConstantBytecode) - && ((((pushValueDesc->generator)) != genPushQuickIntegerConstantBytecode) - && (((pushValueDesc->generator)) != genPushTemporaryVariableBytecode))) { + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { return 0; } storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); - if (((storeValueDesc->generator)) != genStoreAndPopRemoteTempLongBytecode) { + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { return 0; } genNewArrayOfSizeinitialized(1, 0);
Modified: branches/Cog/nsspursrc/vm/cogit.h =================================================================== --- branches/Cog/nsspursrc/vm/cogit.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/nsspursrc/vm/cogit.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
Modified: branches/Cog/nsspursrc/vm/cogmethod.h =================================================================== --- branches/Cog/nsspursrc/vm/cogmethod.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/nsspursrc/vm/cogmethod.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
typedef struct {
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h ___________________________________________________________________ Modified: checkindate - Sun Jun 1 18:10:48 PDT 2014 + Mon Jun 2 08:09:12 PDT 2014
Modified: branches/Cog/sistasrc/vm/cogit.c =================================================================== --- branches/Cog/sistasrc/vm/cogit.c 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/sistasrc/vm/cogit.c 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 from - SistaStackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + SistaStackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */ -static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 " __DATE__ ; +static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -670,6 +670,7 @@ static sqInt genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) NoDbgRegParms; static sqInt genLongJumpIfFalse(void); static sqInt genLongJumpIfTrue(void); +static sqInt genLongStoreAndPopTemporaryVariableBytecode(void); static sqInt genLongUnconditionalBackwardJump(void); static sqInt genLongUnconditionalForwardJump(void); static sqInt genMarshalledSendSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms; @@ -12710,7 +12711,16 @@ return genJumpIfto(trueObject(), target); }
+ +/* 237 11101101 i i i i i i i i Pop and Store Temporary Variable #iiiiiiii */ + static sqInt +genLongStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte1); +} + +static sqInt genLongUnconditionalBackwardJump(void) { sqInt distance; @@ -20847,15 +20857,18 @@ }
-/* Try and collapse +/* If the sequence of bytecodes is push: (Array new: 1) popIntoTemp: tempIndex pushConstant: const or pushTemp: n popIntoTemp: 0 inVectorAt: tempIndex - into - tempAt: tempIndex put: {const}. + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. One might think that we should look for a sequence of more than - one pushes and pops but this is extremely rare. */ + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */
static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) @@ -20863,8 +20876,10 @@ BytecodeDescriptor *pushArrayDesc; BytecodeDescriptor *pushValueDesc; sqInt reg; + sqInt remoteTempIndex; BytecodeDescriptor *storeArrayDesc; BytecodeDescriptor *storeValueDesc; + sqInt tempIndex;
if (slots != 1) { return 0; @@ -20872,17 +20887,25 @@ pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); - if (((storeArrayDesc->generator)) != genStoreAndPopTemporaryVariableBytecode) { - return 0; + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); - if ((((pushValueDesc->generator)) != genPushLiteralConstantBytecode) - && ((((pushValueDesc->generator)) != genPushQuickIntegerConstantBytecode) - && (((pushValueDesc->generator)) != genPushTemporaryVariableBytecode))) { + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { return 0; } storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); - if (((storeValueDesc->generator)) != genStoreAndPopRemoteTempLongBytecode) { + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { return 0; } genNewArrayOfSizeinitialized(1, 0);
Modified: branches/Cog/sistasrc/vm/cogit.h =================================================================== --- branches/Cog/sistasrc/vm/cogit.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/sistasrc/vm/cogit.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
Modified: branches/Cog/sistasrc/vm/cogmethod.h =================================================================== --- branches/Cog/sistasrc/vm/cogmethod.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/sistasrc/vm/cogmethod.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
typedef struct {
Modified: branches/Cog/spursistasrc/vm/cogit.c =================================================================== --- branches/Cog/spursistasrc/vm/cogit.c 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/spursistasrc/vm/cogit.c 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 from - SistaStackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + SistaStackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */ -static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 " __DATE__ ; +static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -674,6 +674,7 @@ static sqInt genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) NoDbgRegParms; static sqInt genLongJumpIfFalse(void); static sqInt genLongJumpIfTrue(void); +static sqInt genLongStoreAndPopTemporaryVariableBytecode(void); static sqInt genLongUnconditionalBackwardJump(void); static sqInt genLongUnconditionalForwardJump(void); static sqInt genMarshalledSendSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms; @@ -13773,7 +13774,16 @@ return genJumpIfto(trueObject(), target); }
+ +/* 237 11101101 i i i i i i i i Pop and Store Temporary Variable #iiiiiiii */ + static sqInt +genLongStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte1); +} + +static sqInt genLongUnconditionalBackwardJump(void) { sqInt distance; @@ -21814,15 +21824,18 @@ }
-/* Try and collapse +/* If the sequence of bytecodes is push: (Array new: 1) popIntoTemp: tempIndex pushConstant: const or pushTemp: n popIntoTemp: 0 inVectorAt: tempIndex - into - tempAt: tempIndex put: {const}. + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. One might think that we should look for a sequence of more than - one pushes and pops but this is extremely rare. */ + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */
static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) @@ -21830,8 +21843,10 @@ BytecodeDescriptor *pushArrayDesc; BytecodeDescriptor *pushValueDesc; sqInt reg; + sqInt remoteTempIndex; BytecodeDescriptor *storeArrayDesc; BytecodeDescriptor *storeValueDesc; + sqInt tempIndex;
if (slots != 1) { return 0; @@ -21839,17 +21854,25 @@ pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); - if (((storeArrayDesc->generator)) != genStoreAndPopTemporaryVariableBytecode) { - return 0; + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); - if ((((pushValueDesc->generator)) != genPushLiteralConstantBytecode) - && ((((pushValueDesc->generator)) != genPushQuickIntegerConstantBytecode) - && (((pushValueDesc->generator)) != genPushTemporaryVariableBytecode))) { + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { return 0; } storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); - if (((storeValueDesc->generator)) != genStoreAndPopRemoteTempLongBytecode) { + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { return 0; } genNewArrayOfSizeinitialized(1, 0);
Modified: branches/Cog/spursistasrc/vm/cogit.h =================================================================== --- branches/Cog/spursistasrc/vm/cogit.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/spursistasrc/vm/cogit.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
Modified: branches/Cog/spursistasrc/vm/cogmethod.h =================================================================== --- branches/Cog/spursistasrc/vm/cogmethod.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/spursistasrc/vm/cogmethod.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
typedef struct {
Modified: branches/Cog/spursrc/vm/cogit.c =================================================================== --- branches/Cog/spursrc/vm/cogit.c 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/spursrc/vm/cogit.c 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 from - StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -669,6 +669,7 @@ static sqInt genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) NoDbgRegParms; static sqInt genLongJumpIfFalse(void); static sqInt genLongJumpIfTrue(void); +static sqInt genLongStoreAndPopTemporaryVariableBytecode(void); static sqInt genLongUnconditionalBackwardJump(void); static sqInt genLongUnconditionalForwardJump(void); static sqInt genMarshalledSendSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms; @@ -13716,7 +13717,16 @@ return genJumpIfto(trueObject(), target); }
+ +/* 237 11101101 i i i i i i i i Pop and Store Temporary Variable #iiiiiiii */ + static sqInt +genLongStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte1); +} + +static sqInt genLongUnconditionalBackwardJump(void) { sqInt distance; @@ -21151,15 +21161,18 @@ }
-/* Try and collapse +/* If the sequence of bytecodes is push: (Array new: 1) popIntoTemp: tempIndex pushConstant: const or pushTemp: n popIntoTemp: 0 inVectorAt: tempIndex - into - tempAt: tempIndex put: {const}. + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. One might think that we should look for a sequence of more than - one pushes and pops but this is extremely rare. */ + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */
static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) @@ -21167,8 +21180,10 @@ BytecodeDescriptor *pushArrayDesc; BytecodeDescriptor *pushValueDesc; sqInt reg; + sqInt remoteTempIndex; BytecodeDescriptor *storeArrayDesc; BytecodeDescriptor *storeValueDesc; + sqInt tempIndex;
if (slots != 1) { return 0; @@ -21176,17 +21191,25 @@ pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); - if (((storeArrayDesc->generator)) != genStoreAndPopTemporaryVariableBytecode) { - return 0; + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); - if ((((pushValueDesc->generator)) != genPushLiteralConstantBytecode) - && ((((pushValueDesc->generator)) != genPushQuickIntegerConstantBytecode) - && (((pushValueDesc->generator)) != genPushTemporaryVariableBytecode))) { + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { return 0; } storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); - if (((storeValueDesc->generator)) != genStoreAndPopRemoteTempLongBytecode) { + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { return 0; } genNewArrayOfSizeinitialized(1, 0);
Modified: branches/Cog/spursrc/vm/cogit.h =================================================================== --- branches/Cog/spursrc/vm/cogit.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/spursrc/vm/cogit.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
Modified: branches/Cog/spursrc/vm/cogmethod.h =================================================================== --- branches/Cog/spursrc/vm/cogmethod.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/spursrc/vm/cogmethod.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
typedef struct {
Modified: branches/Cog/src/vm/cogit.c =================================================================== --- branches/Cog/src/vm/cogit.c 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/src/vm/cogit.c 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 from - StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -664,6 +664,7 @@ static sqInt genLoadStackPointers(AbstractInstruction * self_in_genLoadStackPointers) NoDbgRegParms; static sqInt genLongJumpIfFalse(void); static sqInt genLongJumpIfTrue(void); +static sqInt genLongStoreAndPopTemporaryVariableBytecode(void); static sqInt genLongUnconditionalBackwardJump(void); static sqInt genLongUnconditionalForwardJump(void); static sqInt genMarshalledSendSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms; @@ -12646,7 +12647,16 @@ return genJumpIfto(trueObject(), target); }
+ +/* 237 11101101 i i i i i i i i Pop and Store Temporary Variable #iiiiiiii */ + static sqInt +genLongStoreAndPopTemporaryVariableBytecode(void) +{ + return genStorePopTemporaryVariable(1, byte1); +} + +static sqInt genLongUnconditionalBackwardJump(void) { sqInt distance; @@ -20173,15 +20183,18 @@ }
-/* Try and collapse +/* If the sequence of bytecodes is push: (Array new: 1) popIntoTemp: tempIndex pushConstant: const or pushTemp: n popIntoTemp: 0 inVectorAt: tempIndex - into - tempAt: tempIndex put: {const}. + collapse this into + tempAt: tempIndex put: {const or temp} + and answer true, otherwise answer false. One might think that we should look for a sequence of more than - one pushes and pops but this is extremely rare. */ + one pushes and pops but this is extremely rare. + Exclude pushRcvr: n to avoid potential complications with context inst + vars. */
static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) @@ -20189,8 +20202,10 @@ BytecodeDescriptor *pushArrayDesc; BytecodeDescriptor *pushValueDesc; sqInt reg; + sqInt remoteTempIndex; BytecodeDescriptor *storeArrayDesc; BytecodeDescriptor *storeValueDesc; + sqInt tempIndex;
if (slots != 1) { return 0; @@ -20198,17 +20213,25 @@ pushArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC, methodObj))); assert(((pushArrayDesc->generator)) == genPushNewArrayBytecode); storeArrayDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj))); - if (((storeArrayDesc->generator)) != genStoreAndPopTemporaryVariableBytecode) { - return 0; + if (((storeArrayDesc->generator)) == genStoreAndPopTemporaryVariableBytecode) { + tempIndex = (fetchByteofObject(bytecodePC + ((pushArrayDesc->numBytes)), methodObj)) & 7; } + else { + if (!(((storeArrayDesc->generator)) == genLongStoreAndPopTemporaryVariableBytecode)) { + return 0; + } + tempIndex = fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + 1, methodObj); + } pushValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes)), methodObj))); - if ((((pushValueDesc->generator)) != genPushLiteralConstantBytecode) - && ((((pushValueDesc->generator)) != genPushQuickIntegerConstantBytecode) - && (((pushValueDesc->generator)) != genPushTemporaryVariableBytecode))) { + if (!((((pushValueDesc->generator)) == genPushLiteralConstantBytecode) + || ((((pushValueDesc->generator)) == genPushQuickIntegerConstantBytecode) + || (((pushValueDesc->generator)) == genPushTemporaryVariableBytecode)))) { return 0; } storeValueDesc = generatorAt(bytecodeSetOffset + (fetchByteofObject(((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes)), methodObj))); - if (((storeValueDesc->generator)) != genStoreAndPopRemoteTempLongBytecode) { + remoteTempIndex = fetchByteofObject((((bytecodePC + ((pushArrayDesc->numBytes))) + ((storeArrayDesc->numBytes))) + ((pushValueDesc->numBytes))) + 2, methodObj); + if (!((((storeValueDesc->generator)) == genStoreAndPopRemoteTempLongBytecode) + && (tempIndex == remoteTempIndex))) { return 0; } genNewArrayOfSizeinitialized(1, 0);
Modified: branches/Cog/src/vm/cogit.h =================================================================== --- branches/Cog/src/vm/cogit.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/src/vm/cogit.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
Modified: branches/Cog/src/vm/cogmethod.h =================================================================== --- branches/Cog/src/vm/cogmethod.h 2014-06-02 01:11:49 UTC (rev 2938) +++ branches/Cog/src/vm/cogmethod.h 2014-06-02 15:09:52 UTC (rev 2939) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.746 uuid: cc4961d3-e629-4e28-b308-88eab314a8c9 + CCodeGenerator VMMaker.oscog-eem.747 uuid: 488671d9-ac3b-4b24-8102-9a2623c7ce72 */
typedef struct {
vm-dev@lists.squeakfoundation.org