[Vm-dev] [commit][3380] CogVM source as per VMMaker.oscog-eem.1362

commits at squeakvm.org commits at squeakvm.org
Thu Jun 18 18:51:40 UTC 2015


Revision: 3380
Author:   eliot
Date:     2015-06-18 11:51:39 -0700 (Thu, 18 Jun 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1362

Fix initialization issues with the array of out-of-line literals by
initializing each literal on allocation rather than early in a bzero call.

Drop the unused parameter from resetLiterals: and hide the send of resetLiterals
inside the two allocateOpcodes: methods, rewriting them in more conventional
style, relying on inlining rather than a C macro ensure inlining into callers.

Restore the --enable-fast-bitblt configurations to the Cog ARM VMs.

Modified Paths:
--------------
    branches/Cog/build.linux32ARM/squeak.cog.spur/build/mvm
    branches/Cog/build.linux32ARM/squeak.cog.spur/build.assert/mvm
    branches/Cog/build.linux32ARM/squeak.cog.spur/build.debug/mvm
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    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/build.linux32ARM/squeak.cog.spur/build/mvm
===================================================================
--- branches/Cog/build.linux32ARM/squeak.cog.spur/build/mvm	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/build.linux32ARM/squeak.cog.spur/build/mvm	2015-06-18 18:51:39 UTC (rev 3380)
@@ -18,6 +18,7 @@
 test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \
 		--without-vm-display-fbdev --with-vmversion=5.0 \
 		--with-src=spursrc --with-plugins=src/plugins \
+		--without-vm-display-fbdev --without-npsqueak --enable-fast-bitblt \
 	CC=gcc \
 	CXX=g++ \
 	CFLAGS="$OPT -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DI_REALLY_DONT_CARE_HOW_UNSAFE_THIS_IS -DCOGMTVM=0" \

Modified: branches/Cog/build.linux32ARM/squeak.cog.spur/build.assert/mvm
===================================================================
--- branches/Cog/build.linux32ARM/squeak.cog.spur/build.assert/mvm	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/build.linux32ARM/squeak.cog.spur/build.assert/mvm	2015-06-18 18:51:39 UTC (rev 3380)
@@ -18,6 +18,7 @@
 test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \
 		--without-vm-display-fbdev --with-vmversion=5.0 \
 		--with-src=spursrc --with-plugins=src/plugins \
+		--without-vm-display-fbdev --without-npsqueak --enable-fast-bitblt \
 	CC=gcc \
 	CXX=g++ \
 	CFLAGS="$OPT -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DI_REALLY_DONT_CARE_HOW_UNSAFE_THIS_IS -DCOGMTVM=0" \

Modified: branches/Cog/build.linux32ARM/squeak.cog.spur/build.debug/mvm
===================================================================
--- branches/Cog/build.linux32ARM/squeak.cog.spur/build.debug/mvm	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/build.linux32ARM/squeak.cog.spur/build.debug/mvm	2015-06-18 18:51:39 UTC (rev 3380)
@@ -18,6 +18,7 @@
 test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \
 		--without-vm-display-fbdev --with-vmversion=5.0 \
 		--with-src=spursrc --with-plugins=src/plugins \
+		--without-vm-display-fbdev --without-npsqueak --enable-fast-bitblt \
 	CC=gcc \
 	CXX=g++ \
 	CFLAGS="$OPT -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64  -DI_REALLY_DONT_CARE_HOW_UNSAFE_THIS_IS -DCOGMTVM=0" \

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-06-18 18:51:39 UTC (rev 3380)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-18 18:51:39 UTC (rev 3380)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -903,7 +903,7 @@
 static AbstractInstruction * concretizeLiteral(AbstractInstruction * self_in_concretizeLiteral) NoDbgRegParms;
 static sqInt inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt followingAddress) NoDbgRegParms;
 static sqInt isPCDependent(AbstractInstruction * self_in_isPCDependent) NoDbgRegParms;
-static sqInt isSharable(AbstractInstruction * self_in_isSharable) NoDbgRegParms;
+static usqInt isSharable(AbstractInstruction * self_in_isSharable) NoDbgRegParms;
 static sqInt literalLoadInstructionBytes(AbstractInstruction * self_in_literalLoadInstructionBytes) NoDbgRegParms;
 static sqInt outOfLineLiteralOpcodeLimit(AbstractInstruction * self_in_outOfLineLiteralOpcodeLimit) NoDbgRegParms;
 static sqInt pcRelativeAddressAt(AbstractInstruction * self_in_pcRelativeAddressAt, sqInt instrAddress) NoDbgRegParms;
@@ -1890,24 +1890,6 @@
 #define allocateBlockStarts(numBlocks) do { \
 		blockStarts = (numBlocks) ? alloca(sizeof(BlockStart) * (numBlocks)) : 0; \
 } while (0)
-#define allocateOpcodesbytecodes(numberOfAbstractOpcodes,numberOfBytecodes) do { \
-		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
-		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		abstractOpcodes = alloca(opcodeSize + fixupSize); \
-		bzero(abstractOpcodes, opcodeSize + fixupSize); \
-		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		opcodeIndex = labelCounter = 0; \
-} while (0)
-#define allocateOpcodesbytecodesifFail(numberOfAbstractOpcodes,numberOfBytecodes,failBlock) do { \
-		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
-		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		int allocSize = opcodeSize + fixupSize; \
-		if (allocSize > MaxStackAllocSize) failBlock; \
-		abstractOpcodes = alloca(allocSize); \
-		bzero(abstractOpcodes, opcodeSize + fixupSize); \
-		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		opcodeIndex = labelCounter = 0; \
-} while (0)
 #define backEnd() backEnd
 #define blockAlignment(self) 8
 #define blockStartAt(index) (&blockStarts[index])
@@ -8607,22 +8589,25 @@
     sqInt address;
     AbstractInstruction *anInstruction;
     sqInt end;
+    sqInt fixupSize;
     AbstractInstruction *inst;
     sqInt jumpTarget;
+    sqInt opcodeSize;
     sqInt operand;
     sqInt size;
     sqInt target;
     sqInt wordConstant;
 
 	compilationBreakpointisMNUCase((cPIC->selector), numBytesOf((cPIC->selector)), isMNUCase);
-	allocateOpcodesbytecodes(8, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 8;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = ((usqInt)cPIC));
 	(methodLabel->dependent = null);
 	assert(!(inlineCacheTagIsYoung(caseNTag)));
@@ -8762,7 +8747,8 @@
 cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs)
 {
     sqInt end;
-    sqInt numLiteralsHint;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt size;
     sqInt startAddress;
@@ -8778,15 +8764,15 @@
 		callForCogCompiledCodeCompaction();
 		return 0;
 	}
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
 	compileMNUCPICmethodOperandnumArgs(((CogMethod *) startAddress), methodOperand, numArgs);
@@ -8835,7 +8821,9 @@
 {
     sqInt codeSize;
     sqInt end;
+    sqInt fixupSize;
     sqInt mapSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt startAddress;
 
@@ -8846,14 +8834,15 @@
 	}
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
-	allocateOpcodesbytecodes(100, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 100;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	compileOpenPICnumArgs(selector, numArgs);
 	computeMaximumSizes();
 	concretizeAt(methodLabel, startAddress);
@@ -8901,7 +8890,8 @@
 cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase)
 {
     sqInt end;
-    sqInt numLiteralsHint;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt size;
     sqInt startAddress;
@@ -8914,15 +8904,15 @@
 	if (startAddress == 0) {
 		return ((CogMethod *) InsufficientCodeSpace);
 	}
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
 	compileCPICCase0Case1MethodtagisMNUCasenumArgs(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs);
@@ -9569,16 +9559,19 @@
 static void
 computeEntryOffsets(void)
 {
+    sqInt fixupSize;
+    sqInt opcodeSize;
     AbstractInstruction *sendMissCall;
 
-	allocateOpcodesbytecodes(24, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 24;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	methodOrBlockNumArgs = 0;
 	sendMissCall = compileAbort();
 	compileEntry();
@@ -10290,17 +10283,20 @@
     sqInt address;
     sqInt address1;
     sqInt address2;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     sqInt quickConstant;
     sqInt startAddress;
 
-	allocateOpcodesbytecodes(32, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 32;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -10335,13 +10331,14 @@
 {
     AbstractInstruction *anInstruction;
     AbstractInstruction *anInstruction1;
+    sqInt fixupSize;
     sqInt h;
     AbstractInstruction *inst;
     AbstractInstruction *inst1;
     AbstractInstruction *jumpNext;
     sqInt jumpTarget;
     sqInt numArgs;
-    sqInt numLiteralsHint;
+    sqInt opcodeSize;
     sqInt wordConstant;
 
 
@@ -10349,15 +10346,15 @@
 	   are effectively garbage collected on return. */
 
 	numPICCases = 6;
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = methodZoneBase);
 	(methodLabel->dependent = null);
 	/* begin compileClosedPICPrototype */
@@ -10610,16 +10607,19 @@
 generateOpenPICPrototype(void)
 {
     sqInt codeSize;
+    sqInt fixupSize;
     sqInt mapSize;
+    sqInt opcodeSize;
 
-	allocateOpcodesbytecodes(100, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 100;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = methodZoneBase);
 	(methodLabel->dependent = null);
 	compileOpenPICnumArgs(specialSelector(0), 2);
@@ -10694,11 +10694,21 @@
 static void
 generateTrampolines(void)
 {
+    sqInt fixupSize;
     sqInt methodZoneStart;
+    sqInt opcodeSize;
 
 	methodZoneStart = methodZoneBase;
 	(methodLabel->address = methodZoneStart);
-	allocateOpcodesbytecodes(80, 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 80;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	hasYoungReferent = 0;
@@ -10719,12 +10729,24 @@
 static void
 generateVMOwnerLockFunctions(void)
 {
+    sqInt fixupSize;
+    sqInt numberOfAbstractOpcodes;
+    sqInt opcodeSize;
     sqInt startAddress;
 
 	
 #  if COGMTVM
-	allocateOpcodesbytecodes(numLowLevelLockOpcodes(backEnd), 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numberOfAbstractOpcodes = numLowLevelLockOpcodes(backEnd);
+	numAbstractOpcodes = numberOfAbstractOpcodes;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
 	zeroOpcodeIndex();
+	labelCounter = 0;
+	zeroOpcodeIndex();
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -10753,16 +10775,19 @@
 static sqInt
 genGetLeafCallStackPointer(void)
 {
+    sqInt fixupSize;
+    sqInt opcodeSize;
     sqInt startAddress;
 
-	allocateOpcodesbytecodes(32, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 32;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -11249,7 +11274,7 @@
 initializeBackend(void)
 {
     AbstractInstruction *existingInst;
-    sqInt i1;
+    sqInt i;
     sqInt iLimiT;
     sqInt index;
     AbstractInstruction *newInst;
@@ -11273,9 +11298,9 @@
 
 		newLiterals = calloc(4, sizeof(CogAbstractInstruction));
 		if (!(literals == null)) {
-			for (i1 = 0; i1 < nextLiteralIndex; i1 += 1) {
-				existingInst = literalInstructionAt(i1);
-				newInst = (&(newLiterals[i1]));
+			for (i = 0; i < nextLiteralIndex; i += 1) {
+				existingInst = literalInstructionAt(i);
+				newInst = (&(newLiterals[i]));
 				(newInst->opcode = Literal);
 				/* begin operand0: */
 				operand = ((existingInst->operands))[0];
@@ -11290,8 +11315,8 @@
 				assert(((existingInst->dependent)) == null);
 				(existingInst->dependent = newInst);
 			}
-			for (i1 = 0, iLimiT = (opcodeIndex - 1); i1 <= iLimiT; i1 += 1) {
-				existingInst = abstractInstructionAt(i1);
+			for (i = 0, iLimiT = (opcodeIndex - 1); i <= iLimiT; i += 1) {
+				existingInst = abstractInstructionAt(i);
 				if ((((existingInst->dependent)) != null)
 				 && (((((existingInst->dependent))->opcode)) == Literal)) {
 					(existingInst->dependent = (((existingInst->dependent))->dependent));
@@ -11302,8 +11327,7 @@
 		literals = newLiterals;
 		literalsSize = 4;
 	}
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
+	/* begin resetLiterals */
 
 	/* an impossibly high value */
 
@@ -12711,18 +12735,23 @@
 static sqInt
 maybeGenerateCheckFeatures(void)
 {
+    sqInt fixupSize;
+    sqInt numberOfAbstractOpcodes;
+    sqInt opcodeSize;
     sqInt startAddress;
 
 	return null;
 
-	allocateOpcodesbytecodes(numCheckFeaturesOpcodes(backEnd), 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numberOfAbstractOpcodes = numCheckFeaturesOpcodes(backEnd);
+	numAbstractOpcodes = numberOfAbstractOpcodes;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -12737,18 +12766,23 @@
 maybeGenerateICacheFlush(void)
 {
     static void (*ceFlushICache)(unsigned long from, unsigned long to);
+    sqInt fixupSize;
+    sqInt numberOfAbstractOpcodes;
+    sqInt opcodeSize;
     sqInt startAddress;
 
 	return null;
 
-	allocateOpcodesbytecodes(numICacheFlushOpcodes(backEnd), 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numberOfAbstractOpcodes = numICacheFlushOpcodes(backEnd);
+	numAbstractOpcodes = numberOfAbstractOpcodes;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -14931,8 +14965,7 @@
 zeroOpcodeIndex(void)
 {
 	opcodeIndex = 0;
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
+	/* begin resetLiterals */
 
 	/* an impossibly high value */
 
@@ -19473,11 +19506,11 @@
  */
 
 	/* CogOutOfLineLiteralsARMCompiler>>#isSharable */
-static sqInt
+static usqInt
 isSharable(AbstractInstruction * self_in_isSharable)
 {
 	assert(((self_in_isSharable->opcode)) == Literal);
-	return (((self_in_isSharable->operands))[1]) == null;
+	return ((self_in_isSharable->operands))[1];
 }
 
 
@@ -20110,7 +20143,7 @@
 }
 
 
-/*	Allocate a n unsharable Literal instruction for the literal and answer it. */
+/*	Allocate an unsharable Literal instruction for the literal and answer it. */
 
 	/* OutOfLineLiteralsManager>>#allocateLiteral: */
 static AbstractInstruction *
@@ -20175,10 +20208,11 @@
 	litInst;
 	/* begin setIsUnique */
 	assert(((litInst->opcode)) == Literal);
-	((litInst->operands))[1] = 1;
+	((litInst->operands))[1] = 0;
 	/* begin setLiteralOpcodeIndex: */
 	assert(((litInst->opcode)) == Literal);
 	((litInst->operands))[2] = -1;
+	(litInst->dependent = null);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 
@@ -20268,7 +20302,7 @@
 
 
 /*	Search for a Literal instruction that is in-range and answer it. Otherwise
-	allocate a new Literal instruction for the literal and answer it. */
+	allocate a new sharable Literal instruction for the literal and answer it. */
 
 	/* OutOfLineLiteralsManager>>#locateLiteral: */
 static AbstractInstruction *
@@ -20340,9 +20374,13 @@
 	/* 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);
 
 	/* Record the opcodeIndex of the first dependent instruction (the first instruction that references an out-of-line literal) */
 
@@ -22785,12 +22823,14 @@
 static CogMethod *
 compileCogMethod(sqInt selector)
 {
+    sqInt allocSize;
     sqInt debugStackPointers;
     sqInt extra;
+    sqInt fixupSize;
     sqInt numBlocks;
     sqInt numBytecodes;
     sqInt numCleanBlocks;
-    sqInt numLiteralsHint;
+    sqInt opcodeSize;
     sqInt result;
 
 	methodOrBlockNumTemps = tempCountOf(methodObj);
@@ -22813,15 +22853,22 @@
 		? initialPC - 1
 		: numBytesOf(methodObj));
 	numBytecodes = (endPC - initialPC) + 1;
-	allocateOpcodesbytecodesifFail((numBytecodes + extra) * 10, numBytecodes, return ((CogMethod *) MethodTooBig));
-	/* begin resetLiterals: */
-	numLiteralsHint = literalCountOf(methodObj);
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
+	/* begin allocateOpcodes:bytecodes:ifFail: */
+	numAbstractOpcodes = (numBytecodes + extra) * 10;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	allocSize = opcodeSize + fixupSize;
+	if (allocSize > MaxStackAllocSize) {
+		return ((CogMethod *) MethodTooBig);
 
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+		goto l1;
+	}
+	abstractOpcodes = alloca(allocSize);
+	bzero(abstractOpcodes, allocSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
+l1:	/* end allocateOpcodes:bytecodes:ifFail: */;
 	if (((numBlocks = scanMethod())) < 0) {
 		return ((CogMethod *) numBlocks);
 	}

Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-18 18:51:39 UTC (rev 3380)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -1812,24 +1812,6 @@
 #define allocateBlockStarts(numBlocks) do { \
 		blockStarts = (numBlocks) ? alloca(sizeof(BlockStart) * (numBlocks)) : 0; \
 } while (0)
-#define allocateOpcodesbytecodes(numberOfAbstractOpcodes,numberOfBytecodes) do { \
-		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
-		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		abstractOpcodes = alloca(opcodeSize + fixupSize); \
-		bzero(abstractOpcodes, opcodeSize + fixupSize); \
-		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		opcodeIndex = labelCounter = 0; \
-} while (0)
-#define allocateOpcodesbytecodesifFail(numberOfAbstractOpcodes,numberOfBytecodes,failBlock) do { \
-		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
-		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		int allocSize = opcodeSize + fixupSize; \
-		if (allocSize > MaxStackAllocSize) failBlock; \
-		abstractOpcodes = alloca(allocSize); \
-		bzero(abstractOpcodes, opcodeSize + fixupSize); \
-		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		opcodeIndex = labelCounter = 0; \
-} while (0)
 #define backEnd() backEnd
 #define blockAlignment(self) 8
 #define blockStartAt(index) (&blockStarts[index])
@@ -7980,16 +7962,25 @@
     AbstractInstruction *anInstruction1;
     AbstractInstruction *anInstruction2;
     sqInt end;
+    sqInt fixupSize;
     AbstractInstruction *inst;
     sqInt jumpTarget;
+    sqInt opcodeSize;
     sqInt operand;
     sqInt size;
     sqInt target;
     sqInt wordConstant;
 
 	compilationBreakpointisMNUCase((cPIC->selector), numBytesOf((cPIC->selector)), isMNUCase);
-	allocateOpcodesbytecodes(8, 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 8;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = ((usqInt)cPIC));
 	(methodLabel->dependent = null);
 	assert(!(inlineCacheTagIsYoung(caseNTag)));
@@ -8131,7 +8122,8 @@
 cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs)
 {
     sqInt end;
-    sqInt numLiteralsHint;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt size;
     sqInt startAddress;
@@ -8147,9 +8139,15 @@
 		callForCogCompiledCodeCompaction();
 		return 0;
 	}
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
 	compileMNUCPICmethodOperandnumArgs(((CogMethod *) startAddress), methodOperand, numArgs);
@@ -8198,7 +8196,9 @@
 {
     sqInt codeSize;
     sqInt end;
+    sqInt fixupSize;
     sqInt mapSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt startAddress;
 
@@ -8209,8 +8209,15 @@
 	}
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
-	allocateOpcodesbytecodes(100, 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 100;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	compileOpenPICnumArgs(selector, numArgs);
 	computeMaximumSizes();
 	concretizeAt(methodLabel, startAddress);
@@ -8258,7 +8265,8 @@
 cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase)
 {
     sqInt end;
-    sqInt numLiteralsHint;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt size;
     sqInt startAddress;
@@ -8271,9 +8279,15 @@
 	if (startAddress == 0) {
 		return ((CogMethod *) InsufficientCodeSpace);
 	}
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
 	compileCPICCase0Case1MethodtagisMNUCasenumArgs(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs);
@@ -8908,10 +8922,19 @@
 static void
 computeEntryOffsets(void)
 {
+    sqInt fixupSize;
+    sqInt opcodeSize;
     AbstractInstruction *sendMissCall;
 
-	allocateOpcodesbytecodes(24, 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 24;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	methodOrBlockNumArgs = 0;
 	sendMissCall = compileAbort();
 	compileEntry();
@@ -9622,11 +9645,20 @@
     AbstractInstruction *anInstruction1;
     AbstractInstruction *anInstruction2;
     AbstractInstruction *anInstruction3;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     sqInt quickConstant;
     sqInt startAddress;
 
-	allocateOpcodesbytecodes(32, 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 32;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -9675,6 +9707,7 @@
     AbstractInstruction *anInstruction1;
     AbstractInstruction *anInstruction2;
     AbstractInstruction *anInstruction3;
+    sqInt fixupSize;
     sqInt h;
     AbstractInstruction *inst;
     AbstractInstruction *inst1;
@@ -9682,7 +9715,7 @@
     sqInt jumpTarget;
     sqInt literal;
     sqInt numArgs;
-    sqInt numLiteralsHint;
+    sqInt opcodeSize;
     sqInt wordConstant;
 
 
@@ -9690,9 +9723,15 @@
 	   are effectively garbage collected on return. */
 
 	numPICCases = 6;
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = methodZoneBase);
 	(methodLabel->dependent = null);
 	/* begin compileClosedPICPrototype */
@@ -9942,10 +9981,19 @@
 generateOpenPICPrototype(void)
 {
     sqInt codeSize;
+    sqInt fixupSize;
     sqInt mapSize;
+    sqInt opcodeSize;
 
-	allocateOpcodesbytecodes(100, 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 100;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = methodZoneBase);
 	(methodLabel->dependent = null);
 	compileOpenPICnumArgs(specialSelector(0), 2);
@@ -10020,11 +10068,21 @@
 static void
 generateTrampolines(void)
 {
+    sqInt fixupSize;
     sqInt methodZoneStart;
+    sqInt opcodeSize;
 
 	methodZoneStart = methodZoneBase;
 	(methodLabel->address = methodZoneStart);
-	allocateOpcodesbytecodes(80, 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 80;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	hasYoungReferent = 0;
@@ -10045,12 +10103,24 @@
 static void
 generateVMOwnerLockFunctions(void)
 {
+    sqInt fixupSize;
+    sqInt numberOfAbstractOpcodes;
+    sqInt opcodeSize;
     sqInt startAddress;
 
 	
 #  if COGMTVM
-	allocateOpcodesbytecodes(numLowLevelLockOpcodes(backEnd), 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numberOfAbstractOpcodes = numLowLevelLockOpcodes(backEnd);
+	numAbstractOpcodes = numberOfAbstractOpcodes;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
 	zeroOpcodeIndex();
+	labelCounter = 0;
+	zeroOpcodeIndex();
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -10079,10 +10149,19 @@
 static sqInt
 genGetLeafCallStackPointer(void)
 {
+    sqInt fixupSize;
+    sqInt opcodeSize;
     sqInt startAddress;
 
-	allocateOpcodesbytecodes(32, 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 32;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -10607,7 +10686,7 @@
 	callerSavedRegMask = callerSavedRegisterMask(backEnd);
 	
 	/* begin allocateLiterals: */
-	/* begin resetLiterals: */
+	/* begin resetLiterals */
 }
 
 	/* Cogit>>#initializeCodeZoneFrom:upTo: */
@@ -12038,11 +12117,22 @@
 static sqInt
 maybeGenerateCheckFeatures(void)
 {
+    sqInt fixupSize;
+    sqInt numberOfAbstractOpcodes;
+    sqInt opcodeSize;
     sqInt startAddress;
 
 	
-	allocateOpcodesbytecodes(numCheckFeaturesOpcodes(backEnd), 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numberOfAbstractOpcodes = numCheckFeaturesOpcodes(backEnd);
+	numAbstractOpcodes = numberOfAbstractOpcodes;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -12057,12 +12147,23 @@
 maybeGenerateICacheFlush(void)
 {
     static void (*ceFlushICache)(unsigned long from, unsigned long to);
+    sqInt fixupSize;
+    sqInt numberOfAbstractOpcodes;
+    sqInt opcodeSize;
     sqInt startAddress;
 
 	return null;
 
-	allocateOpcodesbytecodes(numICacheFlushOpcodes(backEnd), 0);
-	/* begin resetLiterals: */
+	/* begin allocateOpcodes:bytecodes: */
+	numberOfAbstractOpcodes = numICacheFlushOpcodes(backEnd);
+	numAbstractOpcodes = numberOfAbstractOpcodes;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -14262,7 +14363,7 @@
 zeroOpcodeIndex(void)
 {
 	opcodeIndex = 0;
-	/* begin resetLiterals: */
+	/* begin resetLiterals */
 }
 
 	/* CogMethodZone>>#addAllToYoungReferrers */
@@ -22391,12 +22492,14 @@
 static CogMethod *
 compileCogMethod(sqInt selector)
 {
+    sqInt allocSize;
     sqInt debugStackPointers;
     sqInt extra;
+    sqInt fixupSize;
     sqInt numBlocks;
     sqInt numBytecodes;
     sqInt numCleanBlocks;
-    sqInt numLiteralsHint;
+    sqInt opcodeSize;
     sqInt result;
 
 	methodOrBlockNumTemps = tempCountOf(methodObj);
@@ -22419,9 +22522,22 @@
 		? initialPC - 1
 		: numBytesOf(methodObj));
 	numBytecodes = (endPC - initialPC) + 1;
-	allocateOpcodesbytecodesifFail((numBytecodes + extra) * 10, numBytecodes, return ((CogMethod *) MethodTooBig));
-	/* begin resetLiterals: */
-	numLiteralsHint = literalCountOf(methodObj);
+	/* begin allocateOpcodes:bytecodes:ifFail: */
+	numAbstractOpcodes = (numBytecodes + extra) * 10;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	allocSize = opcodeSize + fixupSize;
+	if (allocSize > MaxStackAllocSize) {
+		return ((CogMethod *) MethodTooBig);
+
+		goto l1;
+	}
+	abstractOpcodes = alloca(allocSize);
+	bzero(abstractOpcodes, allocSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
+l1:	/* end allocateOpcodes:bytecodes:ifFail: */;
 	if (((numBlocks = scanMethod())) < 0) {
 		return ((CogMethod *) numBlocks);
 	}


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

Modified: branches/Cog/spursistasrc/vm/cogit.h
===================================================================
--- branches/Cog/spursistasrc/vm/cogit.h	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/spursistasrc/vm/cogit.h	2015-06-18 18:51:39 UTC (rev 3380)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
  */
 
 

Modified: branches/Cog/spursistasrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/spursistasrc/vm/cogitARMv5.c	2015-06-18 17:29:27 UTC (rev 3379)
+++ branches/Cog/spursistasrc/vm/cogitARMv5.c	2015-06-18 18:51:39 UTC (rev 3380)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	CCodeGenerator VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1361 uuid: 000b1a0b-f89e-415f-aae5-405d3a401928 " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.1362 uuid: eb2638bd-a092-4dc0-9495-82249a85bfbb " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -901,7 +901,7 @@
 static AbstractInstruction * concretizeLiteral(AbstractInstruction * self_in_concretizeLiteral) NoDbgRegParms;
 static sqInt inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt followingAddress) NoDbgRegParms;
 static sqInt isPCDependent(AbstractInstruction * self_in_isPCDependent) NoDbgRegParms;
-static sqInt isSharable(AbstractInstruction * self_in_isSharable) NoDbgRegParms;
+static usqInt isSharable(AbstractInstruction * self_in_isSharable) NoDbgRegParms;
 static sqInt literalLoadInstructionBytes(AbstractInstruction * self_in_literalLoadInstructionBytes) NoDbgRegParms;
 static sqInt outOfLineLiteralOpcodeLimit(AbstractInstruction * self_in_outOfLineLiteralOpcodeLimit) NoDbgRegParms;
 static sqInt pcRelativeAddressAt(AbstractInstruction * self_in_pcRelativeAddressAt, sqInt instrAddress) NoDbgRegParms;
@@ -1891,24 +1891,6 @@
 #define allocateBlockStarts(numBlocks) do { \
 		blockStarts = (numBlocks) ? alloca(sizeof(BlockStart) * (numBlocks)) : 0; \
 } while (0)
-#define allocateOpcodesbytecodes(numberOfAbstractOpcodes,numberOfBytecodes) do { \
-		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
-		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		abstractOpcodes = alloca(opcodeSize + fixupSize); \
-		bzero(abstractOpcodes, opcodeSize + fixupSize); \
-		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		opcodeIndex = labelCounter = 0; \
-} while (0)
-#define allocateOpcodesbytecodesifFail(numberOfAbstractOpcodes,numberOfBytecodes,failBlock) do { \
-		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
-		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		int allocSize = opcodeSize + fixupSize; \
-		if (allocSize > MaxStackAllocSize) failBlock; \
-		abstractOpcodes = alloca(allocSize); \
-		bzero(abstractOpcodes, opcodeSize + fixupSize); \
-		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		opcodeIndex = labelCounter = 0; \
-} while (0)
 #define backEnd() backEnd
 #define blockAlignment(self) 8
 #define blockStartAt(index) (&blockStarts[index])
@@ -8529,22 +8511,25 @@
     sqInt address;
     AbstractInstruction *anInstruction;
     sqInt end;
+    sqInt fixupSize;
     AbstractInstruction *inst;
     sqInt jumpTarget;
+    sqInt opcodeSize;
     sqInt operand;
     sqInt size;
     sqInt target;
     sqInt wordConstant;
 
 	compilationBreakpointisMNUCase((cPIC->selector), numBytesOf((cPIC->selector)), isMNUCase);
-	allocateOpcodesbytecodes(8, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 8;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = ((usqInt)cPIC));
 	(methodLabel->dependent = null);
 	assert(!(inlineCacheTagIsYoung(caseNTag)));
@@ -8684,7 +8669,8 @@
 cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs)
 {
     sqInt end;
-    sqInt numLiteralsHint;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt size;
     sqInt startAddress;
@@ -8700,15 +8686,15 @@
 		callForCogCompiledCodeCompaction();
 		return 0;
 	}
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
 	compileMNUCPICmethodOperandnumArgs(((CogMethod *) startAddress), methodOperand, numArgs);
@@ -8758,7 +8744,9 @@
 {
     sqInt codeSize;
     sqInt end;
+    sqInt fixupSize;
     sqInt mapSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt startAddress;
 
@@ -8769,14 +8757,15 @@
 	}
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
-	allocateOpcodesbytecodes(100, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 100;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	compileOpenPICnumArgs(selector, numArgs);
 	computeMaximumSizes();
 	concretizeAt(methodLabel, startAddress);
@@ -8825,7 +8814,8 @@
 cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase)
 {
     sqInt end;
-    sqInt numLiteralsHint;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     CogMethod *pic;
     sqInt size;
     sqInt startAddress;
@@ -8838,15 +8828,15 @@
 	if (startAddress == 0) {
 		return ((CogMethod *) InsufficientCodeSpace);
 	}
-	allocateOpcodesbytecodes(numPICCases * 9, 0);
-	/* begin resetLiterals: */
-	numLiteralsHint = numPICCases * 2;
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = numPICCases * 9;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	(methodLabel->address = startAddress);
 	(methodLabel->dependent = null);
 	compileCPICCase0Case1MethodtagisMNUCasenumArgs(((CogMethod *) startAddress), case0CogMethod, case1MethodOrNil, case1Tag, isMNUCase, numArgs);
@@ -9480,16 +9470,19 @@
 static void
 computeEntryOffsets(void)
 {
+    sqInt fixupSize;
+    sqInt opcodeSize;
     AbstractInstruction *sendMissCall;
 
-	allocateOpcodesbytecodes(24, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 24;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	methodOrBlockNumArgs = 0;
 	sendMissCall = compileAbort();
 	compileEntry();
@@ -9541,7 +9534,7 @@
 {
     sqInt classIndex;
     sqInt i;
-    sqInt pc;
+    usqInt pc;
 
 	pc = (((((usqInt)cPIC)) + firstCPICCaseOffset) + cPICCaseSize) - (jumpLongConditionalByteSize(backEnd));
 	for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) {
@@ -10147,17 +10140,20 @@
     sqInt address;
     sqInt address1;
     sqInt address2;
+    sqInt fixupSize;
+    sqInt opcodeSize;
     sqInt quickConstant;
     sqInt startAddress;
 
-	allocateOpcodesbytecodes(32, 0);
-	/* begin resetLiterals: */
-	memset(literals, 0, literalsSize * (sizeof(CogAbstractInstruction)));
-
-	/* an impossibly high value */
-
-	firstOpcodeIndex = 1 << 16;
-	nextLiteralIndex = (lastDumpedLiteralIndex = 0);
+	/* begin allocateOpcodes:bytecodes: */
+	numAbstractOpcodes = 32;
+	opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
+	fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
+	abstractOpcodes = alloca(opcodeSize + fixupSize);
+	bzero(abstractOpcodes, opcodeSize + fixupSize);
+	fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
+	zeroOpcodeIndex();
+	labelCounter = 0;
 	initialPC = 0;
 	endPC = numAbstractOpcodes - 1;
 	startAddress = methodZoneBase;
@@ -10192,13 +10188,14 @@
 {
     AbstractInstruction *anInstruction;

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list