Revision: 3236 Author: eliot Date: 2015-01-29 14:35:45 -0800 (Thu, 29 Jan 2015) Log Message: ----------- CogVM source as per VMMaker.oscog-eem.1029
Spur: Make postBecomeAction's stack sweep only occur in Spur (fix regression). Refactor so that the scan is not inlined. Don't assume newMethod is non-immediate in post-become actions.
Fix stack adjust slip in primitiveSmallFloatTimesTwoPower
Make ensureBehaviorHash: fail for uninitialized behaviours and hence fix the Behavior basicNew basicNew hang.
Fix word size assumption in assert in withoutSmallIntegerTags:
LargeIntegersPlugin: Remove/fix assumption of 32-bit digit length in normalization routines.
Modified Paths: -------------- branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c branches/Cog/nscogsrc/vm/cointerp.c branches/Cog/nscogsrc/vm/cointerp.h branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 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/sistasrc/vm/cointerp.c branches/Cog/sistasrc/vm/cointerp.h branches/Cog/sistasrc/vm/gcc3x-cointerp.c branches/Cog/spursistasrc/vm/cointerp.c branches/Cog/spursistasrc/vm/cointerp.h branches/Cog/spursistasrc/vm/gcc3x-cointerp.c branches/Cog/spursrc/vm/cointerp.c branches/Cog/spursrc/vm/cointerp.h branches/Cog/spursrc/vm/gcc3x-cointerp.c branches/Cog/spurstack64src/vm/gcc3x-interp.c branches/Cog/spurstack64src/vm/interp.c branches/Cog/spurstacksrc/vm/gcc3x-interp.c branches/Cog/spurstacksrc/vm/interp.c branches/Cog/src/plugins/LargeIntegers/LargeIntegers.c 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/nscogsrc/plugins/LargeIntegers/LargeIntegers.c =================================================================== --- branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c 2015-01-25 22:39:42 UTC (rev 3235) +++ branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c 2015-01-29 22:35:45 UTC (rev 3236) @@ -1,9 +1,9 @@ /* Automatically generated by - SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d + SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1028 uuid: 19752f44-5207-45a2-9930-ae424e662f66 from - LargeIntegersPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d + LargeIntegersPlugin VMMaker.oscog-eem.1028 uuid: 19752f44-5207-45a2-9930-ae424e662f66 */ -static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ; +static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.1028 uuid: 19752f44-5207-45a2-9930-ae424e662f66 " __DATE__ ;
@@ -173,9 +173,9 @@ struct VirtualMachine* interpreterProxy; static const char *moduleName = #ifdef SQUEAK_BUILTIN_PLUGIN - "LargeIntegers v1.5 VMMaker.oscog-eem.983 (i)" + "LargeIntegers v1.5 VMMaker.oscog-eem.1028 (i)" #else - "LargeIntegers v1.5 VMMaker.oscog-eem.983 (e)" + "LargeIntegers v1.5 VMMaker.oscog-eem.1028 (e)" #endif ; static const int orOpIndex = 1; @@ -2170,7 +2170,9 @@
/* SmallInteger minVal digitLength */
- sLen = 4; + sLen = ((MinSmallInteger) < -1073741824 + ? 8 + : 4); if (len <= sLen) {
/* SmallInteger minVal */ @@ -2189,8 +2191,7 @@ } for (i = 1; i <= sLen; i += 1) {
- /* If all digits same, then = minVal (sr: minVal digits 1 to 3 are - 0) */ + /* If all digits same, then = minVal (sr: minVal digits 1 to 3 are 0) */
if (!((digitOfBytesat(aLargeNegativeInteger, i)) == (cDigitOfCSIat(minVal, i)))) {
@@ -2243,10 +2244,9 @@ if (len == 0) { return integerObjectOf(0); } - - /* SmallInteger maxVal digitLength. */ - - sLen = BytesPerOop; + sLen = ((MinSmallInteger) > 0x3FFFFFFF + ? 8 + : 4); if ((len <= sLen) && ((digitOfBytesat(aLargePositiveInteger, sLen)) <= (cDigitOfCSIat(MaxSmallInteger, sLen)))) {
Modified: branches/Cog/nscogsrc/vm/cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.c 2015-01-25 22:39:42 UTC (rev 3235) +++ branches/Cog/nscogsrc/vm/cointerp.c 2015-01-29 22:35:45 UTC (rev 3236) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 from - CoInterpreter VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 + CoInterpreter VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -111,8 +111,6 @@ #define AtCacheSize 2 #define AtCacheTotalSize 64 #define AtPutBase 32 -#define BecameActiveClassFlag 8 -#define BecameCompiledMethodFlag 2 #define Byte0Mask 0xFF #define Byte1Mask 0xFF00 #define Byte1Shift 8 @@ -447,7 +445,6 @@ static sqInt externalInstVarofContext(sqInt offset, sqInt aContext) NoDbgRegParms; static void findNewMethodInClassTag(sqInt classTagArg) NoDbgRegParms; sqInt flushExternalPrimitiveOf(sqInt methodObj); -static void followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) NoDbgRegParms; void forceInterruptCheckFromHeartbeat(void); static sqInt frameCallerContext(char *theFP) NoDbgRegParms; static sqInt frameCallerContextput(char *theFP, sqInt aValue) NoDbgRegParms; @@ -1048,6 +1045,7 @@ sqInt copiedValueCountOfClosure(sqInt closurePointer); sqInt copyBits(void); sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y); +static sqInt couldBeProcess(sqInt oop) NoDbgRegParms NeverInline; static void cr(void); static void createActualMessageTo(sqInt lookupClass) NoDbgRegParms; static sqInt defaultNumStackPages(void); @@ -1206,7 +1204,7 @@ void printOop(sqInt oop); void printProcessStack(sqInt aProcess); sqInt printProcsOnList(sqInt procList); -sqInt printStackCallStackOf(sqInt frameOrContext); +sqInt printStackCallStackOf(sqInt aContextOrProcessOrFrame); void printStackPageList(void); void printStackPageListInUse(void); void printStackPages(void); @@ -1362,14 +1360,14 @@ _iss sqInt numStackPages; _iss sqInt tempOop; _iss sqInt needGCFlag; -_iss sqInt profileProcess; _iss sqLong nextProfileTick; _iss sqInt jmpDepth; _iss sqInt longRunningPrimitiveCheckSemaphore; +_iss sqInt profileProcess; _iss sqInt profileSemaphore; -_iss sqInt profileMethod; _iss usqInt fwdTableNext; _iss sqInt longRunningPrimitiveCheckMethod; +_iss sqInt profileMethod; _iss usqInt compStart; _iss sqInt extraRootCount; _iss sqInt statGrowMemory; @@ -1458,8 +1456,8 @@ _iss sqInt overflowLimit; _iss StackPage * overflowedPage; _iss sqInt the2ndUnknownShort; -_iss long methodCache[MethodCacheSize + 1 /* 4097 */]; _iss sqInt atCache[AtCacheTotalSize + 1 /* 65 */]; +_iss long methodCache[MethodCacheSize + 1 /* 4097 */]; _iss sqInt traceLog[TraceBufferSize /* 768 */]; _iss sqInt remapBuffer[RemapBufferSize + 1 /* 26 */]; _iss sqInt primTraceLog[256]; @@ -2099,7 +2097,7 @@ /* 575 */ (void (*)(void))0, 0 }; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1026"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1029"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -16335,98 +16333,6 @@ }
-/* Spur's become: is lazy, turning the becommed object into a forwarding - object to the other. - The read-barrier is minimised by arranging that forwarding pointers will - fail a method cache - probe, since notionally objects' internals are accessed only via sending - messages to them, - the exception is primitives that access the internals of the non-receiver - argument(s). To avoid a read barrier on inst var fetch we scan the - receivers in the stack zone and follow - any forwarded ones. This is way cheaper than scanning all of memory as in - the old become. */ - -static void -followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - char *callerFP; - sqInt delta; - sqInt i; - sqInt newOop; - sqInt numArgs; - sqInt offset; - usqInt oop; - char *theFP; - usqInt theIPPtr; - StackPage *thePage; - char *theSP; - - if (theBecomeEffectsFlags & BecameCompiledMethodFlag) { - ; - - } - assert(GIV(stackPage) != 0); - for (i = 0; i < GIV(numStackPages); i += 1) { - /* begin stackPageAt: */ - thePage = stackPageAtpages(i, GIV(pages)); - if (!(((thePage->baseFP)) == 0)) { - theSP = (thePage->headSP); - - /* Skip the instruction pointer on top of stack of inactive pages. */ - - theFP = (thePage->headFP); - if (thePage == GIV(stackPage)) { - theIPPtr = 0; - } - else { - theIPPtr = ((usqInt)theSP); - theSP += BytesPerWord; - } - while (1) { - assert(addressIsInPage(thePage, theFP)); - assert((theIPPtr == 0) - || (addressIsInPage(thePage, ((void *)theIPPtr)))); - /* begin frameStackedReceiverOffsetNumArgs: */ - numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((mframeCogMethod(theFP))->cmNumArgs) - : byteAt((theFP + FoxIFrameFlags) + 1)); - offset = (FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord())); - oop = longAt(theFP + offset); - - if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) - && (isForwarded(longAt(theFP + FoxThisContext)))) { - longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext))); - } - if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { - oop = longAt(theFP + FoxMFReceiver); - - oop = ((mframeHomeMethod(theFP))->methodObject); - assert(!(isForwarded(oop))); - } - else { - oop = longAt(theFP + FoxIFReceiver); - - oop = longAt(theFP + FoxMethod); - - } - if (!(((callerFP = frameCallerFP(theFP))) != 0)) break; - theIPPtr = ((usqInt)(theFP + FoxCallerSavedIP)); - theFP = callerFP; - } - theSP = ((thePage->baseAddress)) - BytesPerWord; - while (theSP <= ((thePage->baseAddress))) { - oop = longAt(theSP); - - theSP += BytesPerWord; - } - } - } -} - - /* Force an interrupt check ASAP. This version is the entry-point to forceInterruptCheck for the heartbeat timer to allow for repeatable debugging. */ @@ -34846,15 +34752,8 @@ static sqInt becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt anArray; - sqInt anArray1; - sqInt anArray2; - sqInt anArray3; - sqInt c; - sqInt c1; sqInt contextSize; sqInt fieldOffset; - sqInt first; sqInt fmt; sqInt fwdBlock; sqInt fwdBlock1; @@ -34869,23 +34768,7 @@ sqInt hdr21; sqInt header; sqInt header1; - sqInt i; - sqInt i1; - sqInt i2; - sqInt i3; - sqInt i4; - sqInt iLimiT; - sqInt iLimiT1; - sqInt last; - sqInt list; - sqInt m; - sqInt next; sqInt numLiterals; - sqInt obj; - sqInt obj1; - sqInt obj2; - sqInt obj3; - sqInt obj4; sqInt objHeader; sqInt objHeader1; sqInt objHeader11; @@ -34897,14 +34780,8 @@ sqInt oop11; sqInt oop2; sqInt oop21; - sqInt procLists; - sqInt s; - sqInt s1; - sqInt sched; - sqInt schedAssoc; sqInt sp; usqInt start; - sqInt xArray;
if ((checkForLeaks & 4) != 0) { runLeakCheckerForFullGC(1); @@ -35137,9 +35014,8 @@ } } /* begin postBecomeAction: */ - followForwardingPointersInStackZone(0); + ; - cogitPostGCAction(GIV(gcMode)); GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null); GIV(gcMode) = 0; @@ -44341,7 +44217,21 @@ return ((sqInt (*)(sqInt, sqInt, sqInt))fn)(x0, x1, y); }
+static sqInt +couldBeProcess(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((oop & 3) == 0) + && (((((usqInt)oop)) >= (startOfMemory())) + && (((((usqInt)oop)) < GIV(freeStart)) + && (((longAt(oop)) & TypeMask) != HeaderTypeGC)))) + && ((((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) <= 4) + && ((!(((oop & 1) == 0) + && (((((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex))) + && (((lengthOf(oop)) > MyListIndex) + && (isContext(longAt((oop + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord())))))))); +}
+ /* For testing in Smalltalk, this method should be overridden in a subclass. */
static void @@ -49277,10 +49167,7 @@ && ((((((usqInt)aContextOrProcessOrFrame)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)aContextOrProcessOrFrame)) <= (((usqInt)GIV(pages))))))) { return printCallStackFP(((char *) aContextOrProcessOrFrame)); } - if ((!(((aContextOrProcessOrFrame & 1) == 0) - && (((((usqInt) (longAt(aContextOrProcessOrFrame))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex))) - && (((lengthOf(aContextOrProcessOrFrame)) > MyListIndex) - && (isContext(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord()))))))) { + if (couldBeProcess(aContextOrProcessOrFrame)) { return printCallStackOf(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord())))); } context = aContextOrProcessOrFrame; @@ -50515,23 +50402,26 @@ }
sqInt -printStackCallStackOf(sqInt frameOrContext) +printStackCallStackOf(sqInt aContextOrProcessOrFrame) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt context; char *theFP;
- if (((frameOrContext & 3) == 0) - && (((((usqInt)frameOrContext)) >= (startOfMemory())) - && (((((usqInt)frameOrContext)) < GIV(freeStart)) - && (((longAt(frameOrContext)) & TypeMask) != HeaderTypeGC)))) { - if ((((frameOrContext & 1) == 0) - && (((((usqInt) (longAt(frameOrContext))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)) - && (checkIsStillMarriedContextcurrentFP(frameOrContext, null))) { - return printStackCallStackOf(((sqInt)(frameOfMarriedContext(frameOrContext)))); + if (((aContextOrProcessOrFrame & 3) == 0) + && (((((usqInt)aContextOrProcessOrFrame)) >= (startOfMemory())) + && (((((usqInt)aContextOrProcessOrFrame)) < GIV(freeStart)) + && (((longAt(aContextOrProcessOrFrame)) & TypeMask) != HeaderTypeGC)))) { + if ((((aContextOrProcessOrFrame & 1) == 0) + && (((((usqInt) (longAt(aContextOrProcessOrFrame))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)) + && (checkIsStillMarriedContextcurrentFP(aContextOrProcessOrFrame, null))) { + return printStackCallStackOf(((sqInt)(frameOfMarriedContext(aContextOrProcessOrFrame)))); } + if (couldBeProcess(aContextOrProcessOrFrame)) { + return printCallStackOf(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord())))); + } return null; } - theFP = ((void *)frameOrContext); + theFP = ((void *)aContextOrProcessOrFrame); while(1) { context = shortReversePrintFrameAndCallers(theFP); if (!((((longAt((context + BaseHeaderSize) + (SenderIndex << (shiftForWord())))) & 1))
Modified: branches/Cog/nscogsrc/vm/cointerp.h =================================================================== --- branches/Cog/nscogsrc/vm/cointerp.h 2015-01-25 22:39:42 UTC (rev 3235) +++ branches/Cog/nscogsrc/vm/cointerp.h 2015-01-29 22:35:45 UTC (rev 3236) @@ -1,5 +1,5 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 */
@@ -252,7 +252,7 @@ void printMethodDictionary(sqInt dictionary); void printProcessStack(sqInt aProcess); sqInt printProcsOnList(sqInt procList); -sqInt printStackCallStackOf(sqInt frameOrContext); +sqInt printStackCallStackOf(sqInt aContextOrProcessOrFrame); void printStackReferencesTo(sqInt oop); void print(char *s); void setBreakMNUSelector(char *aString);
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c =================================================================== --- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2015-01-25 22:39:42 UTC (rev 3235) +++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2015-01-29 22:35:45 UTC (rev 3236) @@ -2,11 +2,11 @@
/* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 from - CoInterpreter VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 + CoInterpreter VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -114,8 +114,6 @@ #define AtCacheSize 2 #define AtCacheTotalSize 64 #define AtPutBase 32 -#define BecameActiveClassFlag 8 -#define BecameCompiledMethodFlag 2 #define Byte0Mask 0xFF #define Byte1Mask 0xFF00 #define Byte1Shift 8 @@ -450,7 +448,6 @@ static sqInt externalInstVarofContext(sqInt offset, sqInt aContext) NoDbgRegParms; static void findNewMethodInClassTag(sqInt classTagArg) NoDbgRegParms; sqInt flushExternalPrimitiveOf(sqInt methodObj); -static void followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) NoDbgRegParms; void forceInterruptCheckFromHeartbeat(void); static sqInt frameCallerContext(char *theFP) NoDbgRegParms; static sqInt frameCallerContextput(char *theFP, sqInt aValue) NoDbgRegParms; @@ -1051,6 +1048,7 @@ sqInt copiedValueCountOfClosure(sqInt closurePointer); sqInt copyBits(void); sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y); +static sqInt couldBeProcess(sqInt oop) NoDbgRegParms NeverInline; static void cr(void); static void createActualMessageTo(sqInt lookupClass) NoDbgRegParms; static sqInt defaultNumStackPages(void); @@ -1209,7 +1207,7 @@ void printOop(sqInt oop); void printProcessStack(sqInt aProcess); sqInt printProcsOnList(sqInt procList); -sqInt printStackCallStackOf(sqInt frameOrContext); +sqInt printStackCallStackOf(sqInt aContextOrProcessOrFrame); void printStackPageList(void); void printStackPageListInUse(void); void printStackPages(void); @@ -1365,14 +1363,14 @@ _iss sqInt numStackPages; _iss sqInt tempOop; _iss sqInt needGCFlag; -_iss sqInt profileProcess; _iss sqLong nextProfileTick; _iss sqInt jmpDepth; _iss sqInt longRunningPrimitiveCheckSemaphore; +_iss sqInt profileProcess; _iss sqInt profileSemaphore; -_iss sqInt profileMethod; _iss usqInt fwdTableNext; _iss sqInt longRunningPrimitiveCheckMethod; +_iss sqInt profileMethod; _iss usqInt compStart; _iss sqInt extraRootCount; _iss sqInt statGrowMemory; @@ -1461,8 +1459,8 @@ _iss sqInt overflowLimit; _iss StackPage * overflowedPage; _iss sqInt the2ndUnknownShort; -_iss long methodCache[MethodCacheSize + 1 /* 4097 */]; _iss sqInt atCache[AtCacheTotalSize + 1 /* 65 */]; +_iss long methodCache[MethodCacheSize + 1 /* 4097 */]; _iss sqInt traceLog[TraceBufferSize /* 768 */]; _iss sqInt remapBuffer[RemapBufferSize + 1 /* 26 */]; _iss sqInt primTraceLog[256]; @@ -2102,7 +2100,7 @@ /* 575 */ (void (*)(void))0, 0 }; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1026"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1029"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -16344,98 +16342,6 @@ }
-/* Spur's become: is lazy, turning the becommed object into a forwarding - object to the other. - The read-barrier is minimised by arranging that forwarding pointers will - fail a method cache - probe, since notionally objects' internals are accessed only via sending - messages to them, - the exception is primitives that access the internals of the non-receiver - argument(s). To avoid a read barrier on inst var fetch we scan the - receivers in the stack zone and follow - any forwarded ones. This is way cheaper than scanning all of memory as in - the old become. */ - -static void -followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) -{ DECL_MAYBE_SQ_GLOBAL_STRUCT - char *callerFP; - sqInt delta; - sqInt i; - sqInt newOop; - sqInt numArgs; - sqInt offset; - usqInt oop; - char *theFP; - usqInt theIPPtr; - StackPage *thePage; - char *theSP; - - if (theBecomeEffectsFlags & BecameCompiledMethodFlag) { - ; - - } - assert(GIV(stackPage) != 0); - for (i = 0; i < GIV(numStackPages); i += 1) { - /* begin stackPageAt: */ - thePage = stackPageAtpages(i, GIV(pages)); - if (!(((thePage->baseFP)) == 0)) { - theSP = (thePage->headSP); - - /* Skip the instruction pointer on top of stack of inactive pages. */ - - theFP = (thePage->headFP); - if (thePage == GIV(stackPage)) { - theIPPtr = 0; - } - else { - theIPPtr = ((usqInt)theSP); - theSP += BytesPerWord; - } - while (1) { - assert(addressIsInPage(thePage, theFP)); - assert((theIPPtr == 0) - || (addressIsInPage(thePage, ((void *)theIPPtr)))); - /* begin frameStackedReceiverOffsetNumArgs: */ - numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((mframeCogMethod(theFP))->cmNumArgs) - : byteAt((theFP + FoxIFrameFlags) + 1)); - offset = (FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord())); - oop = longAt(theFP + offset); - - if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()) - ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0 - : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) - && (isForwarded(longAt(theFP + FoxThisContext)))) { - longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext))); - } - if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) { - oop = longAt(theFP + FoxMFReceiver); - - oop = ((mframeHomeMethod(theFP))->methodObject); - assert(!(isForwarded(oop))); - } - else { - oop = longAt(theFP + FoxIFReceiver); - - oop = longAt(theFP + FoxMethod); - - } - if (!(((callerFP = frameCallerFP(theFP))) != 0)) break; - theIPPtr = ((usqInt)(theFP + FoxCallerSavedIP)); - theFP = callerFP; - } - theSP = ((thePage->baseAddress)) - BytesPerWord; - while (theSP <= ((thePage->baseAddress))) { - oop = longAt(theSP); - - theSP += BytesPerWord; - } - } - } -} - - /* Force an interrupt check ASAP. This version is the entry-point to forceInterruptCheck for the heartbeat timer to allow for repeatable debugging. */ @@ -34855,15 +34761,8 @@ static sqInt becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt anArray; - sqInt anArray1; - sqInt anArray2; - sqInt anArray3; - sqInt c; - sqInt c1; sqInt contextSize; sqInt fieldOffset; - sqInt first; sqInt fmt; sqInt fwdBlock; sqInt fwdBlock1; @@ -34878,23 +34777,7 @@ sqInt hdr21; sqInt header; sqInt header1; - sqInt i; - sqInt i1; - sqInt i2; - sqInt i3; - sqInt i4; - sqInt iLimiT; - sqInt iLimiT1; - sqInt last; - sqInt list; - sqInt m; - sqInt next; sqInt numLiterals; - sqInt obj; - sqInt obj1; - sqInt obj2; - sqInt obj3; - sqInt obj4; sqInt objHeader; sqInt objHeader1; sqInt objHeader11; @@ -34906,14 +34789,8 @@ sqInt oop11; sqInt oop2; sqInt oop21; - sqInt procLists; - sqInt s; - sqInt s1; - sqInt sched; - sqInt schedAssoc; sqInt sp; usqInt start; - sqInt xArray;
if ((checkForLeaks & 4) != 0) { runLeakCheckerForFullGC(1); @@ -35146,9 +35023,8 @@ } } /* begin postBecomeAction: */ - followForwardingPointersInStackZone(0); + ; - cogitPostGCAction(GIV(gcMode)); GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null); GIV(gcMode) = 0; @@ -44350,7 +44226,21 @@ return ((sqInt (*)(sqInt, sqInt, sqInt))fn)(x0, x1, y); }
+static sqInt +couldBeProcess(sqInt oop) +{ DECL_MAYBE_SQ_GLOBAL_STRUCT + return (((oop & 3) == 0) + && (((((usqInt)oop)) >= (startOfMemory())) + && (((((usqInt)oop)) < GIV(freeStart)) + && (((longAt(oop)) & TypeMask) != HeaderTypeGC)))) + && ((((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) <= 4) + && ((!(((oop & 1) == 0) + && (((((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex))) + && (((lengthOf(oop)) > MyListIndex) + && (isContext(longAt((oop + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord())))))))); +}
+ /* For testing in Smalltalk, this method should be overridden in a subclass. */
static void @@ -49286,10 +49176,7 @@ && ((((((usqInt)aContextOrProcessOrFrame)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)aContextOrProcessOrFrame)) <= (((usqInt)GIV(pages))))))) { return printCallStackFP(((char *) aContextOrProcessOrFrame)); } - if ((!(((aContextOrProcessOrFrame & 1) == 0) - && (((((usqInt) (longAt(aContextOrProcessOrFrame))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex))) - && (((lengthOf(aContextOrProcessOrFrame)) > MyListIndex) - && (isContext(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord()))))))) { + if (couldBeProcess(aContextOrProcessOrFrame)) { return printCallStackOf(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord())))); } context = aContextOrProcessOrFrame; @@ -50524,23 +50411,26 @@ }
sqInt -printStackCallStackOf(sqInt frameOrContext) +printStackCallStackOf(sqInt aContextOrProcessOrFrame) { DECL_MAYBE_SQ_GLOBAL_STRUCT sqInt context; char *theFP;
- if (((frameOrContext & 3) == 0) - && (((((usqInt)frameOrContext)) >= (startOfMemory())) - && (((((usqInt)frameOrContext)) < GIV(freeStart)) - && (((longAt(frameOrContext)) & TypeMask) != HeaderTypeGC)))) { - if ((((frameOrContext & 1) == 0) - && (((((usqInt) (longAt(frameOrContext))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)) - && (checkIsStillMarriedContextcurrentFP(frameOrContext, null))) { - return printStackCallStackOf(((sqInt)(frameOfMarriedContext(frameOrContext)))); + if (((aContextOrProcessOrFrame & 3) == 0) + && (((((usqInt)aContextOrProcessOrFrame)) >= (startOfMemory())) + && (((((usqInt)aContextOrProcessOrFrame)) < GIV(freeStart)) + && (((longAt(aContextOrProcessOrFrame)) & TypeMask) != HeaderTypeGC)))) { + if ((((aContextOrProcessOrFrame & 1) == 0) + && (((((usqInt) (longAt(aContextOrProcessOrFrame))) >> (compactClassFieldLSB())) & 0x1F) == ClassMethodContextCompactIndex)) + && (checkIsStillMarriedContextcurrentFP(aContextOrProcessOrFrame, null))) { + return printStackCallStackOf(((sqInt)(frameOfMarriedContext(aContextOrProcessOrFrame)))); } + if (couldBeProcess(aContextOrProcessOrFrame)) { + return printCallStackOf(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (SuspendedContextIndex << (shiftForWord())))); + } return null; } - theFP = ((void *)frameOrContext); + theFP = ((void *)aContextOrProcessOrFrame); while(1) { context = shortReversePrintFrameAndCallers(theFP); if (!((((longAt((context + BaseHeaderSize) + (SenderIndex << (shiftForWord())))) & 1))
Modified: branches/Cog/nsspursrc/vm/cointerp.c =================================================================== --- branches/Cog/nsspursrc/vm/cointerp.c 2015-01-25 22:39:42 UTC (rev 3235) +++ branches/Cog/nsspursrc/vm/cointerp.c 2015-01-29 22:35:45 UTC (rev 3236) @@ -1,9 +1,9 @@ /* Automatically generated by - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 from - CoInterpreter VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 + CoInterpreter VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 */ -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1026 uuid: 58161d66-0b23-4356-89f1-8e951fd1a1d9 " __DATE__ ; +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1029 uuid: a2c6da7a-d111-4184-bf10-039ed2bea424 " __DATE__ ; char *__interpBuildInfo = __buildInfo;
@@ -1129,6 +1129,7 @@ void printInvalidClassTableEntries(void); void printMethodReferencesTo(sqInt anOop); void printObjectsFromto(sqInt startAddress, sqInt endAddress); +void printObjectsWithHash(sqInt hash); static void printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType) NoDbgRegParms; static void printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType) NoDbgRegParms; void printObjStack(sqInt objStack); @@ -1235,6 +1236,7 @@ sqInt copiedValueCountOfClosure(sqInt closurePointer); sqInt copyBits(void); sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y); +static sqInt couldBeProcess(sqInt oop) NoDbgRegParms NeverInline; static void cr(void); static void createActualMessageTo(sqInt lookupClass) NoDbgRegParms; static sqInt defaultNumStackPages(void); @@ -1395,7 +1397,7 @@ void printOop(sqInt oop); void printProcessStack(sqInt aProcess); sqInt printProcsOnList(sqInt procList); -sqInt printStackCallStackOf(sqInt frameOrContext); +sqInt printStackCallStackOf(sqInt aContextOrProcessOrFrame); void printStackPageList(void); void printStackPageListInUse(void); void printStackPages(void); @@ -1447,6 +1449,7 @@ static sqInt snapshot(sqInt embedded) NoDbgRegParms; static void space(void); sqInt specialSelector(sqInt index); +static void spurPostBecomeAction(sqInt theBecomeEffectsFlags) NoDbgRegParms; double stackFloatValue(sqInt offset); sqInt stackIntegerValue(sqInt offset); static sqInt stackLimitBytes(void); @@ -1581,7 +1584,6 @@ _iss sqInt jmpDepth; _iss sqInt futureSurvivorStart; _iss char * objStackInvalidBecause; -_iss sqInt becomeEffectsFlags; _iss usqInt lastFreeChunk; _iss SpurNewSpaceSpace eden; _iss sqInt ephemeronList; @@ -1590,6 +1592,7 @@ _iss sqInt extraRootCount; _iss sqInt invalidObjStackPage; _iss sqInt previousRememberedSetSize; +_iss sqInt becomeEffectsFlags; _iss sqInt classNameIndex; _iss sqInt growHeadroom; _iss sqInt ephemeronQueue; @@ -2350,7 +2353,7 @@ /*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1 }; char expensiveAsserts = 0; -const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1026"; +const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1029"; sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */; volatile int sendTrace;
@@ -5733,6 +5736,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj)); if (((newHash = (long32At(classObj + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj))) { + lkupClassTag = -PrimErrBadReceiver; + goto l1; + } if (((err = enterIntoClassTable(classObj))) != 0) { lkupClassTag = -err; goto l1; @@ -6831,6 +6838,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(superclass)); if (((newHash = (long32At(superclass + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(superclass))) { + -PrimErrBadReceiver; + goto l273; + } if (((err = enterIntoClassTable(superclass))) != 0) { -err; goto l273; @@ -6845,6 +6856,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(superclass)); if (((newHash1 = (long32At(superclass + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(superclass))) { + lkupClassTag = -PrimErrBadReceiver; + goto l274; + } if (((err1 = enterIntoClassTable(superclass))) != 0) { lkupClassTag = -err1; goto l274; @@ -14006,6 +14021,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj)); if (((newHash = (long32At(classObj + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj))) { + lkupClassTag = -PrimErrBadReceiver; + goto l241; + } if (((err = enterIntoClassTable(classObj))) != 0) { lkupClassTag = -err; goto l241; @@ -14223,6 +14242,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj)); if (((newHash = (long32At(classObj + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj))) { + lkupClassTag = -PrimErrBadReceiver; + goto l248; + } if (((err = enterIntoClassTable(classObj))) != 0) { lkupClassTag = -err; goto l248; @@ -14456,6 +14479,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj)); if (((newHash = (long32At(classObj + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj))) { + lkupClassTag = -PrimErrBadReceiver; + goto l255; + } if (((err = enterIntoClassTable(classObj))) != 0) { lkupClassTag = -err; goto l255; @@ -15687,6 +15714,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj)); if (((newHash = (long32At(classObj + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj))) { + classTag = -PrimErrBadReceiver; + goto l2; + } if (((err = enterIntoClassTable(classObj))) != 0) { classTag = -err; goto l2; @@ -16514,6 +16545,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj)); if (((newHash = (long32At(classObj + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj))) { + classTag = -PrimErrBadReceiver; + goto l2; + } if (((err = enterIntoClassTable(classObj))) != 0) { classTag = -err; goto l2; @@ -17794,7 +17829,8 @@ GIV(method) = ((sqInt) referent); GIV(instructionPointer) = GIV(method) + theIPPtr; } - if (((longAt(GIV(newMethod))) & (0x3FFFFF - 8)) == 0) { + if (((GIV(newMethod) & 3) == 0) + && (((longAt(GIV(newMethod))) & 0x3FFFFF) == 8)) { /* begin followForwarded: */ assert(isUnambiguouslyForwarder(GIV(newMethod))); referent1 = longAt((GIV(newMethod) + BaseHeaderSize) + (0 << (shiftForWord()))); @@ -29195,6 +29231,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(longAt(GIV(stackPointer)))); if (((newHash = (long32At((longAt(GIV(stackPointer))) + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(longAt(GIV(stackPointer))))) { + hashOrError = -PrimErrBadReceiver; + goto l1; + } if (((err = enterIntoClassTable(longAt(GIV(stackPointer))))) != 0) { hashOrError = -err; goto l1; @@ -33558,7 +33598,7 @@ }
-/* For a Smalnteger, answer itself. +/* For a Smalllnteger, answer itself. For a Character, answer its code as an unsigned integer. For a SmallFloat, answer the signed, but unadjusted bit pattern (so as to keep the result a SmallInteger). @@ -35193,6 +35233,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj1)); if (((newHash = (long32At(classObj1 + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj1))) { + classIndex = -PrimErrBadReceiver; + goto l1; + } if (((err = enterIntoClassTable(classObj1))) != 0) { classIndex = -err; goto l1; @@ -35318,6 +35362,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(class)); if (((newHash = (long32At(class + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(class))) { + classIndex = -PrimErrBadReceiver; + goto l2; + } if (((err = enterIntoClassTable(class))) != 0) { classIndex = -err; goto l2; @@ -40925,6 +40973,10 @@ /* begin ensureBehaviorHash: */ assert(addressCouldBeClassObj(classObj)); if (((newHash = (long32At(classObj + 4)) & 0x3FFFFF)) == 0) { + if (!(objCouldBeClassObj(classObj))) { + classIndex = -PrimErrBadReceiver; + goto l1; + } if (((err = enterIntoClassTable(classObj))) != 0) { classIndex = -err; goto l1; @@ -43862,8 +43914,6 @@ static sqInt becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag) { DECL_MAYBE_SQ_GLOBAL_STRUCT - sqInt c; - sqInt c1; sqInt classOrNil; sqInt clone1; sqInt clone2; @@ -43874,7 +43924,6 @@ sqInt effectsFlags1; sqInt fieldOffset; sqInt fieldOffset1; - sqInt first; sqInt fmt; sqInt fmt1; sqInt fmt2; @@ -43891,83 +43940,45 @@ sqLong headerTemp; sqInt i; sqInt i1; - sqInt i11; sqInt i2; sqInt i3; - sqInt i4; - sqInt i5; - sqInt i6; - sqInt i7; sqInt iLimiT; sqInt iLimiT1; sqInt iLimiT2; - sqInt iLimiT3; - sqInt iLimiT4; sqInt j; sqInt jLimiT; - sqInt last; - sqInt list; - sqInt m; sqInt newObj1; sqInt newObj2; - sqInt next; sqInt o1ClassIndex; sqInt o1HasYoung; sqInt o2ClassIndex; sqInt o2HasYoung; - sqInt obj; sqInt obj1; sqInt obj11; - sqInt obj12; sqInt obj2; sqInt obj21; - sqInt obj22; - sqInt obj3; - sqInt obj4; sqInt objOop; sqInt objOop1; - sqInt objOop11; sqInt objOop2; - sqInt objOop21; sqInt objOop3; - sqInt objOop31; sqInt objOop4; - sqInt objOop41; sqInt objOop5; - sqInt objOop51; sqInt objOop6; - sqInt objOop7; sqInt oop; sqInt oop1; sqInt page; - sqInt procLists; sqInt referent; sqInt referent1; sqInt referent11; - sqInt referent12; - sqInt referent13; sqInt referent2; - sqInt referent21; - sqInt referent22; sqInt referent3; - sqInt referent31; - sqInt referent32; sqInt referent4; - sqInt referent41; sqInt referent5; - sqInt referent6; - sqInt referent7; - sqInt referent8; - sqInt s; - sqInt s1; - sqInt sched; - sqInt schedAssoc; sqInt size; sqInt sp; sqInt sp1; sqInt temp1; sqInt temp2; - sqInt xArray;
assert(GIV(becomeEffectsFlags) == 0); if ((checkForLeaks & 4) != 0) { @@ -44253,15 +44264,15 @@ long32Atput(obj2 + 4, ((((long32At(obj2 + 4)) | 0x3FFFFF) - 0x3FFFFF)) + temp1); } o1HasYoung = (o2HasYoung = 0); - for (i7 = 0, iLimiT4 = ((numSlotsOf(obj1)) - 1); i7 <= iLimiT4; i7 += 1) { - temp1 = longAt((obj1 + BaseHeaderSize) + (i7 << (shiftForWord()))); - temp2 = longAt((obj2 + BaseHeaderSize) + (i7 << (shiftForWord()))); + for (i3 = 0, iLimiT2 = ((numSlotsOf(obj1)) - 1); i3 <= iLimiT2; i3 += 1) { + temp1 = longAt((obj1 + BaseHeaderSize) + (i3 << (shiftForWord()))); + temp2 = longAt((obj2 + BaseHeaderSize) + (i3 << (shiftForWord()))); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(obj1))); - longAtput((obj1 + BaseHeaderSize) + (i7 << (shiftForWord())), temp2); + longAtput((obj1 + BaseHeaderSize) + (i3 << (shiftForWord())), temp2); /* begin storePointerUnchecked:ofObject:withValue: */ assert(!(isForwarded(obj2))); - longAtput((obj2 + BaseHeaderSize) + (i7 << (shiftForWord())), temp1); + longAtput((obj2 + BaseHeaderSize) + (i3 << (shiftForWord())), temp1); if (((temp2 & 3) == 0) && ((((usqInt) temp2)) < (((usqInt) GIV(newSpaceLimit))))) { o1HasYoung = 1; @@ -44394,12 +44405,12 @@
/* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj1)); - referent8 = longAt((obj1 + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent8 & 3) == 0) - && (((longAt(referent8)) & 0x3FFFFF) == 8)) { - referent8 = longAt((referent8 + BaseHeaderSize) + (0 << (shiftForWord()))); + referent5 = longAt((obj1 + BaseHeaderSize) + (0 << (shiftForWord()))); + while (((referent5 & 3) == 0) + && (((longAt(referent5)) & 0x3FFFFF) == 8)) { + referent5 = longAt((referent5 + BaseHeaderSize) + (0 << (shiftForWord()))); } - newObj2 = referent8; + newObj2 = referent5; assert((rawHashBitsOf(newObj2)) == 0); /* begin setHashBitsOf:to: */ flag("endianness"); @@ -44414,12 +44425,12 @@
/* begin followForwarded: */ assert(isUnambiguouslyForwarder(obj2)); - referent13 = longAt((obj2 + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent13 & 3) == 0) - && (((longAt(referent13)) & 0x3FFFFF) == 8)) { - referent13 = longAt((referent13 + BaseHeaderSize) + (0 << (shiftForWord()))); + referent11 = longAt((obj2 + BaseHeaderSize) + (0 << (shiftForWord()))); + while (((referent11 & 3) == 0) + && (((longAt(referent11)) & 0x3FFFFF) == 8)) { + referent11 = longAt((referent11 + BaseHeaderSize) + (0 << (shiftForWord()))); } - newObj1 = referent13; + newObj1 = referent11; assert((rawHashBitsOf(newObj1)) == 0); /* begin setHashBitsOf:to: */ flag("endianness"); @@ -44532,302 +44543,8 @@ } followForwardedObjectFieldstoDepth(GIV(specialObjectsOop), 0); /* begin postBecomeAction: */ - followForwardingPointersInStackZone(GIV(becomeEffectsFlags)); - if (GIV(becomeEffectsFlags) != 0) { - if (GIV(becomeEffectsFlags) & BecameCompiledMethodFlag) { - /* begin followForwardedMethodsInMethodCache */ - for (i4 = 0; i4 < MethodCacheSize; i4 += MethodCacheEntrySize) { - c = GIV(methodCache)[i4 + MethodCacheClass]; - s = GIV(methodCache)[i4 + MethodCacheSelector]; - m = GIV(methodCache)[i4 + MethodCacheMethod]; - if ((c != 0) - && ((s != 0) - && ((m != 0) - && (((m & 3) == 0) - && (((longAt(m)) & 0x3FFFFF) == 8))))) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(m)); - referent4 = longAt((m + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent4 & 3) == 0) - && (((longAt(referent4)) & 0x3FFFFF) == 8)) { - referent4 = longAt((referent4 + BaseHeaderSize) + (0 << (shiftForWord()))); - } - m = referent4; - GIV(methodCache)[i4 + MethodCacheMethod] = m; - } - } - /* begin followForwardedMethodsInMethodZone */ - followForwardedMethods(); - } - if (GIV(becomeEffectsFlags) & BecameActiveClassFlag) { - /* begin flushBecommedClassesInMethodCache */ - for (i2 = 0; i2 < MethodCacheSize; i2 += MethodCacheEntrySize) { - c1 = GIV(methodCache)[i2 + MethodCacheClass]; - s1 = GIV(methodCache)[i2 + MethodCacheSelector]; - if ((c1 != 0) - && ((s1 != 0) - && (isForwarded(classOrNilAtIndex(c1))))) { - GIV(methodCache)[i2 + MethodCacheClass] = 0; - GIV(methodCache)[i2 + MethodCacheSelector] = 0; - } - } - /* begin flushAtCache */ - for (i11 = 1; i11 <= AtCacheTotalSize; i11 += 1) { - GIV(atCache)[i11] = 0; - } - /* begin flushBecommedClassesInMethodZone */ - unlinkSendsToForwardedClasses(); - } - /* begin followForwardingPointersInScheduler */ + spurPostBecomeAction(GIV(becomeEffectsFlags));
- /* the GC follows pointers in the special objects array for us. */ - - schedAssoc = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << (shiftForWord()))); - assert(!(isForwarded(schedAssoc))); - /* begin followObjField:ofObject: */ - objOop41 = longAt((schedAssoc + BaseHeaderSize) + (ValueIndex << (shiftForWord()))); - assert(isNonImmediate(objOop41)); - if (((longAt(objOop41)) & (0x3FFFFF - 8)) == 0) { - objOop41 = fixFollowedFieldofObjectwithInitialValue(ValueIndex, schedAssoc, objOop41); - } - sched = objOop41; - /* begin followObjField:ofObject: */ - objOop51 = longAt((sched + BaseHeaderSize) + (ProcessListsIndex << (shiftForWord()))); - assert(isNonImmediate(objOop51)); - if (((longAt(objOop51)) & (0x3FFFFF - 8)) == 0) { - objOop51 = fixFollowedFieldofObjectwithInitialValue(ProcessListsIndex, sched, objOop51); - } - procLists = objOop51; - for (i3 = 0, iLimiT2 = ((numSlotsOf(procLists)) - 1); i3 <= iLimiT2; i3 += 1) { - /* begin followObjField:ofObject: */ - objOop11 = longAt((procLists + BaseHeaderSize) + (i3 << (shiftForWord()))); - assert(isNonImmediate(objOop11)); - if (((longAt(objOop11)) & (0x3FFFFF - 8)) == 0) { - objOop11 = fixFollowedFieldofObjectwithInitialValue(i3, procLists, objOop11); - } - list = objOop11; - /* begin followObjField:ofObject: */ - objOop21 = longAt((list + BaseHeaderSize) + (FirstLinkIndex << (shiftForWord()))); - assert(isNonImmediate(objOop21)); - if (((longAt(objOop21)) & (0x3FFFFF - 8)) == 0) { - objOop21 = fixFollowedFieldofObjectwithInitialValue(FirstLinkIndex, list, objOop21); - } - first = objOop21; - /* begin followObjField:ofObject: */ - objOop31 = longAt((list + BaseHeaderSize) + (LastLinkIndex << (shiftForWord()))); - assert(isNonImmediate(objOop31)); - if (((longAt(objOop31)) & (0x3FFFFF - 8)) == 0) { - objOop31 = fixFollowedFieldofObjectwithInitialValue(LastLinkIndex, list, objOop31); - } - last = objOop31; - while (first != last) { - /* begin followObjField:ofObject: */ - objOop7 = longAt((first + BaseHeaderSize) + (NextLinkIndex << (shiftForWord()))); - assert(isNonImmediate(objOop7)); - if (((longAt(objOop7)) & (0x3FFFFF - 8)) == 0) { - objOop7 = fixFollowedFieldofObjectwithInitialValue(NextLinkIndex, first, objOop7); - } - next = objOop7; - first = next; - } - } - /* begin followForwardingPointersInSpecialObjectsArray */ - /* begin followSemaphoreIn:at: */ - obj12 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (TheLowSpaceSemaphore << (shiftForWord()))); - if (((longAt(obj12)) & (0x3FFFFF - 8)) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(obj12)); - referent12 = longAt((obj12 + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent12 & 3) == 0) - && (((longAt(referent12)) & 0x3FFFFF) == 8)) { - referent12 = longAt((referent12 + BaseHeaderSize) + (0 << (shiftForWord()))); - } - obj12 = referent12; - /* begin storePointer:ofObject:withValue: */ - assert(!(isForwarded(GIV(specialObjectsOop)))); - if (isOldObject(GIV(specialObjectsOop))) { - - /* most stores into young objects */ - - if (((obj12 & 3) == 0) - && ((((usqInt) obj12)) < (((usqInt) GIV(newSpaceLimit))))) { - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) { - remember(GIV(specialObjectsOop)); - } - } - } - longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheLowSpaceSemaphore << (shiftForWord())), obj12); - } - /* begin followSemaphoreIn:at: */ - obj22 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (TheInterruptSemaphore << (shiftForWord()))); - if (((longAt(obj22)) & (0x3FFFFF - 8)) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(obj22)); - referent22 = longAt((obj22 + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent22 & 3) == 0) - && (((longAt(referent22)) & 0x3FFFFF) == 8)) { - referent22 = longAt((referent22 + BaseHeaderSize) + (0 << (shiftForWord()))); - } - obj22 = referent22; - /* begin storePointer:ofObject:withValue: */ - assert(!(isForwarded(GIV(specialObjectsOop)))); - if (isOldObject(GIV(specialObjectsOop))) { - - /* most stores into young objects */ - - if (((obj22 & 3) == 0) - && ((((usqInt) obj22)) < (((usqInt) GIV(newSpaceLimit))))) { - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) { - remember(GIV(specialObjectsOop)); - } - } - } - longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheInterruptSemaphore << (shiftForWord())), obj22); - } - /* begin followSemaphoreIn:at: */ - obj3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (TheTimerSemaphore << (shiftForWord()))); - if (((longAt(obj3)) & (0x3FFFFF - 8)) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(obj3)); - referent32 = longAt((obj3 + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent32 & 3) == 0) - && (((longAt(referent32)) & 0x3FFFFF) == 8)) { - referent32 = longAt((referent32 + BaseHeaderSize) + (0 << (shiftForWord()))); - } - obj3 = referent32; - /* begin storePointer:ofObject:withValue: */ - assert(!(isForwarded(GIV(specialObjectsOop)))); - if (isOldObject(GIV(specialObjectsOop))) { - - /* most stores into young objects */ - - if (((obj3 & 3) == 0) - && ((((usqInt) obj3)) < (((usqInt) GIV(newSpaceLimit))))) { - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) { - remember(GIV(specialObjectsOop)); - } - } - } - longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheTimerSemaphore << (shiftForWord())), obj3); - } - /* begin followSemaphoreIn:at: */ - obj4 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (TheFinalizationSemaphore << (shiftForWord()))); - if (((longAt(obj4)) & (0x3FFFFF - 8)) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(obj4)); - referent41 = longAt((obj4 + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent41 & 3) == 0) - && (((longAt(referent41)) & 0x3FFFFF) == 8)) { - referent41 = longAt((referent41 + BaseHeaderSize) + (0 << (shiftForWord()))); - } - obj4 = referent41; - /* begin storePointer:ofObject:withValue: */ - assert(!(isForwarded(GIV(specialObjectsOop)))); - if (isOldObject(GIV(specialObjectsOop))) { - - /* most stores into young objects */ - - if (((obj4 & 3) == 0) - && ((((usqInt) obj4)) < (((usqInt) GIV(newSpaceLimit))))) { - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) { - remember(GIV(specialObjectsOop)); - } - } - } - longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheFinalizationSemaphore << (shiftForWord())), obj4); - } - xArray = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ExternalObjectsArray << (shiftForWord()))); - if (((longAt(xArray)) & (0x3FFFFF - 8)) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(xArray)); - referent6 = longAt((xArray + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent6 & 3) == 0) - && (((longAt(referent6)) & 0x3FFFFF) == 8)) { - referent6 = longAt((referent6 + BaseHeaderSize) + (0 << (shiftForWord()))); - } - xArray = referent6; - /* begin splObj:put: */ - /* begin storePointer:ofObject:withValue: */ - assert(!(isForwarded(GIV(specialObjectsOop)))); - if (isOldObject(GIV(specialObjectsOop))) { - - /* most stores into young objects */ - - if (((xArray & 3) == 0) - && ((((usqInt) xArray)) < (((usqInt) GIV(newSpaceLimit))))) { - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) { - remember(GIV(specialObjectsOop)); - } - } - } - longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (ExternalObjectsArray << (shiftForWord())), xArray); - } - for (i5 = 0, iLimiT3 = ((numSlotsOf(xArray)) - 1); i5 <= iLimiT3; i5 += 1) { - /* begin followSemaphoreIn:at: */ - obj = longAt((xArray + BaseHeaderSize) + (i5 << (shiftForWord()))); - if (((longAt(obj)) & (0x3FFFFF - 8)) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(obj)); - referent5 = longAt((obj + BaseHeaderSize) + (0 << (shiftForWord()))); - while (((referent5 & 3) == 0) - && (((longAt(referent5)) & 0x3FFFFF) == 8)) { - referent5 = longAt((referent5 + BaseHeaderSize) + (0 << (shiftForWord()))); - } - obj = referent5; - /* begin storePointer:ofObject:withValue: */ - assert(!(isForwarded(xArray))); - if (isOldObject(xArray)) { - - /* most stores into young objects */ - - if (((obj & 3) == 0) - && ((((usqInt) obj)) < (((usqInt) GIV(newSpaceLimit))))) { - /* begin possibleRootStoreInto: */ - if (!(((((usqInt) (longAt(xArray))) >> 29) & 1) != 0)) { - remember(xArray); - } - } - } - longAtput((xArray + BaseHeaderSize) + (i5 << (shiftForWord())), obj); - } - } - /* begin followForwardingPointersInProfileState */ - if (((longAt(GIV(profileProcess))) & (0x3FFFFF - 8)) == 0) { - /* begin followForwarded: */ - assert(isUnambiguouslyForwarder(GIV(profileProcess)));
@@ Diff output truncated at 50000 characters. @@