[Vm-dev] [commit][3043] CogVm source as per VMMaker.oscog-eem.823

commits at squeakvm.org commits at squeakvm.org
Wed Jul 16 20:07:12 UTC 2014


Revision: 3043
Author:   eliot
Date:     2014-07-16 13:07:09 -0700 (Wed, 16 Jul 2014)
Log Message:
-----------
CogVm source as per VMMaker.oscog-eem.823

Reimplement the backward count in interpreted methods, storing the count
in IFrameFlags, hence eliminating the requirement that the jump happens
consecutively N times in just that method with no backward jumps in any other
method.  The Chameneos benchmark has this pattern and so two mehtods don't
get jitted.  This eliminates lastBackwardJumpMethod & backwardJumpCount.

Add support for not inlining in gcc under optimization (for profiling).  

Modified Paths:
--------------
    branches/Cog/nscogsrc/vm/cogit.c
    branches/Cog/nscogsrc/vm/cogit.h
    branches/Cog/nscogsrc/vm/cogmethod.h
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nscogsrc/vm/interp.h
    branches/Cog/nscogsrc/vm/vmCallback.h
    branches/Cog/nsspursrc/vm/cogit.c
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogmethod.h
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspursrc/vm/interp.h
    branches/Cog/nsspursrc/vm/vmCallback.h
    branches/Cog/sistasrc/vm/cogit.c
    branches/Cog/sistasrc/vm/cogit.h
    branches/Cog/sistasrc/vm/cogmethod.h
    branches/Cog/sistasrc/vm/cointerp.c
    branches/Cog/sistasrc/vm/cointerp.h
    branches/Cog/sistasrc/vm/gcc3x-cointerp.c
    branches/Cog/sistasrc/vm/interp.h
    branches/Cog/sistasrc/vm/vmCallback.h
    branches/Cog/spursistasrc/vm/cogit.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogmethod.h
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/interp.h
    branches/Cog/spursistasrc/vm/vmCallback.h
    branches/Cog/spursrc/vm/cogit.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cogmethod.h
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/interp.h
    branches/Cog/spursrc/vm/vmCallback.h
    branches/Cog/src/vm/cogit.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogmethod.h
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    branches/Cog/src/vm/interp.h
    branches/Cog/src/vm/vmCallback.h

Property Changed:
----------------
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h

Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/cogit.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	StackToRegisterMappingCogit VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 

Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/cogit.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 

Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/cogmethod.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 typedef struct {

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -355,7 +355,7 @@
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -363,6 +363,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 sqInt interpret(void);
 static CogMethod * cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) NoDbgRegParms;
 static void activateCoggedNewMethod(sqInt inInterpreter) NoDbgRegParms;
@@ -835,7 +845,7 @@
 void printWronglySizedContexts(sqInt printContexts);
 static void restoreHeadersFromtofromandtofrom(sqInt firstIn, sqInt lastIn, sqInt hdrBaseIn, sqInt firstOut, sqInt lastOut, sqInt hdrBaseOut) NoDbgRegParms;
 static void runLeakCheckerForFullGC(sqInt fullGCFlag) NoDbgRegParms;
-static usqInt safeObjectAfter(sqInt oop) NoDbgRegParms;
+static sqInt safeObjectAfter(sqInt oop) NoDbgRegParms;
 static sqInt safePrintStringOf(sqInt oop) NoDbgRegParms;
 static sqInt shortentoIndexableSize(sqInt obj, sqInt nSlots) NoDbgRegParms;
 static sqInt sizeBitsOfSafe(sqInt oop) NoDbgRegParms;
@@ -1343,7 +1353,6 @@
 _iss sqInt statGrowMemory;
 _iss sqInt weakRootCount;
 _iss sqInt growHeadroom;
-_iss sqInt backwardJumpCount;
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt lkupClass;
 _iss sqInt preemptionYields;
@@ -1369,7 +1378,6 @@
 _iss sqInt edenBytes;
 _iss usqInt fwdTableLast;
 _iss usqLong gcStartUsecs;
-_iss sqInt lastBackwardJumpMethod;
 _iss sqInt noThreadingOfGUIThread;
 _iss sqInt pendingFinalizationSignals;
 _iss sqInt processHasThreadId;
@@ -2066,7 +2074,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.820";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.823";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -2090,7 +2098,6 @@
 #define getDesiredCogCodeSize() integerObjectOf(desiredCogCodeSize)
 #define initialEnterSmalltalkExecutive() enterSmalltalkExecutiveImplementation()
 #define primTraceLogIndex(aValue) (GIV(primTraceLogIndex) = (aValue))
-#define resetBackwardJumpVariables() /* nada */
 #define setDesiredCogCodeSize(dccs) (desiredCogCodeSize = (dccs))
 #define mostRecentlyUsedPage() GIV(mostRecentlyUsedPage)
 #define pageIndexForstackBasePlus1bytesPerPage(pointer,stkBasePlus1,pageByteSize) (((char *)(pointer) - (stkBasePlus1)) / (pageByteSize))
@@ -6329,6 +6336,7 @@
 		case 167:
 			/* longUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt offset;
 				sqInt switched;
 
@@ -6353,29 +6361,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -12860,6 +12876,7 @@
 		case 498: /*242*/
 			/* extUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt byte;
 				sqInt offset;
 				sqInt switched;
@@ -12887,29 +12904,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -36885,15 +36910,17 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
+    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    usqInt next;
+    sqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;
+    sqInt sz3;
     sqInt target;
     usqInt w;
 
@@ -36904,7 +36931,21 @@
 		/* begin objectAfterWhileForwarding: */
 		header2 = longAt(oop);
 		if ((header2 & MarkBit) == 0) {
-			next = ((sqInt) (objectAfter(oop)));
+			/* begin objectAfter: */
+			if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
+				error("no objects after the end of memory");
+			}
+			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
+				sz2 = (longAt(oop)) & AllButTypeMask;
+			}
+			else {
+				/* begin sizeBitsOf: */
+				header3 = longAt(oop);
+				sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
+					? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
+					: header3 & SizeMask);
+			}
+			next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
 			goto l1;
 		}
 		fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -36919,7 +36960,7 @@
 		else {
 			sz1 = realHeader & SizeMask;
 		}
-		next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
+		next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
 	l1:	/* end objectAfterWhileForwarding: */;
 		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
 
@@ -36973,18 +37014,18 @@
 	}
 	/* begin safeObjectAfter: */
 	if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
-		sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
+		sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
 	}
 	else {
 		/* begin sizeBitsOf: */
-		header3 = longAt(newFreeChunk);
-		sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
+		header4 = longAt(newFreeChunk);
+		sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
 			? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
-			: header3 & SizeMask);
+			: header4 & SizeMask);
 	}
-	next = ((newFreeChunk + sz2) >= GIV(freeStart)
+	next = ((newFreeChunk + sz3) >= GIV(freeStart)
 		? GIV(freeStart)
-		: (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
+		: (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
 	assert((next == GIV(freeStart))
 	 || (next == (oopFromChunk(GIV(compEnd)))));
 	if (next == GIV(freeStart)) {
@@ -38852,7 +38893,7 @@
 	given object or free chunk in memory. Return freeStart when
 	enumeration is complete. This is for assertion checking only. */
 
-static usqInt
+static sqInt
 safeObjectAfter(sqInt oop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt header;

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,12 +1,12 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -14,6 +14,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 usqInt argumentCountAddress(void);
 void assertValidMachineCodeFrame(sqInt instrPtr);
 void callForCogCompiledCodeCompaction(void);

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -358,7 +358,7 @@
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -366,6 +366,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 sqInt interpret(void);
 static CogMethod * cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) NoDbgRegParms;
 static void activateCoggedNewMethod(sqInt inInterpreter) NoDbgRegParms;
@@ -838,7 +848,7 @@
 void printWronglySizedContexts(sqInt printContexts);
 static void restoreHeadersFromtofromandtofrom(sqInt firstIn, sqInt lastIn, sqInt hdrBaseIn, sqInt firstOut, sqInt lastOut, sqInt hdrBaseOut) NoDbgRegParms;
 static void runLeakCheckerForFullGC(sqInt fullGCFlag) NoDbgRegParms;
-static usqInt safeObjectAfter(sqInt oop) NoDbgRegParms;
+static sqInt safeObjectAfter(sqInt oop) NoDbgRegParms;
 static sqInt safePrintStringOf(sqInt oop) NoDbgRegParms;
 static sqInt shortentoIndexableSize(sqInt obj, sqInt nSlots) NoDbgRegParms;
 static sqInt sizeBitsOfSafe(sqInt oop) NoDbgRegParms;
@@ -1346,7 +1356,6 @@
 _iss sqInt statGrowMemory;
 _iss sqInt weakRootCount;
 _iss sqInt growHeadroom;
-_iss sqInt backwardJumpCount;
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt lkupClass;
 _iss sqInt preemptionYields;
@@ -1372,7 +1381,6 @@
 _iss sqInt edenBytes;
 _iss usqInt fwdTableLast;
 _iss usqLong gcStartUsecs;
-_iss sqInt lastBackwardJumpMethod;
 _iss sqInt noThreadingOfGUIThread;
 _iss sqInt pendingFinalizationSignals;
 _iss sqInt processHasThreadId;
@@ -2069,7 +2077,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.820";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.823";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -2093,7 +2101,6 @@
 #define getDesiredCogCodeSize() integerObjectOf(desiredCogCodeSize)
 #define initialEnterSmalltalkExecutive() enterSmalltalkExecutiveImplementation()
 #define primTraceLogIndex(aValue) (GIV(primTraceLogIndex) = (aValue))
-#define resetBackwardJumpVariables() /* nada */
 #define setDesiredCogCodeSize(dccs) (desiredCogCodeSize = (dccs))
 #define mostRecentlyUsedPage() GIV(mostRecentlyUsedPage)
 #define pageIndexForstackBasePlus1bytesPerPage(pointer,stkBasePlus1,pageByteSize) (((char *)(pointer) - (stkBasePlus1)) / (pageByteSize))
@@ -6338,6 +6345,7 @@
 		CASE(167)
 			/* longUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt offset;
 				sqInt switched;
 
@@ -6362,29 +6370,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -12869,6 +12885,7 @@
 		CASE(498) /*242*/
 			/* extUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt byte;
 				sqInt offset;
 				sqInt switched;
@@ -12896,29 +12913,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -36894,15 +36919,17 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
+    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    usqInt next;
+    sqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;
+    sqInt sz3;
     sqInt target;
     usqInt w;
 
@@ -36913,7 +36940,21 @@
 		/* begin objectAfterWhileForwarding: */
 		header2 = longAt(oop);
 		if ((header2 & MarkBit) == 0) {
-			next = ((sqInt) (objectAfter(oop)));
+			/* begin objectAfter: */
+			if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
+				error("no objects after the end of memory");
+			}
+			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
+				sz2 = (longAt(oop)) & AllButTypeMask;
+			}
+			else {
+				/* begin sizeBitsOf: */
+				header3 = longAt(oop);
+				sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
+					? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
+					: header3 & SizeMask);
+			}
+			next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
 			goto l1;
 		}
 		fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -36928,7 +36969,7 @@
 		else {
 			sz1 = realHeader & SizeMask;
 		}
-		next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
+		next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
 	l1:	/* end objectAfterWhileForwarding: */;
 		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
 
@@ -36982,18 +37023,18 @@
 	}
 	/* begin safeObjectAfter: */
 	if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
-		sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
+		sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
 	}
 	else {
 		/* begin sizeBitsOf: */
-		header3 = longAt(newFreeChunk);
-		sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
+		header4 = longAt(newFreeChunk);
+		sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
 			? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
-			: header3 & SizeMask);
+			: header4 & SizeMask);
 	}
-	next = ((newFreeChunk + sz2) >= GIV(freeStart)
+	next = ((newFreeChunk + sz3) >= GIV(freeStart)
 		? GIV(freeStart)
-		: (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
+		: (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
 	assert((next == GIV(freeStart))
 	 || (next == (oopFromChunk(GIV(compEnd)))));
 	if (next == GIV(freeStart)) {
@@ -38861,7 +38902,7 @@
 	given object or free chunk in memory. Return freeStart when
 	enumeration is complete. This is for assertion checking only. */
 
-static usqInt
+static sqInt
 safeObjectAfter(sqInt oop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt header;

Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/interp.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nscogsrc/vm/vmCallback.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 #define VM_CALLBACK_INC 1

Modified: branches/Cog/nsspursrc/vm/cogit.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/cogit.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	StackToRegisterMappingCogit VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/cogit.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogmethod.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/cogmethod.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.822 uuid: ccc5a2c0-9c7d-4777-a4c6-ba28c0d02d80
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 typedef struct {

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -360,7 +360,7 @@
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -368,6 +368,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 sqInt interpret(void);
 static CogMethod * cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) NoDbgRegParms;
 sqInt accessorDepthForPrimitiveIndex(sqInt primIndex);
@@ -1539,7 +1549,6 @@
 _iss sqInt classTableIndex;
 _iss sqInt ephemeronQueue;
 _iss sqInt lkupClass;
-_iss sqInt backwardJumpCount;
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt metaclassNumSlots;
 _iss sqInt preemptionYields;
@@ -1562,7 +1571,6 @@
 _iss sqInt gcMode;
 _iss sqInt firstSegmentSize;
 _iss usqLong gcStartUsecs;
-_iss sqInt lastBackwardJumpMethod;
 _iss sqInt noThreadingOfGUIThread;
 _iss sqInt pendingFinalizationSignals;
 _iss sqInt processHasThreadId;
@@ -2295,7 +2303,7 @@
 /*540*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.820";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.823";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -2319,7 +2327,6 @@
 #define getDesiredCogCodeSize() integerObjectOf(desiredCogCodeSize)
 #define initialEnterSmalltalkExecutive() enterSmalltalkExecutiveImplementation()
 #define primTraceLogIndex(aValue) (GIV(primTraceLogIndex) = (aValue))
-#define resetBackwardJumpVariables() /* nada */
 #define setDesiredCogCodeSize(dccs) (desiredCogCodeSize = (dccs))
 #define mostRecentlyUsedPage() GIV(mostRecentlyUsedPage)
 #define pageIndexForstackBasePlus1bytesPerPage(pointer,stkBasePlus1,pageByteSize) (((char *)(pointer) - (stkBasePlus1)) / (pageByteSize))
@@ -7461,6 +7468,7 @@
 		case 167:
 			/* longUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt offset;
 				sqInt switched;
 
@@ -7485,29 +7493,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -14671,6 +14687,7 @@
 		case 498: /*242*/
 			/* extUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt byte;
 				sqInt offset;
 				sqInt switched;
@@ -14698,29 +14715,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);

Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/cointerp.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,12 +1,12 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -14,6 +14,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 sqInt accessorDepthForPrimitiveIndex(sqInt primIndex);
 usqInt argumentCountAddress(void);
 void assertValidMachineCodeFrame(sqInt instrPtr);

Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -363,7 +363,7 @@
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -371,6 +371,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 sqInt interpret(void);
 static CogMethod * cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) NoDbgRegParms;
 sqInt accessorDepthForPrimitiveIndex(sqInt primIndex);
@@ -1542,7 +1552,6 @@
 _iss sqInt classTableIndex;
 _iss sqInt ephemeronQueue;
 _iss sqInt lkupClass;
-_iss sqInt backwardJumpCount;
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt metaclassNumSlots;
 _iss sqInt preemptionYields;
@@ -1565,7 +1574,6 @@
 _iss sqInt gcMode;
 _iss sqInt firstSegmentSize;
 _iss usqLong gcStartUsecs;
-_iss sqInt lastBackwardJumpMethod;
 _iss sqInt noThreadingOfGUIThread;
 _iss sqInt pendingFinalizationSignals;
 _iss sqInt processHasThreadId;
@@ -2298,7 +2306,7 @@
 /*540*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.820";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.823";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -2322,7 +2330,6 @@
 #define getDesiredCogCodeSize() integerObjectOf(desiredCogCodeSize)
 #define initialEnterSmalltalkExecutive() enterSmalltalkExecutiveImplementation()
 #define primTraceLogIndex(aValue) (GIV(primTraceLogIndex) = (aValue))
-#define resetBackwardJumpVariables() /* nada */
 #define setDesiredCogCodeSize(dccs) (desiredCogCodeSize = (dccs))
 #define mostRecentlyUsedPage() GIV(mostRecentlyUsedPage)
 #define pageIndexForstackBasePlus1bytesPerPage(pointer,stkBasePlus1,pageByteSize) (((char *)(pointer) - (stkBasePlus1)) / (pageByteSize))
@@ -7470,6 +7477,7 @@
 		CASE(167)
 			/* longUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt offset;
 				sqInt switched;
 
@@ -7494,29 +7502,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
@@ -14680,6 +14696,7 @@
 		CASE(498) /*242*/
 			/* extUnconditionalJump */
 			{
+				sqInt backwardJumpCountByte;
 				sqInt byte;
 				sqInt offset;
 				sqInt switched;
@@ -14707,29 +14724,37 @@
 						localSP = pointerForOop(GIV(stackPointer));
 						localFP = pointerForOop(GIV(framePointer));
 					}
-					if (GIV(method) == GIV(lastBackwardJumpMethod)) {
-						if (((GIV(backwardJumpCount) -= 1)) <= 0) {
+					backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)));
+					if (((backwardJumpCountByte -= 2)) <= 1) {
+						if (backwardJumpCountByte == -1) {
+
+							/* initialize the count */
+
+							assert(minBackwardJumpCountForCompile <= 128);
+							backwardJumpCountByte = ((minBackwardJumpCountForCompile - 1) << 1) + 1;
+						}
+						else {
 							if (methodWithHeaderShouldBeCogged(headerOf(GIV(method)))) {
 								/* begin externalizeFPandSP */
 								assert((localSP < ((GIV(stackPage)->baseAddress)))
 								 && (localSP > (((GIV(stackPage)->realStackLimit)) - LargeContextSize)));
 								GIV(stackPointer) = localSP;
 								GIV(framePointer) = localFP;
-								resetBackwardJumpVariables();
 								attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
 							}
 							else {
 
-								/* don't ask if one should compile a second time... */
+								/* avoid asking for as long as possible */
 
-								GIV(backwardJumpCount) = 1 << ((BytesPerWord * 8) - 2);
+								backwardJumpCountByte = 0xFF;
 							}
 						}
 					}
-					else {
-						GIV(lastBackwardJumpMethod) = GIV(method);
-						GIV(backwardJumpCount) = minBackwardJumpCountForCompile;
-					}
+					byteAtput(localFP + ((VMBIGENDIAN
+	? (FoxIFrameFlags + BytesPerWord) - 1
+	: FoxIFrameFlags)), backwardJumpCountByte);
 				}
 				/* begin fetchNextBytecode */
 				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);

Modified: branches/Cog/nsspursrc/vm/interp.h
===================================================================
--- branches/Cog/nsspursrc/vm/interp.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/interp.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/nsspursrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nsspursrc/vm/vmCallback.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/nsspursrc/vm/vmCallback.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 #define VM_CALLBACK_INC 1


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Wed Jul 16 11:48:40 PDT 2014
   + Wed Jul 16 13:05:48 PDT 2014

Modified: branches/Cog/sistasrc/vm/cogit.c
===================================================================
--- branches/Cog/sistasrc/vm/cogit.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/sistasrc/vm/cogit.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7 " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -367,7 +367,7 @@
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -375,6 +375,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
 static sqInt computeJumpTargetOffsetPlus(AbstractInstruction * self_in_computeJumpTargetOffsetPlus, sqInt anPCOffset) NoDbgRegParms;
@@ -18419,18 +18429,18 @@
 	inBlock = 0;
 	prevBCDescriptor = null;
 	numCounters = 0;
+	
+#  if NewspeakVM
+	numIRCs = 0;
+
+#  endif /* NewspeakVM */
+
 	if ((primitiveIndex > 0)
 	 && (isQuickPrimitiveIndex(primitiveIndex))) {
 		return 0;
 	}
 	pc = (latestContinuation = initialPC);
 	numBlocks = (framelessStackDelta = (nExts = 0));
-	
-#  if NewspeakVM
-	numIRCs = 0;
-
-#  endif /* NewspeakVM */
-
 	while (pc <= endPC) {
 		byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset;
 		descriptor = generatorAt(byte0);

Modified: branches/Cog/sistasrc/vm/cogit.h
===================================================================
--- branches/Cog/sistasrc/vm/cogit.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/sistasrc/vm/cogit.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,12 +1,12 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -14,6 +14,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 sqInt abortOffset(void);
 void addCogMethodsToHeapMap(void);
 sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod);

Modified: branches/Cog/sistasrc/vm/cogmethod.h
===================================================================
--- branches/Cog/sistasrc/vm/cogmethod.h	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/sistasrc/vm/cogmethod.h	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGenerator VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
 
 typedef struct {

Modified: branches/Cog/sistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/sistasrc/vm/cointerp.c	2014-07-16 18:49:18 UTC (rev 3042)
+++ branches/Cog/sistasrc/vm/cointerp.c	2014-07-16 20:07:09 UTC (rev 3043)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
    from
-	CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7
+	CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.820 uuid: 783c4789-0cac-41f9-9b01-d1930e0fe4d7 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.823 uuid: 2d337398-d2dd-4715-9476-9a463c29efad " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -353,7 +353,7 @@
 /*** Function Prototypes ***/
 
 
-#if defined(PRODUCTION) && !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
+#if !PRODUCTION && defined(__GNUC__) && !defined(NoDbgRegParms)
 # define NoDbgRegParms __attribute__ ((regparm (0)))
 #endif
 
@@ -361,6 +361,16 @@
 # define NoDbgRegParms /*empty*/
 #endif
 
+
+
+#if defined(__GNUC__) && !defined(NeverInline)
+# define NeverInline __attribute__ ((noinline))
+#endif
+
+#if !defined(NeverInline)
+# define NeverInline /*empty*/
+#endif
+
 sqInt interpret(void);
 static CogMethod * cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) NoDbgRegParms;
 static void activateCoggedNewMethod(sqInt inInterpreter) NoDbgRegParms;
@@ -832,7 +842,7 @@
 void printWronglySizedContexts(sqInt printContexts);
 static void restoreHeadersFromtofromandtofrom(sqInt firstIn, sqInt lastIn, sqInt hdrBaseIn, sqInt firstOut, sqInt lastOut, sqInt hdrBaseOut) NoDbgRegParms;
 static void runLeakCheckerForFullGC(sqInt fullGCFlag) NoDbgRegParms;
-static usqInt safeObjectAfter(sqInt oop) NoDbgRegParms;
+static sqInt safeObjectAfter(sqInt oop) NoDbgRegParms;
 static sqInt safePrintStringOf(sqInt oop) NoDbgRegParms;
 static sqInt shortentoIndexableSize(sqInt obj, sqInt nSlots) NoDbgRegParms;
 static sqInt sizeBitsOfSafe(sqInt oop) NoDbgRegParms;
@@ -1297,8 +1307,8 @@
 _iss sqInt specialObjectsOop;
 _iss char * framePointer;
 _iss StackPage * stackPage;
+_iss usqInt freeStart;
 _iss usqInt method;
-_iss usqInt freeStart;
 _iss sqInt nilObj;
 _iss usqInt instructionPointer;
 _iss sqInt argumentCount;
@@ -1359,7 +1369,6 @@
 _iss usqInt compEnd;
 _iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
-_iss sqInt backwardJumpCount;
 _iss sqInt edenBytes;
 _iss usqInt fwdTableLast;
 _iss usqLong gcStartUsecs;
@@ -1388,7 +1397,6 @@
 _iss usqInt gcBiasToGrowThreshold;
 _iss sqInt interruptKeycode;
 _iss sqInt interruptPending;
-_iss sqInt lastBackwardJumpMethod;
 _iss usqInt memory;
 _iss usqLong nextPollUsecs;
 _iss usqLong statForceInterruptCheck;
@@ -2060,7 +2068,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.820]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.823]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -2084,7 +2092,6 @@
 #define getDesiredCogCodeSize() integerObjectOf(desiredCogCodeSize)
 #define initialEnterSmalltalkExecutive() enterSmalltalkExecutiveImplementation()
 #define primTraceLogIndex(aValue) (GIV(primTraceLogIndex) = (aValue))
-#define resetBackwardJumpVariables() /* nada */
 #define setDesiredCogCodeSize(dccs) (desiredCogCodeSize = (dccs))

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list