[Vm-dev] [commit] r2552 - CogVM source as per VMMakerr.oscog-eem.159

commits at squeakvm.org commits at squeakvm.org
Wed May 2 23:13:03 UTC 2012


Author: eliot
Date: 2012-05-02 16:13:02 -0700 (Wed, 02 May 2012)
New Revision: 2552

Removed:
   branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.c
   branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.h
Modified:
   branches/Cog/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj
   branches/Cog/nscogsrc/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c
   branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
   branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c
   branches/Cog/nscogsrc/vm/cogit.c
   branches/Cog/nscogsrc/vm/cogit.h
   branches/Cog/nscogsrc/vm/cogmethod.h
   branches/Cog/nscogsrc/vm/cointerp.c
   branches/Cog/nscogsrc/vm/cointerp.h
   branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
   branches/Cog/nscogsrc/vm/interp.h
   branches/Cog/nscogsrc/vm/vmCallback.h
   branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
   branches/Cog/platforms/Mac OS/vm/sqMacEncoding.c
   branches/Cog/platforms/Mac OS/vm/sqMacMain.c
   branches/Cog/platforms/Mac OS/vm/sqMacUIEventsUniversal.c
   branches/Cog/platforms/unix/plugins/SocketPlugin/sqUnixSocket.c
   branches/Cog/platforms/unix/vm/sqUnixMain.c
   branches/Cog/src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c
   branches/Cog/src/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c
   branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
   branches/Cog/src/plugins/Klatt/Klatt.c
   branches/Cog/src/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c
   branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c
   branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c
   branches/Cog/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
   branches/Cog/src/vm/cogit.c
   branches/Cog/src/vm/cogit.h
   branches/Cog/src/vm/cogmethod.h
   branches/Cog/src/vm/cointerp.c
   branches/Cog/src/vm/cointerp.h
   branches/Cog/src/vm/cointerpmt.c
   branches/Cog/src/vm/cointerpmt.h
   branches/Cog/src/vm/gcc3x-cointerp.c
   branches/Cog/src/vm/gcc3x-cointerpmt.c
   branches/Cog/src/vm/interp.h
   branches/Cog/src/vm/vmCallback.h
   branches/Cog/stackbuild/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj
   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
Log:
CogVM source as per VMMakerr.oscog-eem.159
Plugins:
Fix ThreadedFFIPlugin's preambleCCode for Pharo's mingw config.
Merge fix for JPEGReadWriter2Plugin (http://bugs.squeak.org/view.php?id=7691)
Merge with VMMaker version s of plugins
	JPEGReaderPlugin,
	KlattSynthesizerPlugin
	Matrix2x3Plugin
	Mpeg3Plugin (and hence lose some support files)

Fix limitation in platforms/unix/plugins/SocketPlugin/sqUnixSocket.c which could
cause NetNameResolver localHostAddress to answer 0 (if host has a set hostname
not being honoured by local DNS servers).  Fix falls back to localhost.

Fix shift-enclose on Mac by translating to shifted unicode via UCKeyTranslate.

Allow unix & mac plats to write crash.log to current directory if compiled with
CRASH_DUMP_IN_CWD. (still need to fix Win).


Modified: branches/Cog/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj
===================================================================
--- branches/Cog/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj	2012-05-02 23:13:02 UTC (rev 2552)
@@ -37,7 +37,6 @@
 		A2181C3810814EC700B8FC7A /* seek.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C0810814EC700B8FC7A /* seek.c */; };
 		A2181C3910814EC700B8FC7A /* slice.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C0910814EC700B8FC7A /* slice.c */; };
 		A2181C3A10814EC700B8FC7A /* vlc.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C0B10814EC700B8FC7A /* vlc.c */; };
-		A2181C421081506400B8FC7A /* sqMacFileBits.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C401081506400B8FC7A /* sqMacFileBits.c */; };
 		A2181C46108150C800B8FC7A /* Mpeg3Plugin.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C45108150C800B8FC7A /* Mpeg3Plugin.c */; };
 /* End PBXBuildFile section */
 
@@ -102,8 +101,6 @@
 		A2181C0A10814EC700B8FC7A /* slice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = slice.h; sourceTree = "<group>"; };
 		A2181C0B10814EC700B8FC7A /* vlc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vlc.c; sourceTree = "<group>"; };
 		A2181C0C10814EC700B8FC7A /* vlc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vlc.h; sourceTree = "<group>"; };
-		A2181C401081506400B8FC7A /* sqMacFileBits.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sqMacFileBits.c; path = "../../platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.c"; sourceTree = SOURCE_ROOT; };
-		A2181C411081506400B8FC7A /* sqMacFileBits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sqMacFileBits.h; path = "../../platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.h"; sourceTree = SOURCE_ROOT; };
 		A2181C45108150C800B8FC7A /* Mpeg3Plugin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Mpeg3Plugin.c; path = ../../src/plugins/Mpeg3Plugin/Mpeg3Plugin.c; sourceTree = SOURCE_ROOT; };
 		A2181C491081511C00B8FC7A /* Mpeg3Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mpeg3Plugin.h; path = ../../platforms/Cross/plugins/Mpeg3Plugin/Mpeg3Plugin.h; sourceTree = SOURCE_ROOT; };
 /* End PBXFileReference section */
@@ -135,8 +132,6 @@
 			children = (
 				A2181C491081511C00B8FC7A /* Mpeg3Plugin.h */,
 				A2181C45108150C800B8FC7A /* Mpeg3Plugin.c */,
-				A2181C401081506400B8FC7A /* sqMacFileBits.c */,
-				A2181C411081506400B8FC7A /* sqMacFileBits.h */,
 				A2181BC610814EC700B8FC7A /* libmpeg */,
 				A2181BC510814EA000B8FC7A /* config.h */,
 				A2181BC410814E7000B8FC7A /* interp.h */,
@@ -331,7 +326,6 @@
 				A2181C3810814EC700B8FC7A /* seek.c in Sources */,
 				A2181C3910814EC700B8FC7A /* slice.c in Sources */,
 				A2181C3A10814EC700B8FC7A /* vlc.c in Sources */,
-				A2181C421081506400B8FC7A /* sqMacFileBits.c in Sources */,
 				A2181C46108150C800B8FC7A /* Mpeg3Plugin.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Modified: branches/Cog/nscogsrc/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	JPEGReadWriter2Plugin VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463
+	JPEGReadWriter2Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "JPEGReadWriter2Plugin VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463 " __DATE__ ;
+static char __buildInfo[] = "JPEGReadWriter2Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -38,6 +38,8 @@
 
 
 /*** Constants ***/
+#define BytesPerWord 4
+#define MULTIPLEBYTECODESETS 0
 
 
 /*** Function Prototypes ***/
@@ -68,9 +70,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"JPEGReadWriter2Plugin VMMaker.oscog-eem.105 (i)"
+	"JPEGReadWriter2Plugin VMMaker.oscog-eem.159 (i)"
 #else
-	"JPEGReadWriter2Plugin VMMaker.oscog-eem.105 (e)"
+	"JPEGReadWriter2Plugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 
@@ -291,7 +293,7 @@
 	sqInt dmv2;
 	sqInt form;
 	unsigned *  formBits;
-	sqInt formBitsAsInt;
+	sqInt formBitsOops;
 	sqInt formBitsSize;
 	sqInt formDepth;
 	sqInt formHeight;
@@ -384,8 +386,7 @@
 	di;
 	dmi;
 	dmo;
-	formBits = ((unsigned *) (interpreterProxy->fetchPointerofObject(0, form)));
-	formBitsAsInt = interpreterProxy->fetchPointerofObject(0, form);
+	formBitsOops = interpreterProxy->fetchPointerofObject(0, form);
 
 	/* Various parameter checks */
 
@@ -401,12 +402,13 @@
 	formHeight = ((j_decompress_ptr)aJPEGDecompressStruct)->image_height;
 	pixPerWord = 32 / formDepth;
 	formPitch = ((formWidth + (pixPerWord - 1)) / pixPerWord) * 4;
-	formBitsSize = interpreterProxy->byteSizeOf(formBitsAsInt);
-	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsAsInt))
+	formBitsSize = interpreterProxy->byteSizeOf(formBitsOops);
+	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsOops))
 	 && (formBitsSize == (formPitch * formHeight)));
 	if (interpreterProxy->failed()) {
 		return null;
 	}
+	formBits = interpreterProxy->firstIndexableField(formBitsOops);
 	
 		sourceSize = interpreterProxy->stSizeOf(interpreterProxy->stackValue(3));
 		if (sourceSize == 0) {
@@ -456,7 +458,7 @@
 
 					switch (formDepth) {
 						case 32:
-							for(i = 0, j = 1; i < rowStride; i +=(pcinfo->out_color_components), j++) {
+							for(i = 0, j = 0; i < rowStride; i +=(pcinfo->out_color_components), j++) {
 								formPix = (255 << 24) | (buffer[0][i+rOff] << 16) | (buffer[0][i+gOff] << 8) | buffer[0][i+bOff];
 								if (formPix == 0) formPix = 1;
 								formBits [ ((pcinfo->output_scanline - 1) * (pcinfo->image_width)) + j ] = formPix;
@@ -464,7 +466,7 @@
 							break;
 
 						case 16:
-							for(i = 0, j = 1; i < rowStride; i +=(pcinfo->out_color_components*2), j++) {
+							for(i = 0, j = 0; i < rowStride; i +=(pcinfo->out_color_components*2), j++) {
 								r1 = buffer[0][i+rOff];
 								r2 = buffer[0][i+rOff2];
 								g1 = buffer[0][i+gOff];
@@ -530,7 +532,7 @@
 	unsigned int destinationSize;
 	sqInt form;
 	unsigned *  formBits;
-	sqInt formBitsAsInt;
+	sqInt formBitsOops;
 	sqInt formBitsSize;
 	sqInt formDepth;
 	sqInt formHeight;
@@ -584,8 +586,7 @@
 	j;
 	formPix;
 	destinationSize;
-	formBits = ((unsigned *) (interpreterProxy->fetchPointerofObject(0, form)));
-	formBitsAsInt = interpreterProxy->fetchPointerofObject(0, form);
+	formBitsOops = interpreterProxy->fetchPointerofObject(0, form);
 	formWidth = interpreterProxy->fetchIntegerofObject(1, form);
 	formHeight = interpreterProxy->fetchIntegerofObject(2, form);
 
@@ -601,12 +602,13 @@
 	;
 	pixPerWord = 32 / formDepth;
 	formPitch = ((formWidth + (pixPerWord - 1)) / pixPerWord) * 4;
-	formBitsSize = interpreterProxy->byteSizeOf(formBitsAsInt);
-	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsAsInt))
+	formBitsSize = interpreterProxy->byteSizeOf(formBitsOops);
+	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsOops))
 	 && (formBitsSize == (formPitch * formHeight)));
 	if (interpreterProxy->failed()) {
 		return null;
 	}
+	formBits = interpreterProxy->firstIndexableField(formBitsOops);
 	
 		destinationSize = interpreterProxy->stSizeOf(interpreterProxy->stackValue(4));
 		pcinfo = (j_compress_ptr)aJPEGCompressStruct;
@@ -641,7 +643,7 @@
 				while (pcinfo->next_scanline < pcinfo->image_height) {
 					switch (formDepth) {
 						case 32:
-							for(i = 0, j = 1; i < rowStride; i +=3, j++) {
+							for(i = 0, j = 0; i < rowStride; i +=3, j++) {
 								formPix = formBits [ ((pcinfo->next_scanline) * formWidth) + j ];
 								buffer[0][i] = (formPix >> 16) & 255;
 								buffer[0][i+1] = (formPix >> 8) & 255;
@@ -649,7 +651,7 @@
 							}
 							break;
 						case 16:
-							for(i = 0, j = 1; i < rowStride; i +=6, j++) {
+							for(i = 0, j = 0; i < rowStride; i +=6, j++) {
 								formPix = formBits [ ((pcinfo->next_scanline) * formWidth) / 2 + j ];
 								buffer[0][i] = (formPix >> 23) & 248;
 								buffer[0][i+1] = (formPix >> 18) & 248;

Modified: branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	JPEGReaderPlugin VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463
+	JPEGReaderPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463 " __DATE__ ;
+static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -39,6 +39,7 @@
 /*** Constants ***/
 #define BlockWidthIndex 5
 #define BlueIndex 2
+#define BytesPerWord 4
 #define ConstBits 13
 #define CurrentXIndex 0
 #define CurrentYIndex 1
@@ -68,6 +69,7 @@
 #define MCUBlockIndex 4
 #define MCUWidthIndex 8
 #define MinComponentSize 11
+#define MULTIPLEBYTECODESETS 0
 #define Pass1Bits 2
 #define Pass1Div 0x800
 #define Pass2Div 0x40000
@@ -145,9 +147,9 @@
 static sqInt jsReadLimit;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"JPEGReaderPlugin VMMaker.oscog-eem.105 (i)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.159 (i)"
 #else
-	"JPEGReaderPlugin VMMaker.oscog-eem.105 (e)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 static int *residuals;
@@ -171,7 +173,7 @@
     sqInt i;
     sqInt max;
 
-	if ((oop & 1)) {
+	if (interpreterProxy->isIntegerObject(oop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isPointers(oop))) {
@@ -181,7 +183,7 @@
 		return 0;
 	}
 	arrayOop = interpreterProxy->fetchPointerofObject(MCUBlockIndex, oop);
-	if ((arrayOop & 1)) {
+	if (interpreterProxy->isIntegerObject(arrayOop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isPointers(arrayOop))) {
@@ -193,7 +195,7 @@
 	}
 	for (i = 0; i <= (max - 1); i += 1) {
 		blockOop = interpreterProxy->fetchPointerofObject(i, arrayOop);
-		if ((blockOop & 1)) {
+		if (interpreterProxy->isIntegerObject(blockOop)) {
 			return 0;
 		}
 		if (!(interpreterProxy->isWords(blockOop))) {
@@ -210,7 +212,7 @@
 static sqInt
 colorComponentfrom(int *aColorComponent, sqInt oop)
 {
-	if ((oop & 1)) {
+	if (interpreterProxy->isIntegerObject(oop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isPointers(oop))) {
@@ -802,7 +804,7 @@
 		return 0;
 	}
 	oop = interpreterProxy->fetchPointerofObject(0, streamOop);
-	if ((oop & 1)) {
+	if (interpreterProxy->isIntegerObject(oop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isBytes(oop))) {

Modified: branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	Matrix2x3Plugin VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463
+	Matrix2x3Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "Matrix2x3Plugin VMMaker.oscog-eem.105 uuid: 79234f80-ee6a-404c-9e5c-2134e3b76463 " __DATE__ ;
+static char __buildInfo[] = "Matrix2x3Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -37,6 +37,8 @@
 
 
 /*** Constants ***/
+#define BytesPerWord 4
+#define MULTIPLEBYTECODESETS 0
 
 
 /*** Function Prototypes ***/
@@ -74,9 +76,9 @@
 static double m23ResultY;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"Matrix2x3Plugin VMMaker.oscog-eem.105 (i)"
+	"Matrix2x3Plugin VMMaker.oscog-eem.159 (i)"
 #else
-	"Matrix2x3Plugin VMMaker.oscog-eem.105 (e)"
+	"Matrix2x3Plugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 
@@ -142,25 +144,25 @@
 		return interpreterProxy->primitiveFail();
 	}
 	oop = interpreterProxy->fetchPointerofObject(0, point);
-	isInt = (oop & 1);
+	isInt = interpreterProxy->isIntegerObject(oop);
 	if (!(isInt
 		 || (interpreterProxy->isFloatObject(oop)))) {
 		return interpreterProxy->primitiveFail();
 	}
 	if (isInt) {
-		m23ArgX = (oop >> 1);
+		m23ArgX = interpreterProxy->integerValueOf(oop);
 	}
 	else {
 		m23ArgX = interpreterProxy->floatValueOf(oop);
 	}
 	oop = interpreterProxy->fetchPointerofObject(1, point);
-	isInt = (oop & 1);
+	isInt = interpreterProxy->isIntegerObject(oop);
 	if (!(isInt
 		 || (interpreterProxy->isFloatObject(oop)))) {
 		return interpreterProxy->primitiveFail();
 	}
 	if (isInt) {
-		m23ArgY = (oop >> 1);
+		m23ArgY = interpreterProxy->integerValueOf(oop);
 	}
 	else {
 		m23ArgY = interpreterProxy->floatValueOf(oop);

Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/cogit.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	StackToRegisterMappingCogit VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 

Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/cogit.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 

Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/cogmethod.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 typedef struct {

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1916,7 +1916,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.157";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.159";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -4305,7 +4305,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -4526,7 +4526,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -4572,7 +4572,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -5241,7 +5241,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -8923,7 +8923,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -9508,6 +9508,7 @@
 attemptToSwitchToMachineCode(sqInt bcpc)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt aCompiledMethodHeader;
+    sqInt aMethodOop;
     sqInt closure;
     CogMethod *cogMethod;
     CogBlockMethod *cogMethod1;
@@ -9529,7 +9530,8 @@
 	}
 	if (methodHasCogMethod(GIV(method))) {
 		/* begin cogMethodOf: */
-		methodHeader = longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+		aMethodOop = GIV(method);
+		methodHeader = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
 		assert((isNonIntegerObject(methodHeader))
 		 && ((((usqInt)methodHeader)) < (startOfMemory())));
 		cogMethod = ((CogMethod *) methodHeader);
@@ -10267,7 +10269,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -10977,7 +10979,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -15096,7 +15098,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22605,7 +22607,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22877,7 +22879,17 @@
 sqInt
 methodUsesAlternateBytecodeSet(sqInt aMethodObj)
 {
-	return (((headerOf(aMethodObj)) >> 1)) < 0;
+    sqInt methodHeader;
+    sqInt methodHeader1;
+
+	/* begin headerIndicatesAlternateBytecodeSet: */
+	/* begin headerOf: */
+	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+	methodHeader = (isCogMethodReference(methodHeader1)
+		? (assert(((((CogMethod *) methodHeader1)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
+			(((CogMethod *) methodHeader1)->methodHeader))
+		: methodHeader1);
+	return ((methodHeader >> 1)) < 0;
 }
 
 
@@ -26163,7 +26175,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26413,7 +26425,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26697,7 +26709,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -41616,7 +41628,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -41668,7 +41680,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42101,7 +42113,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -42334,7 +42346,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -45230,7 +45242,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1919,7 +1919,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.157";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.159";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -4309,7 +4309,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -4530,7 +4530,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -4576,7 +4576,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -5245,7 +5245,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -8927,7 +8927,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -9512,6 +9512,7 @@
 attemptToSwitchToMachineCode(sqInt bcpc)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt aCompiledMethodHeader;
+    sqInt aMethodOop;
     sqInt closure;
     CogMethod *cogMethod;
     CogBlockMethod *cogMethod1;
@@ -9533,7 +9534,8 @@
 	}
 	if (methodHasCogMethod(GIV(method))) {
 		/* begin cogMethodOf: */
-		methodHeader = longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+		aMethodOop = GIV(method);
+		methodHeader = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
 		assert((isNonIntegerObject(methodHeader))
 		 && ((((usqInt)methodHeader)) < (startOfMemory())));
 		cogMethod = ((CogMethod *) methodHeader);
@@ -10271,7 +10273,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -10981,7 +10983,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -15100,7 +15102,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22609,7 +22611,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22881,7 +22883,17 @@
 sqInt
 methodUsesAlternateBytecodeSet(sqInt aMethodObj)
 {
-	return (((headerOf(aMethodObj)) >> 1)) < 0;
+    sqInt methodHeader;
+    sqInt methodHeader1;
+
+	/* begin headerIndicatesAlternateBytecodeSet: */
+	/* begin headerOf: */
+	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+	methodHeader = (isCogMethodReference(methodHeader1)
+		? (assert(((((CogMethod *) methodHeader1)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
+			(((CogMethod *) methodHeader1)->methodHeader))
+		: methodHeader1);
+	return ((methodHeader >> 1)) < 0;
 }
 
 
@@ -26167,7 +26179,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26417,7 +26429,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26701,7 +26713,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -41620,7 +41632,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -41672,7 +41684,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42105,7 +42117,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -42338,7 +42350,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -45234,7 +45246,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 

Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/interp.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/nscogsrc/vm/vmCallback.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 #define VM_CALLBACK_INC 1


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Tue Apr 17 23:13:00 PDT 2012
   + Wed May  2 16:06:54 PDT 2012

Deleted: branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.c
===================================================================
--- branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,11 +0,0 @@
-/*
- *  sqMacFileBits.c
- *  mpeglibAudioVideo
- *
- *  Created by John M McIntosh on 15/02/06.
- *  Copyright 2006 __MyCompanyName__. All rights reserved.
- *
- */
-
-#include "sqMacFileBits.h"
-

Deleted: branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.h
===================================================================
--- branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,15 +0,0 @@
-/*
- *  macFileNameBits.c
- *  FT2Plugin support
- *
- *  Created by John M McIntosh on 21/11/05.
- * Feb 15th, 2006, use sqFilenameFromString
- *
- */
-#include "sqVirtualMachine.h" 
-
-extern struct VirtualMachine * interpreterProxy;
-
-void		sqFilenameFromStringOpen(char *buffer,long fileIndex, long fileLength, int flag) {
-	interpreterProxy->ioFilenamefromStringofLengthresolveAliases(buffer,fileIndex, fileLength, flag);
-}

Modified: branches/Cog/platforms/Mac OS/vm/sqMacEncoding.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacEncoding.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/platforms/Mac OS/vm/sqMacEncoding.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -10,8 +10,8 @@
 #include "sq.h"
 
 #include "sqMacEncoding.h"
-#include "sqMacUIConstants.h" 
-#include "sqMacFileLogic.h"	
+#include "sqMacUIConstants.h"
+#include "sqMacFileLogic.h"
 
 
     CFStringEncoding gCurrentVMEncoding=kCFStringEncodingMacRoman;
@@ -28,8 +28,8 @@
     CFStringGetCString (vmPathString, target, VMPATH_SIZE, encoding);
 }
 
-void SetVMPathFromCFString(CFMutableStringRef strRef) {    
-    if (vmPathString != NULL)  
+void SetVMPathFromCFString(CFMutableStringRef strRef) {
+    if (vmPathString != NULL)
         CFRelease(vmPathString);
 	vmPathString = strRef;
 	CFRetain(vmPathString);
@@ -37,7 +37,7 @@
 
 Boolean VMPathIsEmpty() {
     char path[VMPATH_SIZE + 1];
-     if (vmPathString == NULL) 
+     if (vmPathString == NULL)
         return true;
     getVMPathWithEncoding(path,gCurrentVMEncoding);
     return (*path == 0x00);
@@ -51,13 +51,13 @@
     getImageNameWithEncoding(imageName,gCurrentVMEncoding);
     return imageName;
 }
-    
+
 void SetImageNameViaCFString(CFStringRef string) {
     char *ignore;
-	// normalization because we get here from looking for file name in resource folder directly at startup time. 
+	// normalization because we get here from looking for file name in resource folder directly at startup time.
 	// HFS+ imposes Unicode2.1 decomposed UTF-8 encoding on all path elements
 	CFMutableStringRef mutableStr= CFStringCreateMutableCopy(NULL, 0, string);
-	if (gCurrentVMEncoding == kCFStringEncodingUTF8) 
+	if (gCurrentVMEncoding == kCFStringEncodingUTF8)
 		CFStringNormalize(mutableStr, kCFStringNormalizationFormKC); // pre-combined
     CFRetain(mutableStr);
 	if (imageNameString != NULL)
@@ -68,7 +68,7 @@
 
 void SetImageNameViaString(char *string,UInt32 encoding) {
 	CFStringRef path;
-	
+
 	if (imageNameString != NULL)
         CFRelease(imageNameString);
 	path = CFStringCreateWithCString(NULL, string, encoding);
@@ -78,7 +78,7 @@
 
 
 Boolean ImageNameIsEmpty() {
-    if (imageNameString == NULL) 
+    if (imageNameString == NULL)
         return true;
     return getImageName() == 0x00;
 }
@@ -112,15 +112,15 @@
       if (strcmp("iso-8859-1",string) == 0)
           gCurrentVMEncoding = kCFStringEncodingISOLatin1;
   }
-  
+
   char  *getEncodingType(UInt32 aType) {
-      if (aType == kCFStringEncodingMacRoman) 
+      if (aType == kCFStringEncodingMacRoman)
           return (char *)&"macintosh";
-      if (aType == kCFStringEncodingUTF8) 
+      if (aType == kCFStringEncodingUTF8)
           return (char *)&"UTF-8";
-      if (aType == kCFStringEncodingShiftJIS) 
+      if (aType == kCFStringEncodingShiftJIS)
           return (char *)&"ShiftJIS";
-      if (aType == kCFStringEncodingISOLatin1) 
+      if (aType == kCFStringEncodingISOLatin1)
           return (char *)&"Latin1";
       return (char *)&"macintosh";
   }

Modified: branches/Cog/platforms/Mac OS/vm/sqMacMain.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacMain.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/platforms/Mac OS/vm/sqMacMain.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -252,15 +252,14 @@
 }
 #pragma auto_inline on
 
-/* construct /dir/for/image/crash.dmp if a / in imageName else crash.dmp */
+static char vmLogDirA[PATH_MAX+1];
+
 static void
 getCrashDumpFilenameInto(char *buf)
 {
-  char *slash;
-
-  strcpy(buf,imageName);
-  slash = strrchr(buf,'/');
-  strcpy(slash ? slash + 1 : buf, "crash.dmp");
+	strcpy(buf,vmLogDirA);
+	vmLogDirA[0] && strcat(buf, "/");
+	strcat(buf, "crash.dmp");
 }
 
 static void
@@ -439,6 +438,18 @@
 			}
 	}
 
+	/* Set the directory into which to write the crash.dmp file. */
+	/* By default this is the image file's directory (strange but true). */
+#if CRASH_DUMP_IN_CWD
+	getcwd(vmLogDirA,PATH_MAX);
+#else
+	strcpy(vmLogDirA,getImageName());
+	if (strrchr(vmLogDirA,'/'))
+		*strrchr(vmLogDirA,'/') = 0;
+	else
+		getcwd(vmLogDirA,PATH_MAX);
+#endif
+
 	/* read the image file and allocate memory for Squeak heap */
 	f = sqImageFileOpen(getImageName(), "rb");
     if (gSqueakHeadless && f == NULL) 
@@ -527,9 +538,18 @@
 
 /* Andreas' stubs */
 char* ioGetLogDirectory(void) { return ""; };
-sqInt ioSetLogDirectoryOfSize(void* lblIndex, sqInt sz){ return 1; }
 
+sqInt
+ioSetLogDirectoryOfSize(void *lblIndex, sqInt sz)
+{
+	if (sz >= PATH_MAX)
+		return 0;
+	strncpy(vmLogDirA, lblIndex, sz);
+	vmLogDirA[sz] = 0;
+	return 1;
+}
 
+
 char * GetAttributeString(int id) {
 	/* This is a hook for getting various status strings back from
 	   the OS. In particular, it allows Squeak to be passed arguments

Modified: branches/Cog/platforms/Mac OS/vm/sqMacUIEventsUniversal.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacUIEventsUniversal.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/platforms/Mac OS/vm/sqMacUIEventsUniversal.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -60,10 +60,9 @@
 
 enum { KeyMapSize= 32 };
 
-typedef struct
-{
+typedef struct {
   int keyCode;
-  int keyChar;
+  long keyChar;
   int keyRepeated;
 } KeyMapping;
 
@@ -79,8 +78,8 @@
 void signalAnyInterestedParties(void);
 static sqKeyboardEvent *enterKeystroke (long type, long cc, long pc, UniChar utf32Char, long m);
 
-static int addToKeyMap(int keyCode, int keyChar);
-static int findInKeyMap(int keyCode);
+static int addToKeyMap(int keyCode, UniChar keyChar);
+static UniChar findInKeyMap(int keyCode);
 static int removeFromKeyMap(int keyCode);
 static int indexInKeyMap(int keyCode);
 static int findRepeatInKeyMap(int keyCode);
@@ -221,13 +220,11 @@
 sqInputEvent *
 nextEventPut(void)
 {
-	sqInputEvent *evt;
-	evt = eventBuffer + eventBufferPut;
+	sqInputEvent *evt = eventBuffer + eventBufferPut;
 	eventBufferPut = (eventBufferPut + 1) % MAX_EVENT_BUFFER;
-	if (eventBufferGet == eventBufferPut) {
+	if (eventBufferGet == eventBufferPut)
 		/* buffer overflow; drop the last event */
 		eventBufferGet = (eventBufferGet + 1) % MAX_EVENT_BUFFER;
-	}
 	return evt;
 }
 
@@ -789,13 +786,64 @@
     return result;
 }
 
+
+static TISInputSourceRef currentKeyboard = (TISInputSourceRef)-1;
+static UCKeyboardLayout *currentKeyboardLayout;
+
+static UCKeyboardLayout *
+getKeyboardLayout()
+{
+	TISInputSourceRef kbdNow = TISCopyCurrentKeyboardInputSource();
+
+	if (currentKeyboard != kbdNow) {
+		KeyboardLayoutRef keyLayout;
+		SInt32  keyLayoutKind;
+		CFDataRef uchr = (CFDataRef)TISGetInputSourceProperty
+										(kbdNow,
+										 kTISPropertyUnicodeKeyLayoutData);
+		currentKeyboard = kbdNow;
+		currentKeyboardLayout = (const UCKeyboardLayout*)CFDataGetBytePtr(uchr);
+		KLGetCurrentKeyboardLayout(&keyLayout);
+		KLGetKeyboardLayoutProperty(keyLayout, kKLKind, (const void **)&keyLayoutKind);
+		//printf("\nKbd: %ld kind: %ld kKLKCHRKind %ld",
+		//		kbdNow, keyLayoutKind, kKLKCHRKind); fflush(stdout);
+	}
+	return currentKeyboardLayout;
+}
+
+static UniChar
+shiftedUnicodeForEvent(EventRef event, UInt32 keyCode)
+{
+#define MaxStringLength 4
+	UInt32 deadKeyState = 0;
+	UInt32 keyboardType;
+	UniCharCount actualStringLength = 0;
+	UniChar unicodeString[MaxStringLength];
+    OSStatus result;
+
+	GetEventParameter(event, kEventParamKeyboardType, typeUInt32, NULL,
+					  sizeof(keyboardType), NULL, &keyboardType);
+	result = UCKeyTranslate(getKeyboardLayout(),
+							keyCode, kUCKeyActionDown,
+							/* Only interested in the shift state, and
+							 * UCKeyTranslate uses old-style Carbon modifiers. */
+							ModifierStateCarbon(event) & 8
+								? 1 << (shiftKeyBit - 8)
+								: 0,
+							keyboardType, 0,
+							&deadKeyState,
+							MaxStringLength,
+							&actualStringLength, unicodeString);
+	return result == noErr ? unicodeString[0] : 0;
+}
+#undef MaxStringLength
+
 static pascal OSStatus
 MyWindowEventKBHandler(EventHandlerCallRef myHandler,
 						EventRef event, void* userData)
 {
 #pragma unused(myHandler,userData)
     UInt32 whatHappened,keyCode,keyChar;
-	SInt32 key;
     OSStatus result = eventNotHandledErr; /* report failure by default */
 
     if (!windowActive)
@@ -808,28 +856,32 @@
 	GetEventParameter (event, kEventParamKeyCode, typeUInt32,NULL, sizeof(typeUInt32), NULL, &keyCode);
 	/* See UCKeyTranslate in https://developer.apple.com/library/mac/#documentation/Carbon/reference/Unicode_Utilities_Ref/Reference/reference.html
 	 * for how to convert an event to one or more Unicode characters. e.g.
-	 * http://www.cocoabuilder.com/archive/cocoa/184332-key-number-to-unicode-string.html
+	 * http://inquisitivecocoa.com/2009/04/05/key-code-translator/
 	 */
     switch (whatHappened) {
-        case kEventRawKeyDown:
-			//fprintf(stdout,"\nrawkey down %i",ioMSecs()); fflush(stdout);
+        case kEventRawKeyDown: {
+			//printf("\nrawkey down %i ",ioMSecs()); fflush(stdout);
+			//This will work, but this appears unused. */
+			//addToKeyMap(keyCode, shiftedUnicodeForEvent(event,keyCode));
 			addToKeyMap(keyCode, 0);
             result = eventNotHandledErr;
             break;
+		}
         case kEventRawKeyRepeat:
 			//fprintf(stdout,"\nrawkey repeat %i",ioMSecs()); fflush(stdout);
 			setRepeatInKeyMap(keyCode);
             result = eventNotHandledErr;
             break;
-        case kEventRawKeyUp:
+        case kEventRawKeyUp: {
+			UniChar key;
 			//fprintf(stdout,"\nrawkey up %i",ioMSecs()); fflush(stdout);
-			key = findInKeyMap(keyCode);
-			if (key != -1) {
-				enterKeystroke ( EventTypeKeyboard,keyCode, EventKeyUp, 0, ModifierStateCarbon(event));
-			}
+			if ((key = findInKeyMap(keyCode)) != -1)
+				enterKeystroke(EventTypeKeyboard, keyCode, EventKeyUp,
+								key, ModifierStateCarbon(event));
 			removeFromKeyMap(keyCode);
             result = eventNotHandledErr;
             break;
+		}
         case kEventRawKeyModifiersChanged:
             /* ok in this case we fake a mouse event to deal with the modifiers changing */
             if(inputSemaphoreIndex)
@@ -1151,10 +1203,14 @@
     modifiedUniChar = *uniCharBufPtr;
     buttonState = modifierBits =ModifierStateCarbon(actualEvent); //Capture option states
     if (((modifierBits >> 3) & 0x9) == 0x9) {  /* command and shift */
-            if ((modifiedUniChar >= 97) && (modifiedUniChar <= 122)) {
-                    /* convert ascii code of command-shift-letter to upper case */
-                    modifiedUniChar = modifiedUniChar - 32;
-            }
+        if ((modifiedUniChar >= 97) && (modifiedUniChar <= 122)) {
+            /* convert ascii code of command-shift-letter to upper case */
+            modifiedUniChar = modifiedUniChar - 32;
+        }
+		else { /* map potential punctuation character to shifted key. */
+			if (!(modifiedUniChar = shiftedUnicodeForEvent(actualEvent,macKeyCode)))
+				modifiedUniChar = *uniCharBufPtr; /* undo on error */
+		}
     }
 
 	modifierBits = modifierBits >> 3;
@@ -1515,8 +1571,7 @@
 static sqKeyboardEvent *
 enterKeystroke(long type, long cc, long pc, UniChar utf32Code, long m)
 {
-	sqKeyboardEvent 	*evt;
-	evt = (sqKeyboardEvent*) nextEventPut();
+	sqKeyboardEvent *evt = (sqKeyboardEvent*)nextEventPut();
 
 	/* first the basics */
 	//fprintf(stdout,"\nKeyStroke time %i Type %i Value %i",ioMSecs(),pc,cc); fflush(stdout);
@@ -1529,7 +1584,7 @@
 	evt->modifiers = m;
 	evt->windowIndex = windowActive;
 	evt->utf32Code = 0;
-	if(pc == EventKeyChar) {
+	if (pc == EventKeyChar) {
 		evt->utf32Code = utf32Code;
 		if (!inputSemaphoreIndex) {
 			int  keystate;
@@ -1555,9 +1610,9 @@
 
 
 static int
-addToKeyMap(int keyCode, int keyChar)
+addToKeyMap(int keyCode, UniChar keyChar)
 {
-  // fprintf(stdout, "\nAddToKeyMap T %i code %i char %i i %i",ioMSecs(),keyCode,keyChar,keyMapSize); fflush(stdout);
+  //fprintf(stdout, "\nAddToKeyMap T %i code %i char %i(%x,%c) i %i",ioMSecs(),keyCode,keyChar,keyChar,keyChar,keyMapSize); fflush(stdout);
   if (keyMapSize > KeyMapSize) { fprintf(stderr, "keymap overflow\n");  return -1; }
   keyMap[keyMapSize++]= (KeyMapping){ keyCode, keyChar, 0};
   return keyChar;
@@ -1573,7 +1628,7 @@
   return -1;
 }
 
-static int
+static UniChar
 findInKeyMap(int keyCode)
 {
   int idx= indexInKeyMap(keyCode);

Modified: branches/Cog/platforms/unix/plugins/SocketPlugin/sqUnixSocket.c
===================================================================
--- branches/Cog/platforms/unix/plugins/SocketPlugin/sqUnixSocket.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/platforms/unix/plugins/SocketPlugin/sqUnixSocket.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1302,7 +1302,7 @@
 	  /* this is JUST PLAIN WRONG (I mean the design in the image rather
 	     than the implementation here, which is probably correct
 	     w.r.t. the broken design) */
-	  if (optionValueSize > sizeof(buf) - 1)
+	  if (optionValueSize > (int)sizeof(buf) - 1)
 	    goto barf;
 
 	  memset((void *)buf, 0, sizeof(buf));
@@ -1371,7 +1371,6 @@
 
 void sqSocketBindToPort(SocketPtr s, int addr, int port)
 {
-  int result;
   struct sockaddr_in inaddr;
   privateSocketStruct *pss= PSP(s);
 
@@ -1393,10 +1392,8 @@
 
 void sqSocketSetReusable(SocketPtr s)
 {
-  char optionValue[256];
   size_t bufSize;
   unsigned char buf[4];
-  int err;
 
   if (!socketValid(s)) return;
 
@@ -1406,7 +1403,6 @@
     {
       PSP(s)->sockError= errno;
       interpreterProxy->success(false);
-      return;
     }
 }
 
@@ -1446,7 +1442,12 @@
 
 sqInt sqResolverAddrLookupResultSize(void)	{ return strlen(lastName); }
 sqInt sqResolverError(void)			{ return lastError; }
-sqInt sqResolverLocalAddress(void)		{ return nameToAddr(localHostName); }
+sqInt sqResolverLocalAddress(void)
+{	sqInt localaddr = nameToAddr(localHostName);
+	if (!localaddr)
+		localaddr = nameToAddr("localhost");
+	return localaddr;
+}
 sqInt sqResolverNameLookupResult(void)		{ return lastAddr; }
 
 void sqResolverAddrLookupResult(char *nameForAddress, sqInt nameSize)

Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMain.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/platforms/unix/vm/sqUnixMain.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -85,6 +85,8 @@
        char   imageName[MAXPATHLEN+1];		/* full path to image */
 static char   vmName[MAXPATHLEN+1];		/* full path to vm */
        char   vmPath[MAXPATHLEN+1];		/* full path to image directory */
+static char   vmLogDirA[PATH_MAX+1];	/* where to write crash.dmp */
+
        char  *exeName;					/* short vm name, e.g. "squeak" */
 
        int    argCnt=		0;	/* global copies for access from plugins */
@@ -330,20 +332,31 @@
   }
 }
 
-static void recordFullPathForImageName(const char *localImageName)
+static void
+recordFullPathForImageName(const char *localImageName)
 {
-  struct stat s;
-  /* get canonical path to image */
-  if ((stat(localImageName, &s) == -1) || (realpath(localImageName, imageName) == 0))
-    pathCopyAbs(imageName, localImageName, sizeof(imageName));
+	struct stat s;
+	/* get canonical path to image */
+	if ((stat(localImageName, &s) == -1)
+	 || (realpath(localImageName, imageName) == 0))
+		pathCopyAbs(imageName, localImageName, sizeof(imageName));
+
+	/* Set the directory into which to write the crash.dmp file. */
+	/* By default this is the image file's directory (strange but true). */
+#if CRASH_DUMP_IN_CWD
+	getcwd(vmLogDirA,PATH_MAX);
+#else
+	strcpy(vmLogDirA,imageName);
+	if (strrchr(vmLogDirA,'/'))
+		*strrchr(vmLogDirA,'/') = 0;
+	else
+		getcwd(vmLogDirA,PATH_MAX);
+#endif
 }
 
 /* vm access */
 
-sqInt imageNameSize(void)
-{
-  return strlen(imageName);
-}
+sqInt imageNameSize(void) { return strlen(imageName); }
 
 sqInt imageNameGetLength(sqInt sqImageNameIndex, sqInt length)
 {
@@ -379,20 +392,13 @@
 }
 
 
-char *getImageName(void)
-{
-  return imageName;
-}
+char *getImageName(void) { return imageName; }
 
 
 /*** VM Home Directory Path ***/
 
+sqInt vmPathSize(void) { return strlen(vmPath); }
 
-sqInt vmPathSize(void)
-{
-  return strlen(vmPath);
-}
-
 sqInt vmPathGetLength(sqInt sqVMPathIndex, sqInt length)
 {
   char *stVMPath= pointerForOop(sqVMPathIndex);
@@ -850,15 +856,12 @@
 }
 #pragma auto_inline on
 
-/* construct /dir/for/image/crash.dmp if a / in imageName else crash.dmp */
 static void
 getCrashDumpFilenameInto(char *buf)
 {
-  char *slash;
-
-  strcpy(buf,imageName);
-  slash = strrchr(buf,'/');
-  strcpy(slash ? slash + 1 : buf, "crash.dmp");
+	strcpy(buf,vmLogDirA);
+	vmLogDirA[0] && strcat(buf, "/");
+	strcat(buf, "crash.dmp");
 }
 
 static void

Modified: branches/Cog/src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c
===================================================================
--- branches/Cog/src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.144 uuid: bafb8042-095a-42f3-9058-ee7bd133da50
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	ADPCMCodecPlugin VMMaker.oscog-eem.144 uuid: bafb8042-095a-42f3-9058-ee7bd133da50
+	ADPCMCodecPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "ADPCMCodecPlugin VMMaker.oscog-eem.144 uuid: bafb8042-095a-42f3-9058-ee7bd133da50 " __DATE__ ;
+static char __buildInfo[] = "ADPCMCodecPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -59,6 +59,7 @@
 
 /*** Constants ***/
 #define BytesPerWord 4
+#define MULTIPLEBYTECODESETS 0
 
 
 /*** Variables ***/
@@ -69,9 +70,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"ADPCMCodecPlugin VMMaker.oscog-eem.144 (i)"
+	"ADPCMCodecPlugin VMMaker.oscog-eem.159 (i)"
 #else
-	"ADPCMCodecPlugin VMMaker.oscog-eem.144 (e)"
+	"ADPCMCodecPlugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 

Modified: branches/Cog/src/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c
===================================================================
--- branches/Cog/src/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	JPEGReadWriter2Plugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	JPEGReadWriter2Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "JPEGReadWriter2Plugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99 " __DATE__ ;
+static char __buildInfo[] = "JPEGReadWriter2Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -38,6 +38,8 @@
 
 
 /*** Constants ***/
+#define BytesPerWord 4
+#define MULTIPLEBYTECODESETS 0
 
 
 /*** Function Prototypes ***/
@@ -68,9 +70,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"JPEGReadWriter2Plugin VMMaker-oscog.40 (i)"
+	"JPEGReadWriter2Plugin VMMaker.oscog-eem.159 (i)"
 #else
-	"JPEGReadWriter2Plugin VMMaker-oscog.40 (e)"
+	"JPEGReadWriter2Plugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 
@@ -291,7 +293,7 @@
 	sqInt dmv2;
 	sqInt form;
 	unsigned *  formBits;
-	sqInt formBitsAsInt;
+	sqInt formBitsOops;
 	sqInt formBitsSize;
 	sqInt formDepth;
 	sqInt formHeight;
@@ -384,8 +386,7 @@
 	di;
 	dmi;
 	dmo;
-	formBits = ((unsigned *) (interpreterProxy->fetchPointerofObject(0, form)));
-	formBitsAsInt = interpreterProxy->fetchPointerofObject(0, form);
+	formBitsOops = interpreterProxy->fetchPointerofObject(0, form);
 
 	/* Various parameter checks */
 
@@ -401,12 +402,13 @@
 	formHeight = ((j_decompress_ptr)aJPEGDecompressStruct)->image_height;
 	pixPerWord = 32 / formDepth;
 	formPitch = ((formWidth + (pixPerWord - 1)) / pixPerWord) * 4;
-	formBitsSize = interpreterProxy->byteSizeOf(formBitsAsInt);
-	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsAsInt))
+	formBitsSize = interpreterProxy->byteSizeOf(formBitsOops);
+	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsOops))
 	 && (formBitsSize == (formPitch * formHeight)));
 	if (interpreterProxy->failed()) {
 		return null;
 	}
+	formBits = interpreterProxy->firstIndexableField(formBitsOops);
 	
 		sourceSize = interpreterProxy->stSizeOf(interpreterProxy->stackValue(3));
 		if (sourceSize == 0) {
@@ -456,7 +458,7 @@
 
 					switch (formDepth) {
 						case 32:
-							for(i = 0, j = 1; i < rowStride; i +=(pcinfo->out_color_components), j++) {
+							for(i = 0, j = 0; i < rowStride; i +=(pcinfo->out_color_components), j++) {
 								formPix = (255 << 24) | (buffer[0][i+rOff] << 16) | (buffer[0][i+gOff] << 8) | buffer[0][i+bOff];
 								if (formPix == 0) formPix = 1;
 								formBits [ ((pcinfo->output_scanline - 1) * (pcinfo->image_width)) + j ] = formPix;
@@ -464,7 +466,7 @@
 							break;
 
 						case 16:
-							for(i = 0, j = 1; i < rowStride; i +=(pcinfo->out_color_components*2), j++) {
+							for(i = 0, j = 0; i < rowStride; i +=(pcinfo->out_color_components*2), j++) {
 								r1 = buffer[0][i+rOff];
 								r2 = buffer[0][i+rOff2];
 								g1 = buffer[0][i+gOff];
@@ -530,7 +532,7 @@
 	unsigned int destinationSize;
 	sqInt form;
 	unsigned *  formBits;
-	sqInt formBitsAsInt;
+	sqInt formBitsOops;
 	sqInt formBitsSize;
 	sqInt formDepth;
 	sqInt formHeight;
@@ -584,8 +586,7 @@
 	j;
 	formPix;
 	destinationSize;
-	formBits = ((unsigned *) (interpreterProxy->fetchPointerofObject(0, form)));
-	formBitsAsInt = interpreterProxy->fetchPointerofObject(0, form);
+	formBitsOops = interpreterProxy->fetchPointerofObject(0, form);
 	formWidth = interpreterProxy->fetchIntegerofObject(1, form);
 	formHeight = interpreterProxy->fetchIntegerofObject(2, form);
 
@@ -601,12 +602,13 @@
 	;
 	pixPerWord = 32 / formDepth;
 	formPitch = ((formWidth + (pixPerWord - 1)) / pixPerWord) * 4;
-	formBitsSize = interpreterProxy->byteSizeOf(formBitsAsInt);
-	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsAsInt))
+	formBitsSize = interpreterProxy->byteSizeOf(formBitsOops);
+	interpreterProxy->success((interpreterProxy->isWordsOrBytes(formBitsOops))
 	 && (formBitsSize == (formPitch * formHeight)));
 	if (interpreterProxy->failed()) {
 		return null;
 	}
+	formBits = interpreterProxy->firstIndexableField(formBitsOops);
 	
 		destinationSize = interpreterProxy->stSizeOf(interpreterProxy->stackValue(4));
 		pcinfo = (j_compress_ptr)aJPEGCompressStruct;
@@ -641,7 +643,7 @@
 				while (pcinfo->next_scanline < pcinfo->image_height) {
 					switch (formDepth) {
 						case 32:
-							for(i = 0, j = 1; i < rowStride; i +=3, j++) {
+							for(i = 0, j = 0; i < rowStride; i +=3, j++) {
 								formPix = formBits [ ((pcinfo->next_scanline) * formWidth) + j ];
 								buffer[0][i] = (formPix >> 16) & 255;
 								buffer[0][i+1] = (formPix >> 8) & 255;
@@ -649,7 +651,7 @@
 							}
 							break;
 						case 16:
-							for(i = 0, j = 1; i < rowStride; i +=6, j++) {
+							for(i = 0, j = 0; i < rowStride; i +=6, j++) {
 								formPix = formBits [ ((pcinfo->next_scanline) * formWidth) / 2 + j ];
 								buffer[0][i] = (formPix >> 23) & 248;
 								buffer[0][i+1] = (formPix >> 18) & 248;

Modified: branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
===================================================================
--- branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	JPEGReaderPlugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	JPEGReaderPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "JPEGReaderPlugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99 " __DATE__ ;
+static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -39,6 +39,7 @@
 /*** Constants ***/
 #define BlockWidthIndex 5
 #define BlueIndex 2
+#define BytesPerWord 4
 #define ConstBits 13
 #define CurrentXIndex 0
 #define CurrentYIndex 1
@@ -68,6 +69,7 @@
 #define MCUBlockIndex 4
 #define MCUWidthIndex 8
 #define MinComponentSize 11
+#define MULTIPLEBYTECODESETS 0
 #define Pass1Bits 2
 #define Pass1Div 0x800
 #define Pass2Div 0x40000
@@ -145,9 +147,9 @@
 static sqInt jsReadLimit;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"JPEGReaderPlugin VMMaker-oscog.40 (i)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.159 (i)"
 #else
-	"JPEGReaderPlugin VMMaker-oscog.40 (e)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 static int *residuals;
@@ -171,7 +173,7 @@
     sqInt i;
     sqInt max;
 
-	if ((oop & 1)) {
+	if (interpreterProxy->isIntegerObject(oop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isPointers(oop))) {
@@ -181,7 +183,7 @@
 		return 0;
 	}
 	arrayOop = interpreterProxy->fetchPointerofObject(MCUBlockIndex, oop);
-	if ((arrayOop & 1)) {
+	if (interpreterProxy->isIntegerObject(arrayOop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isPointers(arrayOop))) {
@@ -193,7 +195,7 @@
 	}
 	for (i = 0; i <= (max - 1); i += 1) {
 		blockOop = interpreterProxy->fetchPointerofObject(i, arrayOop);
-		if ((blockOop & 1)) {
+		if (interpreterProxy->isIntegerObject(blockOop)) {
 			return 0;
 		}
 		if (!(interpreterProxy->isWords(blockOop))) {
@@ -210,7 +212,7 @@
 static sqInt
 colorComponentfrom(int *aColorComponent, sqInt oop)
 {
-	if ((oop & 1)) {
+	if (interpreterProxy->isIntegerObject(oop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isPointers(oop))) {
@@ -247,7 +249,7 @@
 	yComponent[CurrentYIndex] = 0;
 	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
 		/* begin nextSampleY */
-		dx = curX = yComponent[CurrentXIndex];
+		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
 		sx = yComponent[HScaleIndex];
 		sy = yComponent[VScaleIndex];
@@ -320,7 +322,7 @@
 	crComponent[CurrentYIndex] = 0;
 	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
 		/* begin nextSampleY */
-		dx = curX = yComponent[CurrentXIndex];
+		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
 		sx = yComponent[HScaleIndex];
 		sy = yComponent[VScaleIndex];
@@ -342,7 +344,7 @@
 		}
 		y = sample;
 		/* begin nextSampleCb */
-		dx1 = curX1 = cbComponent[CurrentXIndex];
+		dx1 = (curX1 = cbComponent[CurrentXIndex]);
 		dy1 = cbComponent[CurrentYIndex];
 		sx1 = cbComponent[HScaleIndex];
 		sy1 = cbComponent[VScaleIndex];
@@ -365,7 +367,7 @@
 		cb = sample1;
 		cb -= SampleOffset;
 		/* begin nextSampleCr */
-		dx2 = curX2 = crComponent[CurrentXIndex];
+		dx2 = (curX2 = crComponent[CurrentXIndex]);
 		dy2 = crComponent[CurrentYIndex];
 		sx2 = crComponent[HScaleIndex];
 		sy2 = crComponent[VScaleIndex];
@@ -802,7 +804,7 @@
 		return 0;
 	}
 	oop = interpreterProxy->fetchPointerofObject(0, streamOop);
-	if ((oop & 1)) {
+	if (interpreterProxy->isIntegerObject(oop)) {
 		return 0;
 	}
 	if (!(interpreterProxy->isBytes(oop))) {
@@ -846,7 +848,7 @@
     sqInt sx;
     sqInt sy;
 
-	dx = curX = cbComponent[CurrentXIndex];
+	dx = (curX = cbComponent[CurrentXIndex]);
 	dy = cbComponent[CurrentYIndex];
 	sx = cbComponent[HScaleIndex];
 	sy = cbComponent[VScaleIndex];
@@ -881,7 +883,7 @@
     sqInt sx;
     sqInt sy;
 
-	dx = curX = crComponent[CurrentXIndex];
+	dx = (curX = crComponent[CurrentXIndex]);
 	dy = crComponent[CurrentYIndex];
 	sx = crComponent[HScaleIndex];
 	sy = crComponent[VScaleIndex];
@@ -916,7 +918,7 @@
     sqInt sx;
     sqInt sy;
 
-	dx = curX = aComponent[CurrentXIndex];
+	dx = (curX = aComponent[CurrentXIndex]);
 	dy = aComponent[CurrentYIndex];
 	sx = aComponent[HScaleIndex];
 	sy = aComponent[VScaleIndex];
@@ -951,7 +953,7 @@
     sqInt sx;
     sqInt sy;
 
-	dx = curX = yComponent[CurrentXIndex];
+	dx = (curX = yComponent[CurrentXIndex]);
 	dy = yComponent[CurrentYIndex];
 	sx = yComponent[HScaleIndex];
 	sy = yComponent[VScaleIndex];
@@ -1033,7 +1035,7 @@
 	yComponent[CurrentYIndex] = 0;
 	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
 		/* begin nextSampleY */
-		dx = curX = yComponent[CurrentXIndex];
+		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
 		sx = yComponent[HScaleIndex];
 		sy = yComponent[VScaleIndex];
@@ -1157,7 +1159,7 @@
 	crComponent[CurrentYIndex] = 0;
 	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
 		/* begin nextSampleY */
-		dx = curX = yComponent[CurrentXIndex];
+		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
 		sx = yComponent[HScaleIndex];
 		sy = yComponent[VScaleIndex];
@@ -1179,7 +1181,7 @@
 		}
 		y = sample;
 		/* begin nextSampleCb */
-		dx1 = curX1 = cbComponent[CurrentXIndex];
+		dx1 = (curX1 = cbComponent[CurrentXIndex]);
 		dy1 = cbComponent[CurrentYIndex];
 		sx1 = cbComponent[HScaleIndex];
 		sy1 = cbComponent[VScaleIndex];
@@ -1202,7 +1204,7 @@
 		cb = sample1;
 		cb -= SampleOffset;
 		/* begin nextSampleCr */
-		dx2 = curX2 = crComponent[CurrentXIndex];
+		dx2 = (curX2 = crComponent[CurrentXIndex]);
 		dy2 = crComponent[CurrentYIndex];
 		sx2 = crComponent[HScaleIndex];
 		sy2 = crComponent[VScaleIndex];

Modified: branches/Cog/src/plugins/Klatt/Klatt.c
===================================================================
--- branches/Cog/src/plugins/Klatt/Klatt.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/Klatt/Klatt.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	KlattSynthesizerPlugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	KlattSynthesizerPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "KlattSynthesizerPlugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99 " __DATE__ ;
+static char __buildInfo[] = "KlattSynthesizerPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -65,6 +65,7 @@
 #define Btp 31
 #define Btz 33
 #define Bypass 39
+#define BytesPerWord 4
 #define Diplophonia 4
 #define Epsilon 0.0001
 #define F0 0
@@ -82,6 +83,7 @@
 #define Ftz 32
 #define Gain 51
 #define Jitter 2
+#define MULTIPLEBYTECODESETS 0
 #define PI 3.141592653589793
 #define R1c 12
 #define R1vp 3
@@ -177,9 +179,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"Klatt VMMaker-oscog.40 (i)"
+	"Klatt VMMaker.oscog-eem.159 (i)"
 #else
-	"Klatt VMMaker-oscog.40 (e)"
+	"Klatt VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 static float nlast;
@@ -1198,7 +1200,7 @@
 	aKlattFrame = ((float *) (interpreterProxy->firstIndexableField(oop)));
 l1:	/* end checkedFloatPtrOf: */;
 	/* begin checkedShortPtrOf: */
-	oop1 = bufferOop = interpreterProxy->stackValue(1);
+	oop1 = (bufferOop = interpreterProxy->stackValue(1));
 	interpreterProxy->success(interpreterProxy->isWords(oop1));
 	if (interpreterProxy->failed()) {
 		buffer = 0;
@@ -1362,7 +1364,7 @@
 		turbulence = (linearFromdB(frame[Turbulence])) * 0.1;
 	}
 	else {
-		voicing = parVoicing = turbulence = 0.0;
+		voicing = (parVoicing = (turbulence = 0.0));
 	}
 	friction = (linearFromdB(frame[Friction])) * 0.25;
 	aspiration = (linearFromdB(frame[Aspiration])) * 0.05;
@@ -2538,7 +2540,7 @@
 		turbulence = (linearFromdB(frame[Turbulence])) * 0.1;
 	}
 	else {
-		voicing = parVoicing = turbulence = 0.0;
+		voicing = (parVoicing = (turbulence = 0.0));
 	}
 	friction = (linearFromdB(frame[Friction])) * 0.25;
 	aspiration = (linearFromdB(frame[Aspiration])) * 0.05;

Modified: branches/Cog/src/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c
===================================================================
--- branches/Cog/src/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	Matrix2x3Plugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99
+	Matrix2x3Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "Matrix2x3Plugin VMMaker-oscog.40 uuid: 637db40c-33c6-4263-816e-1b8cc19e3c99 " __DATE__ ;
+static char __buildInfo[] = "Matrix2x3Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -37,6 +37,8 @@
 
 
 /*** Constants ***/
+#define BytesPerWord 4
+#define MULTIPLEBYTECODESETS 0
 
 
 /*** Function Prototypes ***/
@@ -74,9 +76,9 @@
 static double m23ResultY;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"Matrix2x3Plugin VMMaker-oscog.40 (i)"
+	"Matrix2x3Plugin VMMaker.oscog-eem.159 (i)"
 #else
-	"Matrix2x3Plugin VMMaker-oscog.40 (e)"
+	"Matrix2x3Plugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 
@@ -142,25 +144,25 @@
 		return interpreterProxy->primitiveFail();
 	}
 	oop = interpreterProxy->fetchPointerofObject(0, point);
-	isInt = (oop & 1);
+	isInt = interpreterProxy->isIntegerObject(oop);
 	if (!(isInt
 		 || (interpreterProxy->isFloatObject(oop)))) {
 		return interpreterProxy->primitiveFail();
 	}
 	if (isInt) {
-		m23ArgX = (oop >> 1);
+		m23ArgX = interpreterProxy->integerValueOf(oop);
 	}
 	else {
 		m23ArgX = interpreterProxy->floatValueOf(oop);
 	}
 	oop = interpreterProxy->fetchPointerofObject(1, point);
-	isInt = (oop & 1);
+	isInt = interpreterProxy->isIntegerObject(oop);
 	if (!(isInt
 		 || (interpreterProxy->isFloatObject(oop)))) {
 		return interpreterProxy->primitiveFail();
 	}
 	if (isInt) {
-		m23ArgY = (oop >> 1);
+		m23ArgY = interpreterProxy->integerValueOf(oop);
 	}
 	else {
 		m23ArgY = interpreterProxy->floatValueOf(oop);
@@ -262,7 +264,7 @@
 
 	;
 	/* begin loadArgumentMatrix: */
-	matrix = result = interpreterProxy->stackObjectValue(0);
+	matrix = (result = interpreterProxy->stackObjectValue(0));
 	if (interpreterProxy->failed()) {
 		m3 = null;
 		goto l1;
@@ -417,11 +419,11 @@
 	originX = m23ArgX;
 	originY = m23ArgY;
 	matrix2x3InvertPoint(matrix);
-	minX = maxX = m23ResultX;
+	minX = (maxX = m23ResultX);
 
 	/* Load bottom-right point */
 
-	minY = maxY = m23ResultY;
+	minY = (maxY = m23ResultY);
 	loadArgumentPoint(interpreterProxy->fetchPointerofObject(1, srcOop));
 	if (interpreterProxy->failed()) {
 		return null;
@@ -612,11 +614,11 @@
 	/* begin matrix2x3TransformPoint: */
 	m23ResultX = ((m23ArgX * (matrix[0])) + (m23ArgY * (matrix[1]))) + (matrix[2]);
 	m23ResultY = ((m23ArgX * (matrix[3])) + (m23ArgY * (matrix[4]))) + (matrix[5]);
-	minX = maxX = m23ResultX;
+	minX = (maxX = m23ResultX);
 
 	/* Load bottom-right point */
 
-	minY = maxY = m23ResultY;
+	minY = (maxY = m23ResultY);
 	loadArgumentPoint(interpreterProxy->fetchPointerofObject(1, srcOop));
 	if (interpreterProxy->failed()) {
 		return null;

Modified: branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c
===================================================================
--- branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.144 uuid: bafb8042-095a-42f3-9058-ee7bd133da50
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	Mpeg3Plugin VMMaker.oscog-eem.144 uuid: bafb8042-095a-42f3-9058-ee7bd133da50
+	Mpeg3Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "Mpeg3Plugin VMMaker.oscog-eem.144 uuid: bafb8042-095a-42f3-9058-ee7bd133da50 " __DATE__ ;
+static char __buildInfo[] = "Mpeg3Plugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -39,6 +39,7 @@
 
 /*** Constants ***/
 #define BytesPerWord 4
+#define MULTIPLEBYTECODESETS 0
 
 
 /*** Function Prototypes ***/
@@ -98,9 +99,9 @@
 static sqInt maximumNumberOfFilesToWatch;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"Mpeg3Plugin VMMaker.oscog-eem.144 (i)"
+	"Mpeg3Plugin VMMaker.oscog-eem.159 (i)"
 #else
-	"Mpeg3Plugin VMMaker.oscog-eem.144 (e)"
+	"Mpeg3Plugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 static mpeg3_t *mpegFiles[1024+1];
@@ -319,7 +320,7 @@
 		return null;
 	}
 	sz = interpreterProxy->byteSizeOf(((sqInt)(long)(path) - 4));
-	sqFilenameFromStringOpen(storage, path, sz);
+	interpreterProxy->ioFilenamefromStringofLengthresolveAliases(storage, path, sz, 1);
 	result = mpeg3_check_sig(storage);
 	_return_value = (result? interpreterProxy->trueObject(): interpreterProxy->falseObject());
 	if (interpreterProxy->failed()) {
@@ -458,7 +459,7 @@
 primitiveMPEG3EndOfVideo(void)
 {
 	sqInt aNumber;
-	mpeg3_t *file;
+	mpeg3_t *  file;
 	sqInt fileHandle;
 	sqInt result;
 	sqInt _return_value;
@@ -773,7 +774,7 @@
 		return null;
 	}
 	sz = interpreterProxy->byteSizeOf(((sqInt)(long)(path) - 4));
-	sqFilenameFromStringOpen(storage, path, sz);
+	interpreterProxy->ioFilenamefromStringofLengthresolveAliases(storage, path, sz, 1);
 	mpeg3Oop = interpreterProxy->instantiateClassindexableSize(interpreterProxy->classByteArray(), 4);
 	index = ((mpeg3_t **) (interpreterProxy->firstIndexableField(mpeg3Oop)));
 	*index = mpeg3_open(storage,0); makeFileEntry(*index);
@@ -913,18 +914,6 @@
 	return null;
 }
 
-
-/*	int mpeg3_read_frame(mpeg3_t *file, 
-	unsigned char **output_rows, 
-	int in_x, 
-	int in_y, 
-	int in_w, 
-	int in_h, 
-	int out_w, 
-	int out_h, 
-	int color_model,
-	int stream) */
-
 EXPORT(sqInt)
 primitiveMPEG3ReadFrame(void)
 {
@@ -996,18 +985,6 @@
 	return null;
 }
 
-
-/*	int mpeg3_read_frame(mpeg3_t *file, 
-	unsigned char **output_rows, 
-	int in_x, 
-	int in_y, 
-	int in_w, 
-	int in_h, 
-	int out_w, 
-	int out_h, 
-	int color_model,
-	int stream) */
-
 EXPORT(sqInt)
 primitiveMPEG3ReadFrameBufferOffset(void)
 {

Modified: branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c
===================================================================
--- branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.145 uuid: 7f3d6fd8-ce44-45ac-82f8-d0ed70d6f188
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	SoundGenerationPlugin VMMaker.oscog-eem.145 uuid: 7f3d6fd8-ce44-45ac-82f8-d0ed70d6f188
+	SoundGenerationPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "SoundGenerationPlugin VMMaker.oscog-eem.145 uuid: 7f3d6fd8-ce44-45ac-82f8-d0ed70d6f188 " __DATE__ ;
+static char __buildInfo[] = "SoundGenerationPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -63,6 +63,7 @@
 #define IncrementFractionBits 16
 #define LoopIndexFractionMask 0x1FF
 #define LoopIndexScaleFactor 0x200
+#define MULTIPLEBYTECODESETS 0
 #define ScaledIndexOverflow 0x20000000
 #define ScaleFactor 0x8000
 
@@ -75,9 +76,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"SoundGenerationPlugin VMMaker.oscog-eem.145 (i)"
+	"SoundGenerationPlugin VMMaker.oscog-eem.159 (i)"
 #else
-	"SoundGenerationPlugin VMMaker.oscog-eem.145 (e)"
+	"SoundGenerationPlugin VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 

Modified: branches/Cog/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
===================================================================
--- branches/Cog/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.142 uuid: 5b4312fa-5b57-4639-b12d-a45e13e5bbdc
+	VMPluginCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	ThreadedIA32FFIPlugin VMMaker.oscog-eem.142 uuid: 5b4312fa-5b57-4639-b12d-a45e13e5bbdc
+	ThreadedIA32FFIPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "ThreadedIA32FFIPlugin VMMaker.oscog-eem.142 uuid: 5b4312fa-5b57-4639-b12d-a45e13e5bbdc " __DATE__ ;
+static char __buildInfo[] = "ThreadedIA32FFIPlugin VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 
 
 
@@ -88,6 +88,9 @@
 # else
 #	define PLATFORM_API_USES_CALLEE_POPS_CONVENTION 0
 # endif
+#endif /* defined(_X86_) || defined(i386) || defined(__i386) || defined(__i386__) */
+
+#if !defined(ALLOCA_LIES_SO_USE_GETSP)
 # if defined(__MINGW32__) && (__GNUC__ >= 3)
     /*
      * cygwin -mno-cygwin (MinGW) gcc 3.4.x's alloca is a library routine that answers
@@ -95,13 +98,11 @@
      * Grab the actual stack pointer to correct.
      */
 #	define ALLOCA_LIES_SO_USE_GETSP 1
+# else
+#	define ALLOCA_LIES_SO_USE_GETSP 0
 # endif
-#endif /* defined(_X86_) || defined(i386) || defined(__i386) || defined(__i386__) */
+#endif /* !defined(ALLOCA_LIES_SO_USE_GETSP) */
 
-#if !defined(ALLOCA_LIES_SO_USE_GETSP)
-# define ALLOCA_LIES_SO_USE_GETSP 0
-#endif
-
 /* The dispatchOn:in:with:with: generates an unwanted call on error.  Just squash it. */
 #define error(foo) 0
 
@@ -178,6 +179,7 @@
 #define FFITypeUnsignedByte 2
 #define FFITypeVoid 0
 #define MaxNumArgs 15
+#define MULTIPLEBYTECODESETS 0
 #define PrimErrBadArgument 3
 #define PrimErrBadMethod 12
 #define PrimErrBadNumArgs 5
@@ -276,9 +278,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"SqueakFFIPrims VMMaker.oscog-eem.142 (i)"
+	"SqueakFFIPrims VMMaker.oscog-eem.159 (i)"
 #else
-	"SqueakFFIPrims VMMaker.oscog-eem.142 (e)"
+	"SqueakFFIPrims VMMaker.oscog-eem.159 (e)"
 #endif
 ;
 

Modified: branches/Cog/src/vm/cogit.c
===================================================================
--- branches/Cog/src/vm/cogit.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/cogit.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	StackToRegisterMappingCogit VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 

Modified: branches/Cog/src/vm/cogit.h
===================================================================
--- branches/Cog/src/vm/cogit.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/cogit.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 

Modified: branches/Cog/src/vm/cogmethod.h
===================================================================
--- branches/Cog/src/vm/cogmethod.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/cogmethod.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGenerator VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 typedef struct {

Modified: branches/Cog/src/vm/cointerp.c
===================================================================
--- branches/Cog/src/vm/cointerp.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/cointerp.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1906,7 +1906,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.157]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.159]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -4295,7 +4295,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -4516,7 +4516,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -4562,7 +4562,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -5015,7 +5015,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -8682,7 +8682,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -9267,6 +9267,7 @@
 attemptToSwitchToMachineCode(sqInt bcpc)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt aCompiledMethodHeader;
+    sqInt aMethodOop;
     sqInt closure;
     CogMethod *cogMethod;
     CogBlockMethod *cogMethod1;
@@ -9288,7 +9289,8 @@
 	}
 	if (methodHasCogMethod(GIV(method))) {
 		/* begin cogMethodOf: */
-		methodHeader = longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+		aMethodOop = GIV(method);
+		methodHeader = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
 		assert((isNonIntegerObject(methodHeader))
 		 && ((((usqInt)methodHeader)) < (startOfMemory())));
 		cogMethod = ((CogMethod *) methodHeader);
@@ -10026,7 +10028,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -10597,7 +10599,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -14716,7 +14718,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -21929,7 +21931,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22201,7 +22203,17 @@
 sqInt
 methodUsesAlternateBytecodeSet(sqInt aMethodObj)
 {
-	return (((headerOf(aMethodObj)) >> 1)) < 0;
+    sqInt methodHeader;
+    sqInt methodHeader1;
+
+	/* begin headerIndicatesAlternateBytecodeSet: */
+	/* begin headerOf: */
+	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+	methodHeader = (isCogMethodReference(methodHeader1)
+		? (assert(((((CogMethod *) methodHeader1)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
+			(((CogMethod *) methodHeader1)->methodHeader))
+		: methodHeader1);
+	return ((methodHeader >> 1)) < 0;
 }
 
 
@@ -25474,7 +25486,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -25724,7 +25736,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26008,7 +26020,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -40927,7 +40939,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -40979,7 +40991,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -41412,7 +41424,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -41645,7 +41657,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -44541,7 +44553,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 

Modified: branches/Cog/src/vm/cointerp.h
===================================================================
--- branches/Cog/src/vm/cointerp.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/cointerp.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 

Modified: branches/Cog/src/vm/cointerpmt.c
===================================================================
--- branches/Cog/src/vm/cointerpmt.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/cointerpmt.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CoInterpreterMT VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2005,7 +2005,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.157]";
+const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.159]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 sqInt willNotThreadWarnCount;
@@ -4396,7 +4396,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -4617,7 +4617,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -4663,7 +4663,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -5116,7 +5116,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -8783,7 +8783,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -9368,6 +9368,7 @@
 attemptToSwitchToMachineCode(sqInt bcpc)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt aCompiledMethodHeader;
+    sqInt aMethodOop;
     sqInt closure;
     CogMethod *cogMethod;
     CogBlockMethod *cogMethod1;
@@ -9389,7 +9390,8 @@
 	}
 	if (methodHasCogMethod(GIV(method))) {
 		/* begin cogMethodOf: */
-		methodHeader = longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+		aMethodOop = GIV(method);
+		methodHeader = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
 		assert((isNonIntegerObject(methodHeader))
 		 && ((((usqInt)methodHeader)) < (startOfMemory())));
 		cogMethod = ((CogMethod *) methodHeader);
@@ -10186,7 +10188,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -10934,7 +10936,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -15265,7 +15267,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -15982,7 +15984,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -22689,7 +22691,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22961,7 +22963,17 @@
 sqInt
 methodUsesAlternateBytecodeSet(sqInt aMethodObj)
 {
-	return (((headerOf(aMethodObj)) >> 1)) < 0;
+    sqInt methodHeader;
+    sqInt methodHeader1;
+
+	/* begin headerIndicatesAlternateBytecodeSet: */
+	/* begin headerOf: */
+	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+	methodHeader = (isCogMethodReference(methodHeader1)
+		? (assert(((((CogMethod *) methodHeader1)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
+			(((CogMethod *) methodHeader1)->methodHeader))
+		: methodHeader1);
+	return ((methodHeader >> 1)) < 0;
 }
 
 
@@ -26682,7 +26694,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26932,7 +26944,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -27216,7 +27228,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42299,7 +42311,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42393,7 +42405,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42831,7 +42843,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -43064,7 +43076,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 

Modified: branches/Cog/src/vm/cointerpmt.h
===================================================================
--- branches/Cog/src/vm/cointerpmt.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/cointerpmt.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 

Modified: branches/Cog/src/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/src/vm/gcc3x-cointerp.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/gcc3x-cointerp.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1909,7 +1909,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.157]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.159]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -4299,7 +4299,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -4520,7 +4520,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -4566,7 +4566,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -5019,7 +5019,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -8686,7 +8686,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -9271,6 +9271,7 @@
 attemptToSwitchToMachineCode(sqInt bcpc)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt aCompiledMethodHeader;
+    sqInt aMethodOop;
     sqInt closure;
     CogMethod *cogMethod;
     CogBlockMethod *cogMethod1;
@@ -9292,7 +9293,8 @@
 	}
 	if (methodHasCogMethod(GIV(method))) {
 		/* begin cogMethodOf: */
-		methodHeader = longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+		aMethodOop = GIV(method);
+		methodHeader = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
 		assert((isNonIntegerObject(methodHeader))
 		 && ((((usqInt)methodHeader)) < (startOfMemory())));
 		cogMethod = ((CogMethod *) methodHeader);
@@ -10030,7 +10032,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -10601,7 +10603,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -14720,7 +14722,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -21933,7 +21935,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22205,7 +22207,17 @@
 sqInt
 methodUsesAlternateBytecodeSet(sqInt aMethodObj)
 {
-	return (((headerOf(aMethodObj)) >> 1)) < 0;
+    sqInt methodHeader;
+    sqInt methodHeader1;
+
+	/* begin headerIndicatesAlternateBytecodeSet: */
+	/* begin headerOf: */
+	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+	methodHeader = (isCogMethodReference(methodHeader1)
+		? (assert(((((CogMethod *) methodHeader1)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
+			(((CogMethod *) methodHeader1)->methodHeader))
+		: methodHeader1);
+	return ((methodHeader >> 1)) < 0;
 }
 
 
@@ -25478,7 +25490,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -25728,7 +25740,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26012,7 +26024,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -40931,7 +40943,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -40983,7 +40995,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -41416,7 +41428,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -41649,7 +41661,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -44545,7 +44557,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 

Modified: branches/Cog/src/vm/gcc3x-cointerpmt.c
===================================================================
--- branches/Cog/src/vm/gcc3x-cointerpmt.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/gcc3x-cointerpmt.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CoInterpreterMT VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc " __DATE__ ;
+static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2008,7 +2008,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.157]";
+const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.159]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 sqInt willNotThreadWarnCount;
@@ -4400,7 +4400,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -4621,7 +4621,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -4667,7 +4667,7 @@
 				assert(isOopCompiledMethod(GIV(method)));
 				
 #        if MULTIPLEBYTECODESETS
-				bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+				bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 					? 256
 					: 0);
 
@@ -5120,7 +5120,7 @@
 					assert(isOopCompiledMethod(GIV(method)));
 					
 #          if MULTIPLEBYTECODESETS
-					bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+					bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 						? 256
 						: 0);
 
@@ -8787,7 +8787,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -9372,6 +9372,7 @@
 attemptToSwitchToMachineCode(sqInt bcpc)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt aCompiledMethodHeader;
+    sqInt aMethodOop;
     sqInt closure;
     CogMethod *cogMethod;
     CogBlockMethod *cogMethod1;
@@ -9393,7 +9394,8 @@
 	}
 	if (methodHasCogMethod(GIV(method))) {
 		/* begin cogMethodOf: */
-		methodHeader = longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+		aMethodOop = GIV(method);
+		methodHeader = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
 		assert((isNonIntegerObject(methodHeader))
 		 && ((((usqInt)methodHeader)) < (startOfMemory())));
 		cogMethod = ((CogMethod *) methodHeader);
@@ -10190,7 +10192,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -10938,7 +10940,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -15269,7 +15271,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -15986,7 +15988,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -22693,7 +22695,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -22965,7 +22967,17 @@
 sqInt
 methodUsesAlternateBytecodeSet(sqInt aMethodObj)
 {
-	return (((headerOf(aMethodObj)) >> 1)) < 0;
+    sqInt methodHeader;
+    sqInt methodHeader1;
+
+	/* begin headerIndicatesAlternateBytecodeSet: */
+	/* begin headerOf: */
+	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+	methodHeader = (isCogMethodReference(methodHeader1)
+		? (assert(((((CogMethod *) methodHeader1)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
+			(((CogMethod *) methodHeader1)->methodHeader))
+		: methodHeader1);
+	return ((methodHeader >> 1)) < 0;
 }
 
 
@@ -26686,7 +26698,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -26936,7 +26948,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -27220,7 +27232,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42303,7 +42315,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42397,7 +42409,7 @@
 	assert(isOopCompiledMethod(GIV(method)));
 	
 #  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+	bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 		? 256
 		: 0);
 
@@ -42835,7 +42847,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 
@@ -43068,7 +43080,7 @@
 		assert(isOopCompiledMethod(GIV(method)));
 		
 #    if MULTIPLEBYTECODESETS
-		bytecodeSetSelector = ((((headerOf(GIV(method))) >> 1)) < 0
+		bytecodeSetSelector = (methodUsesAlternateBytecodeSet(GIV(method))
 			? 256
 			: 0);
 

Modified: branches/Cog/src/vm/interp.h
===================================================================
--- branches/Cog/src/vm/interp.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/interp.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/src/vm/vmCallback.h
===================================================================
--- branches/Cog/src/vm/vmCallback.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/src/vm/vmCallback.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.157 uuid: 9a11acbe-4a62-43ce-81de-934f351598cc
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 #define VM_CALLBACK_INC 1

Modified: branches/Cog/stackbuild/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj
===================================================================
--- branches/Cog/stackbuild/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/stackbuild/macbuild/Mpeg3Plugin/Mpeg3Plugin.xcodeproj/project.pbxproj	2012-05-02 23:13:02 UTC (rev 2552)
@@ -37,7 +37,6 @@
 		A2181C3810814EC700B8FC7A /* seek.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C0810814EC700B8FC7A /* seek.c */; };
 		A2181C3910814EC700B8FC7A /* slice.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C0910814EC700B8FC7A /* slice.c */; };
 		A2181C3A10814EC700B8FC7A /* vlc.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C0B10814EC700B8FC7A /* vlc.c */; };
-		A2181C421081506400B8FC7A /* sqMacFileBits.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C401081506400B8FC7A /* sqMacFileBits.c */; };
 		A2181C46108150C800B8FC7A /* Mpeg3Plugin.c in Sources */ = {isa = PBXBuildFile; fileRef = A2181C45108150C800B8FC7A /* Mpeg3Plugin.c */; };
 /* End PBXBuildFile section */
 
@@ -102,8 +101,6 @@
 		A2181C0A10814EC700B8FC7A /* slice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = slice.h; sourceTree = "<group>"; };
 		A2181C0B10814EC700B8FC7A /* vlc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vlc.c; sourceTree = "<group>"; };
 		A2181C0C10814EC700B8FC7A /* vlc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vlc.h; sourceTree = "<group>"; };
-		A2181C401081506400B8FC7A /* sqMacFileBits.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sqMacFileBits.c; path = "../../../platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.c"; sourceTree = SOURCE_ROOT; };
-		A2181C411081506400B8FC7A /* sqMacFileBits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sqMacFileBits.h; path = "../../../platforms/Mac OS/plugins/Mpeg3Plugin/sqMacFileBits.h"; sourceTree = SOURCE_ROOT; };
 		A2181C45108150C800B8FC7A /* Mpeg3Plugin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Mpeg3Plugin.c; path = ../../../src/plugins/Mpeg3Plugin/Mpeg3Plugin.c; sourceTree = SOURCE_ROOT; };
 		A2181C491081511C00B8FC7A /* Mpeg3Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mpeg3Plugin.h; path = ../../../platforms/Cross/plugins/Mpeg3Plugin/Mpeg3Plugin.h; sourceTree = SOURCE_ROOT; };
 /* End PBXFileReference section */
@@ -135,8 +132,6 @@
 			children = (
 				A2181C491081511C00B8FC7A /* Mpeg3Plugin.h */,
 				A2181C45108150C800B8FC7A /* Mpeg3Plugin.c */,
-				A2181C401081506400B8FC7A /* sqMacFileBits.c */,
-				A2181C411081506400B8FC7A /* sqMacFileBits.h */,
 				A2181BC610814EC700B8FC7A /* libmpeg */,
 				A2181BC510814EA000B8FC7A /* config.h */,
 				A2181BC410814E7000B8FC7A /* interp.h */,
@@ -331,7 +326,6 @@
 				A2181C3810814EC700B8FC7A /* seek.c in Sources */,
 				A2181C3910814EC700B8FC7A /* slice.c in Sources */,
 				A2181C3A10814EC700B8FC7A /* vlc.c in Sources */,
-				A2181C421081506400B8FC7A /* sqMacFileBits.c in Sources */,
 				A2181C46108150C800B8FC7A /* Mpeg3Plugin.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Modified: branches/Cog/stacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/stacksrc/vm/gcc3x-interp.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/stacksrc/vm/gcc3x-interp.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	StackInterpreter VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875
+	StackInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -188,6 +188,7 @@
 #define ImmutabilityBit 0x20000000
 #define InstanceSpecificationIndex 2
 #define InstructionPointerIndex 1
+#define KeyIndex 0
 #define LargeContextBit 0x40000
 #define LargeContextBytes 252
 #define LargeContextSize 252
@@ -519,6 +520,7 @@
 static sqInt loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray);
 void loadInitialContext(void);
 void longPrintOop(sqInt oop);
+void longPrintReferencesTo(sqInt anOop);
 static sqInt lookupInMethodCacheSelclass(sqInt selector, sqInt class);
 static sqInt lookupMethodInClass(sqInt class);
 static sqInt lookupMethodInDictionary(sqInt dictionary);
@@ -537,6 +539,7 @@
 static sqInt markStackPageMostRecentlyUsed(StackPage *page);
 static sqInt markStackPageNextMostRecentlyUsed(StackPage *page);
 static sqInt marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop, sqInt stackDeltaForCurrentFrame);
+static void marryContextInNewStackPageAndInitializeInterpreterRegisters(sqInt aContext);
 static sqInt marryFrameSP(char *theFP, char *theSP);
 sqInt maybeSplObj(sqInt index);
 sqInt methodArgumentCount(void);
@@ -564,6 +567,7 @@
 sqInt oopFromChunk(sqInt chunk);
 static sqInt oopHasAcceptableClass(sqInt signedOop);
 static sqInt oopHasOkayClass(sqInt signedOop);
+static sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop);
 static sqInt oopisGreaterThanandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop);
 static sqInt oopisLessThan(sqInt anOop, sqInt otherOop);
 static sqInt pageIndexFor(void *pointer);
@@ -971,16 +975,16 @@
 _iss usqInt youngStart;
 _iss sqInt messageSelector;
 _iss usqInt newMethod;
+_iss usqInt endOfMemory;
 _iss usqInt instructionPointer;
-_iss usqInt endOfMemory;
 _iss sqInt rootTableCount;
 _iss sqInt remapBufferCount;
 _iss sqInt trueObj;
 _iss sqInt falseObj;
 _iss StackPage * pages;
-_iss char * stackLimit;
 _iss sqInt lkupClass;
 _iss usqInt reserveStart;
+_iss char * stackLimit;
 _iss char * stackMemory;
 _iss sqInt bytesPerPage;
 _iss usqInt memoryLimit;
@@ -1010,12 +1014,12 @@
 _iss sqInt statGrowMemory;
 _iss sqInt statMarkCount;
 _iss sqInt classNameIndex;
+_iss sqInt coInterpreter;
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt lowSpaceThreshold;
 _iss sqInt profileSemaphore;
 _iss usqLong statGCEndUsecs;
 _iss sqInt statSweepCount;
-_iss sqInt coInterpreter;
 _iss usqInt compEnd;
 _iss sqInt metaclassSizeBytes;
 _iss sqInt pendingFinalizationSignals;
@@ -1326,7 +1330,7 @@
 	/* 212 */ primitiveContextSize,
 	/* 213 */ primitiveContextXray,
 	/* 214 */ primitiveVoidVMState,
-	/* 215 */ (void (*)(void))0,
+	/* 215 */ primitiveFlushCacheByMethod,
 	/* 216 */ (void (*)(void))0,
 	/* 217 */ (void (*)(void))0,
 	/* 218 */ primitiveDoNamedPrimitiveWithArgs,
@@ -1690,7 +1694,7 @@
  0 };
 char * breakSelector;
 sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.152]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.159]";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -7161,8 +7165,11 @@
 								goto l92;
 							}
 							else {
-								result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1);
-								goto l92;
+								if ((fmt < 12)
+								 || (((index >> 1)) >= (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+									result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1);
+									goto l92;
+								}
 							}
 						}
 						/* begin primitiveFailFor: */
@@ -7240,25 +7247,25 @@
 								goto l94;
 							}
 							if (fmt >= 16) {
-
-								/* Note fmt >= 16 is an artificial flag for strings */
-
-								valToPut = asciiOfCharacter(value);
-								if (!(!GIV(primFailCode))) {
+								if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) {
+									GIV(primFailCode) = PrimErrBadArgument;
 									goto l94;
 								}
+								valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord));
 							}
 							else {
+								if ((fmt >= 12)
+								 && (((index >> 1)) < (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+									GIV(primFailCode) = PrimErrBadIndex;
+									goto l94;
+								}
 								valToPut = value;
 							}
 							if ((valToPut & 1)) {
 								valToPut = (valToPut >> 1);
 								if (!((valToPut >= 0)
 									 && (valToPut <= 255))) {
-									/* begin primitiveFail */
-									if (!GIV(primFailCode)) {
-										GIV(primFailCode) = 1;
-									}
+									GIV(primFailCode) = PrimErrBadArgument;
 									goto l94;
 								}
 								byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut);
@@ -9990,25 +9997,25 @@
 					goto l1;
 				}
 				if (fmt >= 16) {
-
-					/* Note fmt >= 16 is an artificial flag for strings */
-
-					valToPut = asciiOfCharacter(value);
-					if (!(!GIV(primFailCode))) {
+					if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) {
+						GIV(primFailCode) = PrimErrBadArgument;
 						goto l1;
 					}
+					valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord));
 				}
 				else {
+					if ((fmt >= 12)
+					 && (index < (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+						GIV(primFailCode) = PrimErrBadIndex;
+						goto l1;
+					}
 					valToPut = value;
 				}
 				if ((valToPut & 1)) {
 					valToPut = (valToPut >> 1);
 					if (!((valToPut >= 0)
 						 && (valToPut <= 255))) {
-						/* begin primitiveFail */
-						if (!GIV(primFailCode)) {
-							GIV(primFailCode) = 1;
-						}
+						GIV(primFailCode) = PrimErrBadArgument;
 						goto l1;
 					}
 					byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut);
@@ -10126,8 +10133,11 @@
 					goto l1;
 				}
 				else {
-					result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1);
-					goto l1;
+					if ((fmt < 12)
+					 || (index >= (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+						result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1);
+						goto l1;
+					}
 				}
 			}
 			/* begin primitiveFailFor: */
@@ -11531,7 +11541,6 @@
     char *theSP1;
     sqInt valuePointer;
 
-	assert(theFP != GIV(framePointer));
 	assert((GIV(stackPage) == 0)
 	 || (GIV(stackPage) == (mostRecentlyUsedPage())));
 	/* begin stackPageFor: */
@@ -14410,13 +14419,9 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
     sqInt activeProc;
-    sqInt aMethodObj;
-    StackPage *newPage;
     sqInt stackPageBytes;
     sqInt stackPagesBytes;
-    char *theFP;
     void *theStackMemory;
-    sqInt top;
 
 	stackPageBytes = stackPageByteSize();
 	stackPagesBytes = computeStackZoneSize();
@@ -14430,36 +14435,7 @@
 	}
 	activeProc = longAt(((longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) + BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) + (ActiveProcessIndex << ShiftForWord));
 	activeContext = longAt((activeProc + BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord));
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	VM_LABEL(0marryContextInNewStackPageAndInitializeInterpreterRegisters);
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 	ioInitHeartbeat();
 	interpret();
 	return null;
@@ -15152,7 +15128,8 @@
     StackPage *thePage;
     sqInt value;
 
-	assert(isContext(aOnceMarriedContext));
+	assert((isContext(aOnceMarriedContext))
+	 && (isMarriedOrWidowedContext(aOnceMarriedContext)));
 	/* begin frameOfMarriedContext: */
 	value = longAt((aOnceMarriedContext + BaseHeaderSize) + (SenderIndex << ShiftForWord));
 	/* begin withoutSmallIntegerTags: */
@@ -15913,10 +15890,6 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
     sqInt activeProc;
-    sqInt aMethodObj;
-    StackPage *newPage;
-    char *theFP;
-    sqInt top;
 
 	if ((checkForLeaks & 1) != 0) {
 		clearLeakMapAndMapAccessibleObjects();
@@ -15924,36 +15897,7 @@
 	}
 	activeProc = longAt(((longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) + BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) + (ActiveProcessIndex << ShiftForWord));
 	activeContext = longAt((activeProc + BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord));
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	VM_LABEL(1marryContextInNewStackPageAndInitializeInterpreterRegisters);
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 }
 
 void
@@ -16057,6 +16001,134 @@
 }
 
 
+/*	Scan the heap long printing the oops of any and all objects that refer to
+	anOop 
+ */
+
+void
+longPrintReferencesTo(sqInt anOop)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt header;
+    sqInt header1;
+    sqInt header2;
+    sqInt i;
+    sqInt obj;
+    sqInt obj1;
+    sqInt oop;
+    sqInt prntObj;
+    sqInt sz;
+    sqInt sz1;
+    sqInt sz2;
+
+	prntObj = 0;
+	/* begin firstAccessibleObject */
+	obj1 = memory + (headerTypeBytes[(longAt(memory)) & TypeMask]);
+	while ((((usqInt) obj1)) < (((usqInt) GIV(freeStart)))) {
+		if (!(((longAt(obj1)) & TypeMask) == HeaderTypeFree)) {
+			oop = obj1;
+			goto l2;
+		}
+		/* begin objectAfter: */
+		if (DoAssertionChecks) {
+			if ((((usqInt) obj1)) >= (((usqInt) GIV(endOfMemory)))) {
+				error("no objects after the end of memory");
+			}
+		}
+		if (((longAt(obj1)) & TypeMask) == HeaderTypeFree) {
+			sz = (longAt(obj1)) & AllButTypeMask;
+		}
+		else {
+			/* begin sizeBitsOf: */
+			header = longAt(obj1);
+			sz = ((header & TypeMask) == HeaderTypeSizeAndClass
+				? (longAt(obj1 - (BytesPerWord * 2))) & LongSizeMask
+				: header & SizeMask);
+		}
+		obj1 = (obj1 + sz) + (headerTypeBytes[(longAt(obj1 + sz)) & TypeMask]);
+	}
+	error("heap is empty");
+	oop = null;
+l2:	/* end firstAccessibleObject */;
+	while (!(oop == null)) {
+		if ((((oop & 1) == 0)
+ && (((((usqInt) (longAt(oop))) >> 8) & 15) <= 4))
+		 || (((((usqInt) (longAt(oop))) >> 8) & 15) >= 12)) {
+			if (((((usqInt) (longAt(oop))) >> 8) & 15) >= 12) {
+				i = ((((usqInt) (longAt((oop + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) - 1;
+			}
+			else {
+				if (((oop & 1) == 0)
+				 && (((((usqInt) (longAt(oop))) >> 12) & 31) == ClassMethodContextCompactIndex)) {
+					i = (CtxtTempFrameStart + (fetchStackPointerOf(oop))) - 1;
+				}
+				else {
+					i = (lengthOf(oop)) - 1;
+				}
+			}
+			while (i >= 0) {
+				if (anOop == (longAt((oop + BaseHeaderSize) + (i << ShiftForWord)))) {
+					printHex(oop);
+					print(" @ ");
+					printNum(i);
+					/* begin cr */
+					printf("\n");
+					prntObj = 1;
+					i = 0;
+				}
+				i -= 1;
+			}
+			if (prntObj) {
+				prntObj = 0;
+				longPrintOop(oop);
+			}
+		}
+		/* begin accessibleObjectAfter: */
+		/* begin objectAfter: */
+		if (DoAssertionChecks) {
+			if ((((usqInt) oop)) >= (((usqInt) GIV(endOfMemory)))) {
+				error("no objects after the end of memory");
+			}
+		}
+		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
+			sz2 = (longAt(oop)) & AllButTypeMask;
+		}
+		else {
+			/* begin sizeBitsOf: */
+			header2 = longAt(oop);
+			sz2 = ((header2 & TypeMask) == HeaderTypeSizeAndClass
+				? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
+				: header2 & SizeMask);
+		}
+		obj = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
+		while ((((usqInt) obj)) < (((usqInt) GIV(freeStart)))) {
+			if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
+				oop = obj;
+				goto l1;
+			}
+			/* begin objectAfter: */
+			if (DoAssertionChecks) {
+				if ((((usqInt) obj)) >= (((usqInt) GIV(endOfMemory)))) {
+					error("no objects after the end of memory");
+				}
+			}
+			if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
+				sz1 = (longAt(obj)) & AllButTypeMask;
+			}
+			else {
+				/* begin sizeBitsOf: */
+				header1 = longAt(obj);
+				sz1 = ((header1 & TypeMask) == HeaderTypeSizeAndClass
+					? (longAt(obj - (BytesPerWord * 2))) & LongSizeMask
+					: header1 & SizeMask);
+			}
+			obj = (obj + sz1) + (headerTypeBytes[(longAt(obj + sz1)) & TypeMask]);
+		}
+		oop = null;
+	l1:	/* end accessibleObjectAfter: */;
+	}
+}
+
+
 /*	This method implements a simple method lookup cache. If an entry for the
 	given selector and class is found in the cache, set the values of
 	'newMethod' and 'primitiveFunctionPointer' and return true. Otherwise,
@@ -17396,6 +17468,49 @@
 }
 
 
+/*	Establish aContext at the base of a new stackPage, make the stackPage the
+	active one and set-up the interreter registers. This is used to boot the
+	system and bring it back after a snapshot. */
+
+static void
+marryContextInNewStackPageAndInitializeInterpreterRegisters(sqInt aContext)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt aMethodObj;
+    StackPage *newPage;
+    char *theFP;
+    sqInt top;
+
+	assert(GIV(stackPage) == 0);
+	newPage = makeBaseFrameFor(aContext);
+	/* begin setStackPageAndLimit: */
+	GIV(stackPage) = newPage;
+	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
+		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
+	}
+	markStackPageMostRecentlyUsed(newPage);
+	GIV(framePointer) = (GIV(stackPage)->headFP);
+	GIV(stackPointer) = (GIV(stackPage)->headSP);
+	/* begin setMethod: */
+	/* begin iframeMethod: */
+	theFP = (GIV(stackPage)->headFP);
+	aMethodObj = longAt(theFP + FoxMethod);
+	GIV(method) = aMethodObj;
+	assert(isOopCompiledMethod(GIV(method)));
+	
+#  if MULTIPLEBYTECODESETS
+	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
+		? 256
+		: 0);
+
+#  endif /* MULTIPLEBYTECODESETS */
+
+	/* begin popStack */
+	top = longAt(GIV(stackPointer));
+	GIV(stackPointer) += BytesPerWord;
+	GIV(instructionPointer) = ((sqInt) top);
+}
+
+
 /*	Marry an unmarried frame. This means creating a spouse context
 	initialized with a subset of the frame's state (state through the last
 	argument) that references the frame. */
@@ -18124,6 +18239,17 @@
 	method will be inlined during C translation. */
 
 static sqInt
+oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop)
+{
+	return (((usqInt) anOop)) >= (((usqInt) otherOop));
+}
+
+
+/*	Compare two oop values, treating them as object memory locations.
+	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
+	method will be inlined during C translation. */
+
+static sqInt
 oopisGreaterThanandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop)
 {
 	return ((((usqInt) anOop)) > (((usqInt) baseOop)))
@@ -32199,45 +32325,13 @@
 primitiveVoidVMState(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
-    sqInt aMethodObj;
-    StackPage *newPage;
     char *sp;
-    char *theFP;
-    sqInt top;
 
 	/* begin push: */
 	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
 	GIV(stackPointer) = sp;
 	activeContext = voidVMStateForSnapshot();
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 }
 
 static void
@@ -32738,7 +32832,7 @@
 			printf("\n");
 		}
 		else {
-			print("widdowed (assuming framePointer valid)");
+			print("widowed (assuming framePointer valid)");
 			/* begin cr */
 			printf("\n");
 		}
@@ -33668,6 +33762,17 @@
 		goto l2;
 	}
 	printf("a(n) %.*s", nameLen, name);
+	if (((instanceSizeOf(classOop)) == (ValueIndex + 1))
+	 && (((longAt((classOop + BaseHeaderSize) + (SuperclassIndex << ShiftForWord))) == (superclassOf(fetchClassOfNonInt(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))))))
+	 && ((((longAt((oop + BaseHeaderSize) + (KeyIndex << ShiftForWord))) & 1) == 0)
+	 && (((((usqInt) (longAt(longAt((oop + BaseHeaderSize) + (KeyIndex << ShiftForWord))))) >> 8) & 15) >= 8)))) {
+		/* begin space */
+		/* begin printChar: */
+		putchar(' ');
+		printOopShort(longAt((oop + BaseHeaderSize) + (KeyIndex << ShiftForWord)));
+		print(" -> ");
+		printHex(longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord)));
+	}
 l2:	/* end printOopShortInner: */;
 	flush();
 }
@@ -36308,7 +36413,6 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
     sqInt activeProc;
-    sqInt aMethodObj;
     sqInt dataSize;
     sqInt fmt;
     sqInt header;
@@ -36316,7 +36420,6 @@
     sqInt header2;
     sqInt i;
     sqInt i1;
-    StackPage *newPage;
     sqInt object;
     sqInt object1;
     sqInt oop;
@@ -36331,8 +36434,6 @@
     sqInt stackIndex;
     sqInt sz;
     sqInt sz1;
-    char *theFP;
-    sqInt top;
 
 	/* begin push: */
 	object1 = GIV(instructionPointer);
@@ -36441,36 +36542,7 @@
 		}
 		longAtput((activeContext + BaseHeaderSize) + (StackPointerIndex << ShiftForWord), (((stackIndex - 1) << 1) | 1));
 	}
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	VM_LABEL(2marryContextInNewStackPageAndInitializeInterpreterRegisters);
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 	if (!GIV(primFailCode)) {
 		/* begin push: */
 		object = GIV(falseObj);
@@ -36861,40 +36933,40 @@
 	sz -= hdr & Size4Bit;
 	if (fmt <= 4) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> ShiftForWord;
-		goto l1;
+		goto l2;
 	}
 	if (fmt < 8) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> 2;
-		goto l1;
+		goto l2;
 	}
 	else {
 		totalLength = (sz - BaseHeaderSize) - (fmt & 3);
-		goto l1;
+		goto l2;
 	}
-l1:	/* end lengthOf:baseHeader:format: */;
+l2:	/* end lengthOf:baseHeader:format: */;
 	/* begin fixedFieldsOf:format:length: */
 	if ((fmt > 4)
 	 || (fmt == 2)) {
 		fixedFields = 0;
-		goto l3;
+		goto l4;
 	}
 	if (fmt < 2) {
 		fixedFields = totalLength;
-		goto l3;
+		goto l4;
 	}
 	/* begin fetchClassOfNonInt: */
 	if (((ccIndex = (((usqInt) (longAt(array))) >> 12) & 31)) == 0) {
 		class = (longAt(array - BaseHeaderSize)) & AllButTypeMask;
-		goto l4;
+		goto l3;
 	}
 	else {
 		class = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord));
-		goto l4;
+		goto l3;
 	}
-l4:	/* end fetchClassOfNonInt: */;
+l3:	/* end fetchClassOfNonInt: */;
 	classFormat = (longAt((class + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) - 1;
 	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 63)) - 1;
-l3:	/* end fixedFieldsOf:format:length: */;
+l4:	/* end fixedFieldsOf:format:length: */;
 	if ((fmt == 3)
 	 && (((((usqInt) hdr) >> 12) & 31) == ClassMethodContextCompactIndex)) {
 		/* begin stackPointerForMaybeMarriedContext: */
@@ -36904,17 +36976,17 @@
 			sp = stackPointerIndexForFrame(frameOfMarriedContext(array));
 			assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array)));
 			stSize = sp;
-			goto l2;
+			goto l1;
 		}
 		/* begin fetchStackPointerOf: */
 		sp1 = longAt((array + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
 		if (!((sp1 & 1))) {
 			stSize = 0;
-			goto l2;
+			goto l1;
 		}
 		assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array)));
 		stSize = (sp1 >> 1);
-	l2:	/* end stackPointerForMaybeMarriedContext: */;
+	l1:	/* end stackPointerForMaybeMarriedContext: */;
 		if (((((usqInt) index)) >= (((usqInt) 1)))
 		 && (((((usqInt) index)) <= (((usqInt) stSize)))
 		 && ((((longAt((array + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
@@ -36925,7 +36997,9 @@
 	else {
 		stSize = totalLength - fixedFields;
 	}
-	if (((((usqInt) index)) >= (((usqInt) 1)))
+	if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12
+	? ((((((usqInt) (longAt((array + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1
+	: 1)))
 	 && ((((usqInt) index)) <= (((usqInt) stSize)))) {
 		/* begin subscript:with:format: */
 		if (fmt <= 4) {
@@ -36978,40 +37052,40 @@
 	sz -= hdr & Size4Bit;
 	if (fmt <= 4) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> ShiftForWord;
-		goto l1;
+		goto l2;
 	}
 	if (fmt < 8) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> 2;
-		goto l1;
+		goto l2;
 	}
 	else {
 		totalLength = (sz - BaseHeaderSize) - (fmt & 3);
-		goto l1;
+		goto l2;
 	}
-l1:	/* end lengthOf:baseHeader:format: */;
+l2:	/* end lengthOf:baseHeader:format: */;
 	/* begin fixedFieldsOf:format:length: */
 	if ((fmt > 4)
 	 || (fmt == 2)) {
 		fixedFields = 0;
-		goto l3;
+		goto l4;
 	}
 	if (fmt < 2) {
 		fixedFields = totalLength;
-		goto l3;
+		goto l4;
 	}
 	/* begin fetchClassOfNonInt: */
 	if (((ccIndex = (((usqInt) (longAt(array))) >> 12) & 31)) == 0) {
 		class = (longAt(array - BaseHeaderSize)) & AllButTypeMask;
-		goto l4;
+		goto l3;
 	}
 	else {
 		class = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord));
-		goto l4;
+		goto l3;
 	}
-l4:	/* end fetchClassOfNonInt: */;
+l3:	/* end fetchClassOfNonInt: */;
 	classFormat = (longAt((class + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) - 1;
 	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 63)) - 1;
-l3:	/* end fixedFieldsOf:format:length: */;
+l4:	/* end fixedFieldsOf:format:length: */;
 	if ((fmt == 3)
 	 && (((((usqInt) hdr) >> 12) & 31) == ClassMethodContextCompactIndex)) {
 		/* begin stackPointerForMaybeMarriedContext: */
@@ -37021,17 +37095,17 @@
 			sp = stackPointerIndexForFrame(frameOfMarriedContext(array));
 			assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array)));
 			stSize = sp;
-			goto l2;
+			goto l1;
 		}
 		/* begin fetchStackPointerOf: */
 		sp1 = longAt((array + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
 		if (!((sp1 & 1))) {
 			stSize = 0;
-			goto l2;
+			goto l1;
 		}
 		assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array)));
 		stSize = (sp1 >> 1);
-	l2:	/* end stackPointerForMaybeMarriedContext: */;
+	l1:	/* end stackPointerForMaybeMarriedContext: */;
 		if (((((usqInt) index)) >= (((usqInt) 1)))
 		 && (((((usqInt) index)) <= (((usqInt) stSize)))
 		 && ((((longAt((array + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
@@ -37043,7 +37117,9 @@
 	else {
 		stSize = totalLength - fixedFields;
 	}
-	if (((((usqInt) index)) >= (((usqInt) 1)))
+	if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12
+	? ((((((usqInt) (longAt((array + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1
+	: 1)))
 	 && ((((usqInt) index)) <= (((usqInt) stSize)))) {
 		/* begin subscript:with:storing:format: */
 		VM_LABEL(2subscriptwithstoringformat);

Modified: branches/Cog/stacksrc/vm/interp.c
===================================================================
--- branches/Cog/stacksrc/vm/interp.c	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/stacksrc/vm/interp.c	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
    from
-	StackInterpreter VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875
+	StackInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -185,6 +185,7 @@
 #define ImmutabilityBit 0x20000000
 #define InstanceSpecificationIndex 2
 #define InstructionPointerIndex 1
+#define KeyIndex 0
 #define LargeContextBit 0x40000
 #define LargeContextBytes 252
 #define LargeContextSize 252
@@ -516,6 +517,7 @@
 static sqInt loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray);
 void loadInitialContext(void);
 void longPrintOop(sqInt oop);
+void longPrintReferencesTo(sqInt anOop);
 static sqInt lookupInMethodCacheSelclass(sqInt selector, sqInt class);
 static sqInt lookupMethodInClass(sqInt class);
 static sqInt lookupMethodInDictionary(sqInt dictionary);
@@ -534,6 +536,7 @@
 static sqInt markStackPageMostRecentlyUsed(StackPage *page);
 static sqInt markStackPageNextMostRecentlyUsed(StackPage *page);
 static sqInt marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop, sqInt stackDeltaForCurrentFrame);
+static void marryContextInNewStackPageAndInitializeInterpreterRegisters(sqInt aContext);
 static sqInt marryFrameSP(char *theFP, char *theSP);
 sqInt maybeSplObj(sqInt index);
 sqInt methodArgumentCount(void);
@@ -561,6 +564,7 @@
 sqInt oopFromChunk(sqInt chunk);
 static sqInt oopHasAcceptableClass(sqInt signedOop);
 static sqInt oopHasOkayClass(sqInt signedOop);
+static sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop);
 static sqInt oopisGreaterThanandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop);
 static sqInt oopisLessThan(sqInt anOop, sqInt otherOop);
 static sqInt pageIndexFor(void *pointer);
@@ -968,16 +972,16 @@
 _iss usqInt youngStart;
 _iss sqInt messageSelector;
 _iss usqInt newMethod;
+_iss usqInt endOfMemory;
 _iss usqInt instructionPointer;
-_iss usqInt endOfMemory;
 _iss sqInt rootTableCount;
 _iss sqInt remapBufferCount;
 _iss sqInt trueObj;
 _iss sqInt falseObj;
 _iss StackPage * pages;
-_iss char * stackLimit;
 _iss sqInt lkupClass;
 _iss usqInt reserveStart;
+_iss char * stackLimit;
 _iss char * stackMemory;
 _iss sqInt bytesPerPage;
 _iss usqInt memoryLimit;
@@ -1007,12 +1011,12 @@
 _iss sqInt statGrowMemory;
 _iss sqInt statMarkCount;
 _iss sqInt classNameIndex;
+_iss sqInt coInterpreter;
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt lowSpaceThreshold;
 _iss sqInt profileSemaphore;
 _iss usqLong statGCEndUsecs;
 _iss sqInt statSweepCount;
-_iss sqInt coInterpreter;
 _iss usqInt compEnd;
 _iss sqInt metaclassSizeBytes;
 _iss sqInt pendingFinalizationSignals;
@@ -1323,7 +1327,7 @@
 	/* 212 */ primitiveContextSize,
 	/* 213 */ primitiveContextXray,
 	/* 214 */ primitiveVoidVMState,
-	/* 215 */ (void (*)(void))0,
+	/* 215 */ primitiveFlushCacheByMethod,
 	/* 216 */ (void (*)(void))0,
 	/* 217 */ (void (*)(void))0,
 	/* 218 */ primitiveDoNamedPrimitiveWithArgs,
@@ -1687,7 +1691,7 @@
  0 };
 char * breakSelector;
 sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.152]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.159]";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -7157,8 +7161,11 @@
 								goto l92;
 							}
 							else {
-								result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1);
-								goto l92;
+								if ((fmt < 12)
+								 || (((index >> 1)) >= (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+									result = (((byteAt((rcvr + BaseHeaderSize) + (((index >> 1)) - 1))) << 1) | 1);
+									goto l92;
+								}
 							}
 						}
 						/* begin primitiveFailFor: */
@@ -7236,25 +7243,25 @@
 								goto l94;
 							}
 							if (fmt >= 16) {
-
-								/* Note fmt >= 16 is an artificial flag for strings */
-
-								valToPut = asciiOfCharacter(value);
-								if (!(!GIV(primFailCode))) {
+								if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) {
+									GIV(primFailCode) = PrimErrBadArgument;
 									goto l94;
 								}
+								valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord));
 							}
 							else {
+								if ((fmt >= 12)
+								 && (((index >> 1)) < (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+									GIV(primFailCode) = PrimErrBadIndex;
+									goto l94;
+								}
 								valToPut = value;
 							}
 							if ((valToPut & 1)) {
 								valToPut = (valToPut >> 1);
 								if (!((valToPut >= 0)
 									 && (valToPut <= 255))) {
-									/* begin primitiveFail */
-									if (!GIV(primFailCode)) {
-										GIV(primFailCode) = 1;
-									}
+									GIV(primFailCode) = PrimErrBadArgument;
 									goto l94;
 								}
 								byteAtput((rcvr + BaseHeaderSize) + (((index >> 1)) - 1), valToPut);
@@ -9986,25 +9993,25 @@
 					goto l1;
 				}
 				if (fmt >= 16) {
-
-					/* Note fmt >= 16 is an artificial flag for strings */
-
-					valToPut = asciiOfCharacter(value);
-					if (!(!GIV(primFailCode))) {
+					if (!(isinstanceOfcompactClassIndex(value, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassCharacter << ShiftForWord)), 0))) {
+						GIV(primFailCode) = PrimErrBadArgument;
 						goto l1;
 					}
+					valToPut = longAt((value + BaseHeaderSize) + (CharacterValueIndex << ShiftForWord));
 				}
 				else {
+					if ((fmt >= 12)
+					 && (index < (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+						GIV(primFailCode) = PrimErrBadIndex;
+						goto l1;
+					}
 					valToPut = value;
 				}
 				if ((valToPut & 1)) {
 					valToPut = (valToPut >> 1);
 					if (!((valToPut >= 0)
 						 && (valToPut <= 255))) {
-						/* begin primitiveFail */
-						if (!GIV(primFailCode)) {
-							GIV(primFailCode) = 1;
-						}
+						GIV(primFailCode) = PrimErrBadArgument;
 						goto l1;
 					}
 					byteAtput((rcvr + BaseHeaderSize) + (index - 1), valToPut);
@@ -10122,8 +10129,11 @@
 					goto l1;
 				}
 				else {
-					result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1);
-					goto l1;
+					if ((fmt < 12)
+					 || (index >= (((((((usqInt) (longAt((rcvr + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1))) {
+						result = (((byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 1) | 1);
+						goto l1;
+					}
 				}
 			}
 			/* begin primitiveFailFor: */
@@ -11527,7 +11537,6 @@
     char *theSP1;
     sqInt valuePointer;
 
-	assert(theFP != GIV(framePointer));
 	assert((GIV(stackPage) == 0)
 	 || (GIV(stackPage) == (mostRecentlyUsedPage())));
 	/* begin stackPageFor: */
@@ -14406,13 +14415,9 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
     sqInt activeProc;
-    sqInt aMethodObj;
-    StackPage *newPage;
     sqInt stackPageBytes;
     sqInt stackPagesBytes;
-    char *theFP;
     void *theStackMemory;
-    sqInt top;
 
 	stackPageBytes = stackPageByteSize();
 	stackPagesBytes = computeStackZoneSize();
@@ -14426,36 +14431,7 @@
 	}
 	activeProc = longAt(((longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) + BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) + (ActiveProcessIndex << ShiftForWord));
 	activeContext = longAt((activeProc + BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord));
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	VM_LABEL(0marryContextInNewStackPageAndInitializeInterpreterRegisters);
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 	ioInitHeartbeat();
 	interpret();
 	return null;
@@ -15148,7 +15124,8 @@
     StackPage *thePage;
     sqInt value;
 
-	assert(isContext(aOnceMarriedContext));
+	assert((isContext(aOnceMarriedContext))
+	 && (isMarriedOrWidowedContext(aOnceMarriedContext)));
 	/* begin frameOfMarriedContext: */
 	value = longAt((aOnceMarriedContext + BaseHeaderSize) + (SenderIndex << ShiftForWord));
 	/* begin withoutSmallIntegerTags: */
@@ -15909,10 +15886,6 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
     sqInt activeProc;
-    sqInt aMethodObj;
-    StackPage *newPage;
-    char *theFP;
-    sqInt top;
 
 	if ((checkForLeaks & 1) != 0) {
 		clearLeakMapAndMapAccessibleObjects();
@@ -15920,36 +15893,7 @@
 	}
 	activeProc = longAt(((longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) + BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) + (ActiveProcessIndex << ShiftForWord));
 	activeContext = longAt((activeProc + BaseHeaderSize) + (SuspendedContextIndex << ShiftForWord));
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	VM_LABEL(1marryContextInNewStackPageAndInitializeInterpreterRegisters);
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 }
 
 void
@@ -16053,6 +15997,134 @@
 }
 
 
+/*	Scan the heap long printing the oops of any and all objects that refer to
+	anOop 
+ */
+
+void
+longPrintReferencesTo(sqInt anOop)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt header;
+    sqInt header1;
+    sqInt header2;
+    sqInt i;
+    sqInt obj;
+    sqInt obj1;
+    sqInt oop;
+    sqInt prntObj;
+    sqInt sz;
+    sqInt sz1;
+    sqInt sz2;
+
+	prntObj = 0;
+	/* begin firstAccessibleObject */
+	obj1 = memory + (headerTypeBytes[(longAt(memory)) & TypeMask]);
+	while ((((usqInt) obj1)) < (((usqInt) GIV(freeStart)))) {
+		if (!(((longAt(obj1)) & TypeMask) == HeaderTypeFree)) {
+			oop = obj1;
+			goto l2;
+		}
+		/* begin objectAfter: */
+		if (DoAssertionChecks) {
+			if ((((usqInt) obj1)) >= (((usqInt) GIV(endOfMemory)))) {
+				error("no objects after the end of memory");
+			}
+		}
+		if (((longAt(obj1)) & TypeMask) == HeaderTypeFree) {
+			sz = (longAt(obj1)) & AllButTypeMask;
+		}
+		else {
+			/* begin sizeBitsOf: */
+			header = longAt(obj1);
+			sz = ((header & TypeMask) == HeaderTypeSizeAndClass
+				? (longAt(obj1 - (BytesPerWord * 2))) & LongSizeMask
+				: header & SizeMask);
+		}
+		obj1 = (obj1 + sz) + (headerTypeBytes[(longAt(obj1 + sz)) & TypeMask]);
+	}
+	error("heap is empty");
+	oop = null;
+l2:	/* end firstAccessibleObject */;
+	while (!(oop == null)) {
+		if ((((oop & 1) == 0)
+ && (((((usqInt) (longAt(oop))) >> 8) & 15) <= 4))
+		 || (((((usqInt) (longAt(oop))) >> 8) & 15) >= 12)) {
+			if (((((usqInt) (longAt(oop))) >> 8) & 15) >= 12) {
+				i = ((((usqInt) (longAt((oop + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) - 1;
+			}
+			else {
+				if (((oop & 1) == 0)
+				 && (((((usqInt) (longAt(oop))) >> 12) & 31) == ClassMethodContextCompactIndex)) {
+					i = (CtxtTempFrameStart + (fetchStackPointerOf(oop))) - 1;
+				}
+				else {
+					i = (lengthOf(oop)) - 1;
+				}
+			}
+			while (i >= 0) {
+				if (anOop == (longAt((oop + BaseHeaderSize) + (i << ShiftForWord)))) {
+					printHex(oop);
+					print(" @ ");
+					printNum(i);
+					/* begin cr */
+					printf("\n");
+					prntObj = 1;
+					i = 0;
+				}
+				i -= 1;
+			}
+			if (prntObj) {
+				prntObj = 0;
+				longPrintOop(oop);
+			}
+		}
+		/* begin accessibleObjectAfter: */
+		/* begin objectAfter: */
+		if (DoAssertionChecks) {
+			if ((((usqInt) oop)) >= (((usqInt) GIV(endOfMemory)))) {
+				error("no objects after the end of memory");
+			}
+		}
+		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
+			sz2 = (longAt(oop)) & AllButTypeMask;
+		}
+		else {
+			/* begin sizeBitsOf: */
+			header2 = longAt(oop);
+			sz2 = ((header2 & TypeMask) == HeaderTypeSizeAndClass
+				? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
+				: header2 & SizeMask);
+		}
+		obj = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
+		while ((((usqInt) obj)) < (((usqInt) GIV(freeStart)))) {
+			if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
+				oop = obj;
+				goto l1;
+			}
+			/* begin objectAfter: */
+			if (DoAssertionChecks) {
+				if ((((usqInt) obj)) >= (((usqInt) GIV(endOfMemory)))) {
+					error("no objects after the end of memory");
+				}
+			}
+			if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
+				sz1 = (longAt(obj)) & AllButTypeMask;
+			}
+			else {
+				/* begin sizeBitsOf: */
+				header1 = longAt(obj);
+				sz1 = ((header1 & TypeMask) == HeaderTypeSizeAndClass
+					? (longAt(obj - (BytesPerWord * 2))) & LongSizeMask
+					: header1 & SizeMask);
+			}
+			obj = (obj + sz1) + (headerTypeBytes[(longAt(obj + sz1)) & TypeMask]);
+		}
+		oop = null;
+	l1:	/* end accessibleObjectAfter: */;
+	}
+}
+
+
 /*	This method implements a simple method lookup cache. If an entry for the
 	given selector and class is found in the cache, set the values of
 	'newMethod' and 'primitiveFunctionPointer' and return true. Otherwise,
@@ -17392,6 +17464,49 @@
 }
 
 
+/*	Establish aContext at the base of a new stackPage, make the stackPage the
+	active one and set-up the interreter registers. This is used to boot the
+	system and bring it back after a snapshot. */
+
+static void
+marryContextInNewStackPageAndInitializeInterpreterRegisters(sqInt aContext)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt aMethodObj;
+    StackPage *newPage;
+    char *theFP;
+    sqInt top;
+
+	assert(GIV(stackPage) == 0);
+	newPage = makeBaseFrameFor(aContext);
+	/* begin setStackPageAndLimit: */
+	GIV(stackPage) = newPage;
+	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
+		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
+	}
+	markStackPageMostRecentlyUsed(newPage);
+	GIV(framePointer) = (GIV(stackPage)->headFP);
+	GIV(stackPointer) = (GIV(stackPage)->headSP);
+	/* begin setMethod: */
+	/* begin iframeMethod: */
+	theFP = (GIV(stackPage)->headFP);
+	aMethodObj = longAt(theFP + FoxMethod);
+	GIV(method) = aMethodObj;
+	assert(isOopCompiledMethod(GIV(method)));
+	
+#  if MULTIPLEBYTECODESETS
+	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
+		? 256
+		: 0);
+
+#  endif /* MULTIPLEBYTECODESETS */
+
+	/* begin popStack */
+	top = longAt(GIV(stackPointer));
+	GIV(stackPointer) += BytesPerWord;
+	GIV(instructionPointer) = ((sqInt) top);
+}
+
+
 /*	Marry an unmarried frame. This means creating a spouse context
 	initialized with a subset of the frame's state (state through the last
 	argument) that references the frame. */
@@ -18120,6 +18235,17 @@
 	method will be inlined during C translation. */
 
 static sqInt
+oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop)
+{
+	return (((usqInt) anOop)) >= (((usqInt) otherOop));
+}
+
+
+/*	Compare two oop values, treating them as object memory locations.
+	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
+	method will be inlined during C translation. */
+
+static sqInt
 oopisGreaterThanandLessThan(sqInt anOop, sqInt baseOop, sqInt limitOop)
 {
 	return ((((usqInt) anOop)) > (((usqInt) baseOop)))
@@ -32195,45 +32321,13 @@
 primitiveVoidVMState(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
-    sqInt aMethodObj;
-    StackPage *newPage;
     char *sp;
-    char *theFP;
-    sqInt top;
 
 	/* begin push: */
 	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
 	GIV(stackPointer) = sp;
 	activeContext = voidVMStateForSnapshot();
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 }
 
 static void
@@ -32734,7 +32828,7 @@
 			printf("\n");
 		}
 		else {
-			print("widdowed (assuming framePointer valid)");
+			print("widowed (assuming framePointer valid)");
 			/* begin cr */
 			printf("\n");
 		}
@@ -33664,6 +33758,17 @@
 		goto l2;
 	}
 	printf("a(n) %.*s", nameLen, name);
+	if (((instanceSizeOf(classOop)) == (ValueIndex + 1))
+	 && (((longAt((classOop + BaseHeaderSize) + (SuperclassIndex << ShiftForWord))) == (superclassOf(fetchClassOfNonInt(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))))))
+	 && ((((longAt((oop + BaseHeaderSize) + (KeyIndex << ShiftForWord))) & 1) == 0)
+	 && (((((usqInt) (longAt(longAt((oop + BaseHeaderSize) + (KeyIndex << ShiftForWord))))) >> 8) & 15) >= 8)))) {
+		/* begin space */
+		/* begin printChar: */
+		putchar(' ');
+		printOopShort(longAt((oop + BaseHeaderSize) + (KeyIndex << ShiftForWord)));
+		print(" -> ");
+		printHex(longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord)));
+	}
 l2:	/* end printOopShortInner: */;
 	flush();
 }
@@ -36304,7 +36409,6 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt activeContext;
     sqInt activeProc;
-    sqInt aMethodObj;
     sqInt dataSize;
     sqInt fmt;
     sqInt header;
@@ -36312,7 +36416,6 @@
     sqInt header2;
     sqInt i;
     sqInt i1;
-    StackPage *newPage;
     sqInt object;
     sqInt object1;
     sqInt oop;
@@ -36327,8 +36430,6 @@
     sqInt stackIndex;
     sqInt sz;
     sqInt sz1;
-    char *theFP;
-    sqInt top;
 
 	/* begin push: */
 	object1 = GIV(instructionPointer);
@@ -36437,36 +36538,7 @@
 		}
 		longAtput((activeContext + BaseHeaderSize) + (StackPointerIndex << ShiftForWord), (((stackIndex - 1) << 1) | 1));
 	}
-	/* begin marryContextInNewStackPageAndInitializeInterpreterRegisters: */
-	VM_LABEL(2marryContextInNewStackPageAndInitializeInterpreterRegisters);
-	assert(GIV(stackPage) == 0);
-	newPage = makeBaseFrameFor(activeContext);
-	/* begin setStackPageAndLimit: */
-	GIV(stackPage) = newPage;
-	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
-		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
-	}
-	markStackPageMostRecentlyUsed(newPage);
-	GIV(framePointer) = (GIV(stackPage)->headFP);
-	GIV(stackPointer) = (GIV(stackPage)->headSP);
-	/* begin setMethod: */
-	/* begin iframeMethod: */
-	theFP = (GIV(stackPage)->headFP);
-	aMethodObj = longAt(theFP + FoxMethod);
-	GIV(method) = aMethodObj;
-	assert(isOopCompiledMethod(GIV(method)));
-	
-#  if MULTIPLEBYTECODESETS
-	bytecodeSetSelector = ((((longAt((GIV(method) + BaseHeaderSize) + (HeaderIndex << ShiftForWord))) >> 1)) < 0
-		? 256
-		: 0);
-
-#  endif /* MULTIPLEBYTECODESETS */
-
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
 	if (!GIV(primFailCode)) {
 		/* begin push: */
 		object = GIV(falseObj);
@@ -36857,40 +36929,40 @@
 	sz -= hdr & Size4Bit;
 	if (fmt <= 4) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> ShiftForWord;
-		goto l1;
+		goto l2;
 	}
 	if (fmt < 8) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> 2;
-		goto l1;
+		goto l2;
 	}
 	else {
 		totalLength = (sz - BaseHeaderSize) - (fmt & 3);
-		goto l1;
+		goto l2;
 	}
-l1:	/* end lengthOf:baseHeader:format: */;
+l2:	/* end lengthOf:baseHeader:format: */;
 	/* begin fixedFieldsOf:format:length: */
 	if ((fmt > 4)
 	 || (fmt == 2)) {
 		fixedFields = 0;
-		goto l3;
+		goto l4;
 	}
 	if (fmt < 2) {
 		fixedFields = totalLength;
-		goto l3;
+		goto l4;
 	}
 	/* begin fetchClassOfNonInt: */
 	if (((ccIndex = (((usqInt) (longAt(array))) >> 12) & 31)) == 0) {
 		class = (longAt(array - BaseHeaderSize)) & AllButTypeMask;
-		goto l4;
+		goto l3;
 	}
 	else {
 		class = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord));
-		goto l4;
+		goto l3;
 	}
-l4:	/* end fetchClassOfNonInt: */;
+l3:	/* end fetchClassOfNonInt: */;
 	classFormat = (longAt((class + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) - 1;
 	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 63)) - 1;
-l3:	/* end fixedFieldsOf:format:length: */;
+l4:	/* end fixedFieldsOf:format:length: */;
 	if ((fmt == 3)
 	 && (((((usqInt) hdr) >> 12) & 31) == ClassMethodContextCompactIndex)) {
 		/* begin stackPointerForMaybeMarriedContext: */
@@ -36900,17 +36972,17 @@
 			sp = stackPointerIndexForFrame(frameOfMarriedContext(array));
 			assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array)));
 			stSize = sp;
-			goto l2;
+			goto l1;
 		}
 		/* begin fetchStackPointerOf: */
 		sp1 = longAt((array + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
 		if (!((sp1 & 1))) {
 			stSize = 0;
-			goto l2;
+			goto l1;
 		}
 		assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array)));
 		stSize = (sp1 >> 1);
-	l2:	/* end stackPointerForMaybeMarriedContext: */;
+	l1:	/* end stackPointerForMaybeMarriedContext: */;
 		if (((((usqInt) index)) >= (((usqInt) 1)))
 		 && (((((usqInt) index)) <= (((usqInt) stSize)))
 		 && ((((longAt((array + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
@@ -36921,7 +36993,9 @@
 	else {
 		stSize = totalLength - fixedFields;
 	}
-	if (((((usqInt) index)) >= (((usqInt) 1)))
+	if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12
+	? ((((((usqInt) (longAt((array + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1
+	: 1)))
 	 && ((((usqInt) index)) <= (((usqInt) stSize)))) {
 		/* begin subscript:with:format: */
 		if (fmt <= 4) {
@@ -36974,40 +37048,40 @@
 	sz -= hdr & Size4Bit;
 	if (fmt <= 4) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> ShiftForWord;
-		goto l1;
+		goto l2;
 	}
 	if (fmt < 8) {
 		totalLength = ((usqInt) (sz - BaseHeaderSize)) >> 2;
-		goto l1;
+		goto l2;
 	}
 	else {
 		totalLength = (sz - BaseHeaderSize) - (fmt & 3);
-		goto l1;
+		goto l2;
 	}
-l1:	/* end lengthOf:baseHeader:format: */;
+l2:	/* end lengthOf:baseHeader:format: */;
 	/* begin fixedFieldsOf:format:length: */
 	if ((fmt > 4)
 	 || (fmt == 2)) {
 		fixedFields = 0;
-		goto l3;
+		goto l4;
 	}
 	if (fmt < 2) {
 		fixedFields = totalLength;
-		goto l3;
+		goto l4;
 	}
 	/* begin fetchClassOfNonInt: */
 	if (((ccIndex = (((usqInt) (longAt(array))) >> 12) & 31)) == 0) {
 		class = (longAt(array - BaseHeaderSize)) & AllButTypeMask;
-		goto l4;
+		goto l3;
 	}
 	else {
 		class = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord));
-		goto l4;
+		goto l3;
 	}
-l4:	/* end fetchClassOfNonInt: */;
+l3:	/* end fetchClassOfNonInt: */;
 	classFormat = (longAt((class + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) - 1;
 	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 63)) - 1;
-l3:	/* end fixedFieldsOf:format:length: */;
+l4:	/* end fixedFieldsOf:format:length: */;
 	if ((fmt == 3)
 	 && (((((usqInt) hdr) >> 12) & 31) == ClassMethodContextCompactIndex)) {
 		/* begin stackPointerForMaybeMarriedContext: */
@@ -37017,17 +37091,17 @@
 			sp = stackPointerIndexForFrame(frameOfMarriedContext(array));
 			assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(array)));
 			stSize = sp;
-			goto l2;
+			goto l1;
 		}
 		/* begin fetchStackPointerOf: */
 		sp1 = longAt((array + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
 		if (!((sp1 & 1))) {
 			stSize = 0;
-			goto l2;
+			goto l1;
 		}
 		assert((ReceiverIndex + ((sp1 >> 1))) < (lengthOf(array)));
 		stSize = (sp1 >> 1);
-	l2:	/* end stackPointerForMaybeMarriedContext: */;
+	l1:	/* end stackPointerForMaybeMarriedContext: */;
 		if (((((usqInt) index)) >= (((usqInt) 1)))
 		 && (((((usqInt) index)) <= (((usqInt) stSize)))
 		 && ((((longAt((array + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
@@ -37039,7 +37113,9 @@
 	else {
 		stSize = totalLength - fixedFields;
 	}
-	if (((((usqInt) index)) >= (((usqInt) 1)))
+	if ((oopisGreaterThanOrEqualTo(index, (fmt >= 12
+	? ((((((usqInt) (longAt((array + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))) >> 10) & 255) + LiteralStart) * BytesPerWord) + 1
+	: 1)))
 	 && ((((usqInt) index)) <= (((usqInt) stSize)))) {
 		/* begin subscript:with:storing:format: */
 		VM_LABEL(2subscriptwithstoringformat);

Modified: branches/Cog/stacksrc/vm/interp.h
===================================================================
--- branches/Cog/stacksrc/vm/interp.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/stacksrc/vm/interp.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/stacksrc/vm/vmCallback.h
===================================================================
--- branches/Cog/stacksrc/vm/vmCallback.h	2012-04-24 17:25:08 UTC (rev 2551)
+++ branches/Cog/stacksrc/vm/vmCallback.h	2012-05-02 23:13:02 UTC (rev 2552)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.152 uuid: d39d62b0-45ca-4621-8f67-e3981bbe1875
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.159 uuid: cbf7f95a-6fe2-4578-898e-47afb8524be4
  */
 
 #define VM_CALLBACK_INC 1



More information about the Vm-dev mailing list