[Vm-dev] [commit][3381] Cog VM source as per VMMaker.oscog-eem.1363

commits at squeakvm.org commits at squeakvm.org
Thu Jun 18 21:08:48 UTC 2015


Revision: 3381
Author:   eliot
Date:     2015-06-18 14:08:45 -0700 (Thu, 18 Jun 2015)
Log Message:
-----------
Cog VM source as per VMMaker.oscog-eem.1363

Move the Literal initialization code into CogAbstractInstruction and make sure
they are fully initializaed (old code left bogus annotations).

At least under X11 the OOLL ARM Cog VM now runs.

Conditionalize the PlatformNoDbgRegParms defines to be x86 only to avoid
warnings on ARM.

Modified Paths:
--------------
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    branches/Cog/platforms/Mac OS/vm/sqConfig.h
    branches/Cog/platforms/unix/vm/sqConfig.h
    branches/Cog/platforms/win32/vm/sqConfig.h
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogitARMv5.c
    branches/Cog/spursistasrc/vm/cogitIA32.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cogitARMv5.c
    branches/Cog/spursrc/vm/cogitIA32.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogitARMv5.c
    branches/Cog/src/vm/cogitIA32.c

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

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -400,9 +400,12 @@
 
 static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
 static sqInt availableRegisterOrNilFor(AbstractInstruction * self_in_availableRegisterOrNilFor, sqInt liveRegsMask) NoDbgRegParms;
+static AbstractInstruction * cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) NoDbgRegParms;
 static AbstractInstruction * generateICacheFlush(AbstractInstruction * self_in_generateICacheFlush) NoDbgRegParms;
 static AbstractInstruction * genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) NoDbgRegParms;
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget) NoDbgRegParms;
+static AbstractInstruction * initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) NoDbgRegParms;
+static AbstractInstruction * initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) NoDbgRegParms;
 static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) NoDbgRegParms;
 static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction) NoDbgRegParms;
 static sqInt isJump(AbstractInstruction * self_in_isJump) NoDbgRegParms;
@@ -1996,6 +1999,23 @@
 }
 
 
+/*	For out-of-line literal support, clone a literal from a literal. */
+
+	/* CogAbstractInstruction>>#cloneLiteralFrom: */
+static AbstractInstruction *
+cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral)
+{
+	assert((((existingLiteral->opcode)) == Literal)
+	 && (((self_in_cloneLiteralFrom->dependent)) == null));
+	(self_in_cloneLiteralFrom->opcode) = Literal;
+	(self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation);
+	((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]);
+	((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]);
+	((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]);
+	return self_in_cloneLiteralFrom;
+}
+
+
 /*	A dummy routine.
 	Processors that can generate code to flush the icache can override. */
 
@@ -2031,6 +2051,44 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+
+/*	For out-of-line literal support, initialize a sharable literal. */
+
+	/* CogAbstractInstruction>>#initializeSharableLiteral: */
+static AbstractInstruction *
+initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal)
+{
+	(self_in_initializeSharableLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeSharableLiteral->dependent) = null;
+	(self_in_initializeSharableLiteral->annotation) = null;
+	((self_in_initializeSharableLiteral->operands))[0] = literal;
+	((self_in_initializeSharableLiteral->operands))[1] = 1;
+	((self_in_initializeSharableLiteral->operands))[2] = -1;
+	return self_in_initializeSharableLiteral;
+}
+
+
+/*	For out-of-line literal support, initialize an unsharable literal. */
+
+	/* CogAbstractInstruction>>#initializeUniqueLiteral: */
+static AbstractInstruction *
+initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal)
+{
+	(self_in_initializeUniqueLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeUniqueLiteral->dependent) = null;
+	(self_in_initializeUniqueLiteral->annotation) = null;
+	((self_in_initializeUniqueLiteral->operands))[0] = literal;
+	((self_in_initializeUniqueLiteral->operands))[1] = 0;
+	((self_in_initializeUniqueLiteral->operands))[2] = -1;
+	return self_in_initializeUniqueLiteral;
+}
+
 	/* CogAbstractInstruction>>#isAFixup: */
 static sqInt
 isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress)
@@ -9623,7 +9681,7 @@
 {
     sqInt classIndex;
     sqInt i;
-    sqInt pc;
+    usqInt pc;
 
 	pc = (((((usqInt)cPIC)) + firstCPICCaseOffset) + cPICCaseSize) - (jumpLongConditionalByteSize(backEnd));
 	for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) {
@@ -10525,12 +10583,12 @@
 generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
 {
     unsigned char annotation;
-    sqInt delta;
+    usqInt delta;
     sqInt i;
     AbstractInstruction *instruction;
     sqInt length;
-    sqInt location;
-    sqInt mapEntry;
+    usqInt location;
+    usqInt mapEntry;
     sqInt maxDelta;
     usqInt mcpc;
 
@@ -11276,10 +11334,8 @@
     AbstractInstruction *existingInst;
     sqInt i;
     sqInt iLimiT;
-    sqInt index;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	(methodLabel->machineCodeSize = 0);
 	(methodLabel->opcode = Label);
@@ -11301,17 +11357,7 @@
 			for (i = 0; i < nextLiteralIndex; i += 1) {
 				existingInst = literalInstructionAt(i);
 				newInst = (&(newLiterals[i]));
-				(newInst->opcode = Literal);
-				/* begin operand0: */
-				operand = ((existingInst->operands))[0];
-				((newInst->operands))[0] = operand;
-				newInst;
-				/* begin setLiteralOpcodeIndex: */
-				/* begin literalOpcodeIndex */
-				assert(((existingInst->opcode)) == Literal);
-				index = ((sqInt)(((existingInst->operands))[2]));
-				assert(((newInst->opcode)) == Literal);
-				((newInst->operands))[2] = index;
+				cloneLiteralFrom(newInst, existingInst);
 				assert(((existingInst->dependent)) == null);
 				(existingInst->dependent = newInst);
 			}
@@ -20152,12 +20198,10 @@
     AbstractInstruction *existingInst;
     sqInt i;
     sqInt iLimiT;
-    sqInt index;
     sqInt initialNumLiterals;
     AbstractInstruction *litInst;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	if (nextLiteralIndex >= literalsSize) {
 		/* begin allocateLiterals: */
@@ -20174,17 +20218,7 @@
 				for (i = 0; i < nextLiteralIndex; i += 1) {
 					existingInst = literalInstructionAt(i);
 					newInst = (&(newLiterals[i]));
-					(newInst->opcode = Literal);
-					/* begin operand0: */
-					operand = ((existingInst->operands))[0];
-					((newInst->operands))[0] = operand;
-					newInst;
-					/* begin setLiteralOpcodeIndex: */
-					/* begin literalOpcodeIndex */
-					assert(((existingInst->opcode)) == Literal);
-					index = ((sqInt)(((existingInst->operands))[2]));
-					assert(((newInst->opcode)) == Literal);
-					((newInst->operands))[2] = index;
+					cloneLiteralFrom(newInst, existingInst);
 					assert(((existingInst->dependent)) == null);
 					(existingInst->dependent = newInst);
 				}
@@ -20202,17 +20236,7 @@
 		}
 	}
 	litInst = literalInstructionAt(nextLiteralIndex);
-	(litInst->opcode = Literal);
-	/* begin operand0: */
-	((litInst->operands))[0] = aLiteral;
-	litInst;
-	/* begin setIsUnique */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[1] = 0;
-	/* begin setLiteralOpcodeIndex: */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[2] = -1;
-	(litInst->dependent = null);
+	initializeUniqueLiteral(litInst, aLiteral);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 
@@ -20312,12 +20336,10 @@
     sqInt i;
     sqInt i1;
     sqInt iLimiT;
-    sqInt index;
     sqInt initialNumLiterals;
     AbstractInstruction *litInst;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	for (i = 0; i < nextLiteralIndex; i += 1) {
 		litInst = literalInstructionAt(i);
@@ -20342,17 +20364,7 @@
 				for (i1 = 0; i1 < nextLiteralIndex; i1 += 1) {
 					existingInst = literalInstructionAt(i1);
 					newInst = (&(newLiterals[i1]));
-					(newInst->opcode = Literal);
-					/* begin operand0: */
-					operand = ((existingInst->operands))[0];
-					((newInst->operands))[0] = operand;
-					newInst;
-					/* begin setLiteralOpcodeIndex: */
-					/* begin literalOpcodeIndex */
-					assert(((existingInst->opcode)) == Literal);
-					index = ((sqInt)(((existingInst->operands))[2]));
-					assert(((newInst->opcode)) == Literal);
-					((newInst->operands))[2] = index;
+					cloneLiteralFrom(newInst, existingInst);
 					assert(((existingInst->dependent)) == null);
 					(existingInst->dependent = newInst);
 				}
@@ -20370,17 +20382,7 @@
 		}
 	}
 	litInst = literalInstructionAt(nextLiteralIndex);
-	(litInst->opcode = Literal);
-	/* begin operand0: */
-	((litInst->operands))[0] = aLiteral;
-	litInst;
-	/* begin setIsSharable */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[1] = 1;
-	/* begin setLiteralOpcodeIndex: */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[2] = -1;
-	(litInst->dependent = null);
+	initializeSharableLiteral(litInst, aLiteral);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 

Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -392,10 +392,13 @@
 static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
 static sqInt availableRegisterOrNilFor(AbstractInstruction * self_in_availableRegisterOrNilFor, sqInt liveRegsMask) NoDbgRegParms;
+static AbstractInstruction * cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) NoDbgRegParms;
 static sqInt genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment) NoDbgRegParms;
 static AbstractInstruction * generateICacheFlush(AbstractInstruction * self_in_generateICacheFlush) NoDbgRegParms;
 static AbstractInstruction * genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) NoDbgRegParms;
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget) NoDbgRegParms;
+static AbstractInstruction * initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) NoDbgRegParms;
+static AbstractInstruction * initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) NoDbgRegParms;
 static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) NoDbgRegParms;
 static sqInt isJump(AbstractInstruction * self_in_isJump) NoDbgRegParms;
 static sqInt isLongJump(AbstractInstruction * self_in_isLongJump) NoDbgRegParms;
@@ -1948,6 +1951,23 @@
 	return null;
 }
 
+
+/*	For out-of-line literal support, clone a literal from a literal. */
+
+	/* CogAbstractInstruction>>#cloneLiteralFrom: */
+static AbstractInstruction *
+cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral)
+{
+	assert((((existingLiteral->opcode)) == Literal)
+	 && (((self_in_cloneLiteralFrom->dependent)) == null));
+	(self_in_cloneLiteralFrom->opcode) = Literal;
+	(self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation);
+	((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]);
+	((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]);
+	((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]);
+	return self_in_cloneLiteralFrom;
+}
+
 	/* CogAbstractInstruction>>#genAlignCStackSavingRegisters:numArgs:wordAlignment: */
 static sqInt
 genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment)
@@ -2006,6 +2026,44 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+
+/*	For out-of-line literal support, initialize a sharable literal. */
+
+	/* CogAbstractInstruction>>#initializeSharableLiteral: */
+static AbstractInstruction *
+initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal)
+{
+	(self_in_initializeSharableLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeSharableLiteral->dependent) = null;
+	(self_in_initializeSharableLiteral->annotation) = null;
+	((self_in_initializeSharableLiteral->operands))[0] = literal;
+	((self_in_initializeSharableLiteral->operands))[1] = 1;
+	((self_in_initializeSharableLiteral->operands))[2] = -1;
+	return self_in_initializeSharableLiteral;
+}
+
+
+/*	For out-of-line literal support, initialize an unsharable literal. */
+
+	/* CogAbstractInstruction>>#initializeUniqueLiteral: */
+static AbstractInstruction *
+initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal)
+{
+	(self_in_initializeUniqueLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeUniqueLiteral->dependent) = null;
+	(self_in_initializeUniqueLiteral->annotation) = null;
+	((self_in_initializeUniqueLiteral->operands))[0] = literal;
+	((self_in_initializeUniqueLiteral->operands))[1] = 0;
+	((self_in_initializeUniqueLiteral->operands))[2] = -1;
+	return self_in_initializeUniqueLiteral;
+}
+
 	/* CogAbstractInstruction>>#isAFixup: */
 static sqInt
 isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress)
@@ -9903,12 +9961,12 @@
 generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
 {
     unsigned char annotation;
-    usqInt delta;
+    sqInt delta;
     sqInt i;
     AbstractInstruction *instruction;
     sqInt length;
-    usqInt location;
-    usqInt mapEntry;
+    sqInt location;
+    sqInt mapEntry;
     sqInt maxDelta;
     usqInt mcpc;
 


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Thu Jun 18 11:49:45 PDT 2015
   + Thu Jun 18 14:07:34 PDT 2015

Modified: branches/Cog/platforms/Mac OS/vm/sqConfig.h
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqConfig.h	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/platforms/Mac OS/vm/sqConfig.h	2015-06-18 21:08:45 UTC (rev 3381)
@@ -22,6 +22,12 @@
 #endif
 
 #if defined(__GNUC__)
-# define PlatformNoDbgRegParms __attribute__ ((regparm (0)))
+/* Define the "don't generate functions with register parameters" attribute
+ * for x86 and similar.  Do so for debugging; gdb typically can't call static
+ * functions that have been optimized to use register arguments.
+ */
+# if defined(_M_I386) || defined(_X86_) || defined(i386) || defined(i486) || defined(i586) || defined(i686) || defined(__i386__) || defined(__386__) || defined(X86) || defined(I386)
+#	define PlatformNoDbgRegParms __attribute__ ((regparm (0)))
+# endif
 # define NeverInline __attribute__ ((noinline))
 #endif

Modified: branches/Cog/platforms/unix/vm/sqConfig.h
===================================================================
--- branches/Cog/platforms/unix/vm/sqConfig.h	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/platforms/unix/vm/sqConfig.h	2015-06-18 21:08:45 UTC (rev 3381)
@@ -20,6 +20,12 @@
 #endif
 
 #if defined(__GNUC__)
-# define PlatformNoDbgRegParms __attribute__ ((regparm (0)))
+/* Define the "don't generate functions with register parameters" attribute
+ * for x86 and similar.  Do so for debugging; gdb typically can't call static
+ * functions that have been optimized to use register arguments.
+ */
+# if defined(_M_I386) || defined(_X86_) || defined(i386) || defined(i486) || defined(i586) || defined(i686) || defined(__i386__) || defined(__386__) || defined(X86) || defined(I386)
+#	define PlatformNoDbgRegParms __attribute__ ((regparm (0)))
+# endif
 # define NeverInline __attribute__ ((noinline))
 #endif

Modified: branches/Cog/platforms/win32/vm/sqConfig.h
===================================================================
--- branches/Cog/platforms/win32/vm/sqConfig.h	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/platforms/win32/vm/sqConfig.h	2015-06-18 21:08:45 UTC (rev 3381)
@@ -33,6 +33,13 @@
 #define VMBIGENDIAN 0
 
 #if defined(__GNUC__) && (__GNUC__ == 3 || (!defined(__MINGW32__) && !defined(__MINGW64__)))
+/* Define the "don't generate functions with register parameters" attribute
+ * for x86 and similar.  Do so for debugging; gdb typically can't call static
+ * functions that have been optimized to use register arguments.
+ */
+# if defined(_M_I386) || defined(_X86_) || defined(i386) || defined(i486) || defined(i586) || defined(i686) || defined(__i386__) || defined(__386__) || defined(X86) || defined(I386)
+#	define PlatformNoDbgRegParms __attribute__ ((regparm (0)))
+# endif
 # define PlatformNoDbgRegParms __attribute__ ((regparm (0)))
 # define NeverInline __attribute__ ((noinline))
 #endif

Modified: branches/Cog/spursistasrc/vm/cogit.h
===================================================================
--- branches/Cog/spursistasrc/vm/cogit.h	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/spursistasrc/vm/cogit.h	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
 
 

Modified: branches/Cog/spursistasrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/spursistasrc/vm/cogitARMv5.c	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/spursistasrc/vm/cogitARMv5.c	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -397,9 +397,12 @@
 
 static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
 static sqInt availableRegisterOrNilFor(AbstractInstruction * self_in_availableRegisterOrNilFor, sqInt liveRegsMask) NoDbgRegParms;
+static AbstractInstruction * cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) NoDbgRegParms;
 static AbstractInstruction * generateICacheFlush(AbstractInstruction * self_in_generateICacheFlush) NoDbgRegParms;
 static AbstractInstruction * genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) NoDbgRegParms;
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget) NoDbgRegParms;
+static AbstractInstruction * initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) NoDbgRegParms;
+static AbstractInstruction * initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) NoDbgRegParms;
 static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) NoDbgRegParms;
 static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction) NoDbgRegParms;
 static sqInt isJump(AbstractInstruction * self_in_isJump) NoDbgRegParms;
@@ -1997,6 +2000,23 @@
 }
 
 
+/*	For out-of-line literal support, clone a literal from a literal. */
+
+	/* CogAbstractInstruction>>#cloneLiteralFrom: */
+static AbstractInstruction *
+cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral)
+{
+	assert((((existingLiteral->opcode)) == Literal)
+	 && (((self_in_cloneLiteralFrom->dependent)) == null));
+	(self_in_cloneLiteralFrom->opcode) = Literal;
+	(self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation);
+	((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]);
+	((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]);
+	((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]);
+	return self_in_cloneLiteralFrom;
+}
+
+
 /*	A dummy routine.
 	Processors that can generate code to flush the icache can override. */
 
@@ -2032,6 +2052,44 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+
+/*	For out-of-line literal support, initialize a sharable literal. */
+
+	/* CogAbstractInstruction>>#initializeSharableLiteral: */
+static AbstractInstruction *
+initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal)
+{
+	(self_in_initializeSharableLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeSharableLiteral->dependent) = null;
+	(self_in_initializeSharableLiteral->annotation) = null;
+	((self_in_initializeSharableLiteral->operands))[0] = literal;
+	((self_in_initializeSharableLiteral->operands))[1] = 1;
+	((self_in_initializeSharableLiteral->operands))[2] = -1;
+	return self_in_initializeSharableLiteral;
+}
+
+
+/*	For out-of-line literal support, initialize an unsharable literal. */
+
+	/* CogAbstractInstruction>>#initializeUniqueLiteral: */
+static AbstractInstruction *
+initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal)
+{
+	(self_in_initializeUniqueLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeUniqueLiteral->dependent) = null;
+	(self_in_initializeUniqueLiteral->annotation) = null;
+	((self_in_initializeUniqueLiteral->operands))[0] = literal;
+	((self_in_initializeUniqueLiteral->operands))[1] = 0;
+	((self_in_initializeUniqueLiteral->operands))[2] = -1;
+	return self_in_initializeUniqueLiteral;
+}
+
 	/* CogAbstractInstruction>>#isAFixup: */
 static sqInt
 isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress)
@@ -11027,10 +11085,8 @@
     AbstractInstruction *existingInst;
     sqInt i;
     sqInt iLimiT;
-    sqInt index;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	(methodLabel->machineCodeSize = 0);
 	(methodLabel->opcode = Label);
@@ -11052,17 +11108,7 @@
 			for (i = 0; i < nextLiteralIndex; i += 1) {
 				existingInst = literalInstructionAt(i);
 				newInst = (&(newLiterals[i]));
-				(newInst->opcode = Literal);
-				/* begin operand0: */
-				operand = ((existingInst->operands))[0];
-				((newInst->operands))[0] = operand;
-				newInst;
-				/* begin setLiteralOpcodeIndex: */
-				/* begin literalOpcodeIndex */
-				assert(((existingInst->opcode)) == Literal);
-				index = ((sqInt)(((existingInst->operands))[2]));
-				assert(((newInst->opcode)) == Literal);
-				((newInst->operands))[2] = index;
+				cloneLiteralFrom(newInst, existingInst);
 				assert(((existingInst->dependent)) == null);
 				(existingInst->dependent = newInst);
 			}
@@ -19275,12 +19321,10 @@
     AbstractInstruction *existingInst;
     sqInt i;
     sqInt iLimiT;
-    sqInt index;
     sqInt initialNumLiterals;
     AbstractInstruction *litInst;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	if (nextLiteralIndex >= literalsSize) {
 		/* begin allocateLiterals: */
@@ -19297,17 +19341,7 @@
 				for (i = 0; i < nextLiteralIndex; i += 1) {
 					existingInst = literalInstructionAt(i);
 					newInst = (&(newLiterals[i]));
-					(newInst->opcode = Literal);
-					/* begin operand0: */
-					operand = ((existingInst->operands))[0];
-					((newInst->operands))[0] = operand;
-					newInst;
-					/* begin setLiteralOpcodeIndex: */
-					/* begin literalOpcodeIndex */
-					assert(((existingInst->opcode)) == Literal);
-					index = ((sqInt)(((existingInst->operands))[2]));
-					assert(((newInst->opcode)) == Literal);
-					((newInst->operands))[2] = index;
+					cloneLiteralFrom(newInst, existingInst);
 					assert(((existingInst->dependent)) == null);
 					(existingInst->dependent = newInst);
 				}
@@ -19325,17 +19359,7 @@
 		}
 	}
 	litInst = literalInstructionAt(nextLiteralIndex);
-	(litInst->opcode = Literal);
-	/* begin operand0: */
-	((litInst->operands))[0] = aLiteral;
-	litInst;
-	/* begin setIsUnique */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[1] = 0;
-	/* begin setLiteralOpcodeIndex: */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[2] = -1;
-	(litInst->dependent = null);
+	initializeUniqueLiteral(litInst, aLiteral);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 
@@ -19435,12 +19459,10 @@
     sqInt i;
     sqInt i1;
     sqInt iLimiT;
-    sqInt index;
     sqInt initialNumLiterals;
     AbstractInstruction *litInst;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	for (i = 0; i < nextLiteralIndex; i += 1) {
 		litInst = literalInstructionAt(i);
@@ -19465,17 +19487,7 @@
 				for (i1 = 0; i1 < nextLiteralIndex; i1 += 1) {
 					existingInst = literalInstructionAt(i1);
 					newInst = (&(newLiterals[i1]));
-					(newInst->opcode = Literal);
-					/* begin operand0: */
-					operand = ((existingInst->operands))[0];
-					((newInst->operands))[0] = operand;
-					newInst;
-					/* begin setLiteralOpcodeIndex: */
-					/* begin literalOpcodeIndex */
-					assert(((existingInst->opcode)) == Literal);
-					index = ((sqInt)(((existingInst->operands))[2]));
-					assert(((newInst->opcode)) == Literal);
-					((newInst->operands))[2] = index;
+					cloneLiteralFrom(newInst, existingInst);
 					assert(((existingInst->dependent)) == null);
 					(existingInst->dependent = newInst);
 				}
@@ -19493,17 +19505,7 @@
 		}
 	}
 	litInst = literalInstructionAt(nextLiteralIndex);
-	(litInst->opcode = Literal);
-	/* begin operand0: */
-	((litInst->operands))[0] = aLiteral;
-	litInst;
-	/* begin setIsSharable */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[1] = 1;
-	/* begin setLiteralOpcodeIndex: */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[2] = -1;
-	(litInst->dependent = null);
+	initializeSharableLiteral(litInst, aLiteral);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 

Modified: branches/Cog/spursistasrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/spursistasrc/vm/cogitIA32.c	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/spursistasrc/vm/cogitIA32.c	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -389,10 +389,13 @@
 static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
 static sqInt availableRegisterOrNilFor(AbstractInstruction * self_in_availableRegisterOrNilFor, sqInt liveRegsMask) NoDbgRegParms;
+static AbstractInstruction * cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) NoDbgRegParms;
 static sqInt genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment) NoDbgRegParms;
 static AbstractInstruction * generateICacheFlush(AbstractInstruction * self_in_generateICacheFlush) NoDbgRegParms;
 static AbstractInstruction * genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) NoDbgRegParms;
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget) NoDbgRegParms;
+static AbstractInstruction * initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) NoDbgRegParms;
+static AbstractInstruction * initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) NoDbgRegParms;
 static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) NoDbgRegParms;
 static sqInt isJump(AbstractInstruction * self_in_isJump) NoDbgRegParms;
 static sqInt isLongJump(AbstractInstruction * self_in_isLongJump) NoDbgRegParms;
@@ -1950,6 +1953,23 @@
 	return null;
 }
 
+
+/*	For out-of-line literal support, clone a literal from a literal. */
+
+	/* CogAbstractInstruction>>#cloneLiteralFrom: */
+static AbstractInstruction *
+cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral)
+{
+	assert((((existingLiteral->opcode)) == Literal)
+	 && (((self_in_cloneLiteralFrom->dependent)) == null));
+	(self_in_cloneLiteralFrom->opcode) = Literal;
+	(self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation);
+	((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]);
+	((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]);
+	((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]);
+	return self_in_cloneLiteralFrom;
+}
+
 	/* CogAbstractInstruction>>#genAlignCStackSavingRegisters:numArgs:wordAlignment: */
 static sqInt
 genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment)
@@ -2008,6 +2028,44 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+
+/*	For out-of-line literal support, initialize a sharable literal. */
+
+	/* CogAbstractInstruction>>#initializeSharableLiteral: */
+static AbstractInstruction *
+initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal)
+{
+	(self_in_initializeSharableLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeSharableLiteral->dependent) = null;
+	(self_in_initializeSharableLiteral->annotation) = null;
+	((self_in_initializeSharableLiteral->operands))[0] = literal;
+	((self_in_initializeSharableLiteral->operands))[1] = 1;
+	((self_in_initializeSharableLiteral->operands))[2] = -1;
+	return self_in_initializeSharableLiteral;
+}
+
+
+/*	For out-of-line literal support, initialize an unsharable literal. */
+
+	/* CogAbstractInstruction>>#initializeUniqueLiteral: */
+static AbstractInstruction *
+initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal)
+{
+	(self_in_initializeUniqueLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeUniqueLiteral->dependent) = null;
+	(self_in_initializeUniqueLiteral->annotation) = null;
+	((self_in_initializeUniqueLiteral->operands))[0] = literal;
+	((self_in_initializeUniqueLiteral->operands))[1] = 0;
+	((self_in_initializeUniqueLiteral->operands))[2] = -1;
+	return self_in_initializeUniqueLiteral;
+}
+
 	/* CogAbstractInstruction>>#isAFixup: */
 static sqInt
 isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress)
@@ -9754,12 +9812,12 @@
 generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
 {
     unsigned char annotation;
-    sqInt delta;
+    usqInt delta;
     sqInt i;
     AbstractInstruction *instruction;
     sqInt length;
-    sqInt location;
-    sqInt mapEntry;
+    usqInt location;
+    usqInt mapEntry;
     sqInt maxDelta;
     usqInt mcpc;
 

Modified: branches/Cog/spursrc/vm/cogit.h
===================================================================
--- branches/Cog/spursrc/vm/cogit.h	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/spursrc/vm/cogit.h	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
 
 

Modified: branches/Cog/spursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/spursrc/vm/cogitARMv5.c	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/spursrc/vm/cogitARMv5.c	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -394,9 +394,12 @@
 
 static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
 static sqInt availableRegisterOrNilFor(AbstractInstruction * self_in_availableRegisterOrNilFor, sqInt liveRegsMask) NoDbgRegParms;
+static AbstractInstruction * cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) NoDbgRegParms;
 static AbstractInstruction * generateICacheFlush(AbstractInstruction * self_in_generateICacheFlush) NoDbgRegParms;
 static AbstractInstruction * genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) NoDbgRegParms;
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget) NoDbgRegParms;
+static AbstractInstruction * initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) NoDbgRegParms;
+static AbstractInstruction * initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) NoDbgRegParms;
 static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) NoDbgRegParms;
 static sqInt isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction) NoDbgRegParms;
 static sqInt isJump(AbstractInstruction * self_in_isJump) NoDbgRegParms;
@@ -1670,6 +1673,23 @@
 }
 
 
+/*	For out-of-line literal support, clone a literal from a literal. */
+
+	/* CogAbstractInstruction>>#cloneLiteralFrom: */
+static AbstractInstruction *
+cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral)
+{
+	assert((((existingLiteral->opcode)) == Literal)
+	 && (((self_in_cloneLiteralFrom->dependent)) == null));
+	(self_in_cloneLiteralFrom->opcode) = Literal;
+	(self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation);
+	((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]);
+	((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]);
+	((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]);
+	return self_in_cloneLiteralFrom;
+}
+
+
 /*	A dummy routine.
 	Processors that can generate code to flush the icache can override. */
 
@@ -1705,6 +1725,44 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+
+/*	For out-of-line literal support, initialize a sharable literal. */
+
+	/* CogAbstractInstruction>>#initializeSharableLiteral: */
+static AbstractInstruction *
+initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal)
+{
+	(self_in_initializeSharableLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeSharableLiteral->dependent) = null;
+	(self_in_initializeSharableLiteral->annotation) = null;
+	((self_in_initializeSharableLiteral->operands))[0] = literal;
+	((self_in_initializeSharableLiteral->operands))[1] = 1;
+	((self_in_initializeSharableLiteral->operands))[2] = -1;
+	return self_in_initializeSharableLiteral;
+}
+
+
+/*	For out-of-line literal support, initialize an unsharable literal. */
+
+	/* CogAbstractInstruction>>#initializeUniqueLiteral: */
+static AbstractInstruction *
+initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal)
+{
+	(self_in_initializeUniqueLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeUniqueLiteral->dependent) = null;
+	(self_in_initializeUniqueLiteral->annotation) = null;
+	((self_in_initializeUniqueLiteral->operands))[0] = literal;
+	((self_in_initializeUniqueLiteral->operands))[1] = 0;
+	((self_in_initializeUniqueLiteral->operands))[2] = -1;
+	return self_in_initializeUniqueLiteral;
+}
+
 	/* CogAbstractInstruction>>#isAFixup: */
 static sqInt
 isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress)
@@ -10669,10 +10727,8 @@
     AbstractInstruction *existingInst;
     sqInt i;
     sqInt iLimiT;
-    sqInt index;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	(methodLabel->machineCodeSize = 0);
 	(methodLabel->opcode = Label);
@@ -10694,17 +10750,7 @@
 			for (i = 0; i < nextLiteralIndex; i += 1) {
 				existingInst = literalInstructionAt(i);
 				newInst = (&(newLiterals[i]));
-				(newInst->opcode = Literal);
-				/* begin operand0: */
-				operand = ((existingInst->operands))[0];
-				((newInst->operands))[0] = operand;
-				newInst;
-				/* begin setLiteralOpcodeIndex: */
-				/* begin literalOpcodeIndex */
-				assert(((existingInst->opcode)) == Literal);
-				index = ((sqInt)(((existingInst->operands))[2]));
-				assert(((newInst->opcode)) == Literal);
-				((newInst->operands))[2] = index;
+				cloneLiteralFrom(newInst, existingInst);
 				assert(((existingInst->dependent)) == null);
 				(existingInst->dependent = newInst);
 			}
@@ -18561,12 +18607,10 @@
     AbstractInstruction *existingInst;
     sqInt i;
     sqInt iLimiT;
-    sqInt index;
     sqInt initialNumLiterals;
     AbstractInstruction *litInst;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	if (nextLiteralIndex >= literalsSize) {
 		/* begin allocateLiterals: */
@@ -18583,17 +18627,7 @@
 				for (i = 0; i < nextLiteralIndex; i += 1) {
 					existingInst = literalInstructionAt(i);
 					newInst = (&(newLiterals[i]));
-					(newInst->opcode = Literal);
-					/* begin operand0: */
-					operand = ((existingInst->operands))[0];
-					((newInst->operands))[0] = operand;
-					newInst;
-					/* begin setLiteralOpcodeIndex: */
-					/* begin literalOpcodeIndex */
-					assert(((existingInst->opcode)) == Literal);
-					index = ((sqInt)(((existingInst->operands))[2]));
-					assert(((newInst->opcode)) == Literal);
-					((newInst->operands))[2] = index;
+					cloneLiteralFrom(newInst, existingInst);
 					assert(((existingInst->dependent)) == null);
 					(existingInst->dependent = newInst);
 				}
@@ -18611,17 +18645,7 @@
 		}
 	}
 	litInst = literalInstructionAt(nextLiteralIndex);
-	(litInst->opcode = Literal);
-	/* begin operand0: */
-	((litInst->operands))[0] = aLiteral;
-	litInst;
-	/* begin setIsUnique */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[1] = 0;
-	/* begin setLiteralOpcodeIndex: */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[2] = -1;
-	(litInst->dependent = null);
+	initializeUniqueLiteral(litInst, aLiteral);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 
@@ -18721,12 +18745,10 @@
     sqInt i;
     sqInt i1;
     sqInt iLimiT;
-    sqInt index;
     sqInt initialNumLiterals;
     AbstractInstruction *litInst;
     AbstractInstruction *newInst;
     AbstractInstruction *newLiterals;
-    sqInt operand;
 
 	for (i = 0; i < nextLiteralIndex; i += 1) {
 		litInst = literalInstructionAt(i);
@@ -18751,17 +18773,7 @@
 				for (i1 = 0; i1 < nextLiteralIndex; i1 += 1) {
 					existingInst = literalInstructionAt(i1);
 					newInst = (&(newLiterals[i1]));
-					(newInst->opcode = Literal);
-					/* begin operand0: */
-					operand = ((existingInst->operands))[0];
-					((newInst->operands))[0] = operand;
-					newInst;
-					/* begin setLiteralOpcodeIndex: */
-					/* begin literalOpcodeIndex */
-					assert(((existingInst->opcode)) == Literal);
-					index = ((sqInt)(((existingInst->operands))[2]));
-					assert(((newInst->opcode)) == Literal);
-					((newInst->operands))[2] = index;
+					cloneLiteralFrom(newInst, existingInst);
 					assert(((existingInst->dependent)) == null);
 					(existingInst->dependent = newInst);
 				}
@@ -18779,17 +18791,7 @@
 		}
 	}
 	litInst = literalInstructionAt(nextLiteralIndex);
-	(litInst->opcode = Literal);
-	/* begin operand0: */
-	((litInst->operands))[0] = aLiteral;
-	litInst;
-	/* begin setIsSharable */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[1] = 1;
-	/* begin setLiteralOpcodeIndex: */
-	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[2] = -1;
-	(litInst->dependent = null);
+	initializeSharableLiteral(litInst, aLiteral);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 

Modified: branches/Cog/spursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/spursrc/vm/cogitIA32.c	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/spursrc/vm/cogitIA32.c	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -386,10 +386,13 @@
 static sqInt abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * addDependent(AbstractInstruction * self_in_addDependent, AbstractInstruction *anInstruction) NoDbgRegParms;
 static sqInt availableRegisterOrNilFor(AbstractInstruction * self_in_availableRegisterOrNilFor, sqInt liveRegsMask) NoDbgRegParms;
+static AbstractInstruction * cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral) NoDbgRegParms;
 static sqInt genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment) NoDbgRegParms;
 static AbstractInstruction * generateICacheFlush(AbstractInstruction * self_in_generateICacheFlush) NoDbgRegParms;
 static AbstractInstruction * genWriteCResultIntoReg(AbstractInstruction * self_in_genWriteCResultIntoReg, sqInt abstractRegister) NoDbgRegParms;
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget) NoDbgRegParms;
+static AbstractInstruction * initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal) NoDbgRegParms;
+static AbstractInstruction * initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal) NoDbgRegParms;
 static sqInt isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress) NoDbgRegParms;
 static sqInt isJump(AbstractInstruction * self_in_isJump) NoDbgRegParms;
 static sqInt isLongJump(AbstractInstruction * self_in_isLongJump) NoDbgRegParms;
@@ -1621,6 +1624,23 @@
 	return null;
 }
 
+
+/*	For out-of-line literal support, clone a literal from a literal. */
+
+	/* CogAbstractInstruction>>#cloneLiteralFrom: */
+static AbstractInstruction *
+cloneLiteralFrom(AbstractInstruction * self_in_cloneLiteralFrom, AbstractInstruction *existingLiteral)
+{
+	assert((((existingLiteral->opcode)) == Literal)
+	 && (((self_in_cloneLiteralFrom->dependent)) == null));
+	(self_in_cloneLiteralFrom->opcode) = Literal;
+	(self_in_cloneLiteralFrom->annotation) = (existingLiteral->annotation);
+	((self_in_cloneLiteralFrom->operands))[0] = (((existingLiteral->operands))[0]);
+	((self_in_cloneLiteralFrom->operands))[1] = (((existingLiteral->operands))[1]);
+	((self_in_cloneLiteralFrom->operands))[2] = (((existingLiteral->operands))[2]);
+	return self_in_cloneLiteralFrom;
+}
+
 	/* CogAbstractInstruction>>#genAlignCStackSavingRegisters:numArgs:wordAlignment: */
 static sqInt
 genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment)
@@ -1679,6 +1699,44 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+
+/*	For out-of-line literal support, initialize a sharable literal. */
+
+	/* CogAbstractInstruction>>#initializeSharableLiteral: */
+static AbstractInstruction *
+initializeSharableLiteral(AbstractInstruction * self_in_initializeSharableLiteral, sqInt literal)
+{
+	(self_in_initializeSharableLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeSharableLiteral->dependent) = null;
+	(self_in_initializeSharableLiteral->annotation) = null;
+	((self_in_initializeSharableLiteral->operands))[0] = literal;
+	((self_in_initializeSharableLiteral->operands))[1] = 1;
+	((self_in_initializeSharableLiteral->operands))[2] = -1;
+	return self_in_initializeSharableLiteral;
+}
+
+
+/*	For out-of-line literal support, initialize an unsharable literal. */
+
+	/* CogAbstractInstruction>>#initializeUniqueLiteral: */
+static AbstractInstruction *
+initializeUniqueLiteral(AbstractInstruction * self_in_initializeUniqueLiteral, sqInt literal)
+{
+	(self_in_initializeUniqueLiteral->opcode) = Literal;
+
+	/* separate := nil for Slang */
+
+	(self_in_initializeUniqueLiteral->dependent) = null;
+	(self_in_initializeUniqueLiteral->annotation) = null;
+	((self_in_initializeUniqueLiteral->operands))[0] = literal;
+	((self_in_initializeUniqueLiteral->operands))[1] = 0;
+	((self_in_initializeUniqueLiteral->operands))[2] = -1;
+	return self_in_initializeUniqueLiteral;
+}
+
 	/* CogAbstractInstruction>>#isAFixup: */
 static sqInt
 isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress)
@@ -9396,12 +9454,12 @@
 generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
 {
     unsigned char annotation;
-    sqInt delta;
+    usqInt delta;
     sqInt i;
     AbstractInstruction *instruction;
     sqInt length;
-    sqInt location;
-    sqInt mapEntry;
+    usqInt location;
+    usqInt mapEntry;
     sqInt maxDelta;
     usqInt mcpc;
 

Modified: branches/Cog/src/vm/cogit.h
===================================================================
--- branches/Cog/src/vm/cogit.h	2015-06-18 18:51:39 UTC (rev 3380)
+++ branches/Cog/src/vm/cogit.h	2015-06-18 21:08:45 UTC (rev 3381)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
+	CCodeGenerator VMMaker.oscog-eem.1363 uuid: 7688edec-456b-4fce-a6e0-b0dd8cf2877a
  */
 
 


@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list