[Vm-dev] [commit][2860] CogVM source as per VMMaker.oscog-eem.598

commits at squeakvm.org commits at squeakvm.org
Fri Jan 31 01:38:03 UTC 2014


Revision: 2860
Author:   eliot
Date:     2014-01-30 17:38:01 -0800 (Thu, 30 Jan 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.598
Author: eem
Time: 30 January 2014, 5:06:23.221 pm
UUID: b85d7330-2ddc-4d90-8592-4e37234f4ac2
Ancestors: VMMaker.oscog-eem.597

Add the revision date to the sourceVersionString.  This may make those annoying
"your VM is out of date" warnings go away when Cog is used for Pharo.

Eliminate declarations for non-existent vars in ScratchPlugin>>primitiveFisheye.

Fix markAndTraceStackPage: for Spur.  Stack references to
forwarders must be followed before calling markAndTrace:.

Fix eliminateAndFreeForwarders; it assumed that no forwarder can reference
a new object after scavenge.  That's not true due to transitive references.

Fix SpurMemoryManager>>become:with:twoWay:copyHash: to follow
the specialObjectsOop if it has been forwarded.

Plugins (and the form print prim):
Fix some egregious oop + 4 and oop + 8 references with the correct
oop + BaseHeaderSize.
Reduce the use of isIntegerObject:.  isWords:, isBytes:
et al fail for immediates anyway.
Use var:type: where appropriate and use symbols for 'char *' et al.
Replace some uses of cCode: 'aFunction(args)' with a send of the
equivalent albeit non-existent selector.  This may allow simulation
at some point in the future.

Fix the isValidSegmentBridge: assert for the last bridge.

Add printLikelyImplementorsOfSelector: for help during debugging.

Modified Paths:
--------------
    branches/Cog/nscogsrc/plugins/AsynchFilePlugin/AsynchFilePlugin.c
    branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
    branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
    branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c
    branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nscogsrc/vm/interp.h
    branches/Cog/nscogsrc/vm/vmCallback.h
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/interp.h
    branches/Cog/spursrc/vm/vmCallback.h
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/spurstacksrc/vm/interp.h
    branches/Cog/spurstacksrc/vm/vmCallback.h
    branches/Cog/src/plugins/AsynchFilePlugin/AsynchFilePlugin.c
    branches/Cog/src/plugins/B2DPlugin/B2DPlugin.c
    branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.c
    branches/Cog/src/plugins/CameraPlugin/CameraPlugin.c
    branches/Cog/src/plugins/FT2Plugin/FT2Plugin.c
    branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
    branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c
    branches/Cog/src/plugins/SoundCodecPrims/SoundCodecPrims.c
    branches/Cog/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
    branches/Cog/src/plugins/UnicodePlugin/UnicodePlugin.c
    branches/Cog/src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c
    branches/Cog/src/plugins/WeDoPlugin/WeDoPlugin.c
    branches/Cog/src/plugins/ZipPlugin/ZipPlugin.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/src/vm/interp.h
    branches/Cog/src/vm/vmCallback.h
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c
    branches/Cog/stacksrc/vm/interp.h
    branches/Cog/stacksrc/vm/vmCallback.h

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

Modified: branches/Cog/nscogsrc/plugins/AsynchFilePlugin/AsynchFilePlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/AsynchFilePlugin/AsynchFilePlugin.c	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/plugins/AsynchFilePlugin/AsynchFilePlugin.c	2014-01-31 01:38:01 UTC (rev 2860)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
    from
-	AsynchFilePlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	AsynchFilePlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
  */
-static char __buildInfo[] = "AsynchFilePlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514 " __DATE__ ;
+static char __buildInfo[] = "AsynchFilePlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220 " __DATE__ ;
 
 
 
@@ -70,7 +70,6 @@
 static sqInt (*integerObjectOf)(sqInt value);
 static void * (*ioLoadFunctionFrom)(char *functionName, char *moduleName);
 static sqInt (*isBytes)(sqInt oop);
-static sqInt (*isIntegerObject)(sqInt objectPointer);
 static sqInt (*isWords)(sqInt oop);
 static sqInt (*pop)(sqInt nItems);
 static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
@@ -88,7 +87,6 @@
 extern sqInt integerObjectOf(sqInt value);
 extern void * ioLoadFunctionFrom(char *functionName, char *moduleName);
 extern sqInt isBytes(sqInt oop);
-extern sqInt isIntegerObject(sqInt objectPointer);
 extern sqInt isWords(sqInt oop);
 extern sqInt pop(sqInt nItems);
 extern sqInt popthenPush(sqInt nItems, sqInt oop);
@@ -102,29 +100,27 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"AsynchFilePlugin VMMaker.oscog-eem.580 (i)"
+	"AsynchFilePlugin VMMaker.oscog-eem.597 (i)"
 #else
-	"AsynchFilePlugin VMMaker.oscog-eem.580 (e)"
+	"AsynchFilePlugin VMMaker.oscog-eem.597 (e)"
 #endif
 ;
 static void * sCOAFfn;
 
 
 
-/*	Return a pointer to the first byte of the async file record within the
+/*	Answer a pointer to the first byte of the async file record within the
 	given Smalltalk bytes object, or nil if oop is not an async file record.
  */
 
 static AsyncFile *
 asyncFileValueOf(sqInt oop)
 {
-	success((!(isIntegerObject(oop)))
-	 && ((isBytes(oop))
-	 && ((slotSizeOf(oop)) == (sizeof(AsyncFile)))));
-	if (failed()) {
-		return null;
-	}
-	return (AsyncFile *) (oop + 4);
+	success((isBytes(oop))
+	 && ((slotSizeOf(oop)) == (sizeof(AsyncFile))));
+	return (!(failed())
+		? ((AsyncFile *) (firstIndexableField(oop)))
+		: 0);
 }
 
 
@@ -425,7 +421,6 @@
 		integerObjectOf = interpreterProxy->integerObjectOf;
 		ioLoadFunctionFrom = interpreterProxy->ioLoadFunctionFrom;
 		isBytes = interpreterProxy->isBytes;
-		isIntegerObject = interpreterProxy->isIntegerObject;
 		isWords = interpreterProxy->isWords;
 		pop = interpreterProxy->pop;
 		popthenPush = interpreterProxy->popthenPush;

Modified: branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2014-01-31 01:38:01 UTC (rev 2860)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	VMPluginCodeGenerator VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
    from
-	BalloonEnginePlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	BalloonEnginePlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
  */
-static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514 " __DATE__ ;
+static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220 " __DATE__ ;
 
 
 
@@ -839,9 +839,9 @@
 static void * loadBBFn;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"B2DPlugin VMMaker.oscog-eem.580 (i)"
+	"B2DPlugin VMMaker.oscog-eem.597 (i)"
 #else
-	"B2DPlugin VMMaker.oscog-eem.580 (e)"
+	"B2DPlugin VMMaker.oscog-eem.597 (e)"
 #endif
 ;
 static int* objBuffer;
@@ -6170,9 +6170,6 @@
 		cmSize = slotSizeOf(cmOop);
 		cmBits = firstIndexableField(cmOop);
 	}
-	if (isIntegerObject(formOop)) {
-		return primitiveFail();
-	}
 	if (!(isPointers(formOop))) {
 		return primitiveFail();
 	}
@@ -7201,9 +7198,6 @@
 	formArray = arrayOop;
 	for (i = 0, iLimiT = ((slotSizeOf(formArray)) - 1); i <= iLimiT; i += 1) {
 		formOop = fetchPointerofObject(i, formArray);
-		if (isIntegerObject(formOop)) {
-			return 0;
-		}
 		if (!(isPointers(formOop))) {
 			return 0;
 		}
@@ -9020,10 +9014,6 @@
 		cmSize = slotSizeOf(cmOop);
 		cmBits = firstIndexableField(cmOop);
 	}
-	if (isIntegerObject(formOop)) {
-		fill = primitiveFail();
-		goto l1;
-	}
 	if (!(isPointers(formOop))) {
 		fill = primitiveFail();
 		goto l1;
@@ -10376,7 +10366,7 @@
 	/* Note -- don't call loadEngineFrom here because this will override the stopReason with Zero */
 
 	engine = stackValue(0);
-	if (isIntegerObject(engine)) {
+	if (isImmediate(engine)) {
 		return primitiveFailFor(GEFEngineIsInteger);
 	}
 	if (!(isPointers(engine))) {

Modified: branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2014-01-31 01:38:01 UTC (rev 2860)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	VMPluginCodeGenerator VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
    from
-	JPEGReaderPlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	JPEGReaderPlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
  */
-static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514 " __DATE__ ;
+static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220 " __DATE__ ;
 
 
 
@@ -129,7 +129,6 @@
 static sqInt (*fetchPointerofObject)(sqInt index, sqInt oop);
 static void * (*firstIndexableField)(sqInt oop);
 static sqInt (*isBytes)(sqInt oop);
-static sqInt (*isIntegerObject)(sqInt objectPointer);
 static sqInt (*isPointers)(sqInt oop);
 static sqInt (*isWords)(sqInt oop);
 static sqInt (*methodArgumentCount)(void);
@@ -147,7 +146,6 @@
 extern sqInt fetchPointerofObject(sqInt index, sqInt oop);
 extern void * firstIndexableField(sqInt oop);
 extern sqInt isBytes(sqInt oop);
-extern sqInt isIntegerObject(sqInt objectPointer);
 extern sqInt isPointers(sqInt oop);
 extern sqInt isWords(sqInt oop);
 extern sqInt methodArgumentCount(void);
@@ -180,9 +178,9 @@
 static sqInt jsReadLimit;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"JPEGReaderPlugin VMMaker.oscog-eem.580 (i)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.597 (i)"
 #else
-	"JPEGReaderPlugin VMMaker.oscog-eem.580 (e)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.597 (e)"
 #endif
 ;
 static int *residuals;
@@ -206,9 +204,6 @@
     sqInt i;
     sqInt max;
 
-	if (isIntegerObject(oop)) {
-		return 0;
-	}
 	if (!(isPointers(oop))) {
 		return 0;
 	}
@@ -216,9 +211,6 @@
 		return 0;
 	}
 	arrayOop = fetchPointerofObject(MCUBlockIndex, oop);
-	if (isIntegerObject(arrayOop)) {
-		return 0;
-	}
 	if (!(isPointers(arrayOop))) {
 		return 0;
 	}
@@ -228,9 +220,6 @@
 	}
 	for (i = 0; i < max; i += 1) {
 		blockOop = fetchPointerofObject(i, arrayOop);
-		if (isIntegerObject(blockOop)) {
-			return 0;
-		}
 		if (!(isWords(blockOop))) {
 			return 0;
 		}
@@ -245,9 +234,6 @@
 static sqInt
 colorComponentfrom(int *aColorComponent, sqInt oop)
 {
-	if (isIntegerObject(oop)) {
-		return 0;
-	}
 	if (!(isPointers(oop))) {
 		return 0;
 	}
@@ -950,16 +936,13 @@
     sqInt oop;
     sqInt sz;
 
-	if ((slotSizeOf(streamOop)) < 5) {
-		return 0;
-	}
 	if (!(isPointers(streamOop))) {
 		return 0;
 	}
-	oop = fetchPointerofObject(0, streamOop);
-	if (isIntegerObject(oop)) {
+	if ((slotSizeOf(streamOop)) < 5) {
 		return 0;
 	}
+	oop = fetchPointerofObject(0, streamOop);
 	if (!(isBytes(oop))) {
 		return 0;
 	}
@@ -1848,7 +1831,6 @@
 		fetchPointerofObject = interpreterProxy->fetchPointerofObject;
 		firstIndexableField = interpreterProxy->firstIndexableField;
 		isBytes = interpreterProxy->isBytes;
-		isIntegerObject = interpreterProxy->isIntegerObject;
 		isPointers = interpreterProxy->isPointers;
 		isWords = interpreterProxy->isWords;
 		methodArgumentCount = interpreterProxy->methodArgumentCount;

Modified: branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c	2014-01-31 01:38:01 UTC (rev 2860)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	VMPluginCodeGenerator VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
    from
-	UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 uuid: 7e7b595f-3783-417f-b514-4f5323e0a3c1
+	UnixOSProcessPlugin * VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 uuid: 7e7b595f-3783-417f-b514-4f5323e0a3c1
  */
-static char __buildInfo[] = "UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 uuid: 7e7b595f-3783-417f-b514-4f5323e0a3c1 " __DATE__ ;
+static char __buildInfo[] = "UnixOSProcessPlugin * VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 uuid: 7e7b595f-3783-417f-b514-4f5323e0a3c1 " __DATE__ ;
 /* D T Lewis - UnixOSProcessPlugin.c translated from class
    UnixOSProcessPlugin of OSProcessPlugin version 4.3.3 Cog */
 
@@ -318,9 +318,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 (i)"
+	"UnixOSProcessPlugin * VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 (i)"
 #else
-	"UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 (e)"
+	"UnixOSProcessPlugin * VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 (e)"
 #endif
 ;
 static void *originalSigHandlers[NSIG];
@@ -731,15 +731,7 @@
 	stdOut = stackObjectValue(6);
 	stdIn = stackObjectValue(7);
 	executableFile = stackObjectValue(8);
-	if ((isIntegerObject(workingDir))
-	 || ((isIntegerObject(envOffsets))
-	 || ((isIntegerObject(envVecBuffer))
-	 || ((isIntegerObject(argOffsets))
-	 || ((isIntegerObject(argVecBuffer))
-	 || ((isIntegerObject(stdErr))
-	 || ((isIntegerObject(stdOut))
-	 || ((isIntegerObject(stdIn))
-	 || (isIntegerObject(executableFile)))))))))) {
+	if (failed()) {
 		return primitiveFailFor(PrimErrBadArgument);
 	}
 	intervalTimer.it_interval.tv_sec = 0;

Modified: branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c	2014-01-31 01:38:01 UTC (rev 2860)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	VMPluginCodeGenerator VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
    from
-	DeflatePlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514
+	DeflatePlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
  */
-static char __buildInfo[] = "DeflatePlugin VMMaker.oscog-eem.580 uuid: 751b08d4-d92e-440a-b3f6-cb2c76f52514 " __DATE__ ;
+static char __buildInfo[] = "DeflatePlugin VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220 " __DATE__ ;
 
 
 
@@ -90,7 +90,6 @@
 static sqInt (*fetchPointerofObject)(sqInt index, sqInt oop);
 static void * (*firstIndexableField)(sqInt oop);
 static sqInt (*isBytes)(sqInt oop);
-static sqInt (*isIntegerObject)(sqInt objectPointer);
 static sqInt (*isPointers)(sqInt oop);
 static sqInt (*isWords)(sqInt oop);
 static sqInt (*methodArgumentCount)(void);
@@ -114,7 +113,6 @@
 extern sqInt fetchPointerofObject(sqInt index, sqInt oop);
 extern void * firstIndexableField(sqInt oop);
 extern sqInt isBytes(sqInt oop);
-extern sqInt isIntegerObject(sqInt objectPointer);
 extern sqInt isPointers(sqInt oop);
 extern sqInt isWords(sqInt oop);
 extern sqInt methodArgumentCount(void);
@@ -136,9 +134,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"ZipPlugin VMMaker.oscog-eem.580 (i)"
+	"ZipPlugin VMMaker.oscog-eem.597 (i)"
 #else
-	"ZipPlugin VMMaker.oscog-eem.580 (e)"
+	"ZipPlugin VMMaker.oscog-eem.597 (e)"
 #endif
 ;
 static unsigned int zipBaseDistance[] = {
@@ -647,9 +645,6 @@
 		return 0;
 	}
 	oop = fetchPointerofObject(0, rcvr);
-	if (isIntegerObject(oop)) {
-		return 0;
-	}
 	if (!(isBytes(oop))) {
 		return 0;
 	}
@@ -661,22 +656,16 @@
 
 	zipReadLimit = fetchIntegerofObject(2, rcvr);
 	oop = fetchPointerofObject(4, rcvr);
-	if ((isIntegerObject(oop))
-	 || (!(isWords(oop)))) {
+	if (!((isWords(oop))
+		 && ((slotSizeOf(oop)) == DeflateHashTableSize))) {
 		return 0;
 	}
-	if (!((slotSizeOf(oop)) == DeflateHashTableSize)) {
-		return 0;
-	}
 	zipHashHead = firstIndexableField(oop);
 	oop = fetchPointerofObject(5, rcvr);
-	if ((isIntegerObject(oop))
-	 || (!(isWords(oop)))) {
+	if (!((isWords(oop))
+		 && ((slotSizeOf(oop)) == DeflateWindowSize))) {
 		return 0;
 	}
-	if (!((slotSizeOf(oop)) == DeflateWindowSize)) {
-		return 0;
-	}
 	zipHashTail = firstIndexableField(oop);
 	zipHashValue = fetchIntegerofObject(6, rcvr);
 
@@ -684,38 +673,28 @@
 
 	zipBlockPos = fetchIntegerofObject(7, rcvr);
 	oop = fetchPointerofObject(9, rcvr);
-	if ((isIntegerObject(oop))
-	 || (!(isBytes(oop)))) {
+	if (!(isBytes(oop))) {
 		return 0;
 	}
 	zipLiteralSize = slotSizeOf(oop);
 	zipLiterals = firstIndexableField(oop);
 	oop = fetchPointerofObject(10, rcvr);
-	if ((isIntegerObject(oop))
-	 || (!(isWords(oop)))) {
+	if (!((isWords(oop))
+		 && ((slotSizeOf(oop)) >= zipLiteralSize))) {
 		return 0;
 	}
-	if ((slotSizeOf(oop)) < zipLiteralSize) {
-		return 0;
-	}
 	zipDistances = firstIndexableField(oop);
 	oop = fetchPointerofObject(11, rcvr);
-	if ((isIntegerObject(oop))
-	 || (!(isWords(oop)))) {
+	if (!((isWords(oop))
+		 && ((slotSizeOf(oop)) == DeflateMaxLiteralCodes))) {
 		return 0;
 	}
-	if (!((slotSizeOf(oop)) == DeflateMaxLiteralCodes)) {
-		return 0;
-	}
 	zipLiteralFreq = firstIndexableField(oop);
 	oop = fetchPointerofObject(12, rcvr);
-	if ((isIntegerObject(oop))
-	 || (!(isWords(oop)))) {
+	if (!((isWords(oop))
+		 && ((slotSizeOf(oop)) == DeflateMaxDistanceCodes))) {
 		return 0;
 	}
-	if (!((slotSizeOf(oop)) == DeflateMaxDistanceCodes)) {
-		return 0;
-	}
 	zipDistanceFreq = firstIndexableField(oop);
 	zipLiteralCount = fetchIntegerofObject(13, rcvr);
 	zipMatchCount = fetchIntegerofObject(14, rcvr);
@@ -732,9 +711,6 @@
 		return 0;
 	}
 	oop = fetchPointerofObject(0, rcvr);
-	if (isIntegerObject(oop)) {
-		return primitiveFail();
-	}
 	if (!(isBytes(oop))) {
 		return primitiveFail();
 	}
@@ -1102,69 +1078,50 @@
 	oop = fetchPointerofObject(0, litStream);
 	litPos = fetchIntegerofObject(1, litStream);
 	litLimit = fetchIntegerofObject(2, litStream);
-	if (!((!(isIntegerObject(oop)))
-		 && ((litPos <= litLimit)
-		 && ((litLimit <= (byteSizeOf(oop)))
-		 && (isBytes(oop)))))) {
+	if (!((litPos <= litLimit)
+		 && ((isBytes(oop))
+		 && (litLimit <= (byteSizeOf(oop)))))) {
 		result = primitiveFail();
 		goto l7;
 	}
 	litArray = firstIndexableField(oop);
 	oop = fetchPointerofObject(0, distStream);
-	if (!((!(isIntegerObject(oop)))
+	if (!((isWords(oop))
+		 && ((litLimit <= (slotSizeOf(oop)))
 		 && (((fetchIntegerofObject(1, distStream)) == litPos)
-		 && ((fetchIntegerofObject(2, distStream)) == litLimit)))) {
+		 && ((fetchIntegerofObject(2, distStream)) == litLimit))))) {
 		result = primitiveFail();
 		goto l7;
 	}
-	if (!((isWords(oop))
-		 && (litLimit <= (slotSizeOf(oop))))) {
-		result = primitiveFail();
-		goto l7;
-	}
 	distArray = firstIndexableField(oop);
 	oop = fetchPointerofObject(0, litTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!(isWords(oop))) {
 		result = primitiveFail();
 		goto l7;
 	}
 	litBlCount = slotSizeOf(oop);
 	llBitLengths = firstIndexableField(oop);
 	oop = fetchPointerofObject(1, litTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!((isWords(oop))
+		 && (litBlCount == (slotSizeOf(oop))))) {
 		result = primitiveFail();
 		goto l7;
 	}
-	if (!(litBlCount == (slotSizeOf(oop)))) {
-		result = primitiveFail();
-		goto l7;
-	}
 	llCodes = firstIndexableField(oop);
 	oop = fetchPointerofObject(0, distTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!(isWords(oop))) {
 		result = primitiveFail();
 		goto l7;
 	}
 	distBlCount = slotSizeOf(oop);
 	distBitLengths = firstIndexableField(oop);
 	oop = fetchPointerofObject(1, distTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!((isWords(oop))
+		 && (distBlCount == (slotSizeOf(oop))))) {
 		result = primitiveFail();
 		goto l7;
 	}
-	if (!(distBlCount == (slotSizeOf(oop)))) {
-		result = primitiveFail();
-		goto l7;
-	}
 	distCodes = firstIndexableField(oop);
-	if (failed()) {
-		result = null;
-		goto l7;
-	}
 	/* begin nextZipBits:put: */
 	if (!((0 >= 0)
 		 && ((1 << 0) > 0))) {
@@ -1364,59 +1321,44 @@
 	oop = fetchPointerofObject(0, literalStream);
 	litPos = fetchIntegerofObject(1, literalStream);
 	litLimit = fetchIntegerofObject(2, literalStream);
-	if (!((!(isIntegerObject(oop)))
-		 && ((litPos <= litLimit)
-		 && ((litLimit <= (byteSizeOf(oop)))
-		 && (isBytes(oop)))))) {
+	if (!((litPos <= litLimit)
+		 && ((isBytes(oop))
+		 && (litLimit <= (byteSizeOf(oop)))))) {
 		return primitiveFail();
 	}
 	litArray = firstIndexableField(oop);
 	oop = fetchPointerofObject(0, distanceStream);
-	if (!((!(isIntegerObject(oop)))
+	if (!((isWords(oop))
+		 && ((litLimit <= (slotSizeOf(oop)))
 		 && (((fetchIntegerofObject(1, distanceStream)) == litPos)
-		 && ((fetchIntegerofObject(2, distanceStream)) == litLimit)))) {
+		 && ((fetchIntegerofObject(2, distanceStream)) == litLimit))))) {
 		return primitiveFail();
 	}
-	if (!((isWords(oop))
-		 && (litLimit <= (slotSizeOf(oop))))) {
-		return primitiveFail();
-	}
 	distArray = firstIndexableField(oop);
 	oop = fetchPointerofObject(0, litTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!(isWords(oop))) {
 		return primitiveFail();
 	}
 	litBlCount = slotSizeOf(oop);
 	llBitLengths = firstIndexableField(oop);
 	oop = fetchPointerofObject(1, litTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!((isWords(oop))
+		 && (litBlCount == (slotSizeOf(oop))))) {
 		return primitiveFail();
 	}
-	if (!(litBlCount == (slotSizeOf(oop)))) {
-		return primitiveFail();
-	}
 	llCodes = firstIndexableField(oop);
 	oop = fetchPointerofObject(0, distTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!(isWords(oop))) {
 		return primitiveFail();
 	}
 	distBlCount = slotSizeOf(oop);
 	distBitLengths = firstIndexableField(oop);
 	oop = fetchPointerofObject(1, distTree);
-	if (!((!(isIntegerObject(oop)))
-		 && (isWords(oop)))) {
+	if (!((isWords(oop))
+		 && (distBlCount == (slotSizeOf(oop))))) {
 		return primitiveFail();
 	}
-	if (!(distBlCount == (slotSizeOf(oop)))) {
-		return primitiveFail();
-	}
 	distCodes = firstIndexableField(oop);
-	if (failed()) {
-		return null;
-	}
 	/* begin nextZipBits:put: */
 	if (!((0 >= 0)
 		 && ((1 << 0) > 0))) {
@@ -1591,7 +1533,6 @@
 		fetchPointerofObject = interpreterProxy->fetchPointerofObject;
 		firstIndexableField = interpreterProxy->firstIndexableField;
 		isBytes = interpreterProxy->isBytes;
-		isIntegerObject = interpreterProxy->isIntegerObject;
 		isPointers = interpreterProxy->isPointers;
 		isWords = interpreterProxy->isWords;
 		methodArgumentCount = interpreterProxy->methodArgumentCount;

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2014-01-31 01:38:01 UTC (rev 2860)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.594 uuid: dc0cca0d-8f63-4da1-a647-94be0840104b
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
    from
-	CoInterpreter VMMaker.oscog-eem.594 uuid: dc0cca0d-8f63-4da1-a647-94be0840104b
+	CoInterpreter VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.594 uuid: dc0cca0d-8f63-4da1-a647-94be0840104b " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1084,6 +1084,7 @@
 void printFrameWithSP(char *theFP, char *theSP);
 void printHex(sqInt n);
 void printInstancesOf(sqInt aClassOop);
+void printLikelyImplementorsOfSelector(sqInt selector);
 static void printLogEntryAt(sqInt i);
 void printMemory(void);
 void printMethodCache(void);
@@ -1143,7 +1144,7 @@
 static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
 static sqInt roomToPushNArgs(sqInt n);
 static void runLeakCheckerForFullGC(sqInt fullGCFlag);
-static sqInt safeObjectAfter(sqInt oop);
+static usqInt safeObjectAfter(sqInt oop);
 static sqInt safePrintStringOf(sqInt oop);
 usqInt scavengeThresholdAddress(void);
 EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -1323,6 +1324,7 @@
 _iss sqInt lastCoggableInterpretedBlockMethod;
 _iss sqInt lastUncoggableInterpretedBlockMethod;
 _iss sqInt lowSpaceThreshold;
+_iss sqInt metaclassNumSlots;
 _iss sqInt rootTableOverflowed;
 _iss usqLong statGCEndUsecs;
 _iss sqInt statSweepCount;
@@ -1330,7 +1332,6 @@
 _iss usqInt compEnd;
 _iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
-_iss sqInt metaclassNumSlots;
 _iss sqInt pendingFinalizationSignals;
 _iss sqInt statIOProcessEvents;
 _iss sqInt edenBytes;
@@ -2029,7 +2030,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.594";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.597";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -23705,17 +23706,15 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
-    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    sqInt next;
+    usqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;
-    sqInt sz3;
     sqInt target;
     usqInt w;
 
@@ -23726,21 +23725,7 @@
 		/* begin objectAfterWhileForwarding: */
 		header2 = longAt(oop);
 		if ((header2 & MarkBit) == 0) {
-			/* begin objectAfter: */
-			if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
-				error("no objects after the end of memory");
-			}
-			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
-				sz2 = (longAt(oop)) & AllButTypeMask;
-			}
-			else {
-				/* begin sizeBitsOf: */
-				header3 = longAt(oop);
-				sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
-					? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
-					: header3 & SizeMask);
-			}
-			next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
+			next = ((sqInt) (objectAfter(oop)));
 			goto l1;
 		}
 		fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -23755,7 +23740,7 @@
 		else {
 			sz1 = realHeader & SizeMask;
 		}
-		next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
+		next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
 	l1:	/* end objectAfterWhileForwarding: */;
 		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
 
@@ -23809,18 +23794,18 @@
 	}
 	/* begin safeObjectAfter: */
 	if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
-		sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
+		sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
 	}
 	else {
 		/* begin sizeBitsOf: */
-		header4 = longAt(newFreeChunk);
-		sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
+		header3 = longAt(newFreeChunk);
+		sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
 			? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
-			: header4 & SizeMask);
+			: header3 & SizeMask);
 	}
-	next = ((newFreeChunk + sz3) >= GIV(freeStart)
+	next = ((newFreeChunk + sz2) >= GIV(freeStart)
 		? GIV(freeStart)
-		: (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
+		: (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
 	assert((next == GIV(freeStart))
 	 || (next == (oopFromChunk(GIV(compEnd)))));
 	if (next == GIV(freeStart)) {
@@ -27643,6 +27628,7 @@
 			: theFP + FoxIFReceiver);
 		while (theSP <= frameRcvrOffset) {
 			oop = longAt(theSP);
+			
 			if (!((oop & 1))) {
 				markAndTrace(oop);
 			}
@@ -27678,6 +27664,7 @@
 	theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
 	while (theSP <= ((thePage->baseAddress))) {
 		oop = longAt(theSP);
+		
 		if (!((oop & 1))) {
 			markAndTrace(oop);
 		}
@@ -36973,7 +36960,9 @@
 	hScale = 0.0;
 l5:	/* end floatValueOf: */;
 	rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord));
-	if ((rcvr & 1)) {
+	if (!((((rcvr & 1) == 0)
+ && (((((usqInt) (longAt(rcvr))) >> (instFormatFieldLSB())) & 15) <= 4))
+		 && ((lengthOf(rcvr)) >= 4))) {
 		/* begin success: */
 		
 		/* Don't overwrite an error code that has already been set. */
@@ -36984,20 +36973,6 @@
 
 	}
 	if (!GIV(primFailCode)) {
-		if (!((((rcvr & 1) == 0)
- && (((((usqInt) (longAt(rcvr))) >> (instFormatFieldLSB())) & 15) <= 4))
-			 && ((lengthOf(rcvr)) >= 4))) {
-			/* begin success: */
-			
-			/* Don't overwrite an error code that has already been set. */
-
-			if (!GIV(primFailCode)) {
-				GIV(primFailCode) = 1;
-			}
-
-		}
-	}
-	if (!GIV(primFailCode)) {
 		bitsArray = longAt((rcvr + BaseHeaderSize) + (0 << ShiftForWord));
 		w = fetchIntegerofObject(1, rcvr);
 		h = fetchIntegerofObject(2, rcvr);
@@ -37015,9 +36990,8 @@
 		}
 		pixelsPerWord = 32 / depth;
 		wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord;
-		if ((!((rcvr & 1)))
-		 && (((bitsArray & 1) == 0)
-		 && (isWordsOrBytesNonImm(bitsArray)))) {
+		if (((bitsArray & 1) == 0)
+		 && (isWordsOrBytesNonImm(bitsArray))) {
 			bitsArraySize = byteLengthOf(bitsArray);
 			/* begin success: */
 			if (!(bitsArraySize == ((wordsPerLine * h) * 4))) {
@@ -37041,8 +37015,7 @@
 		}
 	}
 	if (!GIV(primFailCode)) {
-		ok = ioFormPrint(bitsArray + 4, w, h, depth, hScale, vScale, landscapeFlag);
-
+		ok = ioFormPrint(bitsArray + BaseHeaderSize, w, h, depth, hScale, vScale, landscapeFlag);
 		/* begin success: */
 		if (!ok) {
 
@@ -47133,6 +47106,223 @@
 	}
 }
 
+
+/*	Print all methods whose penultimate literal is either selector,
+	or an object whose first inst var is the method and whose
+	second is selector (e.g. an AdditionalMethodState). */
+
+void
+printLikelyImplementorsOfSelector(sqInt selector)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt aByte;
+    sqInt ccIndex;
+    sqInt ccIndex1;
+    sqInt chunk;
+    sqInt classOop;
+    sqInt fwdBlock;
+    sqInt header;
+    sqInt header1;
+    sqInt i;
+    sqInt methodClassAssociation;
+    char *name;
+    sqInt nameLen;
+    sqInt obj;
+    sqInt offset;
+    sqInt offset1;
+    sqInt oop;
+    sqInt oop1;
+    sqInt penultimateLiteral;
+    sqInt realHeader;
+    sqInt sz;
+    sqInt sz1;
+
+	/* begin allObjectsDo: */
+	/* begin oopFromChunk: */
+	chunk = startOfMemory();
+	oop = chunk + (headerTypeBytes[(longAt(chunk)) & TypeMask]);
+	while (oop < GIV(freeStart)) {
+		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
+			if (((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) >= 12) {
+				/* begin penultimateLiteralOf: */
+				assert(isOopCompiledMethod(oop));
+				/* begin literal:ofMethod: */
+				offset1 = (literalCountOfHeader(headerOf(oop))) - 2;
+				penultimateLiteral = longAt((oop + BaseHeaderSize) + ((offset1 + LiteralStart) << ShiftForWord));
+				if ((penultimateLiteral == selector)
+				 || ((((penultimateLiteral & 1) == 0)
+ && (((((usqInt) (longAt(penultimateLiteral))) >> (instFormatFieldLSB())) & 15) <= 4))
+				 && (((numSlotsOf(penultimateLiteral)) >= 2)
+				 && (((longAt((penultimateLiteral + BaseHeaderSize) + (0 << ShiftForWord))) == oop)
+				 && ((longAt((penultimateLiteral + BaseHeaderSize) + (1 << ShiftForWord))) == selector))))) {
+
+					/* try and print the key of the method class association (the name of the implementing class) */
+
+					/* begin literal:ofMethod: */
+					offset = (literalCountOfHeader(headerOf(oop))) - 1;
+					methodClassAssociation = longAt((oop + BaseHeaderSize) + ((offset + LiteralStart) << ShiftForWord));
+					/* begin printHexnp: */
+					printf("0x%x", oop);
+					/* begin space */
+					/* begin printChar: */
+					putchar(' ');
+					/* begin printOopShortInner: */
+					oop1 = ((((methodClassAssociation & 1) == 0)
+ && (((((usqInt) (longAt(methodClassAssociation))) >> (instFormatFieldLSB())) & 15) <= 4))
+					 && ((numSlotsOf(methodClassAssociation)) >= 2)
+						? longAt((methodClassAssociation + BaseHeaderSize) + (0 << ShiftForWord))
+						: methodClassAssociation);
+					if ((oop1 & 1)) {
+						;
+						printNum((oop1 >> 1));
+						/* begin printChar: */
+						putchar('(');
+						printHex((oop1 >> 1));
+						/* begin printChar: */
+						putchar(')');
+
+						goto l3;
+					}
+					if (!(((oop1 & 3) == 0)
+						 && (((((usqInt)oop1)) >= (startOfMemory()))
+						 && (((((usqInt)oop1)) < GIV(freeStart))
+						 && (((longAt(oop1)) & TypeMask) != HeaderTypeGC))))) {
+						print(((oop1 & (BytesPerWord - 1)) != 0
+							? " is misaligned"
+							: " is not on the heap"));
+						goto l3;
+					}
+					
+					if (((oop1 & 1) == 0)
+					 && (ClassFloatCompactIndex == ((((usqInt) (longAt(oop1))) >> 12) & 0x1F))) {
+						printFloat(dbgFloatValueOf(oop1));
+						goto l3;
+					}
+					classOop = (((ccIndex = (((usqInt) (longAt(oop1))) >> 12) & 0x1F)) == 0
+						? (longAt(oop1 - BaseHeaderSize)) & AllButTypeMask
+						: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)));
+					if (!(((classOop & 3) == 0)
+						 && (((((usqInt)classOop)) >= (startOfMemory()))
+						 && (((((usqInt)classOop)) < GIV(freeStart))
+						 && (((longAt(classOop)) & TypeMask) != HeaderTypeGC))))) {
+						print("a ??");
+						goto l3;
+					}
+					if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) {
+						printNameOfClasscount(oop1, 5);
+						goto l3;
+					}
+					if (oop1 == GIV(nilObj)) {
+						print("nil");
+						goto l3;
+					}
+					if (oop1 == GIV(trueObj)) {
+						print("true");
+						goto l3;
+					}
+					if (oop1 == GIV(falseObj)) {
+						print("false");
+						goto l3;
+					}
+					nameLen = lengthOfNameOfClass(classOop);
+					if (nameLen == 0) {
+						print("a ??");
+						goto l3;
+					}
+					name = nameOfClass(classOop);
+					if (nameLen == 10) {
+						if (!(strncmp(name, "ByteString", 10))) {
+
+							/* strncmp is weird */
+
+							/* begin printChar: */
+							putchar('\'');
+							printStringOf(oop1);
+							/* begin printChar: */
+							putchar('\'');
+
+							goto l3;
+						}
+						if (!(strncmp(name, "ByteSymbol", 10))) {
+
+							/* strncmp is weird */
+
+							/* begin printChar: */
+							putchar('#');
+							printStringOf(oop1);
+							goto l3;
+						}
+					}
+					if ((nameLen == 9)
+					 && (!(strncmp(name, "Character", 9)))) {
+						/* begin printChar: */
+						putchar('$');
+						/* begin printChar: */
+						putchar(((longAt((oop1 + BaseHeaderSize) + (0 << ShiftForWord))) >> 1));
+
+						goto l3;
+					}
+					print("a(n) ");
+					for (i = 0; i < nameLen; i += 1) {
+						/* begin printChar: */
+						putchar(name[i]);
+					}
+					if (((instanceSizeOf(classOop)) == (ValueIndex + 1))
+					 && (((longAt((classOop + BaseHeaderSize) + (SuperclassIndex << ShiftForWord))) == (superclassOf((((ccIndex1 = (((usqInt) (longAt(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))))) >> 12) & 0x1F)) == 0
+	? (longAt((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) - BaseHeaderSize)) & AllButTypeMask
+	: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex1 - 1) << ShiftForWord))))))
+					 && ((((longAt((oop1 + BaseHeaderSize) + (KeyIndex << ShiftForWord))) & 1) == 0)
+					 && (((((usqInt) (longAt(longAt((oop1 + BaseHeaderSize) + (KeyIndex << ShiftForWord))))) >> (instFormatFieldLSB())) & 15) >= 8)))) {
+						/* begin space */
+						/* begin printChar: */
+						putchar(' ');
+						printOopShort(longAt((oop1 + BaseHeaderSize) + (KeyIndex << ShiftForWord)));
+						print(" -> ");
+						printHex(longAt((oop1 + BaseHeaderSize) + (ValueIndex << ShiftForWord)));
+					}
+				l3:	/* end printOopShortInner: */;
+					/* begin cr */
+					printf("\n");
+				}
+			}
+
+		}
+		/* begin objectAfterWhileForwarding: */
+		header = longAt(oop);
+		if ((header & MarkBit) == 0) {
+			/* begin objectAfter: */
+			if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
+				error("no objects after the end of memory");
+			}
+			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
+				sz1 = (longAt(oop)) & AllButTypeMask;
+			}
+			else {
+				/* begin sizeBitsOf: */
+				header1 = longAt(oop);
+				sz1 = ((header1 & TypeMask) == HeaderTypeSizeAndClass
+					? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
+					: header1 & SizeMask);
+			}
+			oop = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
+			goto l1;
+		}
+		fwdBlock = (header & AllButMarkBitAndTypeMask) << 1;
+		assert(fwdBlockValid(fwdBlock));
+
+		/* following code is like sizeBitsOf: */
+
+		realHeader = longAt(fwdBlock + BytesPerWord);
+		if ((realHeader & TypeMask) == HeaderTypeSizeAndClass) {
+			sz = (longAt(oop - (BytesPerWord * 2))) & LongSizeMask;
+		}
+		else {
+			sz = realHeader & SizeMask;
+		}
+		oop = (oop + sz) + (headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
+	l1:	/* end objectAfterWhileForwarding: */;
+	}
+}
+
 static void
 printLogEntryAt(sqInt i)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
@@ -50002,7 +50192,7 @@
 	given object or free chunk in memory. Return freeStart when
 	enumeration is complete. This is for assertion checking only. */
 
-static sqInt
+static usqInt
 safeObjectAfter(sqInt oop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt header;

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2014-01-31 01:38:01 UTC (rev 2860)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.594 uuid: dc0cca0d-8f63-4da1-a647-94be0840104b
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
  */
 
 
@@ -174,6 +174,7 @@
 void printFrameWithSP(char *theFP, char *theSP);
 void printHex(sqInt n);
 void printInstancesOf(sqInt aClassOop);
+void printLikelyImplementorsOfSelector(sqInt selector);
 void printMethodCache(void);
 void printMethodCacheFor(sqInt thing);
 void printMethodDictionaryOf(sqInt behavior);

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-01-29 01:37:18 UTC (rev 2859)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-01-31 01:38:01 UTC (rev 2860)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.594 uuid: dc0cca0d-8f63-4da1-a647-94be0840104b
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
    from
-	CoInterpreter VMMaker.oscog-eem.594 uuid: dc0cca0d-8f63-4da1-a647-94be0840104b
+	CoInterpreter VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.594 uuid: dc0cca0d-8f63-4da1-a647-94be0840104b " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.597 uuid: c9a71dd4-c394-4a8f-aa4d-a6d4dc3ff220 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1087,6 +1087,7 @@
 void printFrameWithSP(char *theFP, char *theSP);
 void printHex(sqInt n);
 void printInstancesOf(sqInt aClassOop);
+void printLikelyImplementorsOfSelector(sqInt selector);
 static void printLogEntryAt(sqInt i);
 void printMemory(void);
 void printMethodCache(void);
@@ -1146,7 +1147,7 @@
 static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
 static sqInt roomToPushNArgs(sqInt n);
 static void runLeakCheckerForFullGC(sqInt fullGCFlag);
-static sqInt safeObjectAfter(sqInt oop);
+static usqInt safeObjectAfter(sqInt oop);
 static sqInt safePrintStringOf(sqInt oop);
 usqInt scavengeThresholdAddress(void);
 EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -1326,6 +1327,7 @@
 _iss sqInt lastCoggableInterpretedBlockMethod;
 _iss sqInt lastUncoggableInterpretedBlockMethod;
 _iss sqInt lowSpaceThreshold;
+_iss sqInt metaclassNumSlots;
 _iss sqInt rootTableOverflowed;
 _iss usqLong statGCEndUsecs;
 _iss sqInt statSweepCount;
@@ -1333,7 +1335,6 @@
 _iss usqInt compEnd;
 _iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
-_iss sqInt metaclassNumSlots;
 _iss sqInt pendingFinalizationSignals;
 _iss sqInt statIOProcessEvents;
 _iss sqInt edenBytes;
@@ -2032,7 +2033,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.594";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.597";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -23714,17 +23715,15 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
-    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    sqInt next;
+    usqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;
-    sqInt sz3;
     sqInt target;
     usqInt w;
 
@@ -23735,21 +23734,7 @@
 		/* begin objectAfterWhileForwarding: */
 		header2 = longAt(oop);
 		if ((header2 & MarkBit) == 0) {
-			/* begin objectAfter: */
-			if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
-				error("no objects after the end of memory");
-			}
-			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
-				sz2 = (longAt(oop)) & AllButTypeMask;
-			}
-			else {
-				/* begin sizeBitsOf: */
-				header3 = longAt(oop);
-				sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
-					? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
-					: header3 & SizeMask);
-			}
-			next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
+			next = ((sqInt) (objectAfter(oop)));
 			goto l1;
 		}
 		fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -23764,7 +23749,7 @@
 		else {
 			sz1 = realHeader & SizeMask;
 		}
-		next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
+		next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
 	l1:	/* end objectAfterWhileForwarding: */;
 		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
 
@@ -23818,18 +23803,18 @@
 	}
 	/* begin safeObjectAfter: */
 	if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
-		sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
+		sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
 	}
 	else {
 		/* begin sizeBitsOf: */
-		header4 = longAt(newFreeChunk);
-		sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
+		header3 = longAt(newFreeChunk);
+		sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
 			? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
-			: header4 & SizeMask);
+			: header3 & SizeMask);
 	}
-	next = ((newFreeChunk + sz3) >= GIV(freeStart)
+	next = ((newFreeChunk + sz2) >= GIV(freeStart)
 		? GIV(freeStart)
-		: (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
+		: (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
 	assert((next == GIV(freeStart))
 	 || (next == (oopFromChunk(GIV(compEnd)))));
 	if (next == GIV(freeStart)) {
@@ -27652,6 +27637,7 @@
 			: theFP + FoxIFReceiver);
 		while (theSP <= frameRcvrOffset) {
 			oop = longAt(theSP);
+			
 			if (!((oop & 1))) {
 				markAndTrace(oop);
 			}
@@ -27687,6 +27673,7 @@
 	theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
 	while (theSP <= ((thePage->baseAddress))) {
 		oop = longAt(theSP);
+		
 		if (!((oop & 1))) {
 			markAndTrace(oop);
 		}
@@ -36982,7 +36969,9 @@
 	hScale = 0.0;
 l5:	/* end floatValueOf: */;
 	rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord));
-	if ((rcvr & 1)) {
+	if (!((((rcvr & 1) == 0)
+ && (((((usqInt) (longAt(rcvr))) >> (instFormatFieldLSB())) & 15) <= 4))
+		 && ((lengthOf(rcvr)) >= 4))) {
 		/* begin success: */
 		
 		/* Don't overwrite an error code that has already been set. */
@@ -36993,20 +36982,6 @@
 
 	}
 	if (!GIV(primFailCode)) {
-		if (!((((rcvr & 1) == 0)
- && (((((usqInt) (longAt(rcvr))) >> (instFormatFieldLSB())) & 15) <= 4))
-			 && ((lengthOf(rcvr)) >= 4))) {
-			/* begin success: */
-			
-			/* Don't overwrite an error code that has already been set. */
-
-			if (!GIV(primFailCode)) {
-				GIV(primFailCode) = 1;
-			}
-
-		}
-	}
-	if (!GIV(primFailCode)) {
 		bitsArray = longAt((rcvr + BaseHeaderSize) + (0 << ShiftForWord));
 		w = fetchIntegerofObject(1, rcvr);
 		h = fetchIntegerofObject(2, rcvr);
@@ -37024,9 +36999,8 @@
 		}
 		pixelsPerWord = 32 / depth;
 		wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord;
-		if ((!((rcvr & 1)))
-		 && (((bitsArray & 1) == 0)
-		 && (isWordsOrBytesNonImm(bitsArray)))) {
+		if (((bitsArray & 1) == 0)
+		 && (isWordsOrBytesNonImm(bitsArray))) {
 			bitsArraySize = byteLengthOf(bitsArray);
 			/* begin success: */
 			if (!(bitsArraySize == ((wordsPerLine * h) * 4))) {
@@ -37050,8 +37024,7 @@
 		}
 	}
 	if (!GIV(primFailCode)) {
-		ok = ioFormPrint(bitsArray + 4, w, h, depth, hScale, vScale, landscapeFlag);
-
+		ok = ioFormPrint(bitsArray + BaseHeaderSize, w, h, depth, hScale, vScale, landscapeFlag);
 		/* begin success: */
 		if (!ok) {
 
@@ -47142,6 +47115,223 @@
 	}
 }
 
+
+/*	Print all methods whose penultimate literal is either selector,
+	or an object whose first inst var is the method and whose
+	second is selector (e.g. an AdditionalMethodState). */
+
+void
+printLikelyImplementorsOfSelector(sqInt selector)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt aByte;
+    sqInt ccIndex;
+    sqInt ccIndex1;
+    sqInt chunk;
+    sqInt classOop;
+    sqInt fwdBlock;
+    sqInt header;
+    sqInt header1;
+    sqInt i;
+    sqInt methodClassAssociation;
+    char *name;
+    sqInt nameLen;
+    sqInt obj;
+    sqInt offset;
+    sqInt offset1;
+    sqInt oop;
+    sqInt oop1;
+    sqInt penultimateLiteral;
+    sqInt realHeader;
+    sqInt sz;
+    sqInt sz1;
+
+	/* begin allObjectsDo: */
+	/* begin oopFromChunk: */
+	chunk = startOfMemory();
+	oop = chunk + (headerTypeBytes[(longAt(chunk)) & TypeMask]);
+	while (oop < GIV(freeStart)) {
+		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
+			if (((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) >= 12) {
+				/* begin penultimateLiteralOf: */
+				assert(isOopCompiledMethod(oop));
+				/* begin literal:ofMethod: */
+				offset1 = (literalCountOfHeader(headerOf(oop))) - 2;
+				penultimateLiteral = longAt((oop + BaseHeaderSize) + ((offset1 + LiteralStart) << ShiftForWord));
+				if ((penultimateLiteral == selector)
+				 || ((((penultimateLiteral & 1) == 0)
+ && (((((usqInt) (longAt(penultimateLiteral))) >> (instFormatFieldLSB())) & 15) <= 4))
+				 && (((numSlotsOf(penultimateLiteral)) >= 2)
+				 && (((longAt((penultimateLiteral + BaseHeaderSize) + (0 << ShiftForWord))) == oop)
+				 && ((longAt((penultimateLiteral + BaseHeaderSize) + (1 << ShiftForWord))) == selector))))) {
+
+					/* try and print the key of the method class association (the name of the implementing class) */
+
+					/* begin literal:ofMethod: */
+					offset = (literalCountOfHeader(headerOf(oop))) - 1;
+					methodClassAssociation = longAt((oop + BaseHeaderSize) + ((offset + LiteralStart) << ShiftForWord));
+					/* begin printHexnp: */
+					printf("0x%x", oop);
+					/* begin space */
+					/* begin printChar: */
+					putchar(' ');
+					/* begin printOopShortInner: */
+					oop1 = ((((methodClassAssociation & 1) == 0)
+ && (((((usqInt) (longAt(methodClassAssociation))) >> (instFormatFieldLSB())) & 15) <= 4))
+					 && ((numSlotsOf(methodClassAssociation)) >= 2)
+						? longAt((methodClassAssociation + BaseHeaderSize) + (0 << ShiftForWord))
+						: methodClassAssociation);
+					if ((oop1 & 1)) {
+						;
+						printNum((oop1 >> 1));
+						/* begin printChar: */
+						putchar('(');
+						printHex((oop1 >> 1));
+						/* begin printChar: */
+						putchar(')');
+
+						goto l3;
+					}
+					if (!(((oop1 & 3) == 0)
+						 && (((((usqInt)oop1)) >= (startOfMemory()))
+						 && (((((usqInt)oop1)) < GIV(freeStart))
+						 && (((longAt(oop1)) & TypeMask) != HeaderTypeGC))))) {
+						print(((oop1 & (BytesPerWord - 1)) != 0
+							? " is misaligned"
+							: " is not on the heap"));
+						goto l3;
+					}
+					
+					if (((oop1 & 1) == 0)
+					 && (ClassFloatCompactIndex == ((((usqInt) (longAt(oop1))) >> 12) & 0x1F))) {
+						printFloat(dbgFloatValueOf(oop1));
+						goto l3;
+					}
+					classOop = (((ccIndex = (((usqInt) (longAt(oop1))) >> 12) & 0x1F)) == 0
+						? (longAt(oop1 - BaseHeaderSize)) & AllButTypeMask
+						: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)));
+					if (!(((classOop & 3) == 0)
+						 && (((((usqInt)classOop)) >= (startOfMemory()))
+						 && (((((usqInt)classOop)) < GIV(freeStart))
+						 && (((longAt(classOop)) & TypeMask) != HeaderTypeGC))))) {
+						print("a ??");
+						goto l3;
+					}
+					if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) {
+						printNameOfClasscount(oop1, 5);
+						goto l3;
+					}
+					if (oop1 == GIV(nilObj)) {
+						print("nil");
+						goto l3;
+					}
+					if (oop1 == GIV(trueObj)) {
+						print("true");
+						goto l3;
+					}
+					if (oop1 == GIV(falseObj)) {
+						print("false");
+						goto l3;
+					}
+					nameLen = lengthOfNameOfClass(classOop);
+					if (nameLen == 0) {
+						print("a ??");
+						goto l3;
+					}
+					name = nameOfClass(classOop);
+					if (nameLen == 10) {
+						if (!(strncmp(name, "ByteString", 10))) {
+
+							/* strncmp is weird */
+
+							/* begin printChar: */
+							putchar('\'');
+							printStringOf(oop1);
+							/* begin printChar: */
+							putchar('\'');
+
+							goto l3;
+						}
+						if (!(strncmp(name, "ByteSymbol", 10))) {
+
+							/* strncmp is weird */
+
+							/* begin printChar: */
+							putchar('#');
+							printStringOf(oop1);
+							goto l3;
+						}
+					}
+					if ((nameLen == 9)
+					 && (!(strncmp(name, "Character", 9)))) {
+						/* begin printChar: */
+						putchar('$');
+						/* begin printChar: */
+						putchar(((longAt((oop1 + BaseHeaderSize) + (0 << ShiftForWord))) >> 1));
+
+						goto l3;
+					}
+					print("a(n) ");
+					for (i = 0; i < nameLen; i += 1) {
+						/* begin printChar: */
+						putchar(name[i]);
+					}
+					if (((instanceSizeOf(classOop)) == (ValueIndex + 1))
+					 && (((longAt((classOop + BaseHeaderSize) + (SuperclassIndex << ShiftForWord))) == (superclassOf((((ccIndex1 = (((usqInt) (longAt(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))))) >> 12) & 0x1F)) == 0
+	? (longAt((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) - BaseHeaderSize)) & AllButTypeMask
+	: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex1 - 1) << ShiftForWord))))))
+					 && ((((longAt((oop1 + BaseHeaderSize) + (KeyIndex << ShiftForWord))) & 1) == 0)
+					 && (((((usqInt) (longAt(longAt((oop1 + BaseHeaderSize) + (KeyIndex << ShiftForWord))))) >> (instFormatFieldLSB())) & 15) >= 8)))) {
+						/* begin space */
+						/* begin printChar: */
+						putchar(' ');
+						printOopShort(longAt((oop1 + BaseHeaderSize) + (KeyIndex << ShiftForWord)));
+						print(" -> ");
+						printHex(longAt((oop1 + BaseHeaderSize) + (ValueIndex << ShiftForWord)));
+					}
+				l3:	/* end printOopShortInner: */;
+					/* begin cr */
+					printf("\n");
+				}
+			}
+
+		}
+		/* begin objectAfterWhileForwarding: */
+		header = longAt(oop);
+		if ((header & MarkBit) == 0) {
+			/* begin objectAfter: */
+			if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
+				error("no objects after the end of memory");
+			}
+			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
+				sz1 = (longAt(oop)) & AllButTypeMask;
+			}
+			else {
+				/* begin sizeBitsOf: */
+				header1 = longAt(oop);
+				sz1 = ((header1 & TypeMask) == HeaderTypeSizeAndClass
+					? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
+					: header1 & SizeMask);
+			}
+			oop = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
+			goto l1;
+		}
+		fwdBlock = (header & AllButMarkBitAndTypeMask) << 1;
+		assert(fwdBlockValid(fwdBlock));
+
+		/* following code is like sizeBitsOf: */
+
+		realHeader = longAt(fwdBlock + BytesPerWord);
+		if ((realHeader & TypeMask) == HeaderTypeSizeAndClass) {
+			sz = (longAt(oop - (BytesPerWord * 2))) & LongSizeMask;
+		}
+		else {
+			sz = realHeader & SizeMask;
+		}
+		oop = (oop + sz) + (headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
+	l1:	/* end objectAfterWhileForwarding: */;
+	}
+}
+
 static void
 printLogEntryAt(sqInt i)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
@@ -50011,7 +50201,7 @@
 	given object or free chunk in memory. Return freeStart when
 	enumeration is complete. This is for assertion checking only. */
 
-static sqInt
+static usqInt
 safeObjectAfter(sqInt oop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt header;

Modified: branches/Cog/nscogsrc/vm/interp.h

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list