[Vm-dev] [commit][3322] CogVM source as per VMMaker.oscog-eem.1292

commits at squeakvm.org commits at squeakvm.org
Thu May 7 01:37:41 UTC 2015


Revision: 3322
Author:   eliot
Date:     2015-05-06 18:37:40 -0700 (Wed, 06 May 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1292

Fix a regression in externalInstVar:ofContext:.  The head frame pointers must
be written back if we're going to map a machince code pc to a bytecode pc in
case of code reclamation.

Add asserts to the stack page enumerators to check
that the head frame pointers have been written back.

Use macros for the oop comparisons, avoiding cCoerce:, to get faster simulation
and avoid the inliner not always inlining in conditionals.

Modified Paths:
--------------
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    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/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/cogitARMv5.c
    branches/Cog/spursrc/vm/cogitIA32.c
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spurstack64src/vm/gcc3x-interp.c
    branches/Cog/spurstack64src/vm/interp.c
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogitARMv5.c
    branches/Cog/src/vm/cogitIA32.c
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c

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

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-05-06 21:11:38 UTC (rev 3321)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-05-07 01:37:40 UTC (rev 3322)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e
+	CCodeGenerator VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-05-06 21:11:38 UTC (rev 3321)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-05-07 01:37:40 UTC (rev 3322)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e
+	CCodeGenerator VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -1175,10 +1175,6 @@
 static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) NoDbgRegParms;
 static sqInt v3or4PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) NoDbgRegParms;
 static sqInt v3or4NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
-static sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop) NoDbgRegParms;
-static sqInt oopisGreaterThanOrEqualToandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop) NoDbgRegParms;
-static sqInt oopisGreaterThan(sqInt anOop, sqInt otherOop) NoDbgRegParms;
-static sqInt oopisLessThan(sqInt anOop, sqInt otherOop) NoDbgRegParms;
 
 
 /*** Variables ***/
@@ -1940,6 +1936,13 @@
 #define traceSpill(ign) 0
 #define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType))
 #define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0]))
+#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop))
+#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop))
+#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
+#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop))
+#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
+#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop))
+#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop))
 
 
 static AbstractInstruction *
@@ -9603,7 +9606,7 @@
 {
     sqInt classIndex;
     sqInt i;
-    sqInt pc;
+    usqInt pc;
 
 	pc = (((((usqInt)cPIC)) + firstCPICCaseOffset) + cPICCaseSize) - (jumpLongConditionalByteSize(backEnd));
 	for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) {
@@ -14985,10 +14988,10 @@
 		if (oopisLessThan(anOop, minCogMethodAddress())) {
 			return " is in generated runtime";
 		}
-		if ((((usqInt) anOop)) < (((usqInt) mzFreeStart))) {
+		if (oopisLessThan(anOop, mzFreeStart)) {
 			return " is in generated methods";
 		}
-		if ((((usqInt) anOop)) < (((usqInt) youngReferrers))) {
+		if (oopisLessThan(anOop, youngReferrers)) {
 			return " is in code zone";
 		}
 		return " is in young referrers";
@@ -24380,6 +24383,7 @@
 genTrinaryInlinePrimitive(sqInt prim)
 {
     sqInt adjust;
+    sqInt needsStoreCheck;
     sqInt ra1;
     sqInt ra2;
     sqInt rNext;
@@ -24439,6 +24443,7 @@
 	assert((rr != ra1)
 	 && ((rr != ra2)
 	 && (ra1 != ra2)));
+	needsStoreCheck = !(isUnannotatableConstant(ssTop()));
 	popToReg(ssTop(), ra2);
 	ssPop(1);
 	popToReg(ssTop(), ra1);
@@ -24459,7 +24464,10 @@
 		}
 		/* begin MoveR:Xwr:R: */
 		genoperandoperandoperand(MoveRXwrR, ra2, ra1, rr);
-		genStoreCheckReceiverRegvalueRegscratchReginFrame(rr, ra2, TempReg, 1);
+		if (needsStoreCheck) {
+			assert(needsFrame);
+			genStoreCheckReceiverRegvalueRegscratchReginFrame(rr, ra2, TempReg, 1);
+		}
 		break;
 	case 1:
 		genConvertSmallIntegerToIntegerInReg(ra2);
@@ -25611,48 +25619,3 @@
 				? 1
 				: 0));
 }
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop)
-{
-	return (((usqInt) anOop)) >= (((usqInt) otherOop));
-}
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisGreaterThanOrEqualToandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop)
-{
-	return ((((usqInt) anOop)) >= (((usqInt) baseOop)))
-	 && ((((usqInt) anOop)) < (((usqInt) limitOop)));
-}
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisGreaterThan(sqInt anOop, sqInt otherOop)
-{
-	return (((usqInt) anOop)) > (((usqInt) otherOop));
-}
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisLessThan(sqInt anOop, sqInt otherOop)
-{
-	return (((usqInt) anOop)) < (((usqInt) otherOop));
-}

Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c	2015-05-06 21:11:38 UTC (rev 3321)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c	2015-05-07 01:37:40 UTC (rev 3322)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e
+	CCodeGenerator VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -1119,10 +1119,6 @@
 static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) NoDbgRegParms;
 static sqInt v3or4PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) NoDbgRegParms;
 static sqInt v3or4NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
-static sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop) NoDbgRegParms;
-static sqInt oopisGreaterThanOrEqualToandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop) NoDbgRegParms;
-static sqInt oopisGreaterThan(sqInt anOop, sqInt otherOop) NoDbgRegParms;
-static sqInt oopisLessThan(sqInt anOop, sqInt otherOop) NoDbgRegParms;
 
 
 /*** Variables ***/
@@ -1886,6 +1882,13 @@
 #define traceSpill(ign) 0
 #define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType))
 #define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0]))
+#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop))
+#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop))
+#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
+#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop))
+#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
+#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop))
+#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop))
 
 
 static sqInt
@@ -13761,10 +13764,10 @@
 		if (oopisLessThan(anOop, minCogMethodAddress())) {
 			return " is in generated runtime";
 		}
-		if ((((usqInt) anOop)) < (((usqInt) mzFreeStart))) {
+		if (oopisLessThan(anOop, mzFreeStart)) {
 			return " is in generated methods";
 		}
-		if ((((usqInt) anOop)) < (((usqInt) youngReferrers))) {
+		if (oopisLessThan(anOop, youngReferrers)) {
 			return " is in code zone";
 		}
 		return " is in young referrers";
@@ -23123,6 +23126,7 @@
 genTrinaryInlinePrimitive(sqInt prim)
 {
     sqInt adjust;
+    sqInt needsStoreCheck;
     sqInt ra1;
     sqInt ra2;
     sqInt rNext;
@@ -23182,6 +23186,7 @@
 	assert((rr != ra1)
 	 && ((rr != ra2)
 	 && (ra1 != ra2)));
+	needsStoreCheck = !(isUnannotatableConstant(ssTop()));
 	popToReg(ssTop(), ra2);
 	ssPop(1);
 	popToReg(ssTop(), ra1);
@@ -23202,7 +23207,10 @@
 		}
 		/* begin MoveR:Xwr:R: */
 		genoperandoperandoperand(MoveRXwrR, ra2, ra1, rr);
-		genStoreCheckReceiverRegvalueRegscratchReginFrame(rr, ra2, TempReg, 1);
+		if (needsStoreCheck) {
+			assert(needsFrame);
+			genStoreCheckReceiverRegvalueRegscratchReginFrame(rr, ra2, TempReg, 1);
+		}
 		break;
 	case 1:
 		genConvertSmallIntegerToIntegerInReg(ra2);
@@ -24352,48 +24360,3 @@
 				? 1
 				: 0));
 }
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop)
-{
-	return (((usqInt) anOop)) >= (((usqInt) otherOop));
-}
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisGreaterThanOrEqualToandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop)
-{
-	return ((((usqInt) anOop)) >= (((usqInt) baseOop)))
-	 && ((((usqInt) anOop)) < (((usqInt) limitOop)));
-}
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisGreaterThan(sqInt anOop, sqInt otherOop)
-{
-	return (((usqInt) anOop)) > (((usqInt) otherOop));
-}
-
-
-/*	Compare two oop values, treating them as object memory locations.
-	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
-	method will be inlined during C translation. */
-
-static sqInt
-oopisLessThan(sqInt anOop, sqInt otherOop)
-{
-	return (((usqInt) anOop)) < (((usqInt) otherOop));
-}

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2015-05-06 21:11:38 UTC (rev 3321)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e
    from
-	CoInterpreter VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e
+	CoInterpreter VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1288 uuid: 909625f0-4d63-4a3b-84e1-1f2753923d7e " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1292 uuid: 0cde527f-cdb5-4345-adad-7dd496ef023e " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1327,6 +1327,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -1539,11 +1540,6 @@
 EXPORT(void) primitiveVoidReceiver(void);
 static void pruneStackstackp(sqInt stack, sqInt stackp) NoDbgRegParms;
 static void unmarkAfterPathTo(void);
-static sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop) NoDbgRegParms;
-static sqInt oopisGreaterThanOrEqualToandLessThanOrEqualTo(sqInt anOop, sqInt baseOop, sqInt limitOop) NoDbgRegParms;
-static sqInt oopisGreaterThanOrEqualToandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop) NoDbgRegParms;
-static sqInt oopisLessThanOrEqualTo(sqInt anOop, sqInt otherOop) NoDbgRegParms;
-static sqInt oopisLessThan(sqInt anOop, sqInt otherOop) NoDbgRegParms;
 
 /*** Variables ***/
 #if SQ_USE_GLOBAL_STRUCT
@@ -1583,12 +1579,12 @@
 _iss usqInt pastSpaceStart;
 _iss sqInt numSegments;
 _iss sqInt traceLogIndex;
-_iss sqInt rememberedSetSize;
 _iss sqInt classTableFirstPage;
 _iss sqInt * freeLists;
+_iss sqInt rememberedSetSize;
 _iss char * stackLimit;
-_iss sqInt * rememberedSet;
 _iss sqInt tempOop;
+_iss sqInt * rememberedSet;
 _iss sqInt remapBufferCount;
 _iss usqInt freeListsMask;
 _iss sqInt profileProcess;
@@ -2382,7 +2378,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.1288";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1292";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -2442,6 +2438,13 @@
 #define printFloat(f) printf("%g", f)
 #define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType))
 #define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0]))
+#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop))
+#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop))
+#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
+#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop))
+#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
+#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop))
+#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop))
 
 
 
@@ -4820,7 +4823,7 @@
 					/* most stores into young objects */
 
 					if (((top & 3) == 0)
-					 && ((((usqInt) top)) < (((usqInt) GIV(newSpaceLimit))))) {
+					 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
 						/* begin possibleRootStoreInto: */
 						if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 							remember(rcvr);
@@ -5843,7 +5846,7 @@
 						/* most stores into young objects */
 
 						if ((((longAtPointer(localSP)) & 3) == 0)
-						 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(objOop))) >> 29) & 1) != 0)) {
 								remember(objOop);
@@ -5884,7 +5887,7 @@
 						/* most stores into young objects */
 
 						if ((((longAtPointer(localSP)) & 3) == 0)
-						 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(litVar))) >> 29) & 1) != 0)) {
 								remember(litVar);
@@ -5926,7 +5929,7 @@
 						/* most stores into young objects */
 
 						if ((((longAtPointer(localSP)) & 3) == 0)
-						 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(objOop))) >> 29) & 1) != 0)) {
 								remember(objOop);
@@ -5967,7 +5970,7 @@
 						/* most stores into young objects */
 
 						if ((((longAtPointer(localSP)) & 3) == 0)
-						 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(litVar))) >> 29) & 1) != 0)) {
 								remember(litVar);
@@ -6624,7 +6627,7 @@
 						/* most stores into young objects */
 
 						if (((top & 3) == 0)
-						 && ((((usqInt) top)) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(litVar))) >> 29) & 1) != 0)) {
 								remember(litVar);
@@ -6665,7 +6668,7 @@
 							/* most stores into young objects */
 
 							if (((top & 3) == 0)
-							 && ((((usqInt) top)) < (((usqInt) GIV(newSpaceLimit))))) {
+							 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
 								/* begin possibleRootStoreInto: */
 								if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 									remember(rcvr);
@@ -6717,7 +6720,7 @@
 						/* most stores into young objects */
 
 						if (((top & 3) == 0)
-						 && ((((usqInt) top)) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 								remember(rcvr);
@@ -6745,7 +6748,7 @@
 						/* most stores into young objects */
 
 						if (((top & 3) == 0)
-						 && ((((usqInt) top)) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 								remember(rcvr);
@@ -7065,7 +7068,7 @@
 					/* most stores into young objects */
 
 					if ((((longAtPointer(localSP)) & 3) == 0)
-					 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+					 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 						/* begin possibleRootStoreInto: */
 						if (!(((((usqInt) (longAt(tempVector))) >> 29) & 1) != 0)) {
 							remember(tempVector);
@@ -7102,7 +7105,7 @@
 					/* most stores into young objects */
 
 					if ((((longAtPointer(localSP)) & 3) == 0)
-					 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+					 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 						/* begin possibleRootStoreInto: */
 						if (!(((((usqInt) (longAt(tempVector))) >> 29) & 1) != 0)) {
 							remember(tempVector);
@@ -9098,8 +9101,8 @@
 						/* begin commonVariable:at:cacheIndex: */
 						index1 = (index >> 1);
 						stSize = GIV(atCache)[atIx + AtCacheSize];
-						if (((((usqInt) index1)) >= (((usqInt) 1)))
-						 && ((((usqInt) index1)) <= (((usqInt) stSize)))) {
+						if ((oopisGreaterThanOrEqualTo(index1, 1))
+						 && (oopisLessThanOrEqualTo(index1, stSize))) {
 							fmt2 = GIV(atCache)[atIx + AtCacheFmt];
 							if (fmt2 <= 4) {
 								assert(!(isContextNonImm(rcvr)));
@@ -9398,8 +9401,8 @@
 					if (!GIV(primFailCode)) {
 						/* begin commonVariable:at:put:cacheIndex: */
 						stSize = GIV(atCache)[atIx + AtCacheSize];
-						if (((((usqInt) ((index >> 1)))) >= (((usqInt) 1)))
-						 && ((((usqInt) ((index >> 1)))) <= (((usqInt) stSize)))) {
+						if ((oopisGreaterThanOrEqualTo((index >> 1), 1))
+						 && (oopisLessThanOrEqualTo((index >> 1), stSize))) {
 							fmt = GIV(atCache)[atIx + AtCacheFmt];
 							if (fmt <= 4) {
 								assert(!(isContextNonImm(rcvr)));
@@ -9411,7 +9414,7 @@
 									/* most stores into young objects */
 
 									if (((value & 3) == 0)
-									 && ((((usqInt) value)) < (((usqInt) GIV(newSpaceLimit))))) {
+									 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
 										/* begin possibleRootStoreInto: */
 										if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 											remember(rcvr);
@@ -11720,8 +11723,8 @@
 						/* begin commonVariable:at:cacheIndex: */
 						index1 = (index >> 1);
 						stSize = GIV(atCache)[atIx + AtCacheSize];
-						if (((((usqInt) index1)) >= (((usqInt) 1)))
-						 && ((((usqInt) index1)) <= (((usqInt) stSize)))) {
+						if ((oopisGreaterThanOrEqualTo(index1, 1))
+						 && (oopisLessThanOrEqualTo(index1, stSize))) {
 							fmt2 = GIV(atCache)[atIx + AtCacheFmt];
 							if (fmt2 <= 4) {
 								assert(!(isContextNonImm(rcvr)));
@@ -12020,8 +12023,8 @@
 					if (!GIV(primFailCode)) {
 						/* begin commonVariable:at:put:cacheIndex: */
 						stSize = GIV(atCache)[atIx + AtCacheSize];
-						if (((((usqInt) ((index >> 1)))) >= (((usqInt) 1)))
-						 && ((((usqInt) ((index >> 1)))) <= (((usqInt) stSize)))) {
+						if ((oopisGreaterThanOrEqualTo((index >> 1), 1))
+						 && (oopisLessThanOrEqualTo((index >> 1), stSize))) {
 							fmt = GIV(atCache)[atIx + AtCacheFmt];
 							if (fmt <= 4) {
 								assert(!(isContextNonImm(rcvr)));
@@ -12033,7 +12036,7 @@
 									/* most stores into young objects */
 
 									if (((value & 3) == 0)
-									 && ((((usqInt) value)) < (((usqInt) GIV(newSpaceLimit))))) {
+									 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
 										/* begin possibleRootStoreInto: */
 										if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 											remember(rcvr);
@@ -12979,7 +12982,7 @@
 							/* most stores into young objects */
 
 							if (((anObject & 3) == 0)
-							 && ((((usqInt) anObject)) < (((usqInt) GIV(newSpaceLimit))))) {
+							 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
 								/* begin possibleRootStoreInto: */
 								if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 									remember(rcvr);
@@ -13031,7 +13034,7 @@
 						/* most stores into young objects */
 
 						if (((anObject & 3) == 0)
-						 && ((((usqInt) anObject)) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 								remember(rcvr);
@@ -13059,7 +13062,7 @@
 						/* most stores into young objects */
 
 						if (((anObject & 3) == 0)
-						 && ((((usqInt) anObject)) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 								remember(rcvr);
@@ -13104,7 +13107,7 @@
 					/* most stores into young objects */
 
 					if ((((longAtPointer(localSP)) & 3) == 0)
-					 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+					 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 						/* begin possibleRootStoreInto: */
 						if (!(((((usqInt) (longAt(litVar))) >> 29) & 1) != 0)) {
 							remember(litVar);
@@ -13180,7 +13183,7 @@
 							/* most stores into young objects */
 
 							if (((anObject & 3) == 0)
-							 && ((((usqInt) anObject)) < (((usqInt) GIV(newSpaceLimit))))) {
+							 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
 								/* begin possibleRootStoreInto: */
 								if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 									remember(rcvr);
@@ -13232,7 +13235,7 @@
 						/* most stores into young objects */
 
 						if (((anObject & 3) == 0)
-						 && ((((usqInt) anObject)) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 								remember(rcvr);
@@ -13260,7 +13263,7 @@
 						/* most stores into young objects */
 
 						if (((anObject & 3) == 0)
-						 && ((((usqInt) anObject)) < (((usqInt) GIV(newSpaceLimit))))) {
+						 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
 							/* begin possibleRootStoreInto: */
 							if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 								remember(rcvr);
@@ -13308,7 +13311,7 @@
 					/* most stores into young objects */
 
 					if ((((longAtPointer(localSP)) & 3) == 0)
-					 && ((((usqInt) (longAtPointer(localSP)))) < (((usqInt) GIV(newSpaceLimit))))) {
+					 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
 						/* begin possibleRootStoreInto: */
 						if (!(((((usqInt) (longAt(litVar))) >> 29) & 1) != 0)) {
 							remember(litVar);
@@ -14219,7 +14222,7 @@
     CogMethod *cogMethod;
     sqInt methodField;
     sqInt methodField1;
-    sqInt theIP;
+    usqInt theIP;
 
 	assertl(GIV(stackPage) == (mostRecentlyUsedPage()), ln);
 	assertl(addressIsInPage(GIV(stackPage), lifp), ln);
@@ -14950,7 +14953,7 @@
 			/* most stores into young objects */
 
 			if (((anOop & 3) == 0)
-			 && ((((usqInt) anOop)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(anOop, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(maybeMarriedContext))) >> 29) & 1) != 0)) {
 					remember(maybeMarriedContext);
@@ -16597,7 +16600,7 @@
 			else {
 				hasYoung = hasYoung
 				 || (((fieldOop & 3) == 0)
-				 && ((((usqInt) fieldOop)) < (((usqInt) GIV(newSpaceLimit)))));
+				 && (oopisLessThan(fieldOop, GIV(newSpaceLimit))));
 				if (!(checkOkayOop(fieldOop))) {
 					return 0;
 				}
@@ -16610,7 +16613,7 @@
 	}
 	if (hasYoung) {
 		/* begin checkOkayYoungReferrer: */
-		if ((((usqInt) oop)) < (((usqInt) GIV(newSpaceLimit)))) {
+		if (oopisLessThan(oop, GIV(newSpaceLimit))) {
 			return 1;
 		}
 		if (!(((((usqInt) (longAt(oop))) >> 29) & 1) != 0)) {
@@ -17317,7 +17320,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -17568,6 +17583,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theFP = (thePage->headFP);
 			theIPPtr = (thePage == GIV(stackPage)
 				? 0
@@ -18740,6 +18756,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19558,6 +19575,7 @@
 	numStrongSlots3 = 0;
 	numStrongSlots4 = 0;
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -21482,6 +21500,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -22529,7 +22548,7 @@
     int index;
     sqInt methodField;
     usqInt numArgs;
-    sqInt numTemps;
+    usqInt numTemps;
     char *rcvrAddress;
     sqInt rcvrOrClosure;
     sqInt theMethod;
@@ -22638,8 +22657,7 @@
 	}
 	printFrameOopat("receiver", rcvrAddress);
 	topThing = longAt(theSP);
-	if (((((usqInt) topThing)) >= (((usqInt) theMethod)))
-	 && ((((usqInt) topThing)) < (((usqInt) theMethodEnd)))) {
+	if (oopisGreaterThanOrEqualToandLessThan(topThing, theMethod, theMethodEnd)) {
 		for (addr = (rcvrAddress - BytesPerWord); addr >= (theSP + BytesPerWord); addr += (-BytesPerWord)) {
 			index = ((rcvrAddress - addr) / BytesPerWord) + numArgs;
 			if (index <= numTemps) {
@@ -24848,7 +24866,7 @@
 			/* most stores into young objects */
 
 			if (((ctxt & 3) == 0)
-			 && ((((usqInt) ctxt)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(ctxt, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(proc))) >> 29) & 1) != 0)) {
 					remember(proc);
@@ -24892,7 +24910,7 @@
 		/* most stores into young objects */
 
 		if (((contextToReturnTo & 3) == 0)
-		 && ((((usqInt) contextToReturnTo)) < (((usqInt) GIV(newSpaceLimit))))) {
+		 && (oopisLessThan(contextToReturnTo, GIV(newSpaceLimit)))) {
 			/* begin possibleRootStoreInto: */
 			if (!(((((usqInt) (longAt(contextToReturnFrom))) >> 29) & 1) != 0)) {
 				remember(contextToReturnFrom);
@@ -24907,7 +24925,7 @@
 		/* most stores into young objects */
 
 		if (((HasBeenReturnedFromMCPC & 3) == 0)
-		 && ((((usqInt) HasBeenReturnedFromMCPC)) < (((usqInt) GIV(newSpaceLimit))))) {
+		 && (oopisLessThan(HasBeenReturnedFromMCPC, GIV(newSpaceLimit)))) {
 			/* begin possibleRootStoreInto: */
 			if (!(((((usqInt) (longAt(contextToReturnFrom))) >> 29) & 1) != 0)) {
 				remember(contextToReturnFrom);
@@ -25004,7 +25022,7 @@
 		/* most stores into young objects */
 
 		if (((activeContext & 3) == 0)
-		 && ((((usqInt) activeContext)) < (((usqInt) GIV(newSpaceLimit))))) {
+		 && (oopisLessThan(activeContext, GIV(newSpaceLimit)))) {
 			/* begin possibleRootStoreInto: */
 			if (!(((((usqInt) (longAt(oldProc))) >> 29) & 1) != 0)) {
 				remember(oldProc);
@@ -25019,7 +25037,7 @@
 		/* most stores into young objects */
 
 		if (((newProc & 3) == 0)
-		 && ((((usqInt) newProc)) < (((usqInt) GIV(newSpaceLimit))))) {
+		 && (oopisLessThan(newProc, GIV(newSpaceLimit)))) {
 			/* begin possibleRootStoreInto: */
 			if (!(((((usqInt) (longAt(sched))) >> 29) & 1) != 0)) {
 				remember(sched);
@@ -25201,7 +25219,7 @@
 			/* most stores into young objects */
 
 			if ((((longAt(argsPointer)) & 3) == 0)
-			 && ((((usqInt) (longAt(argsPointer)))) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(longAt(argsPointer), GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(theContext))) >> 29) & 1) != 0)) {
 					remember(theContext);
@@ -25220,7 +25238,7 @@
 			/* most stores into young objects */
 
 			if ((((longAt(pointer)) & 3) == 0)
-			 && ((((usqInt) (longAt(pointer)))) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(longAt(pointer), GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(theContext))) >> 29) & 1) != 0)) {
 					remember(theContext);
@@ -25381,7 +25399,7 @@
 		? address + BaseHeaderSize
 		: address);
 	limit = GIV(pastSpaceStart);
-	while ((((usqInt) objOop1)) < (((usqInt) limit))) {
+	while (oopisLessThan(objOop1, limit)) {
 		assert(isEnumerableObjectNoAssert(objOop1));
 		fmt = (((usqInt) (longAt(objOop1))) >> 24) & 0x1F;
 		if ((fmt == 3)
@@ -25438,7 +25456,7 @@
 	objOop1 = (numSlots1 == 0xFF
 		? address1 + BaseHeaderSize
 		: address1);
-	while ((((usqInt) objOop1)) < (((usqInt) GIV(freeStart)))) {
+	while (oopisLessThan(objOop1, GIV(freeStart))) {
 		assert(isEnumerableObjectNoAssert(objOop1));
 		fmt = (((usqInt) (longAt(objOop1))) >> 24) & 0x1F;
 		if ((fmt == 3)
@@ -25499,7 +25517,7 @@
 	objOop11 = GIV(nilObj);
 	while (1) {
 		assert((objOop11 % (allocationUnit())) == 0);
-		if (!((((usqInt) objOop11)) < (((usqInt) GIV(endOfMemory))))) break;
+		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
 		assert((long64At(objOop11)) != 0);
 		if (isEnumerableObject(objOop11)) {
 			fmt = (((usqInt) (longAt(objOop11))) >> 24) & 0x1F;
@@ -25570,47 +25588,43 @@
 		return somewhere;
 	}
 	/* begin whereIsMaybeHeapThing: */
-	if (((((usqInt) anOop)) < (((usqInt) GIV(newSpaceLimit))))
-	 && ((((usqInt) anOop)) >= (((usqInt) GIV(newSpaceStart))))) {
-		if (((((usqInt) anOop)) >= (((usqInt) (((eden()).start)))))
-		 && ((((usqInt) anOop)) < (((usqInt) GIV(freeStart))))) {
+	if ((oopisLessThan(anOop, GIV(newSpaceLimit)))
+	 && (oopisGreaterThanOrEqualTo(anOop, GIV(newSpaceStart)))) {
+		if (oopisGreaterThanOrEqualToandLessThan(anOop, ((eden()).start), GIV(freeStart))) {
 			where = " is in eden";
-			goto l1;
+			goto l2;
 		}
 		if (oopisGreaterThanOrEqualToandLessThan(anOop, ((futureSpace()).start), futureSurvivorStart())) {
 			where = " is in future space";
-			goto l1;
+			goto l2;
 		}
-		if (((((usqInt) anOop)) >= (((usqInt) (((pastSpace()).start)))))
-		 && ((((usqInt) anOop)) < (((usqInt) GIV(pastSpaceStart))))) {
+		if (oopisGreaterThanOrEqualToandLessThan(anOop, ((pastSpace()).start), GIV(pastSpaceStart))) {
 			where = " is in past space";
-			goto l1;
+			goto l2;
 		}
 		where = " is in new space";
-		goto l1;
+		goto l2;
 	}
-	if (((((usqInt) anOop)) >= (((usqInt) GIV(oldSpaceStart))))
-	 && ((((usqInt) anOop)) < (((usqInt) GIV(endOfMemory))))) {
+	if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(oldSpaceStart), GIV(endOfMemory))) {
 		if (!((segmentContainingObj(anOop)) == null)) {
 			where = " is in old space";
-			goto l1;
+			goto l2;
 		}
 		where = " is between old space segments";
-		goto l1;
+		goto l2;
 	}
 	where = null;
-l1:	/* end whereIsMaybeHeapThing: */;
+l2:	/* end whereIsMaybeHeapThing: */;
 	if (!(where == null)) {
 		return where;
 	}
 	/* begin whereIsMaybeStackThing: */
-	if (((((usqInt) anOop)) >= (((usqInt) (GIV(stackBasePlus1) - 1))))
-	 && ((((usqInt) anOop)) < (((usqInt) GIV(pages))))) {
+	if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(stackBasePlus1) - 1, GIV(pages))) {
 		where = " is in the stack zone";
-		goto l2;
+		goto l1;
 	}
 	where = null;
-l2:	/* end whereIsMaybeStackThing: */;
+l1:	/* end whereIsMaybeStackThing: */;
 	if (!(where == null)) {
 		return where;
 	}
@@ -25774,7 +25788,7 @@
 			/* most stores into young objects */
 
 			if (((activeProc & 3) == 0)
-			 && ((((usqInt) activeProc)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(activeProc, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(criticalSection))) >> 29) & 1) != 0)) {
 					remember(criticalSection);
@@ -26211,7 +26225,7 @@
 			/* most stores into young objects */
 
 			if (((newValue & 3) == 0)
-			 && ((((usqInt) newValue)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(newValue, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(thisReceiver))) >> 29) & 1) != 0)) {
 					remember(thisReceiver);
@@ -26450,7 +26464,7 @@
 			/* most stores into young objects */
 
 			if (((myList & 3) == 0)
-			 && ((((usqInt) myList)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(myList, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(process))) >> 29) & 1) != 0)) {
 					remember(process);
@@ -26472,7 +26486,7 @@
 			/* most stores into young objects */
 
 			if (((nextLink & 3) == 0)
-			 && ((((usqInt) nextLink)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(nextLink, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(myList))) >> 29) & 1) != 0)) {
 					remember(myList);
@@ -26488,7 +26502,7 @@
 				/* most stores into young objects */
 
 				if (((GIV(nilObj) & 3) == 0)
-				 && ((((usqInt) GIV(nilObj))) < (((usqInt) GIV(newSpaceLimit))))) {
+				 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
 					/* begin possibleRootStoreInto: */
 					if (!(((((usqInt) (longAt(myList))) >> 29) & 1) != 0)) {
 						remember(myList);
@@ -26525,7 +26539,7 @@
 			/* most stores into young objects */
 
 			if (((nextLink & 3) == 0)
-			 && ((((usqInt) nextLink)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(nextLink, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(tempLink))) >> 29) & 1) != 0)) {
 					remember(tempLink);
@@ -26541,7 +26555,7 @@
 				/* most stores into young objects */
 
 				if (((tempLink & 3) == 0)
-				 && ((((usqInt) tempLink)) < (((usqInt) GIV(newSpaceLimit))))) {
+				 && (oopisLessThan(tempLink, GIV(newSpaceLimit)))) {
 					/* begin possibleRootStoreInto: */
 					if (!(((((usqInt) (longAt(myList))) >> 29) & 1) != 0)) {
 						remember(myList);
@@ -26558,7 +26572,7 @@
 		/* most stores into young objects */
 
 		if (((GIV(nilObj) & 3) == 0)
-		 && ((((usqInt) GIV(nilObj))) < (((usqInt) GIV(newSpaceLimit))))) {
+		 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
 			/* begin possibleRootStoreInto: */
 			if (!(((((usqInt) (longAt(process))) >> 29) & 1) != 0)) {
 				remember(process);
@@ -26575,7 +26589,7 @@
 			/* most stores into young objects */
 
 			if (((GIV(nilObj) & 3) == 0)
-			 && ((((usqInt) GIV(nilObj))) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(process))) >> 29) & 1) != 0)) {
 					remember(process);
@@ -26963,7 +26977,7 @@
 			/* most stores into young objects */
 
 			if (((aContextOrNil & 3) == 0)
-			 && ((((usqInt) aContextOrNil)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(aContextOrNil, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(thisCtx))) >> 29) & 1) != 0)) {
 					remember(thisCtx);
@@ -27038,6 +27052,8 @@
     sqInt oldMethod;
     sqInt oop;
     sqInt pc;
+    sqInt pc1;
+    sqInt pc2;
     sqInt prevObj;
     sqInt prevObj1;
     sqInt prevPrevObj;
@@ -27166,7 +27182,7 @@
 			? address + BaseHeaderSize
 			: address);
 		limit = GIV(pastSpaceStart);
-		while ((((usqInt) objOop1)) < (((usqInt) limit))) {
+		while (oopisLessThan(objOop1, limit)) {
 			assert(isEnumerableObjectNoAssert(objOop1));
 			if ((((longAt(objOop1)) & 0x3FFFFF) == ClassMethodContextCompactIndex)
 			 && ((longAt((objOop1 + BaseHeaderSize) + (MethodIndex << (shiftForWord())))) == methodObj)) {
@@ -27200,7 +27216,7 @@
 		objOop1 = (numSlots1 == 0xFF
 			? address1 + BaseHeaderSize
 			: address1);
-		while ((((usqInt) objOop1)) < (((usqInt) GIV(freeStart)))) {
+		while (oopisLessThan(objOop1, GIV(freeStart))) {
 			assert(isEnumerableObjectNoAssert(objOop1));
 			if ((((longAt(objOop1)) & 0x3FFFFF) == ClassMethodContextCompactIndex)
 			 && ((longAt((objOop1 + BaseHeaderSize) + (MethodIndex << (shiftForWord())))) == methodObj)) {
@@ -27212,13 +27228,13 @@
 				else {
 					/* begin ensureContextHasBytecodePC: */
 					assert(!(isMarriedOrWidowedContext(objOop1)));
-					pc = longAt((objOop1 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())));
-					if (((pc & 1))
-					 && (((pc = (pc >> 1))) < 0)) {
-						pc = mustMapMachineCodePCcontext(pc, objOop1);
+					pc1 = longAt((objOop1 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())));
+					if (((pc1 & 1))
+					 && (((pc1 = (pc1 >> 1))) < 0)) {
+						pc1 = mustMapMachineCodePCcontext(pc1, objOop1);
 						/* begin storePointerUnchecked:ofObject:withValue: */
 						assert(!(isForwarded(objOop1)));
-						longAtput((objOop1 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())), pc);
+						longAtput((objOop1 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())), pc1);
 					}
 				}
 			}
@@ -27238,7 +27254,7 @@
 		objOop11 = GIV(nilObj);
 		while (1) {
 			assert((objOop11 % (allocationUnit())) == 0);
-			if (!((((usqInt) objOop11)) < (((usqInt) GIV(endOfMemory))))) break;
+			if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
 			assert((long64At(objOop11)) != 0);
 			if (isEnumerableObject(objOop11)) {
 				if ((((longAt(objOop11)) & 0x3FFFFF) == ClassMethodContextCompactIndex)
@@ -27251,13 +27267,13 @@
 					else {
 						/* begin ensureContextHasBytecodePC: */
 						assert(!(isMarriedOrWidowedContext(objOop11)));
-						pc = longAt((objOop11 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())));
-						if (((pc & 1))
-						 && (((pc = (pc >> 1))) < 0)) {
-							pc = mustMapMachineCodePCcontext(pc, objOop11);
+						pc2 = longAt((objOop11 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())));
+						if (((pc2 & 1))
+						 && (((pc2 = (pc2 >> 1))) < 0)) {
+							pc2 = mustMapMachineCodePCcontext(pc2, objOop11);
 							/* begin storePointerUnchecked:ofObject:withValue: */
 							assert(!(isForwarded(objOop11)));
-							longAtput((objOop11 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())), pc);
+							longAtput((objOop11 + BaseHeaderSize) + (InstructionPointerIndex << (shiftForWord())), pc2);
 						}
 					}
 				}
@@ -28721,8 +28737,8 @@
 		assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(rcvr)));
 		stSize = (sp1 >> 1);
 	l2:	/* end stackPointerForMaybeMarriedContext: */;
-		if (((((usqInt) index)) >= (((usqInt) 1)))
-		 && (((((usqInt) index)) <= (((usqInt) stSize)))
+		if ((oopisGreaterThanOrEqualTo(index, 1))
+		 && ((oopisLessThanOrEqualTo(index, stSize))
 		 && ((((longAt((rcvr + BaseHeaderSize) + (SenderIndex << (shiftForWord())))) & 1))
 		 && (!(isWidowedContext(rcvr)))))) {
 			result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr));
@@ -28735,7 +28751,7 @@
 	if ((oopisGreaterThanOrEqualTo(index, (fmt >= 24
 		? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1
 		: 1)))
-	 && ((((usqInt) index)) <= (((usqInt) stSize)))) {
+	 && (oopisLessThanOrEqualTo(index, stSize))) {
 		/* begin subscript:with:format: */
 		if (fmt <= 5) {
 			result = longAt((rcvr + BaseHeaderSize) + (((index + fixedFields) - 1) << (shiftForWord())));
@@ -28844,8 +28860,8 @@
     sqInt totalLength1;
     sqInt value;
     sqInt value1;
-    sqInt valueToStore;
-    sqInt valueToStore1;
+    usqInt valueToStore;
+    usqInt valueToStore1;
 
 	/* begin commonAtPut: */
 	value = longAt(GIV(stackPointer));
@@ -28932,8 +28948,8 @@
 		assert((ReceiverIndex + ((sp11 >> 1))) < (lengthOf(rcvr)));
 		stSize1 = (sp11 >> 1);
 	l8:	/* end stackPointerForMaybeMarriedContext: */;
-		if (((((usqInt) index)) >= (((usqInt) 1)))
-		 && (((((usqInt) index)) <= (((usqInt) stSize1)))
+		if ((oopisGreaterThanOrEqualTo(index, 1))
+		 && ((oopisLessThanOrEqualTo(index, stSize1))
 		 && ((((longAt((rcvr + BaseHeaderSize) + (SenderIndex << (shiftForWord())))) & 1))
 		 && (!(isWidowedContext(rcvr)))))) {
 			noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value);
@@ -28946,7 +28962,7 @@
 	if ((oopisGreaterThanOrEqualTo(index, (fmt1 >= 24
 		? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1
 		: 1)))
-	 && ((((usqInt) index)) <= (((usqInt) stSize1)))) {
+	 && (oopisLessThanOrEqualTo(index, stSize1))) {
 		/* begin subscript:with:storing:format: */
 		if (fmt1 <= 5) {
 			/* begin storePointer:ofObject:withValue: */
@@ -28956,7 +28972,7 @@
 				/* most stores into young objects */
 
 				if (((value & 3) == 0)
-				 && ((((usqInt) value)) < (((usqInt) GIV(newSpaceLimit))))) {
+				 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
 					/* begin possibleRootStoreInto: */
 					if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 						remember(rcvr);
@@ -29315,7 +29331,7 @@
 			/* most stores into young objects */
 
 			if (((rcvr & 3) == 0)
-			 && ((((usqInt) rcvr)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(rcvr, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */
 				if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) {
 					remember(GIV(specialObjectsOop));
@@ -30389,7 +30405,7 @@
 		/* most stores into young objects */
 
 		if (((v1 & 3) == 0)
-		 && ((((usqInt) v1)) < (((usqInt) GIV(newSpaceLimit))))) {
+		 && (oopisLessThan(v1, GIV(newSpaceLimit)))) {
 			/* begin possibleRootStoreInto: */
 			if (!(((((usqInt) (longAt(objOop3))) >> 29) & 1) != 0)) {
 				remember(objOop3);
@@ -30409,7 +30425,7 @@
 		/* most stores into young objects */
 
 		if (((v2 & 3) == 0)
-		 && ((((usqInt) v2)) < (((usqInt) GIV(newSpaceLimit))))) {
+		 && (oopisLessThan(v2, GIV(newSpaceLimit)))) {
 			/* begin possibleRootStoreInto: */
 			if (!(((((usqInt) (longAt(objOop4))) >> 29) & 1) != 0)) {
 				remember(objOop4);
@@ -31565,7 +31581,7 @@
 				/* most stores into young objects */
 
 				if (((valuePointer & 3) == 0)
-				 && ((((usqInt) valuePointer)) < (((usqInt) GIV(newSpaceLimit))))) {
+				 && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) {
 					/* begin possibleRootStoreInto: */
 					if (!(((((usqInt) (longAt(rcvr))) >> 29) & 1) != 0)) {
 						remember(rcvr);
@@ -32987,12 +33003,18 @@
     sqInt address;
     sqInt address1;
     sqInt firstBytecode;
+    sqInt firstBytecode1;
+    sqInt firstBytecode2;
     sqInt header;
+    sqInt header1;
+    sqInt header2;
     sqInt i;
     sqInt i1;
     sqInt i2;
     usqInt limit;
     sqInt methodHeader;
+    sqInt methodHeader1;
+    sqInt methodHeader2;
     usqInt numSlots;
     usqInt numSlots1;
     sqInt objOop;
@@ -33005,6 +33027,8 @@
     sqInt prevPrevObj;
     sqInt prevPrevObj1;
     sqInt primBits;
+    sqInt primBits1;
+    sqInt primBits2;
     sqInt primIdx;
 
 	/* begin flushExternalPrimitives */
@@ -33024,7 +33048,7 @@
 		? address + BaseHeaderSize
 		: address);
 	limit = GIV(pastSpaceStart);
-	while ((((usqInt) objOop1)) < (((usqInt) limit))) {
+	while (oopisLessThan(objOop1, limit)) {
 		assert(isEnumerableObjectNoAssert(objOop1));
 		if (!(((longAt(objOop1)) & 0x3FFFFF) == 0)) {
 			if (((((usqInt) (longAt(objOop1))) >> 24) & 0x1F) >= 24) {
@@ -33071,7 +33095,7 @@
 	objOop1 = (numSlots1 == 0xFF
 		? address1 + BaseHeaderSize
 		: address1);
-	while ((((usqInt) objOop1)) < (((usqInt) GIV(freeStart)))) {
+	while (oopisLessThan(objOop1, GIV(freeStart))) {
 		assert(isEnumerableObjectNoAssert(objOop1));
 		if (!(((longAt(objOop1)) & 0x3FFFFF) == 0)) {
 			if (((((usqInt) (longAt(objOop1))) >> 24) & 0x1F) >= 24) {
@@ -33081,18 +33105,18 @@
 				/* begin primitiveIndexOfMethod:header: */
 				/* begin methodHeaderOf: */
 				assert(isCompiledMethod(objOop1));
-				header = longAt((objOop1 + BaseHeaderSize) + (HeaderIndex << (shiftForWord())));
-				if ((header & 1)) {
-					methodHeader = header;
+				header1 = longAt((objOop1 + BaseHeaderSize) + (HeaderIndex << (shiftForWord())));
+				if ((header1 & 1)) {
+					methodHeader1 = header1;
 				}
 				else {
-					assert((((usqInt)header)) < GIV(newSpaceStart));
-					assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
-					methodHeader = ((((CogMethod *) header))->methodHeader);
+					assert((((usqInt)header1)) < GIV(newSpaceStart));
+					assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
+					methodHeader1 = ((((CogMethod *) header1))->methodHeader);
 				}
-				if (methodHeader & AlternateHeaderHasPrimFlag) {
-					firstBytecode = (objOop1 + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
-					primIdx = (byteAt(firstBytecode + 1)) + ((byteAt(firstBytecode + 2)) << 8);
+				if (methodHeader1 & AlternateHeaderHasPrimFlag) {
+					firstBytecode1 = (objOop1 + ((LiteralStart + (((methodHeader1 >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
+					primIdx = (byteAt(firstBytecode1 + 1)) + ((byteAt(firstBytecode1 + 2)) << 8);
 				}
 				else {
 					primIdx = 0;
@@ -33122,7 +33146,7 @@
 	objOop11 = GIV(nilObj);
 	while (1) {
 		assert((objOop11 % (allocationUnit())) == 0);
-		if (!((((usqInt) objOop11)) < (((usqInt) GIV(endOfMemory))))) break;
+		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
 		assert((long64At(objOop11)) != 0);
 		if (isEnumerableObject(objOop11)) {
 			if (!(((longAt(objOop11)) & 0x3FFFFF) == 0)) {
@@ -33133,18 +33157,18 @@
 					/* begin primitiveIndexOfMethod:header: */
 					/* begin methodHeaderOf: */
 					assert(isCompiledMethod(objOop11));
-					header = longAt((objOop11 + BaseHeaderSize) + (HeaderIndex << (shiftForWord())));
-					if ((header & 1)) {
-						methodHeader = header;
+					header2 = longAt((objOop11 + BaseHeaderSize) + (HeaderIndex << (shiftForWord())));
+					if ((header2 & 1)) {
+						methodHeader2 = header2;
 					}
 					else {
-						assert((((usqInt)header)) < GIV(newSpaceStart));
-						assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
-						methodHeader = ((((CogMethod *) header))->methodHeader);
+						assert((((usqInt)header2)) < GIV(newSpaceStart));
+						assert((((((CogMethod *) header2))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
+						methodHeader2 = ((((CogMethod *) header2))->methodHeader);
 					}
-					if (methodHeader & AlternateHeaderHasPrimFlag) {
-						firstBytecode = (objOop11 + ((LiteralStart + (((methodHeader >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
-						primIdx = (byteAt(firstBytecode + 1)) + ((byteAt(firstBytecode + 2)) << 8);
+					if (methodHeader2 & AlternateHeaderHasPrimFlag) {
+						firstBytecode2 = (objOop11 + ((LiteralStart + (((methodHeader2 >> 1)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
+						primIdx = (byteAt(firstBytecode2 + 1)) + ((byteAt(firstBytecode2 + 2)) << 8);
 					}
 					else {
 						primIdx = 0;
@@ -33648,7 +33672,7 @@
 				/* most stores into young objects */
 
 				if (((value & 3) == 0)
-				 && ((((usqInt) value)) < (((usqInt) GIV(newSpaceLimit))))) {
+				 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
 					/* begin possibleRootStoreInto: */
 					if (!(((((usqInt) (longAt(arg))) >> 29) & 1) != 0)) {
 						remember(arg);
@@ -34222,7 +34246,7 @@
 			/* most stores into young objects */
 
 			if (((arg & 3) == 0)
-			 && ((((usqInt) arg)) < (((usqInt) GIV(newSpaceLimit))))) {
+			 && (oopisLessThan(arg, GIV(newSpaceLimit)))) {
 				/* begin possibleRootStoreInto: */

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list