Revision: 3512 Author: eliot Date: 2015-12-02 12:56:33 -0800 (Wed, 02 Dec 2015) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.1543
Cogit: Fix the regression caused by the incorrect fix for skipping the primitive and primitive error code bytecodes. Handle the skip in compileMethodBody. Cache methodHeader in an inst var; it's used enough.
Modified Paths: -------------- branches/Cog/nsspursrc/vm/cogit.h branches/Cog/nsspursrc/vm/cogitARMv5.c branches/Cog/nsspursrc/vm/cogitIA32.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
Added Paths: ----------- branches/Cog/src/plugins/Squeak3D/ branches/Cog/src/plugins/Squeak3D/Squeak3D.c
Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nsspursrc/vm/cogit.h =================================================================== --- branches/Cog/nsspursrc/vm/cogit.h 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/nsspursrc/vm/cogit.h 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */
Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c =================================================================== --- branches/Cog/nsspursrc/vm/cogitARMv5.c 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/nsspursrc/vm/cogitARMv5.c 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + StackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -581,7 +581,7 @@ static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); -static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt methodHeader); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); static AbstractInstruction * NoDbgRegParms CallNewspeakSend(sqInt callTarget); @@ -965,7 +965,6 @@ static sqInt NoDbgRegParms mustDumpLiterals(sqInt currentOpcodeIndex); static sqInt resetForBlockCompile(void); static sqInt saveForBlockCompile(void); -static sqInt checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void); static sqInt compileBlockDispatch(void); static sqInt compileFallbackToInterpreterPrimitive(void); static void compileGetErrorCode(void); @@ -1066,7 +1065,7 @@ static sqInt genStoreAndPopTemporaryVariableBytecode(void); static sqInt genStoreRemoteTempLongBytecode(void); static void maybeCompileAllocFillerCheck(void); -static sqInt NoDbgRegParms methodUsesPrimitiveErrorCode(sqInt methodHeader); +static sqInt methodUsesPrimitiveErrorCode(void); static sqInt numSpecialSelectors(void); extern void recordCallOffsetIn(CogMethod *cogMethod); static sqInt NoDbgRegParms registerisInMask(sqInt reg, sqInt mask); @@ -1862,6 +1861,7 @@ static sqInt methodAbortTrampolines[4]; static sqInt methodBytesFreedSinceLastCompaction; static sqInt methodCount; +static sqInt methodHeader; static AbstractInstruction * const methodLabel = &aMethodLabel; static sqInt methodObj; static sqInt methodOrBlockNumArgs; @@ -7877,9 +7877,9 @@
/* Cogit>>#blockCreationBytecodeSizeForHeader: */ static sqInt NoDbgRegParms -blockCreationBytecodeSizeForHeader(sqInt methodHeader) +blockCreationBytecodeSizeForHeader(sqInt aMethodHeader) { - return (headerIndicatesAlternateBytecodeSet(methodHeader) + return (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? AltBlockCreationBytecodeSize : BlockCreationBytecodeSize); } @@ -7931,6 +7931,8 @@ sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -7946,8 +7948,6 @@ sqInt map; sqInt mapByte; usqInt mcpc1; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -7969,8 +7969,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -7991,8 +7991,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -9361,6 +9361,7 @@ } ensureNoForwardedLiteralsIn(aMethodObj); methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); cogMethod = compileCogMethod(aSelectorOop); if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { @@ -9702,10 +9703,15 @@ static sqInt compileMethodBody(void) { + sqInt deltaForPrimErrorCode; + if (endPC < initialPC) { return 0; } - return compileAbstractInstructionsFromthrough(initialPC, endPC); + deltaForPrimErrorCode = (methodUsesPrimitiveErrorCode() + ? (sizeOfCallPrimitiveBytecode(methodHeader)) + (sizeOfLongStoreTempBytecode(methodHeader)) + : 0); + return compileAbstractInstructionsFromthrough(initialPC + deltaForPrimErrorCode, endPC); }
@@ -10304,8 +10310,8 @@ static CogMethod * NoDbgRegParms fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) { - sqInt methodHeader; CogMethod *originalMethod; + sqInt rawHeader;
(method->cmType = CMMethod); (method->objectHeader = nullHeaderForMachineCodeMethod()); @@ -10315,11 +10321,11 @@ /* If the method has already been cogged (e.g. Newspeak accessors) then leave the original method attached to its cog method, but get the right header. */
- methodHeader = rawHeaderOf(methodObj); - if (isCogMethodReference(methodHeader)) { - originalMethod = ((CogMethod *) methodHeader); + rawHeader = rawHeaderOf(methodObj); + if (isCogMethodReference(rawHeader)) { + originalMethod = ((CogMethod *) rawHeader); assert(((originalMethod->blockSize)) == size); - methodHeader = (originalMethod->methodHeader); + assert(methodHeader == ((originalMethod->methodHeader))); addToUnpairedMethodList(method);
} @@ -11040,12 +11046,12 @@ generateMapAtstart(sqInt addressOrNull, sqInt startAddress) { unsigned char annotation; - usqInt delta; + sqInt delta; sqInt i; AbstractInstruction *instruction; sqInt length; - usqInt location; - usqInt mapEntry; + sqInt location; + sqInt mapEntry; sqInt maxDelta; usqInt mcpc;
@@ -13417,6 +13423,8 @@ usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc1; @@ -13432,8 +13440,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -13455,8 +13461,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -13477,8 +13483,8 @@ aMethodObj = (homeMethod->methodObject); bcpc1 = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; @@ -21041,30 +21047,6 @@ }
-/* Answer if methodObj contains a quick primitive. In addition, if it has a - primitive that uses an error code, update the initialPC to skip this code. - The code to - process the error code is generated in compileFrameBuild. For fixups to - work correctly, the initialPC must be updated before scanning for backward - branches. */ - - /* SimpleStackBasedCogit>>#checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed */ -static sqInt -checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void) -{ - sqInt methodHeader; - - if (primitiveIndex == 0) { - return 0; - } - methodHeader = methodHeaderOf(methodObj); - if (methodUsesPrimitiveErrorCode(methodHeader)) { - initialPC = (initialPC + (sizeOfCallPrimitiveBytecode(methodHeader))) + (sizeOfLongStoreTempBytecode(methodHeader)); - } - return isQuickPrimitiveIndex(primitiveIndex); -} - - /* Compile the jump instruction(s) at the end of the method that dispatch to each block body. */ @@ -22980,9 +22962,9 @@ code. */
- /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode: */ -static sqInt NoDbgRegParms -methodUsesPrimitiveErrorCode(sqInt methodHeader) + /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode */ +static sqInt +methodUsesPrimitiveErrorCode(void) { return ((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj))); @@ -23920,7 +23902,6 @@ sqInt i; sqInt iLimiT; AbstractInstruction *jumpSkip; - sqInt methodHeader;
if (!needsFrame) { initSimStackForFramelessMethod(initialPC); @@ -23930,7 +23911,6 @@ if (!needsFrame) { return 0; } - methodHeader = methodHeaderOf(methodObj); /* begin PushR: */ genoperand(PushR, LinkReg);
@@ -23957,7 +23937,7 @@ /* begin PushR: */ genoperand(PushR, SendNumArgsReg); } - if (methodUsesPrimitiveErrorCode(methodHeader)) { + if (methodUsesPrimitiveErrorCode()) { compileGetErrorCode(); } /* begin MoveAw:R: */ @@ -28586,7 +28566,8 @@
# endif /* NewspeakVM */
- if (checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed()) { + if ((primitiveIndex > 0) + && (isQuickPrimitiveIndex(primitiveIndex))) { return 0; } pc = (latestContinuation = initialPC);
Modified: branches/Cog/nsspursrc/vm/cogitIA32.c =================================================================== --- branches/Cog/nsspursrc/vm/cogitIA32.c 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/nsspursrc/vm/cogitIA32.c 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + StackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -519,7 +519,7 @@ static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); -static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt methodHeader); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); static AbstractInstruction * NoDbgRegParms CallNewspeakSend(sqInt callTarget); @@ -875,7 +875,6 @@ static sqInt NoDbgRegParms registerOrNil(CogSimStackEntry * self_in_registerOrNil); static CogSimStackEntry * NoDbgRegParms storeToReg(CogSimStackEntry * self_in_storeToReg, sqInt reg); static sqInt endSizeOffset(void); -static sqInt checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void); static sqInt compileBlockDispatch(void); static sqInt compileFallbackToInterpreterPrimitive(void); static void compileGetErrorCode(void); @@ -976,7 +975,7 @@ static sqInt genStoreAndPopTemporaryVariableBytecode(void); static sqInt genStoreRemoteTempLongBytecode(void); static void maybeCompileAllocFillerCheck(void); -static sqInt NoDbgRegParms methodUsesPrimitiveErrorCode(sqInt methodHeader); +static sqInt methodUsesPrimitiveErrorCode(void); static sqInt numSpecialSelectors(void); extern void recordCallOffsetIn(CogMethod *cogMethod); static sqInt NoDbgRegParms registerisInMask(sqInt reg, sqInt mask); @@ -1768,6 +1767,7 @@ static sqInt methodAbortTrampolines[4]; static sqInt methodBytesFreedSinceLastCompaction; static sqInt methodCount; +static sqInt methodHeader; static AbstractInstruction * const methodLabel = &aMethodLabel; static sqInt methodObj; static sqInt methodOrBlockNumArgs; @@ -6979,9 +6979,9 @@
/* Cogit>>#blockCreationBytecodeSizeForHeader: */ static sqInt NoDbgRegParms -blockCreationBytecodeSizeForHeader(sqInt methodHeader) +blockCreationBytecodeSizeForHeader(sqInt aMethodHeader) { - return (headerIndicatesAlternateBytecodeSet(methodHeader) + return (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? AltBlockCreationBytecodeSize : BlockCreationBytecodeSize); } @@ -7033,6 +7033,8 @@ sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -7048,8 +7050,6 @@ sqInt map; sqInt mapByte; usqInt mcpc1; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -7071,8 +7071,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -7093,8 +7093,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -8468,6 +8468,7 @@ } ensureNoForwardedLiteralsIn(aMethodObj); methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); cogMethod = compileCogMethod(aSelectorOop); if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { @@ -8813,10 +8814,15 @@ static sqInt compileMethodBody(void) { + sqInt deltaForPrimErrorCode; + if (endPC < initialPC) { return 0; } - return compileAbstractInstructionsFromthrough(initialPC, endPC); + deltaForPrimErrorCode = (methodUsesPrimitiveErrorCode() + ? (sizeOfCallPrimitiveBytecode(methodHeader)) + (sizeOfLongStoreTempBytecode(methodHeader)) + : 0); + return compileAbstractInstructionsFromthrough(initialPC + deltaForPrimErrorCode, endPC); }
@@ -9401,8 +9407,8 @@ static CogMethod * NoDbgRegParms fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) { - sqInt methodHeader; CogMethod *originalMethod; + sqInt rawHeader;
(method->cmType = CMMethod); (method->objectHeader = nullHeaderForMachineCodeMethod()); @@ -9412,11 +9418,11 @@ /* If the method has already been cogged (e.g. Newspeak accessors) then leave the original method attached to its cog method, but get the right header. */
- methodHeader = rawHeaderOf(methodObj); - if (isCogMethodReference(methodHeader)) { - originalMethod = ((CogMethod *) methodHeader); + rawHeader = rawHeaderOf(methodObj); + if (isCogMethodReference(rawHeader)) { + originalMethod = ((CogMethod *) rawHeader); assert(((originalMethod->blockSize)) == size); - methodHeader = (originalMethod->methodHeader); + assert(methodHeader == ((originalMethod->methodHeader))); addToUnpairedMethodList(method);
} @@ -12542,6 +12548,8 @@ usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc1; @@ -12557,8 +12565,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -12580,8 +12586,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -12602,8 +12608,8 @@ aMethodObj = (homeMethod->methodObject); bcpc1 = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; @@ -20221,30 +20227,6 @@ }
-/* Answer if methodObj contains a quick primitive. In addition, if it has a - primitive that uses an error code, update the initialPC to skip this code. - The code to - process the error code is generated in compileFrameBuild. For fixups to - work correctly, the initialPC must be updated before scanning for backward - branches. */ - - /* SimpleStackBasedCogit>>#checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed */ -static sqInt -checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void) -{ - sqInt methodHeader; - - if (primitiveIndex == 0) { - return 0; - } - methodHeader = methodHeaderOf(methodObj); - if (methodUsesPrimitiveErrorCode(methodHeader)) { - initialPC = (initialPC + (sizeOfCallPrimitiveBytecode(methodHeader))) + (sizeOfLongStoreTempBytecode(methodHeader)); - } - return isQuickPrimitiveIndex(primitiveIndex); -} - - /* Compile the jump instruction(s) at the end of the method that dispatch to each block body. */ @@ -22449,9 +22431,9 @@ code. */
- /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode: */ -static sqInt NoDbgRegParms -methodUsesPrimitiveErrorCode(sqInt methodHeader) + /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode */ +static sqInt +methodUsesPrimitiveErrorCode(void) { return ((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj))); @@ -23417,7 +23399,6 @@ sqInt i; sqInt iLimiT; AbstractInstruction *jumpSkip; - sqInt methodHeader;
if (!needsFrame) { initSimStackForFramelessMethod(initialPC); @@ -23427,7 +23408,6 @@ if (!needsFrame) { return 0; } - methodHeader = methodHeaderOf(methodObj); /* begin PushR: */ genoperand(PushR, FPReg); @@ -23454,7 +23434,7 @@ /* begin PushR: */ genoperand(PushR, SendNumArgsReg); } - if (methodUsesPrimitiveErrorCode(methodHeader)) { + if (methodUsesPrimitiveErrorCode()) { compileGetErrorCode(); } /* begin MoveAw:R: */ @@ -28385,7 +28365,8 @@
# endif /* NewspeakVM */
- if (checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed()) { + if ((primitiveIndex > 0) + && (isQuickPrimitiveIndex(primitiveIndex))) { return 0; } pc = (latestContinuation = initialPC);
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h ___________________________________________________________________ Modified: checkindate - Wed Dec 2 10:25:49 PST 2015 + Wed Dec 2 12:52:07 PST 2015
Modified: branches/Cog/spursistasrc/vm/cogit.h =================================================================== --- branches/Cog/spursistasrc/vm/cogit.h 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/spursistasrc/vm/cogit.h 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */
Modified: branches/Cog/spursistasrc/vm/cogitARMv5.c =================================================================== --- branches/Cog/spursistasrc/vm/cogitARMv5.c 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/spursistasrc/vm/cogitARMv5.c 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 from - SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */ -static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d " __DATE__ ; +static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -576,7 +576,7 @@ static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); -static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt methodHeader); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); static AbstractInstruction * NoDbgRegParms CallRT(sqInt callTarget); @@ -957,7 +957,6 @@ static sqInt NoDbgRegParms literalInstructionInRange(AbstractInstruction *litInst); static AbstractInstruction * NoDbgRegParms locateLiteral(sqInt aLiteral); static sqInt NoDbgRegParms mustDumpLiterals(sqInt currentOpcodeIndex); -static sqInt checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void); static sqInt compileBlockDispatch(void); static sqInt compileFallbackToInterpreterPrimitive(void); static void compileGetErrorCode(void); @@ -1049,7 +1048,7 @@ static sqInt genStoreAndPopTemporaryVariableBytecode(void); static sqInt genStoreRemoteTempLongBytecode(void); static void maybeCompileAllocFillerCheck(void); -static sqInt NoDbgRegParms methodUsesPrimitiveErrorCode(sqInt methodHeader); +static sqInt methodUsesPrimitiveErrorCode(void); static sqInt numSpecialSelectors(void); extern void recordCallOffsetIn(CogMethod *cogMethod); static sqInt NoDbgRegParms registerisInMask(sqInt reg, sqInt mask); @@ -1861,6 +1860,7 @@ static sqInt methodAbortTrampolines[4]; static sqInt methodBytesFreedSinceLastCompaction; static sqInt methodCount; +static sqInt methodHeader; static AbstractInstruction * const methodLabel = &aMethodLabel; static sqInt methodObj; static sqInt methodOrBlockNumArgs; @@ -7883,9 +7883,9 @@
/* Cogit>>#blockCreationBytecodeSizeForHeader: */ static sqInt NoDbgRegParms -blockCreationBytecodeSizeForHeader(sqInt methodHeader) +blockCreationBytecodeSizeForHeader(sqInt aMethodHeader) { - return (headerIndicatesAlternateBytecodeSet(methodHeader) + return (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? AltBlockCreationBytecodeSize : BlockCreationBytecodeSize); } @@ -7937,6 +7937,8 @@ sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -7952,8 +7954,6 @@ sqInt map; sqInt mapByte; usqInt mcpc1; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -7975,8 +7975,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -7997,8 +7997,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -9276,6 +9276,7 @@ } ensureNoForwardedLiteralsIn(aMethodObj); methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); cogMethod = compileCogMethod(aSelectorOop); if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { @@ -9623,10 +9624,15 @@ static sqInt compileMethodBody(void) { + sqInt deltaForPrimErrorCode; + if (endPC < initialPC) { return 0; } - return compileAbstractInstructionsFromthrough(initialPC, endPC); + deltaForPrimErrorCode = (methodUsesPrimitiveErrorCode() + ? (sizeOfCallPrimitiveBytecode(methodHeader)) + (sizeOfLongStoreTempBytecode(methodHeader)) + : 0); + return compileAbstractInstructionsFromthrough(initialPC + deltaForPrimErrorCode, endPC); }
@@ -10907,12 +10913,12 @@ generateMapAtstart(sqInt addressOrNull, sqInt startAddress) { unsigned char annotation; - usqInt delta; + sqInt delta; sqInt i; AbstractInstruction *instruction; sqInt length; - usqInt location; - usqInt mapEntry; + sqInt location; + sqInt mapEntry; sqInt maxDelta; usqInt mcpc;
@@ -13035,6 +13041,8 @@ usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc1; @@ -13050,8 +13058,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -13073,8 +13079,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -13095,8 +13101,8 @@ aMethodObj = (homeMethod->methodObject); bcpc1 = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; @@ -20131,30 +20137,6 @@ }
-/* Answer if methodObj contains a quick primitive. In addition, if it has a - primitive that uses an error code, update the initialPC to skip this code. - The code to - process the error code is generated in compileFrameBuild. For fixups to - work correctly, the initialPC must be updated before scanning for backward - branches. */ - - /* SimpleStackBasedCogit>>#checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed */ -static sqInt -checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void) -{ - sqInt methodHeader; - - if (primitiveIndex == 0) { - return 0; - } - methodHeader = methodHeaderOf(methodObj); - if (methodUsesPrimitiveErrorCode(methodHeader)) { - initialPC = (initialPC + (sizeOfCallPrimitiveBytecode(methodHeader))) + (sizeOfLongStoreTempBytecode(methodHeader)); - } - return isQuickPrimitiveIndex(primitiveIndex); -} - - /* Compile the jump instruction(s) at the end of the method that dispatch to each block body. */ @@ -21942,9 +21924,9 @@ code. */
- /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode: */ -static sqInt NoDbgRegParms -methodUsesPrimitiveErrorCode(sqInt methodHeader) + /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode */ +static sqInt +methodUsesPrimitiveErrorCode(void) { return ((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj))); @@ -22456,7 +22438,6 @@ sqInt i; sqInt iLimiT; AbstractInstruction *jumpSkip; - sqInt methodHeader;
if (!needsFrame) { initSimStackForFramelessMethod(initialPC); @@ -22466,7 +22447,6 @@ if (!needsFrame) { return 0; } - methodHeader = methodHeaderOf(methodObj); /* begin PushR: */ genoperand(PushR, LinkReg);
@@ -22493,7 +22473,7 @@ /* begin PushR: */ genoperand(PushR, SendNumArgsReg); } - if (methodUsesPrimitiveErrorCode(methodHeader)) { + if (methodUsesPrimitiveErrorCode()) { compileGetErrorCode(); } /* begin MoveAw:R: */ @@ -22554,8 +22534,8 @@ static CogMethod * NoDbgRegParms fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) { - sqInt methodHeader; CogMethod *originalMethod; + sqInt rawHeader;
(method->cmType = CMMethod); (method->objectHeader = nullHeaderForMachineCodeMethod()); @@ -22565,11 +22545,11 @@ /* If the method has already been cogged (e.g. Newspeak accessors) then leave the original method attached to its cog method, but get the right header. */
- methodHeader = rawHeaderOf(methodObj); - if (isCogMethodReference(methodHeader)) { - originalMethod = ((CogMethod *) methodHeader); + rawHeader = rawHeaderOf(methodObj); + if (isCogMethodReference(rawHeader)) { + originalMethod = ((CogMethod *) rawHeader); assert(((originalMethod->blockSize)) == size); - methodHeader = (originalMethod->methodHeader); + assert(methodHeader == ((originalMethod->methodHeader))); } else { @@ -23910,6 +23890,8 @@ static usqInt NoDbgRegParms picDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -23925,8 +23907,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -23955,8 +23935,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -23978,8 +23958,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -24226,6 +24206,8 @@ sqInt picDataForinto(CogMethod *cogMethod, sqInt arrayObj) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -24242,8 +24224,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -24274,8 +24254,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -24297,8 +24277,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -24482,7 +24462,8 @@
# endif /* NewspeakVM */
- if (checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed()) { + if ((primitiveIndex > 0) + && (isQuickPrimitiveIndex(primitiveIndex))) { return 0; } pc = (latestContinuation = initialPC);
Modified: branches/Cog/spursistasrc/vm/cogitIA32.c =================================================================== --- branches/Cog/spursistasrc/vm/cogitIA32.c 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/spursistasrc/vm/cogitIA32.c 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 from - SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */ -static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d " __DATE__ ; +static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -513,7 +513,7 @@ static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); -static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt methodHeader); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); static AbstractInstruction * NoDbgRegParms CallRT(sqInt callTarget); @@ -868,7 +868,6 @@ static sqInt NoDbgRegParms registerOrNil(CogSimStackEntry * self_in_registerOrNil); static CogSimStackEntry * NoDbgRegParms storeToReg(CogSimStackEntry * self_in_storeToReg, sqInt reg); static sqInt endSizeOffset(void); -static sqInt checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void); static sqInt compileBlockDispatch(void); static sqInt compileFallbackToInterpreterPrimitive(void); static void compileGetErrorCode(void); @@ -960,7 +959,7 @@ static sqInt genStoreAndPopTemporaryVariableBytecode(void); static sqInt genStoreRemoteTempLongBytecode(void); static void maybeCompileAllocFillerCheck(void); -static sqInt NoDbgRegParms methodUsesPrimitiveErrorCode(sqInt methodHeader); +static sqInt methodUsesPrimitiveErrorCode(void); static sqInt numSpecialSelectors(void); extern void recordCallOffsetIn(CogMethod *cogMethod); static sqInt NoDbgRegParms registerisInMask(sqInt reg, sqInt mask); @@ -1768,6 +1767,7 @@ static sqInt methodAbortTrampolines[4]; static sqInt methodBytesFreedSinceLastCompaction; static sqInt methodCount; +static sqInt methodHeader; static AbstractInstruction * const methodLabel = &aMethodLabel; static sqInt methodObj; static sqInt methodOrBlockNumArgs; @@ -6979,9 +6979,9 @@
/* Cogit>>#blockCreationBytecodeSizeForHeader: */ static sqInt NoDbgRegParms -blockCreationBytecodeSizeForHeader(sqInt methodHeader) +blockCreationBytecodeSizeForHeader(sqInt aMethodHeader) { - return (headerIndicatesAlternateBytecodeSet(methodHeader) + return (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? AltBlockCreationBytecodeSize : BlockCreationBytecodeSize); } @@ -7033,6 +7033,8 @@ sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -7048,8 +7050,6 @@ sqInt map; sqInt mapByte; usqInt mcpc1; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -7071,8 +7071,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -7093,8 +7093,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -8377,6 +8377,7 @@ } ensureNoForwardedLiteralsIn(aMethodObj); methodObj = aMethodObj; + methodHeader = methodHeaderOf(aMethodObj); cogMethod = compileCogMethod(aSelectorOop); if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { @@ -8728,10 +8729,15 @@ static sqInt compileMethodBody(void) { + sqInt deltaForPrimErrorCode; + if (endPC < initialPC) { return 0; } - return compileAbstractInstructionsFromthrough(initialPC, endPC); + deltaForPrimErrorCode = (methodUsesPrimitiveErrorCode() + ? (sizeOfCallPrimitiveBytecode(methodHeader)) + (sizeOfLongStoreTempBytecode(methodHeader)) + : 0); + return compileAbstractInstructionsFromthrough(initialPC + deltaForPrimErrorCode, endPC); }
@@ -12130,6 +12136,8 @@ usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc1; @@ -12145,8 +12153,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -12168,8 +12174,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -12190,8 +12196,8 @@ aMethodObj = (homeMethod->methodObject); bcpc1 = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc1, aMethodObj)) + bsOffset; @@ -19166,30 +19172,6 @@ }
-/* Answer if methodObj contains a quick primitive. In addition, if it has a - primitive that uses an error code, update the initialPC to skip this code. - The code to - process the error code is generated in compileFrameBuild. For fixups to - work correctly, the initialPC must be updated before scanning for backward - branches. */ - - /* SimpleStackBasedCogit>>#checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed */ -static sqInt -checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void) -{ - sqInt methodHeader; - - if (primitiveIndex == 0) { - return 0; - } - methodHeader = methodHeaderOf(methodObj); - if (methodUsesPrimitiveErrorCode(methodHeader)) { - initialPC = (initialPC + (sizeOfCallPrimitiveBytecode(methodHeader))) + (sizeOfLongStoreTempBytecode(methodHeader)); - } - return isQuickPrimitiveIndex(primitiveIndex); -} - - /* Compile the jump instruction(s) at the end of the method that dispatch to each block body. */ @@ -21265,9 +21247,9 @@ code. */
- /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode: */ -static sqInt NoDbgRegParms -methodUsesPrimitiveErrorCode(sqInt methodHeader) + /* SimpleStackBasedCogit>>#methodUsesPrimitiveErrorCode */ +static sqInt +methodUsesPrimitiveErrorCode(void) { return ((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0) && ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject(initialPC + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj))); @@ -21784,7 +21766,6 @@ sqInt i; sqInt iLimiT; AbstractInstruction *jumpSkip; - sqInt methodHeader;
if (!needsFrame) { initSimStackForFramelessMethod(initialPC); @@ -21794,7 +21775,6 @@ if (!needsFrame) { return 0; } - methodHeader = methodHeaderOf(methodObj); /* begin PushR: */ genoperand(PushR, FPReg); @@ -21821,7 +21801,7 @@ /* begin PushR: */ genoperand(PushR, SendNumArgsReg); } - if (methodUsesPrimitiveErrorCode(methodHeader)) { + if (methodUsesPrimitiveErrorCode()) { compileGetErrorCode(); } /* begin MoveAw:R: */ @@ -21890,8 +21870,8 @@ static CogMethod * NoDbgRegParms fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) { - sqInt methodHeader; CogMethod *originalMethod; + sqInt rawHeader;
(method->cmType = CMMethod); (method->objectHeader = nullHeaderForMachineCodeMethod()); @@ -21901,11 +21881,11 @@ /* If the method has already been cogged (e.g. Newspeak accessors) then leave the original method attached to its cog method, but get the right header. */
- methodHeader = rawHeaderOf(methodObj); - if (isCogMethodReference(methodHeader)) { - originalMethod = ((CogMethod *) methodHeader); + rawHeader = rawHeaderOf(methodObj); + if (isCogMethodReference(rawHeader)) { + originalMethod = ((CogMethod *) rawHeader); assert(((originalMethod->blockSize)) == size); - methodHeader = (originalMethod->methodHeader); + assert(methodHeader == ((originalMethod->methodHeader))); } else { @@ -23374,6 +23354,8 @@ static usqInt NoDbgRegParms picDataForBlockEntryMethod(sqInt blockEntryMcpc, sqInt cogMethod) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -23389,8 +23371,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -23419,8 +23399,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -23442,8 +23422,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -23690,6 +23670,8 @@ sqInt picDataForinto(CogMethod *cogMethod, sqInt arrayObj) { + sqInt aMethodHeader; + sqInt aMethodHeader1; sqInt aMethodObj; sqInt annotation; sqInt bcpc; @@ -23706,8 +23688,6 @@ sqInt map; sqInt mapByte; usqInt mcpc; - sqInt methodHeader; - sqInt methodHeader1; sqInt nExts; sqInt nextBcpc; sqInt result; @@ -23738,8 +23718,8 @@ aMethodObj = (homeMethod->methodObject); endbcpc = (numBytesOf(aMethodObj)) - 1; /* begin bytecodeSetOffsetForHeader: */ - methodHeader = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader) + aMethodHeader = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader) ? 256 : 0); } @@ -23761,8 +23741,8 @@ aMethodObj = (homeMethod->methodObject); bcpc = startbcpc - (blockCreationBytecodeSizeForHeader((homeMethod->methodHeader))); /* begin bytecodeSetOffsetForHeader: */ - methodHeader1 = (homeMethod->methodHeader); - bsOffset = (headerIndicatesAlternateBytecodeSet(methodHeader1) + aMethodHeader1 = (homeMethod->methodHeader); + bsOffset = (headerIndicatesAlternateBytecodeSet(aMethodHeader1) ? 256 : 0); byte = (fetchByteofObject(bcpc, aMethodObj)) + bsOffset; @@ -23946,7 +23926,8 @@
# endif /* NewspeakVM */
- if (checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed()) { + if ((primitiveIndex > 0) + && (isQuickPrimitiveIndex(primitiveIndex))) { return 0; } pc = (latestContinuation = initialPC);
Modified: branches/Cog/spursrc/vm/cogit.h =================================================================== --- branches/Cog/spursrc/vm/cogit.h 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/spursrc/vm/cogit.h 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */
Modified: branches/Cog/spursrc/vm/cogitARMv5.c =================================================================== --- branches/Cog/spursrc/vm/cogitARMv5.c 2015-12-02 18:26:38 UTC (rev 3511) +++ branches/Cog/spursrc/vm/cogitARMv5.c 2015-12-02 20:56:33 UTC (rev 3512) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + CCodeGenerator VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 from - StackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d + StackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1539 uuid: 7d957563-4269-4950-9f7d-3d2dde2ac18d " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1543 uuid: 7ab33230-086d-4b21-a335-26f16100a3b4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -572,7 +572,7 @@ static AbstractInstruction * NoDbgRegParms annotateBytecode(AbstractInstruction *abstractInstruction); static AbstractInstruction * NoDbgRegParms annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); static void NoDbgRegParms assertSaneJumpTarget(AbstractInstruction *jumpTarget); -static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt methodHeader); +static sqInt NoDbgRegParms blockCreationBytecodeSizeForHeader(sqInt aMethodHeader); static sqInt NoDbgRegParms blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod); static AbstractInstruction * NoDbgRegParms CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved); @@ -942,7 +942,6 @@ static sqInt NoDbgRegParms mustDumpLiterals(sqInt currentOpcodeIndex); static sqInt resetForBlockCompile(void); static sqInt saveForBlockCompile(void); -static sqInt checkForQuickPrimitiveAdjustingIntialPCIfErrorCodeUsed(void); static sqInt compileBlockDispatch(void); static sqInt compileFallbackToInterpreterPrimitive(void); static void compileGetErrorCode(void); @@ -1012,7 +1011,7 @@ static sqInt genStoreAndPopTemporaryVariableBytecode(void); static sqInt genStoreRemoteTempLongBytecode(void); static void maybeCompileAllocFillerCheck(void); -static sqInt NoDbgRegParms methodUsesPrimitiveErrorCode(sqInt methodHeader); +static sqInt methodUsesPrimitiveErrorCode(void); static sqInt numSpecialSelectors(void); extern void recordCallOffsetIn(CogMethod *cogMethod); static sqInt NoDbgRegParms registerisInMask(sqInt reg, sqInt mask);
@@ Diff output truncated at 50000 characters. @@
vm-dev@lists.squeakfoundation.org