[Vm-dev] [commit][3606] CogVM source as per VMMaker.oscog-eem.1680

commits at squeakvm.org commits at squeakvm.org
Tue Feb 16 00:21:55 UTC 2016


Revision: 3606
Author:   eliot
Date:     2016-02-15 16:21:53 -0800 (Mon, 15 Feb 2016)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1680

Spur.
Fix https://pharo.fogbugz.com/f/cases/17536/VM-Crash-when-adding-an-iVar-to-a-subclass-of-SystemAnnouncement.

When weaklings (and when ephemerons) are scan-marked forwarders must be coped
with.

Modified Paths:
--------------
    branches/Cog/nsspur64src/vm/cogit.h
    branches/Cog/nsspur64src/vm/cointerp.c
    branches/Cog/nsspur64src/vm/cointerp.h
    branches/Cog/nsspur64src/vm/gcc3x-cointerp.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/nsspurstack64src/vm/gcc3x-interp.c
    branches/Cog/nsspurstack64src/vm/interp.c
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/spur64src/vm/cogit.h
    branches/Cog/spur64src/vm/cointerp.c
    branches/Cog/spur64src/vm/cointerp.h
    branches/Cog/spur64src/vm/gcc3x-cointerp.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.h
    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/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/nsspur64src/vm/cogit.h
===================================================================
--- branches/Cog/nsspur64src/vm/cogit.h	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspur64src/vm/cogit.h	2016-02-16 00:21:53 UTC (rev 3606)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGenerator VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
 
 

Modified: branches/Cog/nsspur64src/vm/cointerp.c
===================================================================
--- branches/Cog/nsspur64src/vm/cointerp.c	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspur64src/vm/cointerp.c	2016-02-16 00:21:53 UTC (rev 3606)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
    from
-	CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2442,7 +2442,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.1677";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1680";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -17850,7 +17850,7 @@
 static sqInt
 checkForAndFollowForwardedPrimitiveState(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    signed char accessorDepth;
+    sqInt accessorDepth;
     sqInt firstBytecode;
     sqInt found;
     sqInt found1;
@@ -51451,17 +51451,13 @@
 fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt objOop;
-    sqInt referent;
 
 	assert(isOopForwarded(initialValue));
-	/* begin followForwarded: */
-	assert(isUnambiguouslyForwarder(initialValue));
-	referent = longAt((initialValue + BaseHeaderSize) + (0LL << (shiftForWord())));
-	while (((referent & (tagMask())) == 0)
-	 && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
-		referent = longAt((referent + BaseHeaderSize) + (0LL << (shiftForWord())));
-	}
-	objOop = referent;
+	objOop = initialValue;
+	do {
+		objOop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+	} while(((objOop & (tagMask())) == 0)
+		 && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())));
 	/* begin storePointer:ofObject:withValue: */
 	assert(!(isForwarded(anObject)));
 	if (isOldObject(anObject)) {
@@ -56068,6 +56064,7 @@
     sqInt objOop;
     sqInt objOop1;
     sqInt objToScan;
+    sqInt oop;
     usqInt ptr;
     sqInt scanLargeObject;
     sqInt sp;
@@ -56076,11 +56073,17 @@
 	foundInactive = 0;
 	ptr = (GIV(unscannedEphemerons).start);
 	while (ptr < ((GIV(unscannedEphemerons).top))) {
-		/* begin keyOfEphemeron: */
+		/* begin followedKeyOfEphemeron: */
 		objOop = (ephemeron = longAt(ptr));
 		assert((isNonImmediate(objOop))
 		 && (isEphemeron(objOop)));
-		key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		/* begin followOopField:ofObject: */
+		oop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		if (((oop & (tagMask())) == 0)
+		 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+			oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop);
+		}
+		key = oop;
 		if (((key & (tagMask())) != 0)
 		 || (((((usqInt) (longAt(key))) >> 55) & 1) != 0)) {
 
@@ -60613,10 +60616,12 @@
     sqInt objOop1;
     sqInt objOop11;
     sqInt objOop12;
+    sqInt objOop13;
     sqInt objStackPage;
     sqInt objToScan;
     sqInt objToScan1;
     sqInt objToScan2;
+    sqInt oop;
     sqInt p;
     usqInt ptr;
     sqInt scanLargeObject;
@@ -60656,9 +60661,16 @@
 				for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) {
 					assert(isWeak(fetchPointerofObject(i1, objStackPage)));
 					weakling = longAt((objStackPage + BaseHeaderSize) + (((long)i1) << (shiftForWord())));
+					assert(!((isForwarded(weakling))));
 					markAndTraceClassOf(weakling);
 					for (i = 0, iLimiT = ((numStrongSlotsOfWeakling(weakling)) - 1); i <= iLimiT; i += 1) {
-						field = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						/* begin followObjField:ofObject: */
+						objOop = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						assert(isNonImmediate(objOop));
+						if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
+							objOop = fixFollowedFieldofObjectwithInitialValue(i, weakling, objOop);
+						}
+						field = objOop;
 						if (!(((field & (tagMask())) != 0)
 							 || (((((usqInt) (longAt(field))) >> 55) & 1) != 0))) {
 							/* begin markAndTrace: */
@@ -60743,9 +60755,9 @@
 										}
 										if (fmt == (weakArrayFormat())) {
 											/* begin fixedFieldsOfClass: */
-											objOop1 = fetchClassOfNonImm(objToScan);
+											objOop11 = fetchClassOfNonImm(objToScan);
 											/* begin fixedFieldsOfClassFormat: */
-											numStrongSlots = (((longAt((objOop1 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+											numStrongSlots = (((longAt((objOop11 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 											goto l20;
 										}
 									}
@@ -60941,11 +60953,17 @@
 		assert(allUnscannedEphemeronsAreActive());
 		ptr = ((GIV(unscannedEphemerons).top)) - BytesPerWord;
 		while (ptr >= ((GIV(unscannedEphemerons).start))) {
-			/* begin keyOfEphemeron: */
-			objOop = (ephemeron = longAt(ptr));
-			assert((isNonImmediate(objOop))
-			 && (isEphemeron(objOop)));
-			key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+			/* begin followedKeyOfEphemeron: */
+			objOop1 = (ephemeron = longAt(ptr));
+			assert((isNonImmediate(objOop1))
+			 && (isEphemeron(objOop1)));
+			/* begin followOopField:ofObject: */
+			oop = longAt((objOop1 + BaseHeaderSize) + (0LL << (shiftForWord())));
+			if (((oop & (tagMask())) == 0)
+			 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+				oop = fixFollowedFieldofObjectwithInitialValue(0, objOop1, oop);
+			}
+			key = oop;
 			/* begin markAndTrace: */
 
 			/* inline markAndShouldScan: */
@@ -61028,9 +61046,9 @@
 						}
 						if (fmt1 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop11 = fetchClassOfNonImm(objToScan1);
+							objOop12 = fetchClassOfNonImm(objToScan1);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots1 = (((longAt((objOop11 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots1 = (((longAt((objOop12 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 							goto l13;
 						}
 					}
@@ -61274,9 +61292,9 @@
 						}
 						if (fmt2 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop12 = fetchClassOfNonImm(objToScan2);
+							objOop13 = fetchClassOfNonImm(objToScan2);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots2 = (((longAt((objOop12 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots2 = (((longAt((objOop13 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 							goto l15;
 						}
 					}
@@ -61518,7 +61536,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -66883,7 +66901,7 @@
 bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil)
 {
     usqInt bridgeSpan;
-    usqInt clifton;
+    sqInt clifton;
     usqInt segEnd;
 
 	segEnd = ((aSegment->segSize)) + ((aSegment->segStart));
@@ -67126,7 +67144,7 @@
     sqInt limit;
     sqInt newEndOfMemory;
     sqInt next;
-    usqInt node;
+    sqInt node;
     usqInt numSlots;
     usqInt numSlots1;
     SpurSegmentInfo *seg;
@@ -67470,7 +67488,7 @@
     usqLong firstSavedBridgeWord;
     sqInt nWritten;
     usqInt pier1;
-    usqInt pier2;
+    sqInt pier2;
     usqLong secondSavedBridgeWord;
 
 	pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);

Modified: branches/Cog/nsspur64src/vm/cointerp.h
===================================================================
--- branches/Cog/nsspur64src/vm/cointerp.h	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspur64src/vm/cointerp.h	2016-02-16 00:21:53 UTC (rev 3606)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
 
 

Modified: branches/Cog/nsspur64src/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspur64src/vm/gcc3x-cointerp.c	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspur64src/vm/gcc3x-cointerp.c	2016-02-16 00:21:53 UTC (rev 3606)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
    from
-	CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2445,7 +2445,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.1677";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1680";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -17859,7 +17859,7 @@
 static sqInt
 checkForAndFollowForwardedPrimitiveState(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    signed char accessorDepth;
+    sqInt accessorDepth;
     sqInt firstBytecode;
     sqInt found;
     sqInt found1;
@@ -51460,17 +51460,13 @@
 fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt objOop;
-    sqInt referent;
 
 	assert(isOopForwarded(initialValue));
-	/* begin followForwarded: */
-	assert(isUnambiguouslyForwarder(initialValue));
-	referent = longAt((initialValue + BaseHeaderSize) + (0LL << (shiftForWord())));
-	while (((referent & (tagMask())) == 0)
-	 && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
-		referent = longAt((referent + BaseHeaderSize) + (0LL << (shiftForWord())));
-	}
-	objOop = referent;
+	objOop = initialValue;
+	do {
+		objOop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+	} while(((objOop & (tagMask())) == 0)
+		 && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())));
 	/* begin storePointer:ofObject:withValue: */
 	assert(!(isForwarded(anObject)));
 	if (isOldObject(anObject)) {
@@ -56077,6 +56073,7 @@
     sqInt objOop;
     sqInt objOop1;
     sqInt objToScan;
+    sqInt oop;
     usqInt ptr;
     sqInt scanLargeObject;
     sqInt sp;
@@ -56085,11 +56082,17 @@
 	foundInactive = 0;
 	ptr = (GIV(unscannedEphemerons).start);
 	while (ptr < ((GIV(unscannedEphemerons).top))) {
-		/* begin keyOfEphemeron: */
+		/* begin followedKeyOfEphemeron: */
 		objOop = (ephemeron = longAt(ptr));
 		assert((isNonImmediate(objOop))
 		 && (isEphemeron(objOop)));
-		key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		/* begin followOopField:ofObject: */
+		oop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		if (((oop & (tagMask())) == 0)
+		 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+			oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop);
+		}
+		key = oop;
 		if (((key & (tagMask())) != 0)
 		 || (((((usqInt) (longAt(key))) >> 55) & 1) != 0)) {
 
@@ -60622,10 +60625,12 @@
     sqInt objOop1;
     sqInt objOop11;
     sqInt objOop12;
+    sqInt objOop13;
     sqInt objStackPage;
     sqInt objToScan;
     sqInt objToScan1;
     sqInt objToScan2;
+    sqInt oop;
     sqInt p;
     usqInt ptr;
     sqInt scanLargeObject;
@@ -60665,9 +60670,16 @@
 				for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) {
 					assert(isWeak(fetchPointerofObject(i1, objStackPage)));
 					weakling = longAt((objStackPage + BaseHeaderSize) + (((long)i1) << (shiftForWord())));
+					assert(!((isForwarded(weakling))));
 					markAndTraceClassOf(weakling);
 					for (i = 0, iLimiT = ((numStrongSlotsOfWeakling(weakling)) - 1); i <= iLimiT; i += 1) {
-						field = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						/* begin followObjField:ofObject: */
+						objOop = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						assert(isNonImmediate(objOop));
+						if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
+							objOop = fixFollowedFieldofObjectwithInitialValue(i, weakling, objOop);
+						}
+						field = objOop;
 						if (!(((field & (tagMask())) != 0)
 							 || (((((usqInt) (longAt(field))) >> 55) & 1) != 0))) {
 							/* begin markAndTrace: */
@@ -60752,9 +60764,9 @@
 										}
 										if (fmt == (weakArrayFormat())) {
 											/* begin fixedFieldsOfClass: */
-											objOop1 = fetchClassOfNonImm(objToScan);
+											objOop11 = fetchClassOfNonImm(objToScan);
 											/* begin fixedFieldsOfClassFormat: */
-											numStrongSlots = (((longAt((objOop1 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+											numStrongSlots = (((longAt((objOop11 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 											goto l20;
 										}
 									}
@@ -60950,11 +60962,17 @@
 		assert(allUnscannedEphemeronsAreActive());
 		ptr = ((GIV(unscannedEphemerons).top)) - BytesPerWord;
 		while (ptr >= ((GIV(unscannedEphemerons).start))) {
-			/* begin keyOfEphemeron: */
-			objOop = (ephemeron = longAt(ptr));
-			assert((isNonImmediate(objOop))
-			 && (isEphemeron(objOop)));
-			key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+			/* begin followedKeyOfEphemeron: */
+			objOop1 = (ephemeron = longAt(ptr));
+			assert((isNonImmediate(objOop1))
+			 && (isEphemeron(objOop1)));
+			/* begin followOopField:ofObject: */
+			oop = longAt((objOop1 + BaseHeaderSize) + (0LL << (shiftForWord())));
+			if (((oop & (tagMask())) == 0)
+			 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+				oop = fixFollowedFieldofObjectwithInitialValue(0, objOop1, oop);
+			}
+			key = oop;
 			/* begin markAndTrace: */
 
 			/* inline markAndShouldScan: */
@@ -61037,9 +61055,9 @@
 						}
 						if (fmt1 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop11 = fetchClassOfNonImm(objToScan1);
+							objOop12 = fetchClassOfNonImm(objToScan1);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots1 = (((longAt((objOop11 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots1 = (((longAt((objOop12 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 							goto l13;
 						}
 					}
@@ -61283,9 +61301,9 @@
 						}
 						if (fmt2 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop12 = fetchClassOfNonImm(objToScan2);
+							objOop13 = fetchClassOfNonImm(objToScan2);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots2 = (((longAt((objOop12 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots2 = (((longAt((objOop13 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 							goto l15;
 						}
 					}
@@ -61527,7 +61545,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -66892,7 +66910,7 @@
 bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil)
 {
     usqInt bridgeSpan;
-    usqInt clifton;
+    sqInt clifton;
     usqInt segEnd;
 
 	segEnd = ((aSegment->segSize)) + ((aSegment->segStart));
@@ -67135,7 +67153,7 @@
     sqInt limit;
     sqInt newEndOfMemory;
     sqInt next;
-    usqInt node;
+    sqInt node;
     usqInt numSlots;
     usqInt numSlots1;
     SpurSegmentInfo *seg;
@@ -67479,7 +67497,7 @@
     usqLong firstSavedBridgeWord;
     sqInt nWritten;
     usqInt pier1;
-    usqInt pier2;
+    sqInt pier2;
     usqLong secondSavedBridgeWord;
 
 	pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspursrc/vm/cogit.h	2016-02-16 00:21:53 UTC (rev 3606)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGenerator VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2016-02-16 00:21:53 UTC (rev 3606)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
    from
-	CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2411,7 +2411,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.1677";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1680";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -50723,17 +50723,13 @@
 fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt objOop;
-    sqInt referent;
 
 	assert(isOopForwarded(initialValue));
-	/* begin followForwarded: */
-	assert(isUnambiguouslyForwarder(initialValue));
-	referent = longAt((initialValue + BaseHeaderSize) + (0 << (shiftForWord())));
-	while (((referent & (tagMask())) == 0)
-	 && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
-		referent = longAt((referent + BaseHeaderSize) + (0 << (shiftForWord())));
-	}
-	objOop = referent;
+	objOop = initialValue;
+	do {
+		objOop = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+	} while(((objOop & (tagMask())) == 0)
+		 && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())));
 	/* begin storePointer:ofObject:withValue: */
 	assert(!(isForwarded(anObject)));
 	if (isOldObject(anObject)) {
@@ -55300,6 +55296,7 @@
     sqInt objOop;
     sqInt objOop1;
     sqInt objToScan;
+    sqInt oop;
     usqInt ptr;
     sqInt scanLargeObject;
     sqInt sp;
@@ -55308,11 +55305,17 @@
 	foundInactive = 0;
 	ptr = (GIV(unscannedEphemerons).start);
 	while (ptr < ((GIV(unscannedEphemerons).top))) {
-		/* begin keyOfEphemeron: */
+		/* begin followedKeyOfEphemeron: */
 		objOop = (ephemeron = longAt(ptr));
 		assert((isNonImmediate(objOop))
 		 && (isEphemeron(objOop)));
-		key = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+		/* begin followOopField:ofObject: */
+		oop = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+		if (((oop & (tagMask())) == 0)
+		 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+			oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop);
+		}
+		key = oop;
 		if (((key & (tagMask())) != 0)
 		 || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) {
 
@@ -59724,10 +59727,12 @@
     sqInt objOop1;
     sqInt objOop11;
     sqInt objOop12;
+    sqInt objOop13;
     sqInt objStackPage;
     sqInt objToScan;
     sqInt objToScan1;
     sqInt objToScan2;
+    sqInt oop;
     sqInt p;
     usqInt ptr;
     sqInt scanLargeObject;
@@ -59767,9 +59772,16 @@
 				for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) {
 					assert(isWeak(fetchPointerofObject(i1, objStackPage)));
 					weakling = longAt((objStackPage + BaseHeaderSize) + (i1 << (shiftForWord())));
+					assert(!((isForwarded(weakling))));
 					markAndTraceClassOf(weakling);
 					for (i = 0, iLimiT = ((numStrongSlotsOfWeakling(weakling)) - 1); i <= iLimiT; i += 1) {
-						field = longAt((weakling + BaseHeaderSize) + (i << (shiftForWord())));
+						/* begin followObjField:ofObject: */
+						objOop = longAt((weakling + BaseHeaderSize) + (i << (shiftForWord())));
+						assert(isNonImmediate(objOop));
+						if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
+							objOop = fixFollowedFieldofObjectwithInitialValue(i, weakling, objOop);
+						}
+						field = objOop;
 						if (!(((field & (tagMask())) != 0)
 							 || (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0))) {
 							/* begin markAndTrace: */
@@ -59852,9 +59864,9 @@
 										}
 										if (fmt == (weakArrayFormat())) {
 											/* begin fixedFieldsOfClass: */
-											objOop1 = fetchClassOfNonImm(objToScan);
+											objOop11 = fetchClassOfNonImm(objToScan);
 											/* begin fixedFieldsOfClassFormat: */
-											numStrongSlots = (((longAt((objOop1 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
+											numStrongSlots = (((longAt((objOop11 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
 											goto l20;
 										}
 									}
@@ -60046,11 +60058,17 @@
 		assert(allUnscannedEphemeronsAreActive());
 		ptr = ((GIV(unscannedEphemerons).top)) - BytesPerWord;
 		while (ptr >= ((GIV(unscannedEphemerons).start))) {
-			/* begin keyOfEphemeron: */
-			objOop = (ephemeron = longAt(ptr));
-			assert((isNonImmediate(objOop))
-			 && (isEphemeron(objOop)));
-			key = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+			/* begin followedKeyOfEphemeron: */
+			objOop1 = (ephemeron = longAt(ptr));
+			assert((isNonImmediate(objOop1))
+			 && (isEphemeron(objOop1)));
+			/* begin followOopField:ofObject: */
+			oop = longAt((objOop1 + BaseHeaderSize) + (0 << (shiftForWord())));
+			if (((oop & (tagMask())) == 0)
+			 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+				oop = fixFollowedFieldofObjectwithInitialValue(0, objOop1, oop);
+			}
+			key = oop;
 			/* begin markAndTrace: */
 
 			/* inline markAndShouldScan: */
@@ -60131,9 +60149,9 @@
 						}
 						if (fmt1 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop11 = fetchClassOfNonImm(objToScan1);
+							objOop12 = fetchClassOfNonImm(objToScan1);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots1 = (((longAt((objOop11 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots1 = (((longAt((objOop12 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
 							goto l13;
 						}
 					}
@@ -60371,9 +60389,9 @@
 						}
 						if (fmt2 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop12 = fetchClassOfNonImm(objToScan2);
+							objOop13 = fetchClassOfNonImm(objToScan2);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots2 = (((longAt((objOop12 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots2 = (((longAt((objOop13 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
 							goto l15;
 						}
 					}
@@ -60611,7 +60629,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -66203,7 +66221,7 @@
     sqInt limit;
     sqInt newEndOfMemory;
     sqInt next;
-    sqInt node;
+    usqInt node;
     usqInt numSlots;
     usqInt numSlots1;
     SpurSegmentInfo *seg;
@@ -66332,7 +66350,7 @@
 static sqInt NoDbgRegParms
 readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt bridge;
+    usqInt bridge;
     usqInt bridgehead;
     usqInt bridgeSpan;
     sqInt bytesRead;
@@ -66547,7 +66565,7 @@
     usqLong firstSavedBridgeWord;
     sqInt nWritten;
     usqInt pier1;
-    sqInt pier2;
+    usqInt pier2;
     usqLong secondSavedBridgeWord;
 
 	pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);

Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspursrc/vm/cointerp.h	2016-02-16 00:21:53 UTC (rev 3606)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
 
 

Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2016-02-16 00:21:53 UTC (rev 3606)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
    from
-	CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2414,7 +2414,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.1677";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1680";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -50732,17 +50732,13 @@
 fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt objOop;
-    sqInt referent;
 
 	assert(isOopForwarded(initialValue));
-	/* begin followForwarded: */
-	assert(isUnambiguouslyForwarder(initialValue));
-	referent = longAt((initialValue + BaseHeaderSize) + (0 << (shiftForWord())));
-	while (((referent & (tagMask())) == 0)
-	 && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
-		referent = longAt((referent + BaseHeaderSize) + (0 << (shiftForWord())));
-	}
-	objOop = referent;
+	objOop = initialValue;
+	do {
+		objOop = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+	} while(((objOop & (tagMask())) == 0)
+		 && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())));
 	/* begin storePointer:ofObject:withValue: */
 	assert(!(isForwarded(anObject)));
 	if (isOldObject(anObject)) {
@@ -55309,6 +55305,7 @@
     sqInt objOop;
     sqInt objOop1;
     sqInt objToScan;
+    sqInt oop;
     usqInt ptr;
     sqInt scanLargeObject;
     sqInt sp;
@@ -55317,11 +55314,17 @@
 	foundInactive = 0;
 	ptr = (GIV(unscannedEphemerons).start);
 	while (ptr < ((GIV(unscannedEphemerons).top))) {
-		/* begin keyOfEphemeron: */
+		/* begin followedKeyOfEphemeron: */
 		objOop = (ephemeron = longAt(ptr));
 		assert((isNonImmediate(objOop))
 		 && (isEphemeron(objOop)));
-		key = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+		/* begin followOopField:ofObject: */
+		oop = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+		if (((oop & (tagMask())) == 0)
+		 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+			oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop);
+		}
+		key = oop;
 		if (((key & (tagMask())) != 0)
 		 || (((((usqInt) (longAt(key + 4))) >> 23) & 1) != 0)) {
 
@@ -59733,10 +59736,12 @@
     sqInt objOop1;
     sqInt objOop11;
     sqInt objOop12;
+    sqInt objOop13;
     sqInt objStackPage;
     sqInt objToScan;
     sqInt objToScan1;
     sqInt objToScan2;
+    sqInt oop;
     sqInt p;
     usqInt ptr;
     sqInt scanLargeObject;
@@ -59776,9 +59781,16 @@
 				for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) {
 					assert(isWeak(fetchPointerofObject(i1, objStackPage)));
 					weakling = longAt((objStackPage + BaseHeaderSize) + (i1 << (shiftForWord())));
+					assert(!((isForwarded(weakling))));
 					markAndTraceClassOf(weakling);
 					for (i = 0, iLimiT = ((numStrongSlotsOfWeakling(weakling)) - 1); i <= iLimiT; i += 1) {
-						field = longAt((weakling + BaseHeaderSize) + (i << (shiftForWord())));
+						/* begin followObjField:ofObject: */
+						objOop = longAt((weakling + BaseHeaderSize) + (i << (shiftForWord())));
+						assert(isNonImmediate(objOop));
+						if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
+							objOop = fixFollowedFieldofObjectwithInitialValue(i, weakling, objOop);
+						}
+						field = objOop;
 						if (!(((field & (tagMask())) != 0)
 							 || (((((usqInt) (longAt(field + 4))) >> 23) & 1) != 0))) {
 							/* begin markAndTrace: */
@@ -59861,9 +59873,9 @@
 										}
 										if (fmt == (weakArrayFormat())) {
 											/* begin fixedFieldsOfClass: */
-											objOop1 = fetchClassOfNonImm(objToScan);
+											objOop11 = fetchClassOfNonImm(objToScan);
 											/* begin fixedFieldsOfClassFormat: */
-											numStrongSlots = (((longAt((objOop1 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
+											numStrongSlots = (((longAt((objOop11 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
 											goto l20;
 										}
 									}
@@ -60055,11 +60067,17 @@
 		assert(allUnscannedEphemeronsAreActive());
 		ptr = ((GIV(unscannedEphemerons).top)) - BytesPerWord;
 		while (ptr >= ((GIV(unscannedEphemerons).start))) {
-			/* begin keyOfEphemeron: */
-			objOop = (ephemeron = longAt(ptr));
-			assert((isNonImmediate(objOop))
-			 && (isEphemeron(objOop)));
-			key = longAt((objOop + BaseHeaderSize) + (0 << (shiftForWord())));
+			/* begin followedKeyOfEphemeron: */
+			objOop1 = (ephemeron = longAt(ptr));
+			assert((isNonImmediate(objOop1))
+			 && (isEphemeron(objOop1)));
+			/* begin followOopField:ofObject: */
+			oop = longAt((objOop1 + BaseHeaderSize) + (0 << (shiftForWord())));
+			if (((oop & (tagMask())) == 0)
+			 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+				oop = fixFollowedFieldofObjectwithInitialValue(0, objOop1, oop);
+			}
+			key = oop;
 			/* begin markAndTrace: */
 
 			/* inline markAndShouldScan: */
@@ -60140,9 +60158,9 @@
 						}
 						if (fmt1 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop11 = fetchClassOfNonImm(objToScan1);
+							objOop12 = fetchClassOfNonImm(objToScan1);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots1 = (((longAt((objOop11 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots1 = (((longAt((objOop12 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
 							goto l13;
 						}
 					}
@@ -60380,9 +60398,9 @@
 						}
 						if (fmt2 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop12 = fetchClassOfNonImm(objToScan2);
+							objOop13 = fetchClassOfNonImm(objToScan2);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots2 = (((longAt((objOop12 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots2 = (((longAt((objOop13 + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) >> 1)) & ((1 << (fixedFieldsFieldWidth())) - 1);
 							goto l15;
 						}
 					}
@@ -60620,7 +60638,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -66212,7 +66230,7 @@
     sqInt limit;
     sqInt newEndOfMemory;
     sqInt next;
-    sqInt node;
+    usqInt node;
     usqInt numSlots;
     usqInt numSlots1;
     SpurSegmentInfo *seg;
@@ -66341,7 +66359,7 @@
 static sqInt NoDbgRegParms
 readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt bridge;
+    usqInt bridge;
     usqInt bridgehead;
     usqInt bridgeSpan;
     sqInt bytesRead;
@@ -66556,7 +66574,7 @@
     usqLong firstSavedBridgeWord;
     sqInt nWritten;
     usqInt pier1;
-    sqInt pier2;
+    usqInt pier2;
     usqLong secondSavedBridgeWord;
 
 	pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);

Modified: branches/Cog/nsspurstack64src/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstack64src/vm/gcc3x-interp.c	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspurstack64src/vm/gcc3x-interp.c	2016-02-16 00:21:53 UTC (rev 3606)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
    from
-	StackInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	StackInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2185,7 +2185,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1677";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1680";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -38177,17 +38177,13 @@
 fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt objOop;
-    sqInt referent;
 
 	assert(isOopForwarded(initialValue));
-	/* begin followForwarded: */
-	assert(isUnambiguouslyForwarder(initialValue));
-	referent = longAt((initialValue + BaseHeaderSize) + (0LL << (shiftForWord())));
-	while (((referent & (tagMask())) == 0)
-	 && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
-		referent = longAt((referent + BaseHeaderSize) + (0LL << (shiftForWord())));
-	}
-	objOop = referent;
+	objOop = initialValue;
+	do {
+		objOop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+	} while(((objOop & (tagMask())) == 0)
+		 && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())));
 	/* begin storePointer:ofObject:withValue: */
 	assert(!(isForwarded(anObject)));
 	if (isOldObject(anObject)) {
@@ -42766,6 +42762,7 @@
     sqInt objOop;
     sqInt objOop1;
     sqInt objToScan;
+    sqInt oop;
     usqInt ptr;
     sqInt scanLargeObject;
     sqInt sp;
@@ -42774,11 +42771,17 @@
 	foundInactive = 0;
 	ptr = (GIV(unscannedEphemerons).start);
 	while (ptr < ((GIV(unscannedEphemerons).top))) {
-		/* begin keyOfEphemeron: */
+		/* begin followedKeyOfEphemeron: */
 		objOop = (ephemeron = longAt(ptr));
 		assert((isNonImmediate(objOop))
 		 && (isEphemeron(objOop)));
-		key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		/* begin followOopField:ofObject: */
+		oop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		if (((oop & (tagMask())) == 0)
+		 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+			oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop);
+		}
+		key = oop;
 		if (((key & (tagMask())) != 0)
 		 || (((((usqInt) (longAt(key))) >> 55) & 1) != 0)) {
 
@@ -47163,10 +47166,12 @@
     sqInt objOop1;
     sqInt objOop11;
     sqInt objOop12;
+    sqInt objOop13;
     sqInt objStackPage;
     sqInt objToScan;
     sqInt objToScan1;
     sqInt objToScan2;
+    sqInt oop;
     sqInt p;
     usqInt ptr;
     sqInt scanLargeObject;
@@ -47205,9 +47210,16 @@
 				for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) {
 					assert(isWeak(fetchPointerofObject(i1, objStackPage)));
 					weakling = longAt((objStackPage + BaseHeaderSize) + (((long)i1) << (shiftForWord())));
+					assert(!((isForwarded(weakling))));
 					markAndTraceClassOf(weakling);
 					for (i = 0, iLimiT = ((numStrongSlotsOfWeakling(weakling)) - 1); i <= iLimiT; i += 1) {
-						field = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						/* begin followObjField:ofObject: */
+						objOop = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						assert(isNonImmediate(objOop));
+						if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
+							objOop = fixFollowedFieldofObjectwithInitialValue(i, weakling, objOop);
+						}
+						field = objOop;
 						if (!(((field & (tagMask())) != 0)
 							 || (((((usqInt) (longAt(field))) >> 55) & 1) != 0))) {
 							/* begin markAndTrace: */
@@ -47292,9 +47304,9 @@
 										}
 										if (fmt == (weakArrayFormat())) {
 											/* begin fixedFieldsOfClass: */
-											objOop1 = fetchClassOfNonImm(objToScan);
+											objOop11 = fetchClassOfNonImm(objToScan);
 											/* begin fixedFieldsOfClassFormat: */
-											numStrongSlots = (((longAt((objOop1 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+											numStrongSlots = (((longAt((objOop11 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 											goto l20;
 										}
 									}
@@ -47480,11 +47492,17 @@
 		assert(allUnscannedEphemeronsAreActive());
 		ptr = ((GIV(unscannedEphemerons).top)) - BytesPerWord;
 		while (ptr >= ((GIV(unscannedEphemerons).start))) {
-			/* begin keyOfEphemeron: */
-			objOop = (ephemeron = longAt(ptr));
-			assert((isNonImmediate(objOop))
-			 && (isEphemeron(objOop)));
-			key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+			/* begin followedKeyOfEphemeron: */
+			objOop1 = (ephemeron = longAt(ptr));
+			assert((isNonImmediate(objOop1))
+			 && (isEphemeron(objOop1)));
+			/* begin followOopField:ofObject: */
+			oop = longAt((objOop1 + BaseHeaderSize) + (0LL << (shiftForWord())));
+			if (((oop & (tagMask())) == 0)
+			 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+				oop = fixFollowedFieldofObjectwithInitialValue(0, objOop1, oop);
+			}
+			key = oop;
 			/* begin markAndTrace: */
 
 			/* inline markAndShouldScan: */
@@ -47567,9 +47585,9 @@
 						}
 						if (fmt1 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop11 = fetchClassOfNonImm(objToScan1);
+							objOop12 = fetchClassOfNonImm(objToScan1);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots1 = (((longAt((objOop11 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots1 = (((longAt((objOop12 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 							goto l13;
 						}
 					}
@@ -47805,9 +47823,9 @@
 						}
 						if (fmt2 == (weakArrayFormat())) {
 							/* begin fixedFieldsOfClass: */
-							objOop12 = fetchClassOfNonImm(objToScan2);
+							objOop13 = fetchClassOfNonImm(objToScan2);
 							/* begin fixedFieldsOfClassFormat: */
-							numStrongSlots2 = (((longAt((objOop12 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+							numStrongSlots2 = (((longAt((objOop13 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 							goto l15;
 						}
 					}
@@ -57784,7 +57802,7 @@
     sqInt referent2;
     sqInt referent3;
     char *theFP;
-    usqInt theIPPtr;
+    char *theIPPtr;
     StackPage *thePage;
 
 	/* begin externalWriteBackHeadFramePointers */
@@ -57835,11 +57853,11 @@
 			theFP = (thePage->headFP);
 			theIPPtr = (thePage == GIV(stackPage)
 				? 0
-				: ((usqInt)((thePage->headSP))));
+				: (thePage->headSP));
 			while (1) {
 				assert(addressIsInPage(thePage, theFP));
 				assert((theIPPtr == 0)
-				 || (addressIsInPage(thePage, ((void *)theIPPtr))));
+				 || (addressIsInPage(thePage, theIPPtr)));
 				oop = longAt(theFP + FoxReceiver);
 				if (((oop & (tagMask())) == 0)
 				 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {

Modified: branches/Cog/nsspurstack64src/vm/interp.c
===================================================================
--- branches/Cog/nsspurstack64src/vm/interp.c	2016-02-15 19:28:01 UTC (rev 3605)
+++ branches/Cog/nsspurstack64src/vm/interp.c	2016-02-16 00:21:53 UTC (rev 3606)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
    from
-	StackInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37
+	StackInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1677 uuid: 7056bb77-6aa0-4cb6-aa6c-cd921c231d37 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1680 uuid: 6fe34e1e-a5e0-4966-a2cd-3f21ccb0bde9 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2182,7 +2182,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1677";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1680";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -38168,17 +38168,13 @@
 fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt objOop;
-    sqInt referent;
 
 	assert(isOopForwarded(initialValue));
-	/* begin followForwarded: */
-	assert(isUnambiguouslyForwarder(initialValue));
-	referent = longAt((initialValue + BaseHeaderSize) + (0LL << (shiftForWord())));
-	while (((referent & (tagMask())) == 0)
-	 && (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
-		referent = longAt((referent + BaseHeaderSize) + (0LL << (shiftForWord())));
-	}
-	objOop = referent;
+	objOop = initialValue;
+	do {
+		objOop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+	} while(((objOop & (tagMask())) == 0)
+		 && (((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())));
 	/* begin storePointer:ofObject:withValue: */
 	assert(!(isForwarded(anObject)));
 	if (isOldObject(anObject)) {
@@ -42757,6 +42753,7 @@
     sqInt objOop;
     sqInt objOop1;
     sqInt objToScan;
+    sqInt oop;
     usqInt ptr;
     sqInt scanLargeObject;
     sqInt sp;
@@ -42765,11 +42762,17 @@
 	foundInactive = 0;
 	ptr = (GIV(unscannedEphemerons).start);
 	while (ptr < ((GIV(unscannedEphemerons).top))) {
-		/* begin keyOfEphemeron: */
+		/* begin followedKeyOfEphemeron: */
 		objOop = (ephemeron = longAt(ptr));
 		assert((isNonImmediate(objOop))
 		 && (isEphemeron(objOop)));
-		key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		/* begin followOopField:ofObject: */
+		oop = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+		if (((oop & (tagMask())) == 0)
+		 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+			oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop);
+		}
+		key = oop;
 		if (((key & (tagMask())) != 0)
 		 || (((((usqInt) (longAt(key))) >> 55) & 1) != 0)) {
 
@@ -47154,10 +47157,12 @@
     sqInt objOop1;
     sqInt objOop11;
     sqInt objOop12;
+    sqInt objOop13;
     sqInt objStackPage;
     sqInt objToScan;
     sqInt objToScan1;
     sqInt objToScan2;
+    sqInt oop;
     sqInt p;
     usqInt ptr;
     sqInt scanLargeObject;
@@ -47196,9 +47201,16 @@
 				for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) {
 					assert(isWeak(fetchPointerofObject(i1, objStackPage)));
 					weakling = longAt((objStackPage + BaseHeaderSize) + (((long)i1) << (shiftForWord())));
+					assert(!((isForwarded(weakling))));
 					markAndTraceClassOf(weakling);
 					for (i = 0, iLimiT = ((numStrongSlotsOfWeakling(weakling)) - 1); i <= iLimiT; i += 1) {
-						field = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						/* begin followObjField:ofObject: */
+						objOop = longAt((weakling + BaseHeaderSize) + (((long)i) << (shiftForWord())));
+						assert(isNonImmediate(objOop));
+						if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
+							objOop = fixFollowedFieldofObjectwithInitialValue(i, weakling, objOop);
+						}
+						field = objOop;
 						if (!(((field & (tagMask())) != 0)
 							 || (((((usqInt) (longAt(field))) >> 55) & 1) != 0))) {
 							/* begin markAndTrace: */
@@ -47283,9 +47295,9 @@
 										}
 										if (fmt == (weakArrayFormat())) {
 											/* begin fixedFieldsOfClass: */
-											objOop1 = fetchClassOfNonImm(objToScan);
+											objOop11 = fetchClassOfNonImm(objToScan);
 											/* begin fixedFieldsOfClassFormat: */
-											numStrongSlots = (((longAt((objOop1 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
+											numStrongSlots = (((longAt((objOop11 + BaseHeaderSize) + (((long)InstanceSpecificationIndex) << (shiftForWord())))) >> 3)) & ((1LL << (fixedFieldsFieldWidth())) - 1);
 											goto l20;
 										}
 									}
@@ -47471,11 +47483,17 @@
 		assert(allUnscannedEphemeronsAreActive());
 		ptr = ((GIV(unscannedEphemerons).top)) - BytesPerWord;
 		while (ptr >= ((GIV(unscannedEphemerons).start))) {
-			/* begin keyOfEphemeron: */
-			objOop = (ephemeron = longAt(ptr));
-			assert((isNonImmediate(objOop))
-			 && (isEphemeron(objOop)));
-			key = longAt((objOop + BaseHeaderSize) + (0LL << (shiftForWord())));
+			/* begin followedKeyOfEphemeron: */
+			objOop1 = (ephemeron = longAt(ptr));
+			assert((isNonImmediate(objOop1))
+			 && (isEphemeron(objOop1)));
+			/* begin followOopField:ofObject: */
+			oop = longAt((objOop1 + BaseHeaderSize) + (0LL << (shiftForWord())));
+			if (((oop & (tagMask())) == 0)
+			 && (((longAt(oop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun()))) {
+				oop = fixFollowedFieldofObjectwithInitialValue(0, objOop1, oop);
+			}
+			key = oop;
 			/* begin markAndTrace: */
 
 			/* inline markAndShouldScan: */
@@ -47558,9 +47576,9 @@
 						}

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list