Revision: 3082 Author: eliot Date: 2014-09-25 10:53:41 -0700 (Thu, 25 Sep 2014) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.882
Spur: Fix bug in sweepToFollowForwardersForPigCompact which failed to update and answer lowest forwarder. Fixes numForwarders == 0 assert failures.
Fix bug with become and class table not removing classes which become causes them to be unhashed.
Fix bogus assert fail in synchronousSignal:. Refactor following code into ensureSemaphoreForwardedThroughContext: and fix the assert there-in.
Use rawOverflowSlotsOf: in bytesInObject:.
Make a little more progress on Spur image segment support. Provide a classTableEntriesDo: and use it to compute an arrayOfUnmarkedClasses.
Cogit: Make sure voidImplicitReceiverCacheAt: sets codeModified if IRCs are inline.
Make sure freeMethod: clears cmRefersToYoung
Fix assert in cogitPostGCAction: that would fire erroneously in Spur become.
Nuke some unneeded pruneYoungReferrers calls.
Factor-out send-site unlinking into unlinkSendAt:targetMethod:sendTable:
Sista: Rename ceClassTrap: et al to ceSistaTrap: given that Sista may trap in more cases than just unknown classes.
Renumber the primitives in StackInterpreter>>callPrimitiveBytecode.
Modified Paths: -------------- branches/Cog/build.linux32x86/HowToBuild branches/Cog/nscogsrc/vm/cogit.c branches/Cog/nscogsrc/vm/cogit.h branches/Cog/nscogsrc/vm/cointerp.c branches/Cog/nscogsrc/vm/cointerp.h branches/Cog/nscogsrc/vm/gcc3x-cointerp.c branches/Cog/nsspursrc/vm/cogit.c branches/Cog/nsspursrc/vm/cogit.h branches/Cog/nsspursrc/vm/cointerp.c branches/Cog/nsspursrc/vm/cointerp.h branches/Cog/nsspursrc/vm/gcc3x-cointerp.c branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c branches/Cog/nsspurstacksrc/vm/interp.c branches/Cog/scripts/revertIfEssentiallyUnchanged branches/Cog/scripts/svnrevert branches/Cog/sistasrc/vm/cogit.c branches/Cog/sistasrc/vm/cogit.h branches/Cog/sistasrc/vm/cointerp.c branches/Cog/sistasrc/vm/cointerp.h branches/Cog/sistasrc/vm/gcc3x-cointerp.c branches/Cog/spursistasrc/vm/cogit.c branches/Cog/spursistasrc/vm/cogit.h branches/Cog/spursistasrc/vm/cointerp.c branches/Cog/spursistasrc/vm/cointerp.h branches/Cog/spursistasrc/vm/gcc3x-cointerp.c branches/Cog/spursrc/vm/cogit.c branches/Cog/spursrc/vm/cogit.h branches/Cog/spursrc/vm/cointerp.c branches/Cog/spursrc/vm/cointerp.h branches/Cog/spursrc/vm/gcc3x-cointerp.c branches/Cog/spurstacksrc/vm/gcc3x-interp.c branches/Cog/spurstacksrc/vm/interp.c branches/Cog/src/vm/cogit.c branches/Cog/src/vm/cogit.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/stacksrc/vm/gcc3x-interp.c branches/Cog/stacksrc/vm/interp.c
Property Changed: ---------------- branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/build.linux32x86/HowToBuild =================================================================== --- branches/Cog/build.linux32x86/HowToBuild 2014-09-18 17:12:31 UTC (rev 3081) +++ branches/Cog/build.linux32x86/HowToBuild 2014-09-25 17:53:41 UTC (rev 3082) @@ -188,6 +188,8 @@
N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir.
+Be prepared to install libuuid support. e.g. on CentOS 6.5 use +sudo yum -y install libuuid-devel
Testing an external plugin has completely linked
Modified: branches/Cog/nscogsrc/vm/cogit.c =================================================================== --- branches/Cog/nscogsrc/vm/cogit.c 2014-09-18 17:12:31 UTC (rev 3081) +++ branches/Cog/nscogsrc/vm/cogit.c 2014-09-25 17:53:41 UTC (rev 3082) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 + CCodeGenerator VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d from - StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 + StackToRegisterMappingCogit VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -9413,7 +9413,8 @@ voidYoungReferrersPostTenureAll(); } assert(allMethodsHaveCorrectHeader()); - assert(kosherYoungReferrers()); + assert((gcMode == GCModeBecome) + || (kosherYoungReferrers())); }
@@ -12114,10 +12115,8 @@ } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } - pruneYoungReferrers(); if (freedPIC) { unlinkSendsToFree(); - codeModified = 1; } if (codeModified) {
@@ -12553,7 +12552,7 @@ { sqInt *address; sqInt *address1; - usqInt cacheAddress; + sqInt cacheAddress; sqInt cacheTag; sqInt cacheTag1; sqInt cacheTagMarked; @@ -12626,6 +12625,7 @@ /* Either the cacheTag is unmarked (e.g. new class) or the target has been freed (because it is unmarked), so unlink the send. */
+ /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); codeModified = 1; @@ -12722,7 +12722,7 @@ static sqInt markYoungObjectspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) { - usqInt cacheAddress; + sqInt cacheAddress; sqInt cacheTag; sqInt cacheTag1; sqInt class; @@ -13813,7 +13813,7 @@ static sqInt remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr) { - usqInt cacheAddress; + sqInt cacheAddress; sqInt cacheTag; sqInt cacheTag1; sqInt entryPoint; @@ -14150,6 +14150,7 @@
if ((((targetMethod1->cmType)) == CMFree) || (((targetMethod1->selector)) == theSelector)) { + /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); codeModified = 1; @@ -14201,6 +14202,7 @@ }
if (((targetMethod1->cmType)) == CMFree) { + /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); codeModified = 1; @@ -14244,8 +14246,10 @@ } }
+ /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); + codeModified = 1;
} else { @@ -14292,6 +14296,7 @@ }
if ((((sqInt)targetMethod1)) == theCogMethod) { + /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); codeModified = 1; @@ -14577,12 +14582,14 @@ static void voidImplicitReceiverCacheAt(sqInt mcpc) { - usqInt cacheAddress; + sqInt cacheAddress;
assert(NumOopsPerIRC == 2); cacheAddress = (((usqInt)mcpc)) + (jumpShortByteSize(backEnd)); unalignedLongAtput(backEnd, cacheAddress, 0); unalignedLongAtput(backEnd, cacheAddress + BytesPerOop, 0); + codeModified = 1; + }
static AbstractInstruction * @@ -14842,12 +14849,11 @@
} /* begin maybeFreeCountersOf: */ - (cogMethod->cmRefersToYoung = 0); } if (((cogMethod->cmType)) == CMOpenPIC) { removeFromOpenPICList(cogMethod); - (cogMethod->cmRefersToYoung = 0); } + (cogMethod->cmRefersToYoung = 0); (cogMethod->cmType = CMFree); methodBytesFreedSinceLastCompaction += (cogMethod->blockSize); } @@ -15117,8 +15123,15 @@ while (pointer < limitAddress) { cogMethod = ((CogMethod *) (longAt(pointer))); if (!((cogMethod->cmRefersToYoung))) { - print("* "); + print("*"); } + if (((cogMethod->cmType)) == CMFree) { + print("!"); + } + if (!(((cogMethod->cmRefersToYoung)) + && (((cogMethod->cmType)) != CMFree))) { + print(" "); + } printCogMethod(cogMethod); pointer += BytesPerWord; }
Modified: branches/Cog/nscogsrc/vm/cogit.h =================================================================== --- branches/Cog/nscogsrc/vm/cogit.h 2014-09-18 17:12:31 UTC (rev 3081) +++ branches/Cog/nscogsrc/vm/cogit.h 2014-09-25 17:53:41 UTC (rev 3082) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 + CCodeGenerator VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d */
Modified: branches/Cog/nscogsrc/vm/cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.c 2014-09-18 17:12:31 UTC (rev 3081) +++ branches/Cog/nscogsrc/vm/cointerp.c 2014-09-25 17:53:41 UTC (rev 3082) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.881 uuid: 539d444b-dd24-4254-a007-bd1e298e84f7 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d from - CoInterpreter VMMaker.oscog-eem.881 uuid: 539d444b-dd24-4254-a007-bd1e298e84f7 + CoInterpreter VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.881 uuid: 539d444b-dd24-4254-a007-bd1e298e84f7 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -852,7 +852,7 @@ void printWronglySizedContexts(sqInt printContexts); static void restoreHeadersFromtofromandtofrom(sqInt firstIn, sqInt lastIn, sqInt hdrBaseIn, sqInt firstOut, sqInt lastOut, sqInt hdrBaseOut) NoDbgRegParms; static void runLeakCheckerForFullGC(sqInt fullGCFlag) NoDbgRegParms; -static usqInt safeObjectAfter(sqInt oop) NoDbgRegParms; +static sqInt safeObjectAfter(sqInt oop) NoDbgRegParms; static sqInt safePrintStringOf(sqInt oop) NoDbgRegParms; static sqInt shortentoIndexableSize(sqInt obj, sqInt nSlots) NoDbgRegParms; static sqInt sizeBitsOfSafe(sqInt oop) NoDbgRegParms; @@ -923,7 +923,6 @@ void * firstIndexableField(sqInt oop); sqInt firstLongFormat(void); static sqInt fixedFieldsOfformatlength(sqInt oop, sqInt fmt, sqInt wordLength) NoDbgRegParms; -static void followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth) NoDbgRegParms; static sqInt followForwarded(sqInt objOop) NoDbgRegParms; sqInt formatOfClass(sqInt classPointer); static sqInt fwdBlockValid(sqInt addr) NoDbgRegParms; @@ -2086,7 +2085,7 @@ /* 574 */ (void (*)(void))0, /* 575 */ (void (*)(void))0, 0 }; -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.881"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.882"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -4385,7 +4384,7 @@ ? ((longAt(localFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 : (byteAt((localFP + FoxIFrameFlags) + 3)) != 0))) { goto commonCallerReturn; - goto l297; + goto l298; } closure = longAt(localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) ? ((mframeCogMethod(localFP))->cmNumArgs) @@ -4422,11 +4421,11 @@ theMethod = longAt((home + BaseHeaderSize) + (MethodIndex << ShiftForWord)); if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) { unwindContextOrNilOrZero = home; - goto l299; + goto l300; } } unwindContextOrNilOrZero = ctxtOrNilOrZero; - l299: /* end internalFindUnwindThroughContext: */; + l300: /* end internalFindUnwindThroughContext: */; if (unwindContextOrNilOrZero == GIV(nilObj)) {
/* error: can't find home on chain; cannot return */ @@ -4440,10 +4439,10 @@ : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l301; + goto l302; } ourContext = marryFrameSP(localFP, localSP); - l301: /* end ensureFrameIsMarried:SP: */; + l302: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -4452,7 +4451,7 @@ GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l297; + goto l298; } if (unwindContextOrNilOrZero != 0) { /* begin internalAboutToReturn:through: */ @@ -4464,10 +4463,10 @@ : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); ourContext1 = longAt(localFP + FoxThisContext); - goto l298; + goto l299; } ourContext1 = marryFrameSP(localFP, localSP); - l298: /* end ensureFrameIsMarried:SP: */; + l299: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext1); /* begin internalPush: */ @@ -4478,7 +4477,7 @@ GIV(argumentCount) = 2; goto normalSend; /* return self */ - goto l297; + goto l298; } contextToReturnTo = null; if (((longAt((home + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1)) { @@ -4537,10 +4536,10 @@ : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); ourContext2 = longAt(localFP + FoxThisContext); - goto l300; + goto l301; } ourContext2 = marryFrameSP(localFP, localSP); - l300: /* end ensureFrameIsMarried:SP: */; + l301: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext2); /* begin internalPush: */ @@ -4549,7 +4548,7 @@ GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l297; + goto l298; } } assert(pageListIsWellFormed()); @@ -4660,7 +4659,7 @@ GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l297; + goto l298; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } @@ -4678,7 +4677,7 @@
/* return self */ } - l297: /* end case */; + l298: /* end case */; break; case 121: /* returnTrue */ @@ -4798,27 +4797,27 @@ fp = (thePage->headFP); if (fp == theFP) { frameAbove = 0; - goto l304; + goto l305; } while (((callerFP = frameCallerFP(fp))) != 0) { if (callerFP == theFP) { frameAbove = fp; - goto l304; + goto l305; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l304: /* end findFrameAbove:inPage: */; + l305: /* end findFrameAbove:inPage: */; /* begin newStackPage */ lruOrFree = ((mostRecentlyUsedPage())->nextPage); if (isFree(lruOrFree)) { newPage = lruOrFree; - goto l305; + goto l306; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l305: /* end newStackPage */; + l306: /* end newStackPage */; assert(newPage == GIV(stackPage)); moveFramesInthroughtoPage(thePage, frameAbove, newPage); markStackPageMostRecentlyUsed(newPage); @@ -4842,7 +4841,7 @@ longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); GIV(stackPointer) = sp2; ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorCannotReturn << ShiftForWord)), contextToReturnFrom, 1); - goto l303; + goto l304; } GIV(instructionPointer) = 0; thePage = makeBaseFrameFor(contextToReturnTo); @@ -4881,7 +4880,7 @@ GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l303; + goto l304; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } @@ -4899,8 +4898,8 @@ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
/* return self */ - l303: /* end baseFrameReturn */; - goto l302; + l304: /* end baseFrameReturn */; + goto l303; } /* begin frameCallerSavedIP: */ localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP)); @@ -4929,7 +4928,7 @@ GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l302; + goto l303; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } @@ -4946,7 +4945,7 @@
longAtPointerput(localSP, localReturnValue); } - l302: /* end case */; + l303: /* end case */; break; case 126: /* dynamicSuperSendBytecode */ @@ -5238,7 +5237,7 @@ GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l309; + goto l310; }
/* second probe */ @@ -5249,7 +5248,7 @@ GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l309; + goto l310; } probe = (((usqInt) hash) >> 2) & MethodCacheMask; if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector)) @@ -5257,10 +5256,10 @@ GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l309; + goto l310; } ok = 0; - l309: /* end inlineLookupInMethodCacheSel:classTag: */; + l310: /* end inlineLookupInMethodCacheSel:classTag: */; if (ok) { /* begin ifAppropriateCompileToNativeCode:selector: */ methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord)); @@ -5298,7 +5297,7 @@ localFP = pointerForOop(GIV(framePointer)); addNewMethodToCache(GIV(lkupClass)); } - l306: /* end internalFindNewMethod */; + l307: /* end internalFindNewMethod */; /* begin internalExecuteNewMethod */ VM_LABEL(0internalExecuteNewMethod); if (primitiveFunctionPointer != 0) { @@ -5312,31 +5311,31 @@ if (localPrimIndex >= 264) { longAtPointerput(localSP, longAt(((longAtPointer(localSP)) + BaseHeaderSize) + ((localPrimIndex - 264) << ShiftForWord))); 1; - goto l310; + goto l311; } if (localPrimIndex == 256) { 1; - goto l310; + goto l311; } if (localPrimIndex == 257) { longAtPointerput(localSP, GIV(trueObj)); 1; - goto l310; + goto l311; } if (localPrimIndex == 258) { longAtPointerput(localSP, GIV(falseObj)); 1; - goto l310; + goto l311; } if (localPrimIndex == 259) { longAtPointerput(localSP, GIV(nilObj)); 1; - goto l310; + goto l311; } longAtPointerput(localSP, (((localPrimIndex - 261) << 1) | 1)); 1; - l310: /* end internalQuickPrimitiveResponse */; - goto l308; + l311: /* end internalQuickPrimitiveResponse */; + goto l309; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -5394,7 +5393,7 @@ returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); null; - goto l308; + goto l309; } } if (methodHasCogMethod(GIV(newMethod))) { @@ -5475,11 +5474,11 @@ table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (PrimErrTableIndex << ShiftForWord)); if (GIV(primFailCode) <= ((lastPointerOf(table)) / BytesPerWord)) { errorCode = longAt((table + BaseHeaderSize) + ((GIV(primFailCode) - 1) << ShiftForWord)); - goto l307; + goto l308; } } errorCode = ((GIV(primFailCode) << 1) | 1); - l307: /* end getErrorObjectFromPrimFailCode */; + l308: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -5503,7 +5502,7 @@ localFP = pointerForOop(GIV(framePointer)); } } - l308: /* end internalExecuteNewMethod */; + l309: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -6899,7 +6898,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l311; + goto l312; } if (bytecode == 172) {
@@ -6909,7 +6908,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l311; + goto l312; } if (bytecode > 167) {
@@ -6920,7 +6919,7 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l311; + goto l312; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -6928,7 +6927,7 @@ /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l311: /* end case */; + l312: /* end case */; break; case 179: /* bytecodePrimGreaterThan */ @@ -7078,7 +7077,7 @@ localIP = (localIP + (bytecode - 151)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l312; + goto l313; } if (bytecode == 172) {
@@ -7089,14 +7088,14 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l312; + goto l313; } currentBytecode = bytecode + GIV(bytecodeSetSelector);
/* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l312: /* end case */; + l313: /* end case */; break; case 180: /* bytecodePrimLessOrEqual */ @@ -9793,7 +9792,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l313; + goto l314; } if (bytecode == 244) {
@@ -9803,7 +9802,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l313; + goto l314; } if (bytecode == 243) {
@@ -9814,7 +9813,7 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l313; + goto l314; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -9822,7 +9821,7 @@ /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l313: /* end case */; + l314: /* end case */; break; case 339: /*83*/ /* bytecodePrimGreaterThanV4 */ @@ -9972,7 +9971,7 @@ localIP = (localIP + (bytecode - 207)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l314; + goto l315; } if (bytecode == 244) {
@@ -9983,14 +9982,14 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l314; + goto l315; } currentBytecode = bytecode + GIV(bytecodeSetSelector);
/* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l314: /* end case */; + l315: /* end case */; break; case 340: /*84*/ /* bytecodePrimLessOrEqualV4 */ @@ -12137,10 +12136,10 @@ : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); ourContext = longAt(theFP + FoxThisContext); - goto l315; + goto l316; } ourContext = marryFrameSP(theFP, theSP); - l315: /* end ensureFrameIsMarried:SP: */; + l316: /* end ensureFrameIsMarried:SP: */; localIP -= 1; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); @@ -13043,11 +13042,13 @@ { sqInt byte1; sqInt byte2; + sqInt prim;
VM_LABEL(0callPrimitiveBytecode); error("callPrimitiveBytecode should not be evaluated. method activation should step beyond this bytecode.");
} + l296: /* end case */; break; case 509: /*253*/ /* extPushClosureBytecode */ @@ -13081,10 +13082,10 @@ : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); context = longAt(theFP + FoxThisContext); - goto l296; + goto l297; } context = marryFrameSP(theFP, theSP); - l296: /* end ensureFrameIsMarried:SP: */; + l297: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ VM_LABEL(1closureInnumArgsinstructionPointernumCopiedValues); newClosure1 = eeInstantiateSmallClassnumSlots(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBlockClosure << ShiftForWord)), ClosureFirstCopiedValueIndex + numCopied); @@ -20426,7 +20427,6 @@ synchronousSignal(sqInt aSemaphore) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt excessSignals; - sqInt firstLink;
if (isEmptyList(aSemaphore)) {
@@ -20446,7 +20446,7 @@ null; return 0; } - + /* begin ensureSemaphoreForwardedThroughContext: */ return resumepreemptedYieldingIffrom(removeFirstLinkOfList(aSemaphore), GIV(preemptionYields), CSSignal); }
@@ -36766,15 +36766,17 @@ sqInt header1; sqInt header2; sqInt header3; + sqInt header4; usqInt lastWord; sqInt newFreeChunk; sqInt newOop; - usqInt next; + sqInt next; sqInt oop; sqInt realHeader; sqInt sz; sqInt sz1; sqInt sz2; + sqInt sz3; sqInt target; usqInt w;
@@ -36785,7 +36787,21 @@ /* begin objectAfterWhileForwarding: */ header2 = longAt(oop); if ((header2 & MarkBit) == 0) { - next = ((sqInt) (objectAfter(oop))); + /* begin objectAfter: */ + if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) { + error("no objects after the end of memory"); + } + if (((longAt(oop)) & TypeMask) == HeaderTypeFree) { + sz2 = (longAt(oop)) & AllButTypeMask; + } + else { + /* begin sizeBitsOf: */ + header3 = longAt(oop); + sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass + ? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask + : header3 & SizeMask); + } + next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]); goto l1; } fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1; @@ -36800,7 +36816,7 @@ else { sz1 = realHeader & SizeMask; } - next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]))); + next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]); l1: /* end objectAfterWhileForwarding: */; if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
@@ -36854,18 +36870,18 @@ } /* begin safeObjectAfter: */ if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) { - sz2 = (longAt(newFreeChunk)) & AllButTypeMask; + sz3 = (longAt(newFreeChunk)) & AllButTypeMask; } else { /* begin sizeBitsOf: */ - header3 = longAt(newFreeChunk); - sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass + header4 = longAt(newFreeChunk); + sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass ? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask - : header3 & SizeMask); + : header4 & SizeMask); } - next = ((newFreeChunk + sz2) >= GIV(freeStart) + next = ((newFreeChunk + sz3) >= GIV(freeStart) ? GIV(freeStart) - : (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask])); + : (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask])); assert((next == GIV(freeStart)) || (next == (oopFromChunk(GIV(compEnd))))); if (next == GIV(freeStart)) { @@ -38737,7 +38753,7 @@ given object or free chunk in memory. Return freeStart when enumeration is complete. This is for assertion checking only. */
-static usqInt +static sqInt safeObjectAfter(sqInt oop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt header; @@ -40850,12 +40866,6 @@ return (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1; }
-static void -followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth) -{ - error("shouldNotImplement"); -} - static sqInt followForwarded(sqInt objOop) {
Modified: branches/Cog/nscogsrc/vm/cointerp.h =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.h 2014-09-18 17:12:31 UTC (rev 3081) +++ branches/Cog/nscogsrc/vm/cointerp.h 2014-09-25 17:53:41 UTC (rev 3082) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.881 uuid: 539d444b-dd24-4254-a007-bd1e298e84f7 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d */
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2014-09-18 17:12:31 UTC (rev 3081) +++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2014-09-25 17:53:41 UTC (rev 3082) @@ -2,11 +2,11 @@
/* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.881 uuid: 539d444b-dd24-4254-a007-bd1e298e84f7 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d from - CoInterpreter VMMaker.oscog-eem.881 uuid: 539d444b-dd24-4254-a007-bd1e298e84f7 + CoInterpreter VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.881 uuid: 539d444b-dd24-4254-a007-bd1e298e84f7 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -855,7 +855,7 @@ void printWronglySizedContexts(sqInt printContexts); static void restoreHeadersFromtofromandtofrom(sqInt firstIn, sqInt lastIn, sqInt hdrBaseIn, sqInt firstOut, sqInt lastOut, sqInt hdrBaseOut) NoDbgRegParms; static void runLeakCheckerForFullGC(sqInt fullGCFlag) NoDbgRegParms; -static usqInt safeObjectAfter(sqInt oop) NoDbgRegParms; +static sqInt safeObjectAfter(sqInt oop) NoDbgRegParms; static sqInt safePrintStringOf(sqInt oop) NoDbgRegParms; static sqInt shortentoIndexableSize(sqInt obj, sqInt nSlots) NoDbgRegParms; static sqInt sizeBitsOfSafe(sqInt oop) NoDbgRegParms; @@ -926,7 +926,6 @@ void * firstIndexableField(sqInt oop); sqInt firstLongFormat(void); static sqInt fixedFieldsOfformatlength(sqInt oop, sqInt fmt, sqInt wordLength) NoDbgRegParms; -static void followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth) NoDbgRegParms; static sqInt followForwarded(sqInt objOop) NoDbgRegParms; sqInt formatOfClass(sqInt classPointer); static sqInt fwdBlockValid(sqInt addr) NoDbgRegParms; @@ -2089,7 +2088,7 @@ /* 574 */ (void (*)(void))0, /* 575 */ (void (*)(void))0, 0 }; -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.881"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.882"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -4394,7 +4393,7 @@ ? ((longAt(localFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0 : (byteAt((localFP + FoxIFrameFlags) + 3)) != 0))) { goto commonCallerReturn; - goto l297; + goto l298; } closure = longAt(localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory()) ? ((mframeCogMethod(localFP))->cmNumArgs) @@ -4431,11 +4430,11 @@ theMethod = longAt((home + BaseHeaderSize) + (MethodIndex << ShiftForWord)); if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) { unwindContextOrNilOrZero = home; - goto l299; + goto l300; } } unwindContextOrNilOrZero = ctxtOrNilOrZero; - l299: /* end internalFindUnwindThroughContext: */; + l300: /* end internalFindUnwindThroughContext: */; if (unwindContextOrNilOrZero == GIV(nilObj)) {
/* error: can't find home on chain; cannot return */ @@ -4449,10 +4448,10 @@ : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); ourContext = longAt(localFP + FoxThisContext); - goto l301; + goto l302; } ourContext = marryFrameSP(localFP, localSP); - l301: /* end ensureFrameIsMarried:SP: */; + l302: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); /* begin internalPush: */ @@ -4461,7 +4460,7 @@ GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l297; + goto l298; } if (unwindContextOrNilOrZero != 0) { /* begin internalAboutToReturn:through: */ @@ -4473,10 +4472,10 @@ : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); ourContext1 = longAt(localFP + FoxThisContext); - goto l298; + goto l299; } ourContext1 = marryFrameSP(localFP, localSP); - l298: /* end ensureFrameIsMarried:SP: */; + l299: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext1); /* begin internalPush: */ @@ -4487,7 +4486,7 @@ GIV(argumentCount) = 2; goto normalSend; /* return self */ - goto l297; + goto l298; } contextToReturnTo = null; if (((longAt((home + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1)) { @@ -4546,10 +4545,10 @@ : (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(localFP))); ourContext2 = longAt(localFP + FoxThisContext); - goto l300; + goto l301; } ourContext2 = marryFrameSP(localFP, localSP); - l300: /* end ensureFrameIsMarried:SP: */; + l301: /* end ensureFrameIsMarried:SP: */; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext2); /* begin internalPush: */ @@ -4558,7 +4557,7 @@ GIV(argumentCount) = 1; goto normalSend; /* return self */ - goto l297; + goto l298; } } assert(pageListIsWellFormed()); @@ -4669,7 +4668,7 @@ GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l297; + goto l298; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } @@ -4687,7 +4686,7 @@
/* return self */ } - l297: /* end case */; + l298: /* end case */; BREAK; CASE(121) /* returnTrue */ @@ -4807,27 +4806,27 @@ fp = (thePage->headFP); if (fp == theFP) { frameAbove = 0; - goto l304; + goto l305; } while (((callerFP = frameCallerFP(fp))) != 0) { if (callerFP == theFP) { frameAbove = fp; - goto l304; + goto l305; } fp = callerFP; } error("did not find theFP in stack page"); frameAbove = 0; - l304: /* end findFrameAbove:inPage: */; + l305: /* end findFrameAbove:inPage: */; /* begin newStackPage */ lruOrFree = ((mostRecentlyUsedPage())->nextPage); if (isFree(lruOrFree)) { newPage = lruOrFree; - goto l305; + goto l306; } divorceFramesIn(lruOrFree); newPage = lruOrFree; - l305: /* end newStackPage */; + l306: /* end newStackPage */; assert(newPage == GIV(stackPage)); moveFramesInthroughtoPage(thePage, frameAbove, newPage); markStackPageMostRecentlyUsed(newPage); @@ -4851,7 +4850,7 @@ longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer)); GIV(stackPointer) = sp2; ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorCannotReturn << ShiftForWord)), contextToReturnFrom, 1); - goto l303; + goto l304; } GIV(instructionPointer) = 0; thePage = makeBaseFrameFor(contextToReturnTo); @@ -4890,7 +4889,7 @@ GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l303; + goto l304; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } @@ -4908,8 +4907,8 @@ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
/* return self */ - l303: /* end baseFrameReturn */; - goto l302; + l304: /* end baseFrameReturn */; + goto l303; } /* begin frameCallerSavedIP: */ localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP)); @@ -4938,7 +4937,7 @@ GIV(framePointer) = localFP; ceEnterCogCodePopReceiverReg(); - goto l302; + goto l303; } localIP = pointerForOop(longAt(localFP + FoxIFSavedIP)); } @@ -4955,7 +4954,7 @@
longAtPointerput(localSP, localReturnValue); } - l302: /* end case */; + l303: /* end case */; BREAK; CASE(126) /* dynamicSuperSendBytecode */ @@ -5247,7 +5246,7 @@ GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l309; + goto l310; }
/* second probe */ @@ -5258,7 +5257,7 @@ GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l309; + goto l310; } probe = (((usqInt) hash) >> 2) & MethodCacheMask; if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector)) @@ -5266,10 +5265,10 @@ GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod]; primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction])); ok = 1; - goto l309; + goto l310; } ok = 0; - l309: /* end inlineLookupInMethodCacheSel:classTag: */; + l310: /* end inlineLookupInMethodCacheSel:classTag: */; if (ok) { /* begin ifAppropriateCompileToNativeCode:selector: */ methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord)); @@ -5307,7 +5306,7 @@ localFP = pointerForOop(GIV(framePointer)); addNewMethodToCache(GIV(lkupClass)); } - l306: /* end internalFindNewMethod */; + l307: /* end internalFindNewMethod */; /* begin internalExecuteNewMethod */ VM_LABEL(0internalExecuteNewMethod); if (primitiveFunctionPointer != 0) { @@ -5321,31 +5320,31 @@ if (localPrimIndex >= 264) { longAtPointerput(localSP, longAt(((longAtPointer(localSP)) + BaseHeaderSize) + ((localPrimIndex - 264) << ShiftForWord))); 1; - goto l310; + goto l311; } if (localPrimIndex == 256) { 1; - goto l310; + goto l311; } if (localPrimIndex == 257) { longAtPointerput(localSP, GIV(trueObj)); 1; - goto l310; + goto l311; } if (localPrimIndex == 258) { longAtPointerput(localSP, GIV(falseObj)); 1; - goto l310; + goto l311; } if (localPrimIndex == 259) { longAtPointerput(localSP, GIV(nilObj)); 1; - goto l310; + goto l311; } longAtPointerput(localSP, (((localPrimIndex - 261) << 1) | 1)); 1; - l310: /* end internalQuickPrimitiveResponse */; - goto l308; + l311: /* end internalQuickPrimitiveResponse */; + goto l309; } /* begin externalizeIPandSP */ assert((((usqInt)localIP)) != (ceReturnToInterpreterPC())); @@ -5403,7 +5402,7 @@ returntoExecutive(popStack(), 1); browserPluginReturnIfNeeded(); null; - goto l308; + goto l309; } } if (methodHasCogMethod(GIV(newMethod))) { @@ -5484,11 +5483,11 @@ table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (PrimErrTableIndex << ShiftForWord)); if (GIV(primFailCode) <= ((lastPointerOf(table)) / BytesPerWord)) { errorCode = longAt((table + BaseHeaderSize) + ((GIV(primFailCode) - 1) << ShiftForWord)); - goto l307; + goto l308; } } errorCode = ((GIV(primFailCode) << 1) | 1); - l307: /* end getErrorObjectFromPrimFailCode */; + l308: /* end getErrorObjectFromPrimFailCode */; longAtPointerput(localSP, errorCode); } GIV(primFailCode) = 0; @@ -5512,7 +5511,7 @@ localFP = pointerForOop(GIV(framePointer)); } } - l308: /* end internalExecuteNewMethod */; + l309: /* end internalExecuteNewMethod */; /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -6908,7 +6907,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l311; + goto l312; } if (bytecode == 172) {
@@ -6918,7 +6917,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l311; + goto l312; } if (bytecode > 167) {
@@ -6929,7 +6928,7 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l311; + goto l312; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -6937,7 +6936,7 @@ /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l311: /* end case */; + l312: /* end case */; BREAK; CASE(179) /* bytecodePrimGreaterThan */ @@ -7087,7 +7086,7 @@ localIP = (localIP + (bytecode - 151)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l312; + goto l313; } if (bytecode == 172) {
@@ -7098,14 +7097,14 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l312; + goto l313; } currentBytecode = bytecode + GIV(bytecodeSetSelector);
/* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l312: /* end case */; + l313: /* end case */; BREAK; CASE(180) /* bytecodePrimLessOrEqual */ @@ -9802,7 +9801,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l313; + goto l314; } if (bytecode == 244) {
@@ -9812,7 +9811,7 @@ /* begin fetchNextBytecode */ currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- goto l313; + goto l314; } if (bytecode == 243) {
@@ -9823,7 +9822,7 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l313; + goto l314; } } currentBytecode = bytecode + GIV(bytecodeSetSelector); @@ -9831,7 +9830,7 @@ /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(trueObj)); } - l313: /* end case */; + l314: /* end case */; BREAK; CASE(339) /*83*/ /* bytecodePrimGreaterThanV4 */ @@ -9981,7 +9980,7 @@ localIP = (localIP + (bytecode - 207)) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l314; + goto l315; } if (bytecode == 244) {
@@ -9992,14 +9991,14 @@ localIP = (localIP + offset) + 1; currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
- goto l314; + goto l315; } currentBytecode = bytecode + GIV(bytecodeSetSelector);
/* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), GIV(falseObj)); } - l314: /* end case */; + l315: /* end case */; BREAK; CASE(340) /*84*/ /* bytecodePrimLessOrEqualV4 */ @@ -12146,10 +12145,10 @@ : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); ourContext = longAt(theFP + FoxThisContext); - goto l315; + goto l316; } ourContext = marryFrameSP(theFP, theSP); - l315: /* end ensureFrameIsMarried:SP: */; + l316: /* end ensureFrameIsMarried:SP: */; localIP -= 1; /* begin internalPush: */ longAtPointerput((localSP -= BytesPerOop), ourContext); @@ -13052,11 +13051,13 @@ { sqInt byte1; sqInt byte2; + sqInt prim;
VM_LABEL(0callPrimitiveBytecode); error("callPrimitiveBytecode should not be evaluated. method activation should step beyond this bytecode.");
} + l296: /* end case */; BREAK; CASE(509) /*253*/ /* extPushClosureBytecode */ @@ -13090,10 +13091,10 @@ : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) { assert(isContext(frameContext(theFP))); context = longAt(theFP + FoxThisContext); - goto l296; + goto l297; } context = marryFrameSP(theFP, theSP); - l296: /* end ensureFrameIsMarried:SP: */; + l297: /* end ensureFrameIsMarried:SP: */; /* begin closureIn:numArgs:instructionPointer:numCopiedValues: */ VM_LABEL(1closureInnumArgsinstructionPointernumCopiedValues); newClosure1 = eeInstantiateSmallClassnumSlots(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBlockClosure << ShiftForWord)), ClosureFirstCopiedValueIndex + numCopied); @@ -20435,7 +20436,6 @@ synchronousSignal(sqInt aSemaphore) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt excessSignals; - sqInt firstLink;
if (isEmptyList(aSemaphore)) {
@@ -20455,7 +20455,7 @@ null; return 0; } - + /* begin ensureSemaphoreForwardedThroughContext: */ return resumepreemptedYieldingIffrom(removeFirstLinkOfList(aSemaphore), GIV(preemptionYields), CSSignal); }
@@ -36775,15 +36775,17 @@ sqInt header1; sqInt header2; sqInt header3; + sqInt header4; usqInt lastWord; sqInt newFreeChunk; sqInt newOop; - usqInt next; + sqInt next; sqInt oop; sqInt realHeader; sqInt sz; sqInt sz1; sqInt sz2; + sqInt sz3; sqInt target; usqInt w;
@@ -36794,7 +36796,21 @@ /* begin objectAfterWhileForwarding: */ header2 = longAt(oop); if ((header2 & MarkBit) == 0) { - next = ((sqInt) (objectAfter(oop))); + /* begin objectAfter: */ + if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) { + error("no objects after the end of memory"); + } + if (((longAt(oop)) & TypeMask) == HeaderTypeFree) { + sz2 = (longAt(oop)) & AllButTypeMask; + } + else { + /* begin sizeBitsOf: */ + header3 = longAt(oop); + sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass + ? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask + : header3 & SizeMask); + } + next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]); goto l1; } fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1; @@ -36809,7 +36825,7 @@ else { sz1 = realHeader & SizeMask; } - next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]))); + next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]); l1: /* end objectAfterWhileForwarding: */; if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
@@ -36863,18 +36879,18 @@ } /* begin safeObjectAfter: */ if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) { - sz2 = (longAt(newFreeChunk)) & AllButTypeMask; + sz3 = (longAt(newFreeChunk)) & AllButTypeMask; } else { /* begin sizeBitsOf: */ - header3 = longAt(newFreeChunk); - sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass + header4 = longAt(newFreeChunk); + sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass ? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask - : header3 & SizeMask); + : header4 & SizeMask); } - next = ((newFreeChunk + sz2) >= GIV(freeStart) + next = ((newFreeChunk + sz3) >= GIV(freeStart) ? GIV(freeStart) - : (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask])); + : (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask])); assert((next == GIV(freeStart)) || (next == (oopFromChunk(GIV(compEnd))))); if (next == GIV(freeStart)) { @@ -38746,7 +38762,7 @@ given object or free chunk in memory. Return freeStart when enumeration is complete. This is for assertion checking only. */
-static usqInt +static sqInt safeObjectAfter(sqInt oop) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt header; @@ -40859,12 +40875,6 @@ return (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1; }
-static void -followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth) -{ - error("shouldNotImplement"); -} - static sqInt followForwarded(sqInt objOop) {
Modified: branches/Cog/nsspursrc/vm/cogit.c =================================================================== --- branches/Cog/nsspursrc/vm/cogit.c 2014-09-18 17:12:31 UTC (rev 3081) +++ branches/Cog/nsspursrc/vm/cogit.c 2014-09-25 17:53:41 UTC (rev 3082) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGenerator VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 + CCodeGenerator VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d from - StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 + StackToRegisterMappingCogit VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d */ -static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ; +static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.882 uuid: f22a00ff-acaf-49b0-9f6d-44efec689c0d " __DATE__ ; char *__cogitBuildInfo = __buildInfo;
@@ -9367,7 +9367,8 @@ voidYoungReferrersPostTenureAll(); } assert(allMethodsHaveCorrectHeader()); - assert(kosherYoungReferrers()); + assert((gcMode == GCModeBecome) + || (kosherYoungReferrers())); }
@@ -10555,8 +10556,6 @@ } if (freedPIC) { unlinkSendsToFree(); - pruneYoungReferrers(); - flushICacheFromto(processor, codeBase, ((sqInt)(limitZony()))); } }
@@ -10655,8 +10654,6 @@ } if (freedMethod) { unlinkSendsToFree(); - pruneYoungReferrers(); - flushICacheFromto(processor, codeBase, ((sqInt)(limitZony()))); } }
@@ -12225,10 +12222,8 @@ } cogMethod = ((CogMethod *) (roundUpLength((((sqInt)cogMethod)) + ((cogMethod->blockSize))))); } - pruneYoungReferrers(); if (freedPIC) { unlinkSendsToFree(); - codeModified = 1; } if (codeModified) {
@@ -14039,6 +14034,7 @@
if ((((targetMethod1->cmType)) == CMFree) || (((targetMethod1->selector)) == theSelector)) { + /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); codeModified = 1; @@ -14090,6 +14086,7 @@ }
if (((targetMethod1->cmType)) == CMFree) { + /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); codeModified = 1; @@ -14133,8 +14130,10 @@ } }
+ /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); + codeModified = 1;
} else { @@ -14181,6 +14180,7 @@ }
if ((((sqInt)targetMethod1)) == theCogMethod) { + /* begin unlinkSendAt:targetMethod:sendTable: */ unlinkedRoutine = sendTable1[((((targetMethod1->cmNumArgs)) < (NumSendTrampolines - 1)) ? ((targetMethod1->cmNumArgs)) : (NumSendTrampolines - 1))]; rewriteInlineCacheAttagtarget(backEnd, ((sqInt)mcpc), (targetMethod1->selector), unlinkedRoutine); codeModified = 1; @@ -14472,6 +14472,7 @@ cacheAddress = implicitReceiveCacheAt(backEnd, mcpc); unalignedLongAtput(backEnd, cacheAddress, 0); unalignedLongAtput(backEnd, cacheAddress + BytesPerOop, 0); + }
static AbstractInstruction * @@ -14740,12 +14741,11 @@
} /* begin maybeFreeCountersOf: */
@@ Diff output truncated at 50000 characters. @@
vm-dev@lists.squeakfoundation.org