[Vm-dev] [commit][3078] CogVM source as per VMMaker.oscog-eem.880

commits at squeakvm.org commits at squeakvm.org
Sat Sep 13 23:20:56 UTC 2014


Revision: 3078
Author:   eliot
Date:     2014-09-13 16:20:54 -0700 (Sat, 13 Sep 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.880

Move evaluation of Cogit primitive desacriptor enabled function from
initialization to just-in-time, and add enablers on SmallInteger primitives
to ensure they are applied only to SmallInteger receivers (falling back to
interpreter prims if not).  Hence fix Cog for 4.1 (e.g. MuO) images.

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

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

Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nscogsrc/vm/cogit.c	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291
+	CCodeGenerator VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291
+	StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -601,7 +601,6 @@
 static sqInt checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) NoDbgRegParms;
 sqInt checkIntegrityOfObjectReferencesInCode(sqInt fullGCFlag);
 static sqInt checkMaybeObjRefAt(sqInt mcpc) NoDbgRegParms;
-static void checkPrimitiveTableEnablers(void);
 static sqInt checkValidObjectReferencesInClosedPIC(CogMethod *cPIC) NoDbgRegParms;
 static sqInt closedPICRefersToUnmarkedObject(CogMethod *cPIC) NoDbgRegParms;
 char * codeEntryFor(char *address);
@@ -732,6 +731,7 @@
 static sqInt maybeGenerateCheckFeatures(void);
 static sqInt maybeGenerateICacheFlush(void);
 static void maybeMarkCountersIn(CogMethod *cogMethod) NoDbgRegParms;
+static sqInt mclassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
 usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
 static sqInt methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt comparePenultimateLiteral) NoDbgRegParms;
 sqInt minCogMethodAddress(void);
@@ -750,8 +750,10 @@
 static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
 void printCogMethodFor(void *address);
 void printTrampolineTable(void);
+static sqInt processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasDivQuoRem(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasDoublePrecisionFloatingPointSupport(sqInt ignoredPrimIndex) NoDbgRegParms;
+static sqInt processorHasMultiplyAndMClassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasMultiply(sqInt ignoredPrimIndex) NoDbgRegParms;
 static AbstractInstruction * gRetN(sqInt offset) NoDbgRegParms;
 static void recordGeneratedRunTimeaddress(char *aString, sqInt address) NoDbgRegParms;
@@ -1796,231 +1798,6 @@
 static void (*postCompileHook)(CogMethod *, void *);
 static BytecodeDescriptor * prevBCDescriptor;
 static AbstractInstruction * primInvokeLabel;
-static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1] = {
-	{ 0, -1, 0 },
-	{ genPrimitiveAdd, 1, 0 },
-	{ genPrimitiveSubtract, 1, 0 },
-	{ genPrimitiveLessThan, 1, 0 },
-	{ genPrimitiveGreaterThan, 1, 0 },
-	{ genPrimitiveLessOrEqual, 1, 0 },
-	{ genPrimitiveGreaterOrEqual, 1, 0 },
-	{ genPrimitiveEqual, 1, 0 },
-	{ genPrimitiveNotEqual, 1, 0 },
-	{ genPrimitiveMultiply, 1, processorHasMultiply },
-	{ genPrimitiveDivide, 1, processorHasDivQuoRem },
-	{ genPrimitiveMod, 1, processorHasDivQuoRem },
-	{ genPrimitiveDiv, 1, processorHasDivQuoRem },
-	{ genPrimitiveQuo, 1, processorHasDivQuoRem },
-	{ genPrimitiveBitAnd, 1, 0 },
-	{ genPrimitiveBitOr, 1, 0 },
-	{ genPrimitiveBitXor, 1, 0 },
-	{ genPrimitiveBitShift, 1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveAsFloat, 0, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatAdd, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatSubtract, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatLessThan, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatGreaterThan, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatLessOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatGreaterOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatNotEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatMultiply, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatDivide, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveFloatSquareRoot, 0, processorHasDoublePrecisionFloatingPointSupport },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveAt, 1, 0 },
-	{ genPrimitiveAtPut, 2, 0 },
-	{ genPrimitiveSize, 0, 0 },
-	{ genPrimitiveStringAt, 1, 0 },
-	{ genPrimitiveStringAtPut, 2, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveNew, -1, 0 },
-	{ genPrimitiveNewWithArg, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveIdentityHash, 0, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveNewMethod, 2, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveIdentical, 1, 0 },
-	{ genPrimitiveClass, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveNotIdentical, 1, 0 },
-	{ genPrimitiveAsCharacter, -1, 0 },
-	{ genPrimitiveCharacterValue, 0, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveIdentityHash, 0, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genFastPrimFail, -1, 0 },
-	{ genFastPrimFail, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveClosureValue, 0, 0 },
-	{ genPrimitiveClosureValue, 1, 0 },
-	{ genPrimitiveClosureValue, 2, 0 },
-	{ genPrimitiveClosureValue, 3, 0 },
-	{ genPrimitiveClosureValue, 4, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveClosureValue, 0, 0 },
-	{ genPrimitiveClosureValue, 1, 0 }
-};
 static sqInt primitiveIndex;
 void (*realCECallCogCodePopReceiverAndClassRegs)(void);
 void (*realCECallCogCodePopReceiverArg0Regs)(void);
@@ -9358,25 +9135,6 @@
 	return checkValidObjectReference(maybeObject);
 }
 
-
-/*	Disable primitive generators with enablers that answer false. */
-
-static void
-checkPrimitiveTableEnablers(void)
-{
-    sqInt i;
-    PrimitiveDescriptor *primitiveDescriptor;
-
-	for (i = 1; i <= MaxCompiledPrimitiveIndex; i += 1) {
-		primitiveDescriptor = (&(primitiveGeneratorTable[i]));
-		if (((primitiveDescriptor->enabled)) != null) {
-			if (!(((primitiveDescriptor->enabled))(i))) {
-				(primitiveDescriptor->primitiveGenerator = null);
-			}
-		}
-	}
-}
-
 static sqInt
 checkValidObjectReferencesInClosedPIC(CogMethod *cPIC)
 {
@@ -10321,18 +10079,12 @@
 		return 0;
 	}
 	if ((((primitiveDescriptor = primitiveGeneratorOrNil())) != null)
-	 && (((primitiveDescriptor->primitiveGenerator)) != null)) {
-
-		/* If a descriptor specifies an argument count (by numArgs >= 0)
-		   then it must match for the generated code to be correct.  For
-		   example for speed many primitives use ResultReceiverReg
-		   instead of accessing the stack, so the receiver better be at
-		   numArgs down the stack.  Use the interpreter version if not. */
-
-		if ((((primitiveDescriptor->primNumArgs)) < 0)
-		 || (((primitiveDescriptor->primNumArgs)) == (argumentCountOf(methodObj)))) {
-			return ((primitiveDescriptor->primitiveGenerator))();
-		}
+	 && ((((primitiveDescriptor->primitiveGenerator)) != null)
+	 && (((((primitiveDescriptor->primNumArgs)) < 0)
+	 || (((primitiveDescriptor->primNumArgs)) == (argumentCountOf(methodObj))))
+	 && ((((primitiveDescriptor->enabled)) == null)
+	 || (((primitiveDescriptor->enabled))(primitiveIndex)))))) {
+		return ((primitiveDescriptor->primitiveGenerator))();
 	}
 	if ((((primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex))) == null)
 	 || (primitiveRoutine == (functionPointerForinClass(0, null)))) {
@@ -11835,7 +11587,6 @@
 	generateStackPointerCapture();
 	generateTrampolines();
 	
-	checkPrimitiveTableEnablers();
 	manageFromto(methodZoneBase, endAddress);
 	computeEntryOffsets();
 	generateClosedPICPrototype();
@@ -13111,7 +12862,13 @@
 {
 }
 
+static sqInt
+mclassIsSmallInteger(sqInt ignoredPrimIndex)
+{
+	return (methodClassOf(methodObj)) == (classSmallInteger());
+}
 
+
 /*	Answer the absolute machine code pc matching the zero-relative
 	bytecode pc of a backward branch in cogMethod, given the start
 	of the bytecodes for cogMethod's block or method object. */
@@ -13514,6 +13271,231 @@
 primitiveGeneratorOrNil(void)
 {
     PrimitiveDescriptor *primitiveDescriptor;
+    static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1] = {
+	{ 0, -1, 0 },
+	{ genPrimitiveAdd, 1, mclassIsSmallInteger },
+	{ genPrimitiveSubtract, 1, mclassIsSmallInteger },
+	{ genPrimitiveLessThan, 1, mclassIsSmallInteger },
+	{ genPrimitiveGreaterThan, 1, mclassIsSmallInteger },
+	{ genPrimitiveLessOrEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveGreaterOrEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveNotEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveMultiply, 1, processorHasMultiplyAndMClassIsSmallInteger },
+	{ genPrimitiveDivide, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveMod, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveDiv, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveQuo, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveBitAnd, 1, mclassIsSmallInteger },
+	{ genPrimitiveBitOr, 1, mclassIsSmallInteger },
+	{ genPrimitiveBitXor, 1, mclassIsSmallInteger },
+	{ genPrimitiveBitShift, 1, mclassIsSmallInteger },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveAsFloat, 0, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatAdd, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatSubtract, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatLessThan, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatGreaterThan, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatLessOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatGreaterOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatNotEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatMultiply, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatDivide, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveFloatSquareRoot, 0, processorHasDoublePrecisionFloatingPointSupport },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveAt, 1, 0 },
+	{ genPrimitiveAtPut, 2, 0 },
+	{ genPrimitiveSize, 0, 0 },
+	{ genPrimitiveStringAt, 1, 0 },
+	{ genPrimitiveStringAtPut, 2, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveNew, -1, 0 },
+	{ genPrimitiveNewWithArg, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveIdentityHash, 0, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveNewMethod, 2, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveIdentical, 1, 0 },
+	{ genPrimitiveClass, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveNotIdentical, 1, 0 },
+	{ genPrimitiveAsCharacter, -1, 0 },
+	{ genPrimitiveCharacterValue, 0, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveIdentityHash, 0, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genFastPrimFail, -1, 0 },
+	{ genFastPrimFail, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveClosureValue, 0, 0 },
+	{ genPrimitiveClosureValue, 1, 0 },
+	{ genPrimitiveClosureValue, 2, 0 },
+	{ genPrimitiveClosureValue, 3, 0 },
+	{ genPrimitiveClosureValue, 4, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveClosureValue, 0, 0 },
+	{ genPrimitiveClosureValue, 1, 0 }
+};
 
 	if (isQuickPrimitiveIndex(primitiveIndex)) {
 
@@ -13558,6 +13540,13 @@
 }
 
 static sqInt
+processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
+{
+	return (processorHasDivQuoRem(ignoredPrimIndex))
+	 && (mclassIsSmallInteger(ignoredPrimIndex));
+}
+
+static sqInt
 processorHasDivQuoRem(sqInt ignoredPrimIndex)
 {
 	return canDivQuoRem(backEnd);
@@ -13570,6 +13559,13 @@
 }
 
 static sqInt
+processorHasMultiplyAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
+{
+	return (processorHasMultiply(ignoredPrimIndex))
+	 && (mclassIsSmallInteger(ignoredPrimIndex));
+}
+
+static sqInt
 processorHasMultiply(sqInt ignoredPrimIndex)
 {
 	return canMulRR(backEnd);

Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nscogsrc/vm/cogit.h	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291
+	CCodeGenerator VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
 
 

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
    from
-	CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2086,7 +2086,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.879";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.880";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -52659,7 +52659,7 @@
 
 	index = longAt(GIV(stackPointer));
 	if (!((index & 1))) {
-		(GIV(primFailCode) = PrimErrBadArgument);
+		GIV(primFailCode) = PrimErrBadArgument;
 		return;
 	}
 	index = (index >> 1);
@@ -52824,7 +52824,7 @@
 		stSize = (sp1 >> 1);
 	l2:	/* end fetchStackPointerOf: */;
 		if (!(((index >= 1) && (index <= stSize)))) {
-			(GIV(primFailCode) = PrimErrBadIndex);
+			GIV(primFailCode) = PrimErrBadIndex;
 			return;
 		}
 		/* begin subscript:with:format: */
@@ -52849,7 +52849,7 @@
 	assert((senderOop & 1));
 	spouseFP = pointerForOop(senderOop - 1);
 	if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
-		(GIV(primFailCode) = PrimErrBadIndex);
+		GIV(primFailCode) = PrimErrBadIndex;
 		return;
 	}
 	value = ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())
@@ -52910,7 +52910,7 @@
 	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
 	aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
 	if (!((index & 1))) {
-		(GIV(primFailCode) = PrimErrBadArgument);
+		GIV(primFailCode) = PrimErrBadArgument;
 		return;
 	}
 	hdr = longAt(aContext);
@@ -53094,7 +53094,7 @@
 		stSize = (sp1 >> 1);
 	l2:	/* end fetchStackPointerOf: */;
 		if (!(((index >= 1) && (index <= stSize)))) {
-			(GIV(primFailCode) = PrimErrBadIndex);
+			GIV(primFailCode) = PrimErrBadIndex;
 			return;
 		}
 		/* begin subscript:with:storing:format: */
@@ -53140,7 +53140,7 @@
 	assert((senderOop & 1));
 	spouseFP = pointerForOop(senderOop - 1);
 	if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
-		(GIV(primFailCode) = PrimErrBadIndex);
+		GIV(primFailCode) = PrimErrBadIndex;
 		return;
 	}
 	if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {
@@ -54351,7 +54351,7 @@
 	assert(pageListIsWellFormed());
 	
 	if (GIV(fullGCLock) > 0) {
-		(GIV(primFailCode) = PrimErrInappropriate);
+		GIV(primFailCode) = PrimErrInappropriate;
 		return;
 	}
 	incrementalGC();

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-09-13 23:20:54 UTC (rev 3078)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
    from
-	CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2089,7 +2089,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.879";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.880";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -52668,7 +52668,7 @@
 
 	index = longAt(GIV(stackPointer));
 	if (!((index & 1))) {
-		(GIV(primFailCode) = PrimErrBadArgument);
+		GIV(primFailCode) = PrimErrBadArgument;
 		return;
 	}
 	index = (index >> 1);
@@ -52833,7 +52833,7 @@
 		stSize = (sp1 >> 1);
 	l2:	/* end fetchStackPointerOf: */;
 		if (!(((index >= 1) && (index <= stSize)))) {
-			(GIV(primFailCode) = PrimErrBadIndex);
+			GIV(primFailCode) = PrimErrBadIndex;
 			return;
 		}
 		/* begin subscript:with:format: */
@@ -52858,7 +52858,7 @@
 	assert((senderOop & 1));
 	spouseFP = pointerForOop(senderOop - 1);
 	if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
-		(GIV(primFailCode) = PrimErrBadIndex);
+		GIV(primFailCode) = PrimErrBadIndex;
 		return;
 	}
 	value = ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())
@@ -52919,7 +52919,7 @@
 	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
 	aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
 	if (!((index & 1))) {
-		(GIV(primFailCode) = PrimErrBadArgument);
+		GIV(primFailCode) = PrimErrBadArgument;
 		return;
 	}
 	hdr = longAt(aContext);
@@ -53103,7 +53103,7 @@
 		stSize = (sp1 >> 1);
 	l2:	/* end fetchStackPointerOf: */;
 		if (!(((index >= 1) && (index <= stSize)))) {
-			(GIV(primFailCode) = PrimErrBadIndex);
+			GIV(primFailCode) = PrimErrBadIndex;
 			return;
 		}
 		/* begin subscript:with:storing:format: */
@@ -53149,7 +53149,7 @@
 	assert((senderOop & 1));
 	spouseFP = pointerForOop(senderOop - 1);
 	if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
-		(GIV(primFailCode) = PrimErrBadIndex);
+		GIV(primFailCode) = PrimErrBadIndex;
 		return;
 	}
 	if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {
@@ -54360,7 +54360,7 @@
 	assert(pageListIsWellFormed());
 	
 	if (GIV(fullGCLock) > 0) {
-		(GIV(primFailCode) = PrimErrInappropriate);
+		GIV(primFailCode) = PrimErrInappropriate;
 		return;
 	}
 	incrementalGC();

Modified: branches/Cog/nsspursrc/vm/cogit.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.c	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nsspursrc/vm/cogit.c	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291
+	CCodeGenerator VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291
+	StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -597,7 +597,6 @@
 static sqInt checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) NoDbgRegParms;
 sqInt checkIntegrityOfObjectReferencesInCode(sqInt fullGCFlag);
 static sqInt checkMaybeObjRefAt(sqInt mcpc) NoDbgRegParms;
-static void checkPrimitiveTableEnablers(void);
 static sqInt checkValidObjectReferencesInClosedPIC(CogMethod *cPIC) NoDbgRegParms;
 char * codeEntryFor(char *address);
 char * codeEntryNameFor(char *address);
@@ -730,6 +729,7 @@
 static sqInt maybeGenerateCheckFeatures(void);
 static sqInt maybeGenerateICacheFlush(void);
 static void maybeMarkCountersIn(CogMethod *cogMethod) NoDbgRegParms;
+static sqInt mclassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
 usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
 static sqInt methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt comparePenultimateLiteral) NoDbgRegParms;
 sqInt minCogMethodAddress(void);
@@ -749,8 +749,10 @@
 static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
 void printCogMethodFor(void *address);
 void printTrampolineTable(void);
+static sqInt processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasDivQuoRem(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasDoublePrecisionFloatingPointSupport(sqInt ignoredPrimIndex) NoDbgRegParms;
+static sqInt processorHasMultiplyAndMClassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasMultiply(sqInt ignoredPrimIndex) NoDbgRegParms;
 static AbstractInstruction * gRetN(sqInt offset) NoDbgRegParms;
 static void recordGeneratedRunTimeaddress(char *aString, sqInt address) NoDbgRegParms;
@@ -1811,231 +1813,6 @@
 static void (*postCompileHook)(CogMethod *, void *);
 static BytecodeDescriptor * prevBCDescriptor;
 static AbstractInstruction * primInvokeLabel;
-static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1] = {
-	{ 0, -1, 0 },
-	{ genPrimitiveAdd, 1, 0 },
-	{ genPrimitiveSubtract, 1, 0 },
-	{ genPrimitiveLessThan, 1, 0 },
-	{ genPrimitiveGreaterThan, 1, 0 },
-	{ genPrimitiveLessOrEqual, 1, 0 },
-	{ genPrimitiveGreaterOrEqual, 1, 0 },
-	{ genPrimitiveEqual, 1, 0 },
-	{ genPrimitiveNotEqual, 1, 0 },
-	{ genPrimitiveMultiply, 1, processorHasMultiply },
-	{ genPrimitiveDivide, 1, processorHasDivQuoRem },
-	{ genPrimitiveMod, 1, processorHasDivQuoRem },
-	{ genPrimitiveDiv, 1, processorHasDivQuoRem },
-	{ genPrimitiveQuo, 1, processorHasDivQuoRem },
-	{ genPrimitiveBitAnd, 1, 0 },
-	{ genPrimitiveBitOr, 1, 0 },
-	{ genPrimitiveBitXor, 1, 0 },
-	{ genPrimitiveBitShift, 1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveAsFloat, 0, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatAdd, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatSubtract, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatLessThan, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatGreaterThan, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatLessOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatGreaterOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatNotEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatMultiply, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ genPrimitiveFloatDivide, 1, processorHasDoublePrecisionFloatingPointSupport },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveFloatSquareRoot, 0, processorHasDoublePrecisionFloatingPointSupport },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveAt, 1, 0 },
-	{ genPrimitiveAtPut, 2, 0 },
-	{ genPrimitiveSize, 0, 0 },
-	{ genPrimitiveStringAt, 1, 0 },
-	{ genPrimitiveStringAtPut, 2, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveNew, -1, 0 },
-	{ genPrimitiveNewWithArg, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveIdentityHash, 0, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveNewMethod, 2, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveIdentical, 1, 0 },
-	{ genPrimitiveClass, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveNotIdentical, 1, 0 },
-	{ genPrimitiveAsCharacter, -1, 0 },
-	{ genPrimitiveCharacterValue, 0, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveIdentityHash, 0, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genFastPrimFail, -1, 0 },
-	{ genFastPrimFail, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveClosureValue, 0, 0 },
-	{ genPrimitiveClosureValue, 1, 0 },
-	{ genPrimitiveClosureValue, 2, 0 },
-	{ genPrimitiveClosureValue, 3, 0 },
-	{ genPrimitiveClosureValue, 4, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ 0, -1, 0 },
-	{ genPrimitiveClosureValue, 0, 0 },
-	{ genPrimitiveClosureValue, 1, 0 }
-};
 static sqInt primitiveIndex;
 void (*realCECallCogCodePopReceiverAndClassRegs)(void);
 void (*realCECallCogCodePopReceiverArg0Regs)(void);
@@ -9375,25 +9152,6 @@
 	return checkValidObjectReference(maybeObject);
 }
 
-
-/*	Disable primitive generators with enablers that answer false. */
-
-static void
-checkPrimitiveTableEnablers(void)
-{
-    sqInt i;
-    PrimitiveDescriptor *primitiveDescriptor;
-
-	for (i = 1; i <= MaxCompiledPrimitiveIndex; i += 1) {
-		primitiveDescriptor = (&(primitiveGeneratorTable[i]));
-		if (((primitiveDescriptor->enabled)) != null) {
-			if (!(((primitiveDescriptor->enabled))(i))) {
-				(primitiveDescriptor->primitiveGenerator = null);
-			}
-		}
-	}
-}
-
 static sqInt
 checkValidObjectReferencesInClosedPIC(CogMethod *cPIC)
 {
@@ -10275,18 +10033,12 @@
 		return 0;
 	}
 	if ((((primitiveDescriptor = primitiveGeneratorOrNil())) != null)
-	 && (((primitiveDescriptor->primitiveGenerator)) != null)) {
-
-		/* If a descriptor specifies an argument count (by numArgs >= 0)
-		   then it must match for the generated code to be correct.  For
-		   example for speed many primitives use ResultReceiverReg
-		   instead of accessing the stack, so the receiver better be at
-		   numArgs down the stack.  Use the interpreter version if not. */
-
-		if ((((primitiveDescriptor->primNumArgs)) < 0)
-		 || (((primitiveDescriptor->primNumArgs)) == (argumentCountOf(methodObj)))) {
-			return ((primitiveDescriptor->primitiveGenerator))();
-		}
+	 && ((((primitiveDescriptor->primitiveGenerator)) != null)
+	 && (((((primitiveDescriptor->primNumArgs)) < 0)
+	 || (((primitiveDescriptor->primNumArgs)) == (argumentCountOf(methodObj))))
+	 && ((((primitiveDescriptor->enabled)) == null)
+	 || (((primitiveDescriptor->enabled))(primitiveIndex)))))) {
+		return ((primitiveDescriptor->primitiveGenerator))();
 	}
 	if ((((primitiveRoutine = functionPointerForCompiledMethodprimitiveIndex(methodObj, primitiveIndex))) == null)
 	 || (primitiveRoutine == (functionPointerForinClass(0, null)))) {
@@ -11942,7 +11694,6 @@
 	generateStackPointerCapture();
 	generateTrampolines();
 	
-	checkPrimitiveTableEnablers();
 	manageFromto(methodZoneBase, endAddress);
 	computeEntryOffsets();
 	generateClosedPICPrototype();
@@ -13010,7 +12761,13 @@
 {
 }
 
+static sqInt
+mclassIsSmallInteger(sqInt ignoredPrimIndex)
+{
+	return (methodClassOf(methodObj)) == (classSmallInteger());
+}
 
+
 /*	Answer the absolute machine code pc matching the zero-relative
 	bytecode pc of a backward branch in cogMethod, given the start
 	of the bytecodes for cogMethod's block or method object. */
@@ -13419,6 +13176,231 @@
 primitiveGeneratorOrNil(void)
 {
     PrimitiveDescriptor *primitiveDescriptor;
+    static PrimitiveDescriptor primitiveGeneratorTable[MaxCompiledPrimitiveIndex+1] = {
+	{ 0, -1, 0 },
+	{ genPrimitiveAdd, 1, mclassIsSmallInteger },
+	{ genPrimitiveSubtract, 1, mclassIsSmallInteger },
+	{ genPrimitiveLessThan, 1, mclassIsSmallInteger },
+	{ genPrimitiveGreaterThan, 1, mclassIsSmallInteger },
+	{ genPrimitiveLessOrEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveGreaterOrEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveNotEqual, 1, mclassIsSmallInteger },
+	{ genPrimitiveMultiply, 1, processorHasMultiplyAndMClassIsSmallInteger },
+	{ genPrimitiveDivide, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveMod, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveDiv, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveQuo, 1, processorHasDivQuoRemAndMClassIsSmallInteger },
+	{ genPrimitiveBitAnd, 1, mclassIsSmallInteger },
+	{ genPrimitiveBitOr, 1, mclassIsSmallInteger },
+	{ genPrimitiveBitXor, 1, mclassIsSmallInteger },
+	{ genPrimitiveBitShift, 1, mclassIsSmallInteger },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveAsFloat, 0, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatAdd, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatSubtract, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatLessThan, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatGreaterThan, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatLessOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatGreaterOrEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatNotEqual, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatMultiply, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ genPrimitiveFloatDivide, 1, processorHasDoublePrecisionFloatingPointSupport },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveFloatSquareRoot, 0, processorHasDoublePrecisionFloatingPointSupport },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveAt, 1, 0 },
+	{ genPrimitiveAtPut, 2, 0 },
+	{ genPrimitiveSize, 0, 0 },
+	{ genPrimitiveStringAt, 1, 0 },
+	{ genPrimitiveStringAtPut, 2, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveNew, -1, 0 },
+	{ genPrimitiveNewWithArg, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveIdentityHash, 0, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveNewMethod, 2, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveIdentical, 1, 0 },
+	{ genPrimitiveClass, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveNotIdentical, 1, 0 },
+	{ genPrimitiveAsCharacter, -1, 0 },
+	{ genPrimitiveCharacterValue, 0, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveIdentityHash, 0, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genFastPrimFail, -1, 0 },
+	{ genFastPrimFail, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveClosureValue, 0, 0 },
+	{ genPrimitiveClosureValue, 1, 0 },
+	{ genPrimitiveClosureValue, 2, 0 },
+	{ genPrimitiveClosureValue, 3, 0 },
+	{ genPrimitiveClosureValue, 4, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ 0, -1, 0 },
+	{ genPrimitiveClosureValue, 0, 0 },
+	{ genPrimitiveClosureValue, 1, 0 }
+};
 
 	if (isQuickPrimitiveIndex(primitiveIndex)) {
 
@@ -13463,6 +13445,13 @@
 }
 
 static sqInt
+processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
+{
+	return (processorHasDivQuoRem(ignoredPrimIndex))
+	 && (mclassIsSmallInteger(ignoredPrimIndex));
+}
+
+static sqInt
 processorHasDivQuoRem(sqInt ignoredPrimIndex)
 {
 	return canDivQuoRem(backEnd);
@@ -13475,6 +13464,13 @@
 }
 
 static sqInt
+processorHasMultiplyAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
+{
+	return (processorHasMultiply(ignoredPrimIndex))
+	 && (mclassIsSmallInteger(ignoredPrimIndex));
+}
+
+static sqInt
 processorHasMultiply(sqInt ignoredPrimIndex)
 {
 	return canMulRR(backEnd);

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nsspursrc/vm/cogit.h	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.876 uuid: 85989927-97e3-4111-a351-b242bf444291
+	CCodeGenerator VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
    from
-	CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -798,6 +798,7 @@
 sqInt ceClassAtIndex(sqInt classIndex);
 void ceSheduleScavenge(void);
 static void clearLeakMapAndMapAccessibleObjects(void);
+static sqInt copyObjtoSegmentaddrstopAtsaveOopAt(sqInt objOop, sqInt segmentWordArray, sqInt limitSeg, sqInt stopAddr, sqInt oopPtr) NoDbgRegParms;
 void ensureNoForwardedLiteralsIn(sqInt aMethodObj);
 usqInt freeStartAddress(void);
 usqInt getScavengeThreshold(void);
@@ -2324,7 +2325,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 CoInterpreterPrimitives_VMMaker.oscog-eem.879";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.880";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -36632,18 +36633,27 @@
 primitiveStoreImageSegment(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt arrayOfRoots;
+    sqInt copyObj;
+    sqInt copyPtr;
     sqInt ecode;
     sqInt endSeg;
     sqInt firstIn;
     sqInt firstOut;
-    sqInt hdrBaseIn;
-    sqInt hdrBaseOut;
     sqInt lastIn;
     sqInt lastOut;
-    sqInt lastSeg;
+    sqInt limitSeg;
+    sqInt newSegLimit;
+    sqInt numSlots;
+    usqInt numSlots1;
+    usqInt numSlots11;
+    usqInt numSlots2;
+    usqInt numSlots3;
+    sqInt originalObj;
+    sqInt originalPtr;
     sqInt outPointerArray;
+    usqInt p;
     sqInt segmentWordArray;
-    sqInt versionOffset;
+    sqInt slotBytes;
 
 	outPointerArray = longAt(GIV(stackPointer));
 	segmentWordArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -38588,6 +38598,84 @@
 }
 
 
+/*	Copy objOop into the segment beginning at limitSeg, and forward it to the
+	copy. Fail if out of space. Answer the next segmentAddr if successful. */
+/*	Copy the object... */
+
+static sqInt
+copyObjtoSegmentaddrstopAtsaveOopAt(sqInt objOop, sqInt segmentWordArray, sqInt limitSeg, sqInt stopAddr, sqInt oopPtr)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    usqInt bodySize;
+    sqInt copy;
+    sqInt header;
+    usqInt numSlots;
+    sqInt valuePointer;
+
+	bodySize = bytesInObject(objOop);
+	if ((((usqInt) (limitSeg + bodySize))) >= (((usqInt) stopAddr))) {
+		return 0;
+	}
+	memcpy(limitSeg, ((byteAt(objOop + 7)) == 0xFF
+		? objOop - (BaseHeaderSize)
+		: objOop), bodySize);
+	/* begin objectStartingAt: */
+	numSlots = byteAt(limitSeg + 7);
+	copy = (numSlots == 0xFF
+		? limitSeg + (BaseHeaderSize)
+		: limitSeg);
+	/* begin setIsRememberedOf:to: */
+	flag("endianness");
+	longAtput(copy, (longAt(copy)) & (~(1 << 29)));
+	/* begin setIsPinnedOf:to: */
+	flag("endianness");
+	longAtput(copy, (longAt(copy)) & (~(1 << 30)));
+	setIsMarkedOfto(copy, 0);
+	if ((((((usqInt) (longAt(objOop))) >> 24) & 0x1F) >= 24)
+	 && (methodHasCogMethod(objOop))) {
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		/* begin methodHeaderOf: */
+		assert(isCompiledMethod(objOop));
+		header = longAt((objOop + (BaseHeaderSize)) + (HeaderIndex << 2));
+		valuePointer = ((header & 1)
+			? header
+			: (assert((((usqInt)header)) < GIV(newSpaceStart)),
+				assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())),
+				((((CogMethod *) header))->methodHeader)));
+		assert(!(isForwarded(copy)));
+		longAtput((copy + (BaseHeaderSize)) + (HeaderIndex << 2), valuePointer);
+	}
+	longAtput(oopPtr, objOop);
+	/* begin forward:to: */
+	/* begin set:classIndexTo:formatTo: */
+	assert(((8 >= 0) && (8 <= (classIndexMask()))));
+	assert(((7 >= 0) && (7 <= (formatMask()))));
+	flag("endianness");
+	longAtput(objOop, ((longAt(objOop)) & (~((0x1F << 24) + 0x3FFFFF))) + (8 + (7 << 24)));
+	/* begin storePointer:ofForwarder:withValue: */
+	assert(isForwarded(objOop));
+	assert(!(isOopForwarded(copy)));
+	if (isOldObject(objOop)) {
+
+		/* most stores into young objects */
+
+		if (((copy & 3) == 0)
+		 && ((((usqInt) copy)) < (((usqInt) GIV(newSpaceLimit))))) {
+			/* begin possibleRootStoreInto: */
+			if (!(((((usqInt) (longAt(objOop))) >> 29) & 1) != 0)) {
+				remember(objOop);
+			}
+		}
+	}
+	longAtput((objOop + (BaseHeaderSize)) + (0 << 2), copy);
+	if ((byteAt(objOop + 7)) == 0) {
+		/* begin setRawNumSlotsOf:to: */
+		flag("endian");
+		byteAtput(objOop + 7, 1);
+	}
+	return limitSeg + bodySize;
+}
+
+
 /*	Ensure there are no forwarded literals in the argument. */
 
 void
@@ -65072,7 +65160,7 @@
 	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
 	aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
 	if (!((index & 1))) {
-		GIV(primFailCode) = PrimErrBadArgument;
+		(GIV(primFailCode) = PrimErrBadArgument);
 		return;
 	}
 	hdr = long64At(aContext);
@@ -65318,7 +65406,7 @@
 		stSize = (sp1 >> 1);
 	l2:	/* end fetchStackPointerOf: */;
 		if (!(((index >= 1) && (index <= stSize)))) {
-			GIV(primFailCode) = PrimErrBadIndex;
+			(GIV(primFailCode) = PrimErrBadIndex);
 			return;
 		}
 		/* begin subscript:with:storing:format: */
@@ -65374,7 +65462,7 @@
 	assert((senderOop & 1));
 	spouseFP = pointerForOop(senderOop - 1);
 	if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
-		GIV(primFailCode) = PrimErrBadIndex;
+		(GIV(primFailCode) = PrimErrBadIndex);
 		return;
 	}
 	if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {

Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nsspursrc/vm/cointerp.h	2014-09-13 23:20:54 UTC (rev 3078)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
 
 
@@ -155,6 +155,7 @@
 sqInt classIndexMask(void);
 sqInt classIndexOf(sqInt objOop);
 sqInt classOrNilAtIndex(sqInt classIndex);
+sqInt classSmallInteger(void);
 sqInt classTableMajorIndexShift(void);
 sqInt classTableMinorIndexMask(void);
 sqInt classTablePageSize(void);

Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2014-09-13 00:35:44 UTC (rev 3077)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2014-09-13 23:20:54 UTC (rev 3078)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
    from
-	CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
+	CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.880 uuid: 4aeaa3e0-8c6b-44b4-a124-128870605261 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -801,6 +801,7 @@
 sqInt ceClassAtIndex(sqInt classIndex);
 void ceSheduleScavenge(void);
 static void clearLeakMapAndMapAccessibleObjects(void);
+static sqInt copyObjtoSegmentaddrstopAtsaveOopAt(sqInt objOop, sqInt segmentWordArray, sqInt limitSeg, sqInt stopAddr, sqInt oopPtr) NoDbgRegParms;
 void ensureNoForwardedLiteralsIn(sqInt aMethodObj);
 usqInt freeStartAddress(void);
 usqInt getScavengeThreshold(void);
@@ -2327,7 +2328,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 CoInterpreterPrimitives_VMMaker.oscog-eem.879";

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list