[Vm-dev] [commit][3254] CogVM source as per VMMaker.oscog-eem.1060

commits at squeakvm.org commits at squeakvm.org
Thu Feb 12 19:20:08 UTC 2015


Revision: 3254
Author:   eliot
Date:     2015-02-12 11:20:06 -0800 (Thu, 12 Feb 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1060

Clip the argument in the 64-bit versions of primitiveTimesTwoPower and avoid
the compiler warning with a cast.  Be clever with the SmallFloat version to
show how convenient the SmallFloat zeros are to work with.

primitiveDoNamedPrimitiveWithArgs needs to follow the same convention re
primitiveFunctionPointer as primitiveDoPrimitiveWithArgs et al on failure,
otherwise checkForAndFollowForwardedPrimitiveState will be fatally confused.
Add an assert to check the range of accessorDepth there-in.

Linux: Make UTF-8 the default copy/paste encoding to match the help text.

Modified Paths:
--------------
    branches/Cog/nscogsrc/plugins/FloatMathPlugin/FloatMathPlugin.c
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/platforms/unix/vm/sqUnixMain.c
    branches/Cog/sistasrc/vm/cointerp.c
    branches/Cog/sistasrc/vm/cointerp.h
    branches/Cog/sistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spurstack64src/vm/gcc3x-interp.c
    branches/Cog/spurstack64src/vm/interp.c
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/src/plugins/FloatMathPlugin/FloatMathPlugin.c
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c

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

Modified: branches/Cog/nscogsrc/plugins/FloatMathPlugin/FloatMathPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/FloatMathPlugin/FloatMathPlugin.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nscogsrc/plugins/FloatMathPlugin/FloatMathPlugin.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	VMPluginCodeGenerator VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	FloatMathPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	FloatMathPlugin VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "FloatMathPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ;
+static char __buildInfo[] = "FloatMathPlugin VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 
 
 
@@ -41,7 +41,9 @@
 
 
 /*** Function Prototypes ***/
+static sqInt floatExponentBits(void);
 EXPORT(const char*) getModuleName(void);
+static sqInt isFinite(double aDouble);
 EXPORT(sqInt) primitiveArcCos(void);
 EXPORT(sqInt) primitiveArcCosH(void);
 EXPORT(sqInt) primitiveArcSin(void);
@@ -71,7 +73,9 @@
 
 #if !defined(SQUEAK_BUILTIN_PLUGIN)
 static sqInt (*failed)(void);
+static sqInt (*floatObjectOf)(double  aFloat);
 static sqInt (*methodArgumentCount)(void);
+static sqInt (*methodReturnValue)(sqInt oop);
 static sqInt (*pop)(sqInt nItems);
 static sqInt (*primitiveFail)(void);
 static sqInt (*pushFloat)(double  f);
@@ -79,7 +83,9 @@
 static sqInt (*stackIntegerValue)(sqInt offset);
 #else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
 extern sqInt failed(void);
+extern sqInt floatObjectOf(double  aFloat);
 extern sqInt methodArgumentCount(void);
+extern sqInt methodReturnValue(sqInt oop);
 extern sqInt pop(sqInt nItems);
 extern sqInt primitiveFail(void);
 extern sqInt pushFloat(double  f);
@@ -90,14 +96,24 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"FloatMathPlugin VMMaker.oscog-eem.983 (i)"
+	"FloatMathPlugin VMMaker.oscog-eem.1060 (i)"
 #else
-	"FloatMathPlugin VMMaker.oscog-eem.983 (e)"
+	"FloatMathPlugin VMMaker.oscog-eem.1060 (e)"
 #endif
 ;
 
 
 
+/*	Answer the number of bits in the double-precision exponent. This is an
+	11-bit field. */
+
+static sqInt
+floatExponentBits(void)
+{
+	return 11;
+}
+
+
 /*	Note: This is hardcoded so it can be run from Squeak.
 	The module name is used for validating a module *after*
 	it is loaded to check if it does really contain the module
@@ -109,7 +125,13 @@
 	return moduleName;
 }
 
+static sqInt
+isFinite(double aDouble)
+{
+	return (aDouble - aDouble) == 0.0;
+}
 
+
 /*	Computes acos(receiver) */
 
 EXPORT(sqInt)
@@ -569,7 +591,7 @@
 }
 
 
-/*	Computes E raised to the receiver power. */
+/*	Multiply the receiver by the power of the argument. */
 
 EXPORT(sqInt)
 primitiveTimesTwoPower(void)
@@ -577,18 +599,32 @@
     sqInt arg;
     double rcvr;
     double result;
+    sqInt twiceMaxExponent;
 
 	arg = stackIntegerValue(0);
 	rcvr = stackFloatValue(1);
 	if (failed()) {
 		return null;
 	}
-	result = __ieee754_ldexp(rcvr, arg);
-	if (isnan(result)) {
-		return primitiveFail();
+	if (BytesPerOop > 4) {
+
+		/* clip arg to at most int range; ldexp's last arg is of type int */
+
+		twiceMaxExponent = 2 * (1 << 11);
+		if (arg < (-twiceMaxExponent)) {
+			arg = -twiceMaxExponent;
+		}
+		else {
+			if (arg > twiceMaxExponent) {
+				arg = twiceMaxExponent;
+			}
+		}
 	}
-	pop((methodArgumentCount()) + 1);
-	pushFloat(result);
+	result = __ieee754_ldexp(rcvr, (int)arg);
+	if (!(isnan(result))) {
+		methodReturnValue(floatObjectOf(result));
+	}
+	return null;
 }
 
 
@@ -606,7 +642,9 @@
 		
 #if !defined(SQUEAK_BUILTIN_PLUGIN)
 		failed = interpreterProxy->failed;
+		floatObjectOf = interpreterProxy->floatObjectOf;
 		methodArgumentCount = interpreterProxy->methodArgumentCount;
+		methodReturnValue = interpreterProxy->methodReturnValue;
 		pop = interpreterProxy->pop;
 		primitiveFail = interpreterProxy->primitiveFail;
 		pushFloat = interpreterProxy->pushFloat;

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -766,7 +766,6 @@
 EXPORT(void) primitiveSubtractLargeIntegers(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1573,7 +1572,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2097,7 +2096,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1055";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1060";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -24066,8 +24065,8 @@
 static void
 primitiveBitAnd(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    usqInt integerArgument;
-    usqInt integerReceiver;
+    usqLong integerArgument;
+    usqLong integerReceiver;
     sqInt oop;
     sqInt oop1;
     char *sp;
@@ -24121,8 +24120,8 @@
 static void
 primitiveBitOr(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    usqInt integerArgument;
-    usqInt integerReceiver;
+    usqLong integerArgument;
+    usqLong integerReceiver;
     sqInt oop;
     sqInt oop1;
     char *sp;
@@ -24312,8 +24311,8 @@
 static void
 primitiveBitXor(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    usqInt integerArgument;
-    usqInt integerReceiver;
+    usqLong integerArgument;
+    usqLong integerReceiver;
     sqInt oop;
     sqInt oop1;
     char *sp;
@@ -33412,93 +33411,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    sqInt ccIndex;
-    sqInt classOop;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	/* begin is:instanceOf:compactClassIndex: */
-	if ((oop & 1)) {
-		isFloat = 0;
-		goto l3;
-	}
-	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
-	classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())));
-	assert(!((oop & 1)));
-	ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F;
-	if (ccIndex == 0) {
-		isFloat = ((longAt(oop - BaseHeaderSize)) & AllButTypeMask) == classOop;
-		goto l2;
-	}
-	isFloat = ClassFloatCompactIndex == ccIndex;
-	goto l2;
-
-	isFloat = classOop == (fetchPointerofObject(ccIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))));
-l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
-l3:	/* end is:instanceOf:compactClassIndex: */;
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l4;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l4:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
@@ -54236,11 +54148,10 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -769,7 +769,6 @@
 EXPORT(void) primitiveSubtractLargeIntegers(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1576,7 +1575,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2100,7 +2099,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1055";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1060";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -24075,8 +24074,8 @@
 static void
 primitiveBitAnd(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    usqInt integerArgument;
-    usqInt integerReceiver;
+    usqLong integerArgument;
+    usqLong integerReceiver;
     sqInt oop;
     sqInt oop1;
     char *sp;
@@ -24130,8 +24129,8 @@
 static void
 primitiveBitOr(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    usqInt integerArgument;
-    usqInt integerReceiver;
+    usqLong integerArgument;
+    usqLong integerReceiver;
     sqInt oop;
     sqInt oop1;
     char *sp;
@@ -24321,8 +24320,8 @@
 static void
 primitiveBitXor(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    usqInt integerArgument;
-    usqInt integerReceiver;
+    usqLong integerArgument;
+    usqLong integerReceiver;
     sqInt oop;
     sqInt oop1;
     char *sp;
@@ -33421,93 +33420,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    sqInt ccIndex;
-    sqInt classOop;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	/* begin is:instanceOf:compactClassIndex: */
-	if ((oop & 1)) {
-		isFloat = 0;
-		goto l3;
-	}
-	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
-	classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())));
-	assert(!((oop & 1)));
-	ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F;
-	if (ccIndex == 0) {
-		isFloat = ((longAt(oop - BaseHeaderSize)) & AllButTypeMask) == classOop;
-		goto l2;
-	}
-	isFloat = ClassFloatCompactIndex == ccIndex;
-	goto l2;
-
-	isFloat = classOop == (fetchPointerofObject(ccIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))));
-l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
-l3:	/* end is:instanceOf:compactClassIndex: */;
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l4;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l4:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
@@ -54245,11 +54157,10 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -780,7 +780,6 @@
 EXPORT(void) primitiveSubtractLargeIntegers(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1801,7 +1800,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2356,7 +2355,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.1055";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1060";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -5602,6 +5601,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l225;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -5619,7 +5619,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					/* return self */
+					null;
 				l225:	/* end baseFrameReturn */;
 					goto l224;
 				}
@@ -37999,74 +37999,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	isFloat = ((oop & 3) == 0)
-	 && (((longAt(oop)) & 0x3FFFFF) == ClassFloatCompactIndex);
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l2;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l2:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt isFloat;
@@ -60907,6 +60839,7 @@
 	else {
 		assert(saneFunctionPointerForFailureOfPrimIndex(primIndex));
 	}
+	assert(((accessorDepth >= -127) && (accessorDepth <= 0x7F)));
 	if (accessorDepth >= 0) {
 		for (index = 0; index <= GIV(argumentCount); index += 1) {
 			oop = longAt(GIV(stackPointer) + (index * BytesPerWord));
@@ -73430,11 +73363,11 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		primitiveFunctionPointer = primitiveDoNamedPrimitiveWithArgs;
+
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}

Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nsspursrc/vm/cointerp.h	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
 
 

Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -783,7 +783,6 @@
 EXPORT(void) primitiveSubtractLargeIntegers(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1804,7 +1803,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2359,7 +2358,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.1055";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1060";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -5611,6 +5610,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l225;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -5628,7 +5628,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					/* return self */
+					null;
 				l225:	/* end baseFrameReturn */;
 					goto l224;
 				}
@@ -38008,74 +38008,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	isFloat = ((oop & 3) == 0)
-	 && (((longAt(oop)) & 0x3FFFFF) == ClassFloatCompactIndex);
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l2;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l2:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt isFloat;
@@ -60916,6 +60848,7 @@
 	else {
 		assert(saneFunctionPointerForFailureOfPrimIndex(primIndex));
 	}
+	assert(((accessorDepth >= -127) && (accessorDepth <= 0x7F)));
 	if (accessorDepth >= 0) {
 		for (index = 0; index <= GIV(argumentCount); index += 1) {
 			oop = longAt(GIV(stackPointer) + (index * BytesPerWord));
@@ -73439,11 +73372,11 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		primitiveFunctionPointer = primitiveDoNamedPrimitiveWithArgs;
+
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}

Modified: branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	StackInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	StackInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -539,7 +539,6 @@
 static void primitiveSuspend(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1584,7 +1583,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2108,7 +2107,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1055";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1060";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -25009,74 +25008,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	isFloat = ((oop & 3) == 0)
-	 && (((longAt(oop)) & 0x3FFFFF) == ClassFloatCompactIndex);
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l2;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l2:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt isFloat;
@@ -48081,6 +48012,7 @@
 	else {
 		assert(saneFunctionPointerForFailureOfPrimIndex(primIndex));
 	}
+	assert(((accessorDepth >= -127) && (accessorDepth <= 0x7F)));
 	if (accessorDepth >= 0) {
 		for (index = 0; index <= GIV(argumentCount); index += 1) {
 			oop = longAt(GIV(stackPointer) + (index * BytesPerWord));
@@ -63941,11 +63873,11 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		primitiveFunctionPointer = primitiveDoNamedPrimitiveWithArgs;
+
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}

Modified: branches/Cog/nsspurstacksrc/vm/interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/interp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/nsspurstacksrc/vm/interp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	StackInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	StackInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -536,7 +536,6 @@
 static void primitiveSuspend(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1581,7 +1580,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2105,7 +2104,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1055";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1060";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -25000,74 +24999,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	isFloat = ((oop & 3) == 0)
-	 && (((longAt(oop)) & 0x3FFFFF) == ClassFloatCompactIndex);
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l2;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l2:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt isFloat;
@@ -48072,6 +48003,7 @@
 	else {
 		assert(saneFunctionPointerForFailureOfPrimIndex(primIndex));
 	}
+	assert(((accessorDepth >= -127) && (accessorDepth <= 0x7F)));
 	if (accessorDepth >= 0) {
 		for (index = 0; index <= GIV(argumentCount); index += 1) {
 			oop = longAt(GIV(stackPointer) + (index * BytesPerWord));
@@ -63932,11 +63864,11 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		primitiveFunctionPointer = primitiveDoNamedPrimitiveWithArgs;
+
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Wed Feb 11 14:19:44 PST 2015
   + Thu Feb 12 11:19:52 PST 2015

Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMain.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/platforms/unix/vm/sqUnixMain.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -124,7 +124,7 @@
        int    uxDropFileCount=	0;	/* number of dropped items	*/
        char **uxDropFileNames=	0;	/* dropped filenames		*/
 
-       int    textEncodingUTF8= 0;	/* 1 if copy from external selection uses UTF8 */
+       int    textEncodingUTF8= 1;	/* 1 if copy from external selection uses UTF8 */
 
 #if defined(IMAGE_DUMP)
 static int    dumpImageFile=	0;	/* 1 after SIGHUP received */
@@ -1479,21 +1479,19 @@
 		reportStackHeadroom = 1;
 		return 1; }
 #endif /* COGVM */
-      else if (!strcmp(argv[0], "-textenc"))
-	{
-	  char *buf= (char *)malloc(strlen(argv[1]) + 1);
-	  int len, i;
-	  strcpy(buf, argv[1]);
-	  len= strlen(buf);
-	  for (i= 0;  i < len;  ++i)
-	    buf[i]= toupper(buf[i]);
-	  if ((!strcmp(buf, "UTF8")) || (!strcmp(buf, "UTF-8")))
-	    textEncodingUTF8= 1;
-	  else
-	    setEncoding(&uxTextEncoding, buf);
-	  free(buf);
-	  return 2;
-	}
+      else if (!strcmp(argv[0], "-textenc")) {
+		int i, len = strlen(argv[1]);
+		char *buf = (char *)alloca(len + 1);
+		for (i = 0;  i < len;  ++i)
+			buf[i] = toupper(argv[1][i]);
+		if ((!strcmp(buf, "UTF8")) || (!strcmp(buf, "UTF-8")))
+			textEncodingUTF8 = 1;
+		else {
+			textEncodingUTF8 = 0;
+			setEncoding(&uxTextEncoding, buf);
+		}
+		return 2;
+	  }
     }
   return 0;	/* option not recognised */
 }

Modified: branches/Cog/sistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/sistasrc/vm/cointerp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/sistasrc/vm/cointerp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -766,7 +766,6 @@
 EXPORT(void) primitiveSubtractLargeIntegers(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1574,7 +1573,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2098,7 +2097,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1055]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1060]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -4838,7 +4837,6 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
-							null;
 							goto l300;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4856,7 +4854,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					null;
+					/* return self */
 				l300:	/* end baseFrameReturn */;
 					goto l299;
 				}
@@ -33519,93 +33517,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    sqInt ccIndex;
-    sqInt classOop;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	/* begin is:instanceOf:compactClassIndex: */
-	if ((oop & 1)) {
-		isFloat = 0;
-		goto l3;
-	}
-	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
-	classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())));
-	assert(!((oop & 1)));
-	ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F;
-	if (ccIndex == 0) {
-		isFloat = ((longAt(oop - BaseHeaderSize)) & AllButTypeMask) == classOop;
-		goto l2;
-	}
-	isFloat = ClassFloatCompactIndex == ccIndex;
-	goto l2;
-
-	isFloat = classOop == (fetchPointerofObject(ccIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))));
-l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
-l3:	/* end is:instanceOf:compactClassIndex: */;
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l4;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l4:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
@@ -54326,11 +54237,10 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}

Modified: branches/Cog/sistasrc/vm/cointerp.h
===================================================================
--- branches/Cog/sistasrc/vm/cointerp.h	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/sistasrc/vm/cointerp.h	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
 
 

Modified: branches/Cog/sistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/sistasrc/vm/gcc3x-cointerp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/sistasrc/vm/gcc3x-cointerp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -769,7 +769,6 @@
 EXPORT(void) primitiveSubtractLargeIntegers(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1577,7 +1576,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2101,7 +2100,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1055]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1060]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -4847,7 +4846,6 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
-							null;
 							goto l300;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4865,7 +4863,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					null;
+					/* return self */
 				l300:	/* end baseFrameReturn */;
 					goto l299;
 				}
@@ -33528,93 +33526,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    sqInt ccIndex;
-    sqInt classOop;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	integerPointer = top;
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		arg = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		arg = 0;
-		goto l1;
-	}
-l1:	/* end popInteger */;
-	/* begin popFloat */
-	/* begin floatValueOf: */
-	/* begin popStack */
-	top1 = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	oop = top1;
-	/* begin is:instanceOf:compactClassIndex: */
-	if ((oop & 1)) {
-		isFloat = 0;
-		goto l3;
-	}
-	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
-	classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())));
-	assert(!((oop & 1)));
-	ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F;
-	if (ccIndex == 0) {
-		isFloat = ((longAt(oop - BaseHeaderSize)) & AllButTypeMask) == classOop;
-		goto l2;
-	}
-	isFloat = ClassFloatCompactIndex == ccIndex;
-	goto l2;
-
-	isFloat = classOop == (fetchPointerofObject(ccIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))));
-l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
-l3:	/* end is:instanceOf:compactClassIndex: */;
-	if (isFloat) {
-		;
-		fetchFloatAtinto(oop + BaseHeaderSize, result);
-		rcvr = result;
-		goto l4;
-	}
-	/* begin primitiveFail */
-	if (!GIV(primFailCode)) {
-		GIV(primFailCode) = 1;
-	}
-	rcvr = 0.0;
-l4:	/* end floatValueOf: */;
-	if (!GIV(primFailCode)) {
-		/* begin pushFloat: */
-		f = ldexp(rcvr, arg);
-		/* begin push: */
-		object = floatObjectOf(f);
-		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
-		GIV(stackPointer) = sp;
-	}
-	else {
-		/* begin unPop: */
-		GIV(stackPointer) -= 2 * BytesPerWord;
-	}
-}
-
-static void
 primitiveTruncated(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
@@ -54335,11 +54246,10 @@
 		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), longAt((GIV(tempOop) + BaseHeaderSize) + (0 << (shiftForWord()))));
 		GIV(stackPointer) = sp4;
 
-		/* Hack.  A nil prim error code (primErrorCode = 1) is interpreted by the image
-		   as meaning this primitive is not implemented.  So to pass back nil as an error
-		   code we use -1 to indicate generic failure. */
+		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
 
 		GIV(argumentCount) = 3;
+		
 		if (GIV(primFailCode) == 1) {
 			GIV(primFailCode) = -1;
 		}

Modified: branches/Cog/spursistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.c	2015-02-11 22:20:23 UTC (rev 3253)
+++ branches/Cog/spursistasrc/vm/cointerp.c	2015-02-12 19:20:06 UTC (rev 3254)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
    from
-	CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8
+	CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1055 uuid: dd8f0ae4-8ad8-470c-a35b-29cf787f83c8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1060 uuid: c43c476e-10ff-420e-a2eb-c17d4624e338 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -780,7 +780,6 @@
 EXPORT(void) primitiveSubtractLargeIntegers(void);
 static void primitiveTestAndSetOwnershipOfCriticalSection(void);
 static void primitiveTestDisplayDepth(void);
-static void primitiveTimesTwoPower(void);
 static void primitiveTruncated(void);
 static void primitiveUnloadModule(void);
 static void primitiveUpdateTimezone(void);
@@ -1802,7 +1801,7 @@
 	/* 51 */ primitiveTruncated,
 	/* 52 */ primitiveFractionalPart,
 	/* 53 */ primitiveExponent,
-	/* 54 */ primitiveTimesTwoPower,
+	/* 54 */ (void (*)(void))0,
 	/* 55 */ primitiveSquareRoot,
 	/* 56 */ primitiveSine,
 	/* 57 */ primitiveArctan,
@@ -2357,7 +2356,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1055]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1060]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -38421,74 +38420,6 @@
 }
 
 static void
-primitiveTimesTwoPower(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt arg;
-    double f;
-    sqInt integerPointer;
-    sqInt isFloat;
-    sqInt object;
-    sqInt oop;
-    double rcvr;
-    double result;
-    char *sp;
-    sqInt top;
-    sqInt top1;
-
-	/* begin popInteger */
-	/* begin popStack */

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list