Revision: 2747 Author: eliot Date: 2013-07-12 16:30:49 -0700 (Fri, 12 Jul 2013) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.302. Fix type errors in the Cogit that prevent the Cogit working when compiled with clang. Specifically void * pointers are not comparable. Make sure that fetchPointer:ofObject: & isIntegerValue: are declared in cointerp.h. Fix bug when assigning to some context inst vars from generated methods. Add accessors to document the context inst var access scheme. Fix a compiler warning comparing an error code in cog:selector: Modified Paths: -------------- branches/Cog/macbuild/HowToBuild branches/Cog/nscogsrc/vm/cogit.c branches/Cog/nscogsrc/vm/cogit.h branches/Cog/nscogsrc/vm/cogmethod.h branches/Cog/nscogsrc/vm/cointerp.c branches/Cog/nscogsrc/vm/cointerp.h branches/Cog/nscogsrc/vm/gcc3x-cointerp.c branches/Cog/nscogsrc/vm/interp.h branches/Cog/nscogsrc/vm/vmCallback.h branches/Cog/scripts/versionInfoPlist branches/Cog/src/vm/cogit.c branches/Cog/src/vm/cogit.h branches/Cog/src/vm/cogmethod.h branches/Cog/src/vm/cointerp.c branches/Cog/src/vm/cointerp.h branches/Cog/src/vm/cointerpmt.c branches/Cog/src/vm/cointerpmt.h branches/Cog/src/vm/gcc3x-cointerp.c branches/Cog/src/vm/gcc3x-cointerpmt.c branches/Cog/src/vm/interp.h branches/Cog/src/vm/vmCallback.h Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h Modified: branches/Cog/macbuild/HowToBuild =================================================================== --- branches/Cog/macbuild/HowToBuild 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/macbuild/HowToBuild 2013-07-12 23:30:49 UTC (rev 2747) @@ -3,7 +3,7 @@ http://www.squeakvm.org/svn/squeak/branches/Cog/image/VMMaker-Squeak4.1.changes http://www.squeakvm.org/svn/squeak/branches/Cog/image/VMMaker-Squeak4.1.image -How to Build the Croquet Cog VM on Mac OS X +How to Build the Squeak Cog VM on Mac OS X -------------------------------- 1. Install the tools (xcode etc); the CoreVM.xcodeproj is set-up to build using gcc 4.2 but you can optionally install the Intel C++ compiler 11.1 Modified: branches/Cog/nscogsrc/vm/cogit.c =================================================================== --- branches/Cog/nscogsrc/vm/cogit.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/cogit.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + CCodeGenerator VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - StackToRegisterMappingCogit VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + StackToRegisterMappingCogit VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo; @@ -329,7 +329,6 @@ #define SSConstant 2 #define SSRegister 3 #define SSSpill 4 -#define StackPointerIndex 2 #define SubCqR 84 #define SubCwR 91 #define SubRdRd 98 @@ -362,8 +361,8 @@ static BlockStart * addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span); void addCogMethodsToHeapMap(void); static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction); -static sqInt addressIsInFixups(void *address); -static sqInt addressIsInInstructions(void *address); +static sqInt addressIsInFixups(AbstractInstruction *address); +static sqInt addressIsInInstructions(AbstractInstruction *address); static sqInt addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC); static void addToOpenPICList(CogMethod *anOpenPIC); static void addToYoungReferrers(CogMethod *cogMethod); @@ -378,7 +377,7 @@ static AbstractInstruction * annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); static AbstractInstruction * annotatewith(AbstractInstruction *abstractInstruction, sqInt annotationFlag); static sqInt anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n); -static void assertSaneJumpTarget(void *jumpTarget); +static void assertSaneJumpTarget(AbstractInstruction *jumpTarget); static sqInt availableRegisterOrNil(void); static sqInt blockCreationBytecodeSizeForHeader(sqInt methodHeader); static sqInt blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); @@ -833,7 +832,7 @@ sqInt interpretOffset(void); static sqInt inverseBranchFor(sqInt opcode); static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress); -static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, void *addressOrInstruction); +static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction); static sqInt isBackwardBranchatextsin(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); static sqInt isBigEndian(AbstractInstruction * self_in_isBigEndian); static sqInt isBranch(BytecodeDescriptor * self_in_isBranch); @@ -2154,15 +2153,15 @@ } static sqInt -addressIsInFixups(void *address) +addressIsInFixups(AbstractInstruction *address) { - return address >= (void *)&fixups[0] && address < (void *)&fixups[numAbstractOpcodes]; + return address >= (AbstractInstruction *)&fixups[0] && address < (AbstractInstruction *)&fixups[numAbstractOpcodes]; } static sqInt -addressIsInInstructions(void *address) +addressIsInInstructions(AbstractInstruction *address) { - return address >= (void *)&abstractOpcodes[0] && address < (void *)&abstractOpcodes[opcodeIndex]; + return address >= &abstractOpcodes[0] && address < &abstractOpcodes[opcodeIndex]; } @@ -2354,12 +2353,12 @@ } static void -assertSaneJumpTarget(void *jumpTarget) +assertSaneJumpTarget(AbstractInstruction *jumpTarget) { assert((closedPICSize == null) || ((openPICSize == null) || ((addressIsInInstructions(jumpTarget)) - || ((((((sqInt)jumpTarget)) >= codeBase) && ((((sqInt)jumpTarget)) <= ((((sqInt)(limitZony()))) + (((closedPICSize < openPICSize) ? openPICSize : closedPICSize))))))))); + || ((((((usqInt)jumpTarget)) >= codeBase) && ((((usqInt)jumpTarget)) <= ((((sqInt)(limitZony()))) + (((closedPICSize < openPICSize) ? openPICSize : closedPICSize))))))))); } static sqInt @@ -3620,7 +3619,7 @@ methodObj = aMethodObj; cogMethod = compileCogMethod(aSelectorOop); if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { - if ((((usqInt)cogMethod)) == InsufficientCodeSpace) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { callForCogCompiledCodeCompaction(); } return null; @@ -6184,7 +6183,7 @@ sqInt reg; addressOperand = ((self_in_concretizeMoveAwR->operands))[0]; - if (isAnInstruction(self_in_concretizeMoveAwR, ((void *) addressOperand))) { + if (isAnInstruction(self_in_concretizeMoveAwR, ((AbstractInstruction *) addressOperand))) { addressOperand = (((AbstractInstruction *) addressOperand)->address); } reg = concreteRegister(self_in_concretizeMoveAwR, ((self_in_concretizeMoveAwR->operands))[1]); @@ -6461,7 +6460,7 @@ reg = concreteRegister(self_in_concretizeMoveRAw, ((self_in_concretizeMoveRAw->operands))[0]); addressOperand = ((self_in_concretizeMoveRAw->operands))[1]; - if (isAnInstruction(self_in_concretizeMoveRAw, ((void *) addressOperand))) { + if (isAnInstruction(self_in_concretizeMoveRAw, ((AbstractInstruction *) addressOperand))) { addressOperand = (((AbstractInstruction *) addressOperand)->address); } if (reg == EAX) { @@ -7566,7 +7565,7 @@ switch (opType) { case 2: - if (byte2 <= StackPointerIndex) { + if (isReadMediatedContextInstVarIndex(byte2)) { genPushMaybeContextReceiverVariable(byte2); } else { @@ -7590,7 +7589,7 @@ /* 5 & 6 */ - if (byte2 <= StackPointerIndex) { + if (isWriteMediatedContextInstVarIndex(byte2)) { genStorePopMaybeContextReceiverVariable(opType == 6, byte2); } else { @@ -9042,9 +9041,9 @@ index = byte1 + (extA << 8); extA = 0; - return (index > StackPointerIndex - ? genPushReceiverVariable(index) - : genPushMaybeContextReceiverVariable(index)); + return (isReadMediatedContextInstVarIndex(index) + ? genPushMaybeContextReceiverVariable(index) + : genPushReceiverVariable(index)); } @@ -9165,9 +9164,9 @@ index = byte1 + (extA << 8); extA = 0; - return (index > StackPointerIndex - ? genStorePopReceiverVariable(1, index) - : genStorePopMaybeContextReceiverVariable(1, index)); + return (isWriteMediatedContextInstVarIndex(index) + ? genStorePopMaybeContextReceiverVariable(1, index) + : genStorePopReceiverVariable(1, index)); } @@ -9197,9 +9196,9 @@ index = byte1 + (extA << 8); extA = 0; - return (index > StackPointerIndex - ? genStorePopReceiverVariable(0, index) - : genStorePopMaybeContextReceiverVariable(0, index)); + return (isWriteMediatedContextInstVarIndex(index) + ? genStorePopMaybeContextReceiverVariable(0, index) + : genStorePopReceiverVariable(0, index)); } @@ -14212,7 +14211,7 @@ } static sqInt -isAnInstruction(AbstractInstruction * self_in_isAnInstruction, void *addressOrInstruction) +isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction) { return addressIsInInstructions(addressOrInstruction); } @@ -15895,13 +15894,13 @@ cogMethod = ((CogMethod *) baseAddress); while ((cogMethod < (limitZony())) - && ((((void *) cogMethod)) <= address)) { + && ((((usqInt)cogMethod)) <= (((usqInt)address)))) { nextMethod = methodAfter(cogMethod); if (nextMethod == cogMethod) { return 0; } - if ((address >= (((void *) cogMethod))) - && (address < (((void *) nextMethod)))) { + if (((((usqInt)address)) >= (((usqInt)cogMethod))) + && ((((usqInt)address)) < (((usqInt)nextMethod)))) { return cogMethod; } cogMethod = nextMethod; @@ -17635,8 +17634,8 @@ } assert(isJump(self_in_sizePCDependentInstructionAt)); target = ((self_in_sizePCDependentInstructionAt->operands))[0]; - if (isAnInstruction(self_in_sizePCDependentInstructionAt, ((void *) target))) { - abstractInstruction = ((AbstractInstruction *) target); + abstractInstruction = ((AbstractInstruction *) target); + if (isAnInstruction(self_in_sizePCDependentInstructionAt, abstractInstruction)) { maximumSpan = ((abstractInstruction->address)) - (((abstractInstructionfollows(self_in_sizePCDependentInstructionAt, abstractInstruction) ? eventualAbsoluteAddress : (self_in_sizePCDependentInstructionAt->address))) + 2); Modified: branches/Cog/nscogsrc/vm/cogit.h =================================================================== --- branches/Cog/nscogsrc/vm/cogit.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/cogit.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + CCodeGenerator VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ Modified: branches/Cog/nscogsrc/vm/cogmethod.h =================================================================== --- branches/Cog/nscogsrc/vm/cogmethod.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/cogmethod.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + CCodeGenerator VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ typedef struct { Modified: branches/Cog/nscogsrc/vm/cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/cointerp.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -651,6 +651,7 @@ sqInt isPointers(sqInt oop); static sqInt isPrimitiveFunctionPointerAnIndex(void); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); static sqInt isSingleContext(sqInt aContext); static sqInt isStillMarriedContext(sqInt aContext); @@ -660,6 +661,7 @@ static sqInt isWordsOrBytesNonInt(sqInt oop); sqInt isWordsOrBytes(sqInt oop); sqInt isWords(sqInt oop); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); static sqInt isYoungRoot(sqInt oop); sqInt isYoung(sqInt oop); @@ -1976,7 +1978,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.296"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.302"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -5373,7 +5375,7 @@ if (opType == 2) { /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((byte3 < MethodIndex) + if ((byte3 <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -11739,7 +11741,7 @@ extA = 0; /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((index < MethodIndex) + if ((index <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -24975,6 +24977,21 @@ } +/* Reading the sender, instructionPointer and stackPointer inst vars of a + context must take + account of potentially married contexts and fetch the state from the + frame. method, + closureOrNil and receiver can safely be fetched from the context without + checking. + */ + +sqInt +isReadMediatedContextInstVarIndex(sqInt index) +{ + return index <= StackPointerIndex; +} + + /* For machine code assertion checking. Answer true if not in a fullGC and obj is young. */ @@ -25125,6 +25142,19 @@ } +/* Wrining any inst vars of a context must take account of potentially + married contexts + and set the state in the frame. Inst vars in subclasses don't need + mediation; subclasses + can't marry. */ + +sqInt +isWriteMediatedContextInstVarIndex(sqInt index) +{ + return index <= ReceiverIndex; +} + + /* Answer if obj is young. Assume obj is non-immediate. */ sqInt Modified: branches/Cog/nscogsrc/vm/cointerp.h =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/cointerp.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ @@ -73,6 +73,7 @@ sqInt failed(void); sqInt falseObject(void); sqInt fetchByteofObject(sqInt byteIndex, sqInt oop); +sqInt fetchPointerofObject(sqInt fieldIndex, sqInt oop); void findStringBeginningWith(char *aCString); void findString(char *aCString); void flushExternalPrimitiveOf(sqInt methodObj); @@ -95,13 +96,16 @@ usqInt interpretAddress(void); sqInt isCogMethodReference(sqInt methodHeader); sqInt isCompiledMethod(sqInt oop); +sqInt isIntegerValue(sqInt intValue); sqInt isMarked(sqInt oop); sqInt isNonIntegerObject(sqInt objectPointer); sqInt isOopCompiledMethod(sqInt oop); sqInt isOopImmutable(sqInt anOop); sqInt isOopMutable(sqInt anOop); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); sqInt isYoung(sqInt oop); sqInt isKindOfClass(sqInt oop, sqInt aClass); Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -654,6 +654,7 @@ sqInt isPointers(sqInt oop); static sqInt isPrimitiveFunctionPointerAnIndex(void); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); static sqInt isSingleContext(sqInt aContext); static sqInt isStillMarriedContext(sqInt aContext); @@ -663,6 +664,7 @@ static sqInt isWordsOrBytesNonInt(sqInt oop); sqInt isWordsOrBytes(sqInt oop); sqInt isWords(sqInt oop); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); static sqInt isYoungRoot(sqInt oop); sqInt isYoung(sqInt oop); @@ -1979,7 +1981,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.296"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.302"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -5382,7 +5384,7 @@ if (opType == 2) { /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((byte3 < MethodIndex) + if ((byte3 <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -11748,7 +11750,7 @@ extA = 0; /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((index < MethodIndex) + if ((index <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -24984,6 +24986,21 @@ } +/* Reading the sender, instructionPointer and stackPointer inst vars of a + context must take + account of potentially married contexts and fetch the state from the + frame. method, + closureOrNil and receiver can safely be fetched from the context without + checking. + */ + +sqInt +isReadMediatedContextInstVarIndex(sqInt index) +{ + return index <= StackPointerIndex; +} + + /* For machine code assertion checking. Answer true if not in a fullGC and obj is young. */ @@ -25134,6 +25151,19 @@ } +/* Wrining any inst vars of a context must take account of potentially + married contexts + and set the state in the frame. Inst vars in subclasses don't need + mediation; subclasses + can't marry. */ + +sqInt +isWriteMediatedContextInstVarIndex(sqInt index) +{ + return index <= ReceiverIndex; +} + + /* Answer if obj is young. Assume obj is non-immediate. */ sqInt Modified: branches/Cog/nscogsrc/vm/interp.h =================================================================== --- branches/Cog/nscogsrc/vm/interp.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/interp.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ #define VM_PROXY_MAJOR 1 Modified: branches/Cog/nscogsrc/vm/vmCallback.h =================================================================== --- branches/Cog/nscogsrc/vm/vmCallback.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/nscogsrc/vm/vmCallback.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ #define VM_CALLBACK_INC 1 Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h ___________________________________________________________________ Modified: checkindate - Fri Jun 14 16:49:42 PDT 2013 + Fri Jul 12 16:29:31 PDT 2013 Modified: branches/Cog/scripts/versionInfoPlist =================================================================== --- branches/Cog/scripts/versionInfoPlist 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/scripts/versionInfoPlist 2013-07-12 23:30:49 UTC (rev 2747) @@ -6,6 +6,8 @@ # IFS=" " +TERMINAL=dumb +#TERMINAL=glasstty if [ $# != 3 ]; then echo usage: $0 platformDir referencePlist toBeEditedPlist 1>&2 exit 1 @@ -17,5 +19,5 @@ | sed 's/^[ ]*\(.*\)<!--version-->/\1/' \ | sed 's./.\\\\/.g'` # double up for ex command below do - ex -u NONE "+g/$p/s/0\([< ]\)/$REV\1/" +w +q "$3" + ex -T $TERMINAL -u NONE "+g/$p/s/0\([< ]\)/$REV\1/" +w +q "$3" done Modified: branches/Cog/src/vm/cogit.c =================================================================== --- branches/Cog/src/vm/cogit.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/cogit.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + CCodeGenerator VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - StackToRegisterMappingCogit VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + StackToRegisterMappingCogit VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__cogitBuildInfo = __buildInfo; @@ -329,7 +329,6 @@ #define SSConstant 2 #define SSRegister 3 #define SSSpill 4 -#define StackPointerIndex 2 #define SubCqR 84 #define SubCwR 91 #define SubRdRd 98 @@ -362,8 +361,8 @@ static BlockStart * addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span); void addCogMethodsToHeapMap(void); static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction); -static sqInt addressIsInFixups(void *address); -static sqInt addressIsInInstructions(void *address); +static sqInt addressIsInFixups(AbstractInstruction *address); +static sqInt addressIsInInstructions(AbstractInstruction *address); static sqInt addressOfEndOfCaseinCPIC(sqInt n, CogMethod *cPIC); static void addToOpenPICList(CogMethod *anOpenPIC); static void addToYoungReferrers(CogMethod *cogMethod); @@ -378,7 +377,7 @@ static AbstractInstruction * annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop); static AbstractInstruction * annotatewith(AbstractInstruction *abstractInstruction, sqInt annotationFlag); static sqInt anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n); -static void assertSaneJumpTarget(void *jumpTarget); +static void assertSaneJumpTarget(AbstractInstruction *jumpTarget); static sqInt availableRegisterOrNil(void); static sqInt blockCreationBytecodeSizeForHeader(sqInt methodHeader); static sqInt blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg); @@ -791,7 +790,7 @@ sqInt interpretOffset(void); static sqInt inverseBranchFor(sqInt opcode); static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress); -static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, void *addressOrInstruction); +static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction); static sqInt isBackwardBranchatextsin(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj); static sqInt isBigEndian(AbstractInstruction * self_in_isBigEndian); static sqInt isBranch(BytecodeDescriptor * self_in_isBranch); @@ -1841,15 +1840,15 @@ } static sqInt -addressIsInFixups(void *address) +addressIsInFixups(AbstractInstruction *address) { - return address >= (void *)&fixups[0] && address < (void *)&fixups[numAbstractOpcodes]; + return address >= (AbstractInstruction *)&fixups[0] && address < (AbstractInstruction *)&fixups[numAbstractOpcodes]; } static sqInt -addressIsInInstructions(void *address) +addressIsInInstructions(AbstractInstruction *address) { - return address >= (void *)&abstractOpcodes[0] && address < (void *)&abstractOpcodes[opcodeIndex]; + return address >= &abstractOpcodes[0] && address < &abstractOpcodes[opcodeIndex]; } @@ -2041,12 +2040,12 @@ } static void -assertSaneJumpTarget(void *jumpTarget) +assertSaneJumpTarget(AbstractInstruction *jumpTarget) { assert((closedPICSize == null) || ((openPICSize == null) || ((addressIsInInstructions(jumpTarget)) - || ((((((sqInt)jumpTarget)) >= codeBase) && ((((sqInt)jumpTarget)) <= ((((sqInt)(limitZony()))) + (((closedPICSize < openPICSize) ? openPICSize : closedPICSize))))))))); + || ((((((usqInt)jumpTarget)) >= codeBase) && ((((usqInt)jumpTarget)) <= ((((sqInt)(limitZony()))) + (((closedPICSize < openPICSize) ? openPICSize : closedPICSize))))))))); } static sqInt @@ -3203,7 +3202,7 @@ methodObj = aMethodObj; cogMethod = compileCogMethod(aSelectorOop); if ((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= -1))) { - if ((((usqInt)cogMethod)) == InsufficientCodeSpace) { + if ((((sqInt)cogMethod)) == InsufficientCodeSpace) { callForCogCompiledCodeCompaction(); } return null; @@ -5758,7 +5757,7 @@ sqInt reg; addressOperand = ((self_in_concretizeMoveAwR->operands))[0]; - if (isAnInstruction(self_in_concretizeMoveAwR, ((void *) addressOperand))) { + if (isAnInstruction(self_in_concretizeMoveAwR, ((AbstractInstruction *) addressOperand))) { addressOperand = (((AbstractInstruction *) addressOperand)->address); } reg = concreteRegister(self_in_concretizeMoveAwR, ((self_in_concretizeMoveAwR->operands))[1]); @@ -6035,7 +6034,7 @@ reg = concreteRegister(self_in_concretizeMoveRAw, ((self_in_concretizeMoveRAw->operands))[0]); addressOperand = ((self_in_concretizeMoveRAw->operands))[1]; - if (isAnInstruction(self_in_concretizeMoveRAw, ((void *) addressOperand))) { + if (isAnInstruction(self_in_concretizeMoveRAw, ((AbstractInstruction *) addressOperand))) { addressOperand = (((AbstractInstruction *) addressOperand)->address); } if (reg == EAX) { @@ -7140,7 +7139,7 @@ switch (opType) { case 2: - if (byte2 <= StackPointerIndex) { + if (isReadMediatedContextInstVarIndex(byte2)) { genPushMaybeContextReceiverVariable(byte2); } else { @@ -7164,7 +7163,7 @@ /* 5 & 6 */ - if (byte2 <= StackPointerIndex) { + if (isWriteMediatedContextInstVarIndex(byte2)) { genStorePopMaybeContextReceiverVariable(opType == 6, byte2); } else { @@ -13084,7 +13083,7 @@ } static sqInt -isAnInstruction(AbstractInstruction * self_in_isAnInstruction, void *addressOrInstruction) +isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction) { return addressIsInInstructions(addressOrInstruction); } @@ -14545,13 +14544,13 @@ cogMethod = ((CogMethod *) baseAddress); while ((cogMethod < (limitZony())) - && ((((void *) cogMethod)) <= address)) { + && ((((usqInt)cogMethod)) <= (((usqInt)address)))) { nextMethod = methodAfter(cogMethod); if (nextMethod == cogMethod) { return 0; } - if ((address >= (((void *) cogMethod))) - && (address < (((void *) nextMethod)))) { + if (((((usqInt)address)) >= (((usqInt)cogMethod))) + && ((((usqInt)address)) < (((usqInt)nextMethod)))) { return cogMethod; } cogMethod = nextMethod; @@ -16175,8 +16174,8 @@ } assert(isJump(self_in_sizePCDependentInstructionAt)); target = ((self_in_sizePCDependentInstructionAt->operands))[0]; - if (isAnInstruction(self_in_sizePCDependentInstructionAt, ((void *) target))) { - abstractInstruction = ((AbstractInstruction *) target); + abstractInstruction = ((AbstractInstruction *) target); + if (isAnInstruction(self_in_sizePCDependentInstructionAt, abstractInstruction)) { maximumSpan = ((abstractInstruction->address)) - (((abstractInstructionfollows(self_in_sizePCDependentInstructionAt, abstractInstruction) ? eventualAbsoluteAddress : (self_in_sizePCDependentInstructionAt->address))) + 2); Modified: branches/Cog/src/vm/cogit.h =================================================================== --- branches/Cog/src/vm/cogit.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/cogit.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + CCodeGenerator VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ Modified: branches/Cog/src/vm/cogmethod.h =================================================================== --- branches/Cog/src/vm/cogmethod.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/cogmethod.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.299 uuid: e51057f5-4de2-4c2b-82ce-844d130e2f33 + CCodeGenerator VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ typedef struct { Modified: branches/Cog/src/vm/cointerp.c =================================================================== --- branches/Cog/src/vm/cointerp.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/cointerp.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -643,6 +643,7 @@ sqInt isPointers(sqInt oop); static sqInt isPrimitiveFunctionPointerAnIndex(void); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); static sqInt isSingleContext(sqInt aContext); static sqInt isStillMarriedContext(sqInt aContext); @@ -652,6 +653,7 @@ static sqInt isWordsOrBytesNonInt(sqInt oop); sqInt isWordsOrBytes(sqInt oop); sqInt isWords(sqInt oop); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); static sqInt isYoungRoot(sqInt oop); sqInt isYoung(sqInt oop); @@ -1966,7 +1968,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.296]"; +const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.302]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -5239,7 +5241,7 @@ if (opType == 2) { /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((byte3 < MethodIndex) + if ((byte3 <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -20585,6 +20587,21 @@ } +/* Reading the sender, instructionPointer and stackPointer inst vars of a + context must take + account of potentially married contexts and fetch the state from the + frame. method, + closureOrNil and receiver can safely be fetched from the context without + checking. + */ + +sqInt +isReadMediatedContextInstVarIndex(sqInt index) +{ + return index <= StackPointerIndex; +} + + /* For machine code assertion checking. Answer true if not in a fullGC and obj is young. */ @@ -20735,6 +20752,19 @@ } +/* Wrining any inst vars of a context must take account of potentially + married contexts + and set the state in the frame. Inst vars in subclasses don't need + mediation; subclasses + can't marry. */ + +sqInt +isWriteMediatedContextInstVarIndex(sqInt index) +{ + return index <= ReceiverIndex; +} + + /* Answer if obj is young. Assume obj is non-immediate. */ sqInt Modified: branches/Cog/src/vm/cointerp.h =================================================================== --- branches/Cog/src/vm/cointerp.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/cointerp.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ @@ -73,6 +73,7 @@ sqInt failed(void); sqInt falseObject(void); sqInt fetchByteofObject(sqInt byteIndex, sqInt oop); +sqInt fetchPointerofObject(sqInt fieldIndex, sqInt oop); void findStringBeginningWith(char *aCString); void findString(char *aCString); void flushExternalPrimitiveOf(sqInt methodObj); @@ -95,13 +96,16 @@ usqInt interpretAddress(void); sqInt isCogMethodReference(sqInt methodHeader); sqInt isCompiledMethod(sqInt oop); +sqInt isIntegerValue(sqInt intValue); sqInt isMarked(sqInt oop); sqInt isNonIntegerObject(sqInt objectPointer); sqInt isOopCompiledMethod(sqInt oop); sqInt isOopImmutable(sqInt anOop); sqInt isOopMutable(sqInt anOop); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); sqInt isYoung(sqInt oop); sqInt isKindOfClass(sqInt oop, sqInt aClass); Modified: branches/Cog/src/vm/cointerpmt.c =================================================================== --- branches/Cog/src/vm/cointerpmt.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/cointerpmt.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - CoInterpreterMT VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CoInterpreterMT VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -699,6 +699,7 @@ sqInt isPointers(sqInt oop); static sqInt isPrimitiveFunctionPointerAnIndex(void); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); static sqInt isSingleContext(sqInt aContext); static sqInt isStillMarriedContext(sqInt aContext); @@ -708,6 +709,7 @@ static sqInt isWordsOrBytesNonInt(sqInt oop); sqInt isWordsOrBytes(sqInt oop); sqInt isWords(sqInt oop); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); static sqInt isYoungRoot(sqInt oop); sqInt isYoung(sqInt oop); @@ -2065,7 +2067,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.296]"; +const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.302]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; sqInt willNotThreadWarnCount; @@ -5340,7 +5342,7 @@ if (opType == 2) { /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((byte3 < MethodIndex) + if ((byte3 <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -21365,6 +21367,21 @@ } +/* Reading the sender, instructionPointer and stackPointer inst vars of a + context must take + account of potentially married contexts and fetch the state from the + frame. method, + closureOrNil and receiver can safely be fetched from the context without + checking. + */ + +sqInt +isReadMediatedContextInstVarIndex(sqInt index) +{ + return index <= StackPointerIndex; +} + + /* For machine code assertion checking. Answer true if not in a fullGC and obj is young. */ @@ -21515,6 +21532,19 @@ } +/* Wrining any inst vars of a context must take account of potentially + married contexts + and set the state in the frame. Inst vars in subclasses don't need + mediation; subclasses + can't marry. */ + +sqInt +isWriteMediatedContextInstVarIndex(sqInt index) +{ + return index <= ReceiverIndex; +} + + /* Answer if obj is young. Assume obj is non-immediate. */ sqInt Modified: branches/Cog/src/vm/cointerpmt.h =================================================================== --- branches/Cog/src/vm/cointerpmt.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/cointerpmt.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ @@ -74,6 +74,7 @@ sqInt failed(void); sqInt falseObject(void); sqInt fetchByteofObject(sqInt byteIndex, sqInt oop); +sqInt fetchPointerofObject(sqInt fieldIndex, sqInt oop); void findStringBeginningWith(char *aCString); void findString(char *aCString); void flushExternalPrimitiveOf(sqInt methodObj); @@ -97,13 +98,16 @@ usqInt interpretAddress(void); sqInt isCogMethodReference(sqInt methodHeader); sqInt isCompiledMethod(sqInt oop); +sqInt isIntegerValue(sqInt intValue); sqInt isMarked(sqInt oop); sqInt isNonIntegerObject(sqInt objectPointer); sqInt isOopCompiledMethod(sqInt oop); sqInt isOopImmutable(sqInt anOop); sqInt isOopMutable(sqInt anOop); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); sqInt isYoung(sqInt oop); sqInt isKindOfClass(sqInt oop, sqInt aClass); Modified: branches/Cog/src/vm/gcc3x-cointerp.c =================================================================== --- branches/Cog/src/vm/gcc3x-cointerp.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/gcc3x-cointerp.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -646,6 +646,7 @@ sqInt isPointers(sqInt oop); static sqInt isPrimitiveFunctionPointerAnIndex(void); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); static sqInt isSingleContext(sqInt aContext); static sqInt isStillMarriedContext(sqInt aContext); @@ -655,6 +656,7 @@ static sqInt isWordsOrBytesNonInt(sqInt oop); sqInt isWordsOrBytes(sqInt oop); sqInt isWords(sqInt oop); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); static sqInt isYoungRoot(sqInt oop); sqInt isYoung(sqInt oop); @@ -1969,7 +1971,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.296]"; +const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.302]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; @@ -5248,7 +5250,7 @@ if (opType == 2) { /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((byte3 < MethodIndex) + if ((byte3 <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -20594,6 +20596,21 @@ } +/* Reading the sender, instructionPointer and stackPointer inst vars of a + context must take + account of potentially married contexts and fetch the state from the + frame. method, + closureOrNil and receiver can safely be fetched from the context without + checking. + */ + +sqInt +isReadMediatedContextInstVarIndex(sqInt index) +{ + return index <= StackPointerIndex; +} + + /* For machine code assertion checking. Answer true if not in a fullGC and obj is young. */ @@ -20744,6 +20761,19 @@ } +/* Wrining any inst vars of a context must take account of potentially + married contexts + and set the state in the frame. Inst vars in subclasses don't need + mediation; subclasses + can't marry. */ + +sqInt +isWriteMediatedContextInstVarIndex(sqInt index) +{ + return index <= ReceiverIndex; +} + + /* Answer if obj is young. Assume obj is non-immediate. */ sqInt Modified: branches/Cog/src/vm/gcc3x-cointerpmt.c =================================================================== --- branches/Cog/src/vm/gcc3x-cointerpmt.c 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/gcc3x-cointerpmt.c 2013-07-12 23:30:49 UTC (rev 2747) @@ -2,11 +2,11 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 from - CoInterpreterMT VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CoInterpreterMT VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 " __DATE__ ; +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 " __DATE__ ; char *__interpBuildInfo = __buildInfo; @@ -702,6 +702,7 @@ sqInt isPointers(sqInt oop); static sqInt isPrimitiveFunctionPointerAnIndex(void); sqInt isQuickPrimitiveIndex(sqInt anInteger); +sqInt isReadMediatedContextInstVarIndex(sqInt index); sqInt isReallyYoungObject(sqInt obj); static sqInt isSingleContext(sqInt aContext); static sqInt isStillMarriedContext(sqInt aContext); @@ -711,6 +712,7 @@ static sqInt isWordsOrBytesNonInt(sqInt oop); sqInt isWordsOrBytes(sqInt oop); sqInt isWords(sqInt oop); +sqInt isWriteMediatedContextInstVarIndex(sqInt index); sqInt isYoungObject(sqInt obj); static sqInt isYoungRoot(sqInt oop); sqInt isYoung(sqInt oop); @@ -2068,7 +2070,7 @@ /* 575 */ (void (*)(void))0, 0 }; static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void); -const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.296]"; +const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.302]"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */; volatile int sendTrace; sqInt willNotThreadWarnCount; @@ -5349,7 +5351,7 @@ if (opType == 2) { /* begin pushMaybeContextReceiverVariable: */ rcvr = longAt(localFP + FoxIFReceiver); - if ((byte3 < MethodIndex) + if ((byte3 <= StackPointerIndex) && (((((usqInt) (longAt(rcvr))) >> 12) & 31) == ClassMethodContextCompactIndex)) { /* begin internalPush: */ /* begin instVar:ofContext: */ @@ -21374,6 +21376,21 @@ } +/* Reading the sender, instructionPointer and stackPointer inst vars of a + context must take + account of potentially married contexts and fetch the state from the + frame. method, + closureOrNil and receiver can safely be fetched from the context without + checking. + */ + +sqInt +isReadMediatedContextInstVarIndex(sqInt index) +{ + return index <= StackPointerIndex; +} + + /* For machine code assertion checking. Answer true if not in a fullGC and obj is young. */ @@ -21524,6 +21541,19 @@ } +/* Wrining any inst vars of a context must take account of potentially + married contexts + and set the state in the frame. Inst vars in subclasses don't need + mediation; subclasses + can't marry. */ + +sqInt +isWriteMediatedContextInstVarIndex(sqInt index) +{ + return index <= ReceiverIndex; +} + + /* Answer if obj is young. Assume obj is non-immediate. */ sqInt Modified: branches/Cog/src/vm/interp.h =================================================================== --- branches/Cog/src/vm/interp.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/interp.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ #define VM_PROXY_MAJOR 1 Modified: branches/Cog/src/vm/vmCallback.h =================================================================== --- branches/Cog/src/vm/vmCallback.h 2013-07-04 02:40:44 UTC (rev 2746) +++ branches/Cog/src/vm/vmCallback.h 2013-07-12 23:30:49 UTC (rev 2747) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.296 uuid: ca2924d5-7bfb-4690-a7ce-9ec8d2222043 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.302 uuid: 2ac39432-ac54-4584-964e-b129c90792f4 */ #define VM_CALLBACK_INC 1 |
Free forum by Nabble | Edit this page |