[Vm-dev] [commit][3549] CogVM source as per VMMaker.oscog-eem.1626

commits at squeakvm.org commits at squeakvm.org
Sat Jan 9 20:37:16 UTC 2016


Revision: 3549
Author:   eliot
Date:     2016-01-09 12:37:15 -0800 (Sat, 09 Jan 2016)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1626

x64 Cogit:
ceCaptureCStackPointers cannot assume VarBaseReg is caller-saved and should
save and restore it if used.

Add support for dumping the register state on x86_64 Mac OS Cocoa.

Modified Paths:
--------------
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    branches/Cog/nsspursrc/vm/cogitMIPSEL.c
    branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m
    branches/Cog/spur64src/vm/cogit.h
    branches/Cog/spur64src/vm/cogitX64.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogitARMv5.c
    branches/Cog/spursistasrc/vm/cogitIA32.c
    branches/Cog/spursistasrc/vm/cogitMIPSEL.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cogitARMv5.c
    branches/Cog/spursrc/vm/cogitIA32.c
    branches/Cog/spursrc/vm/cogitMIPSEL.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogitARMv5.c
    branches/Cog/src/vm/cogitIA32.c
    branches/Cog/src/vm/cogitMIPSEL.c

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

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2016-01-09 18:55:57 UTC (rev 3548)
+++ branches/Cog/nsspursrc/vm/cogit.h	2016-01-09 20:37:15 UTC (rev 3549)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	CCodeGenerator VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2016-01-09 18:55:57 UTC (rev 3548)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2016-01-09 20:37:15 UTC (rev 3549)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	CCodeGenerator VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -501,7 +501,6 @@
 static sqInt NoDbgRegParms loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize);
 static sqInt NoDbgRegParms machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes);
 static sqInt NoDbgRegParms machineCodeWords(AbstractInstruction * self_in_machineCodeWords);
-static AbstractInstruction * NoDbgRegParms maybeEstablishVarBase(AbstractInstruction * self_in_maybeEstablishVarBase);
 static sqInt NoDbgRegParms memM16xrregbasepuwloffset(AbstractInstruction * self_in_memM16xrregbasepuwloffset, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt weirdstuff, sqInt loadstore, sqInt offset8);
 static sqInt NoDbgRegParms memM16xrregbasepuwlrm(AbstractInstruction * self_in_memM16xrregbasepuwlrm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt weirdstuff, sqInt loadstore, sqInt offsetReg);
 static sqInt NoDbgRegParms memMxrregbasepubwlimm(AbstractInstruction * self_in_memMxrregbasepubwlimm, sqInt cond, sqInt destReg, sqInt baseReg, sqInt postpreoffset, sqInt updown, sqInt byteword, sqInt weirdstuff, sqInt loadstore, sqInt offset);
@@ -905,7 +904,7 @@
 static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver);
-static sqInt NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
+static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg);
 static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg);
@@ -1021,8 +1020,8 @@
 static sqInt genLongUnconditionalBackwardJump(void);
 static sqInt genLongUnconditionalForwardJump(void);
 static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs);
-static AbstractInstruction * NoDbgRegParms genMoveFalseR(sqInt reg);
-static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg);
+static AbstractInstruction * NoDbgRegParms genMoveConstantR(sqInt constant, sqInt reg);
+static sqInt NoDbgRegParms genMoveTrueR(sqInt reg);
 static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName);
 static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling);
 static sqInt genPushClosureTempsBytecode(void);
@@ -6641,26 +6640,6 @@
 }
 
 
-/*	The receiver has a VarBaseReg; generate the code to set it to its value. */
-
-	/* CogARMCompiler>>#maybeEstablishVarBase */
-static AbstractInstruction * NoDbgRegParms
-maybeEstablishVarBase(AbstractInstruction * self_in_maybeEstablishVarBase)
-{
-    AbstractInstruction *anInstruction;
-    sqInt quickConstant;
-
-	/* begin MoveCq:R: */
-	quickConstant = varBaseAddress();
-	/* begin gen:quickConstant:operand: */
-	anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg);
-	if (usesOutOfLineLiteral(anInstruction)) {
-		(anInstruction->dependent = locateLiteral(quickConstant));
-	}
-	return self_in_maybeEstablishVarBase;
-}
-
-
 /*	build an ARM [base +/- offset8] half-word memory instruction
 	p -> pre-index (1) or post-index (0) the offset. Combines with W to do
 	some odd things.
@@ -10227,12 +10206,21 @@
 static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void)
 
 {
+    AbstractInstruction *anInstruction;
     sqInt endAddress;
     sqInt enilopmart;
+    sqInt quickConstant;
     sqInt size;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	quickConstant = varBaseAddress();
+	/* begin gen:quickConstant:operand: */
+	anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg);
+	if (usesOutOfLineLiteral(anInstruction)) {
+		(anInstruction->dependent = locateLiteral(quickConstant));
+	}
+	((AbstractInstruction *) backEnd);
 	genLoadStackPointers(backEnd);
 	if (regArg3OrNone != NoReg) {
 		/* begin PopR: */
@@ -10317,9 +10305,11 @@
     sqInt address1;
     sqInt address2;
     AbstractInstruction *anInstruction;
+    AbstractInstruction *anInstruction1;
     sqInt fixupSize;
     sqInt opcodeSize;
     sqInt quickConstant;
+    sqInt quickConstant1;
     sqInt startAddress;
 
 	/* begin allocateOpcodes:bytecodes: */
@@ -10332,7 +10322,17 @@
 	zeroOpcodeIndex();
 	labelCounter = 0;
 	startAddress = methodZoneBase;
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeSaveVarBase */
+	genoperand(PushR, VarBaseReg);
+	((AbstractInstruction *) backEnd);
+	/* begin maybeEstablishVarBase */
+	quickConstant1 = varBaseAddress();
+	/* begin gen:quickConstant:operand: */
+	anInstruction1 = genoperandoperand(MoveCqR, quickConstant1, VarBaseReg);
+	if (usesOutOfLineLiteral(anInstruction1)) {
+		(anInstruction1->dependent = locateLiteral(quickConstant1));
+	}
+	((AbstractInstruction *) backEnd);
 	if (captureFramePointer) {
 		/* begin MoveR:Aw: */
 		address = cFramePointerAddress();
@@ -10344,6 +10344,9 @@
 	/* begin gen:operand:literal: */
 	checkLiteralforInstruction(address1, genoperandoperand(MoveRAw, SPReg, address1));
 
+	/* begin maybeRestoreVarBase */
+	genoperand(PopR, VarBaseReg);
+	((AbstractInstruction *) backEnd);
 	/* begin RetN: */
 	genoperand(RetN, 0);
 	outputInstructionsForGeneratedRuntimeAt(startAddress);
@@ -15623,7 +15626,7 @@
 
 	/* FP jumps are a little weird */
 	jumpCond = jumpOpcodeGenerator(0);
-	/* begin genMoveFalseR: */
+	/* begin genMoveConstant:R: */
 	constant = falseObject();
 	if (shouldAnnotateObjectReference(constant)) {
 		annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -15639,7 +15642,7 @@
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
 	genoperand(RetN, 0);
-	jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg));
+	jmpTarget(jumpCond, genMoveConstantR(trueObject(), ReceiverResultReg));
 	/* begin genPrimReturn */
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
@@ -16302,7 +16305,6 @@
 	jumpNotSI = genJumpNotSmallInteger(Arg0Reg);
 	genShiftAwaySmallIntegerTagsInScratchReg(ClassReg);
 	genRemoveSmallIntegerTagsInScratchReg(Arg1Reg);
-	/* begin MulR:R: */
 	genMulRR(backEnd, Arg1Reg, ClassReg);
 	/* begin JumpOverflow: */
 	jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0));
@@ -16449,7 +16451,7 @@
 	/* begin CmpR:R: */
 	genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
 	jumpTrue = genConditionalBranchoperand(jumpOpcode, 0);
-	/* begin genMoveFalseR: */
+	/* begin genMoveConstant:R: */
 	constant = falseObject();
 	if (shouldAnnotateObjectReference(constant)) {
 		annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -16465,7 +16467,7 @@
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
 	genoperand(RetN, 0);
-	jmpTarget(jumpTrue, genMoveTrueR(ReceiverResultReg));
+	jmpTarget(jumpTrue, genMoveConstantR(trueObject(), ReceiverResultReg));
 	/* begin genPrimReturn */
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
@@ -16520,7 +16522,7 @@
 
 	/* FP jumps are a little weird */
 	jumpCond = jumpFPOpcodeGenerator(0);
-	/* begin genMoveFalseR: */
+	/* begin genMoveConstant:R: */
 	constant = falseObject();
 	if (shouldAnnotateObjectReference(constant)) {
 		annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -16536,7 +16538,7 @@
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
 	genoperand(RetN, 0);
-	jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg));
+	jmpTarget(jumpCond, genMoveConstantR(trueObject(), ReceiverResultReg));
 	/* begin genPrimReturn */
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
@@ -19911,7 +19913,7 @@
 }
 
 	/* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */
-static sqInt NoDbgRegParms
+static AbstractInstruction * NoDbgRegParms
 genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg)
 {
 	return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1);
@@ -20408,7 +20410,7 @@
 		/* begin JumpNonZero: */
 		jumpCmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0));
 	}
-	/* begin genMoveTrueR: */
+	/* begin genMoveConstant:R: */
 	constant = trueObject();
 	if (shouldAnnotateObjectReference(constant)) {
 		annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -20424,7 +20426,7 @@
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
 	genoperand(RetN, 0);
-	jmpTarget(jumpCmp, genMoveFalseR(ReceiverResultReg));
+	jmpTarget(jumpCmp, genMoveConstantR(falseObject(), ReceiverResultReg));
 	/* begin genPrimReturn */
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
@@ -23541,15 +23543,12 @@
 	return 0;
 }
 
-	/* SimpleStackBasedCogit>>#genMoveFalseR: */
+	/* SimpleStackBasedCogit>>#genMoveConstant:R: */
 static AbstractInstruction * NoDbgRegParms
-genMoveFalseR(sqInt reg)
+genMoveConstantR(sqInt constant, sqInt reg)
 {
     AbstractInstruction *anInstruction;
-    sqInt constant;
 
-	/* begin genMoveConstant:R: */
-	constant = falseObject();
 	return (shouldAnnotateObjectReference(constant)
 		? annotateobjRef(gMoveCwR(constant, reg), constant)
 		: (/* begin MoveCq:R: */
@@ -23561,7 +23560,7 @@
 }
 
 	/* SimpleStackBasedCogit>>#genMoveTrueR: */
-static AbstractInstruction * NoDbgRegParms
+static sqInt NoDbgRegParms
 genMoveTrueR(sqInt reg)
 {
     AbstractInstruction *anInstruction;
@@ -23621,15 +23620,24 @@
     AbstractInstruction *anInstruction4;
     AbstractInstruction *anInstruction5;
     AbstractInstruction *anInstruction6;
+    AbstractInstruction *anInstruction7;
     sqInt callTarget;
     AbstractInstruction *continuePostSample;
     AbstractInstruction * inst;
     AbstractInstruction *jmpFail;
     AbstractInstruction *jmpSample;
+    sqInt quickConstant;
     sqInt reg;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	quickConstant = varBaseAddress();
+	/* begin gen:quickConstant:operand: */
+	anInstruction7 = genoperandoperand(MoveCqR, quickConstant, VarBaseReg);
+	if (usesOutOfLineLiteral(anInstruction7)) {
+		(anInstruction7->dependent = locateLiteral(quickConstant));
+	}
+	((AbstractInstruction *) backEnd);
 	if (profiling) {
 
 		/* Test nextProfileTick for being non-zero and call checkProfileTick: if so.
@@ -25608,13 +25616,22 @@
 static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void)
 
 {
+    AbstractInstruction *anInstruction;
     sqInt endAddress;
     sqInt enilopmart;
+    sqInt quickConstant;
     sqInt reg;
     sqInt size;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	quickConstant = varBaseAddress();
+	/* begin gen:quickConstant:operand: */
+	anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg);
+	if (usesOutOfLineLiteral(anInstruction)) {
+		(anInstruction->dependent = locateLiteral(quickConstant));
+	}
+	((AbstractInstruction *) backEnd);
 	genLoadStackPointers(backEnd);
 	/* begin PopR: */
 	genoperand(PopR, ClassReg);

Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c	2016-01-09 18:55:57 UTC (rev 3548)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c	2016-01-09 20:37:15 UTC (rev 3549)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	CCodeGenerator VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -463,7 +463,6 @@
 static sqInt NoDbgRegParms loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize);
 static sqInt NoDbgRegParms loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize);
 static sqInt NoDbgRegParms machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes);
-static AbstractInstruction * NoDbgRegParms maybeEstablishVarBase(AbstractInstruction * self_in_maybeEstablishVarBase);
 static sqInt NoDbgRegParms modRMRO(AbstractInstruction * self_in_modRMRO, sqInt mod, sqInt regMode, sqInt regOpcode);
 static sqInt NoDbgRegParms nsSendCacheAt(AbstractInstruction * self_in_nsSendCacheAt, char *callSiteReturnAddress);
 static sqInt NoDbgRegParms numCheckFeaturesOpcodes(AbstractInstruction * self_in_numCheckFeaturesOpcodes);
@@ -852,7 +851,7 @@
 static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver);
-static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
+static sqInt NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg);
 static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg);
@@ -3197,7 +3196,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset15) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset15) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset15) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpLongNonZero:
@@ -3237,7 +3236,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset17) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset17) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset17) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case Jump:
@@ -3302,7 +3301,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset19) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset19) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset19) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpNonNegative:
@@ -3340,7 +3339,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset110) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset110) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset110) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpOverflow:
@@ -3378,7 +3377,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset111) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset111) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset111) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpNoOverflow:
@@ -3416,7 +3415,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset112) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset112) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset112) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpCarry:
@@ -3456,7 +3455,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset113) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset113) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset113) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpNoCarry:
@@ -3496,7 +3495,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset114) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset114) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset114) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpLess:
@@ -3534,7 +3533,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset115) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset115) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset115) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpGreaterOrEqual:
@@ -3572,7 +3571,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset116) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset116) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset116) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpGreater:
@@ -3610,7 +3609,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset117) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset117) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset117) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpLessOrEqual:
@@ -3648,7 +3647,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset118) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset118) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset118) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpAbove:
@@ -3687,7 +3686,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset119) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset119) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset119) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpBelowOrEqual:
@@ -3726,7 +3725,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset120) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset120) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset120) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpFPOrdered:
@@ -3764,7 +3763,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset121) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset121) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset121) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case JumpFPUnordered:
@@ -3802,7 +3801,7 @@
 		((self_in_dispatchConcretize->machineCode))[3] = ((((usqInt) offset122) >> 8) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[4] = ((((usqInt) offset122) >> 16) & 0xFF);
 		((self_in_dispatchConcretize->machineCode))[5] = ((((usqInt) offset122) >> 24) & 0xFF);
-		((self_in_dispatchConcretize->machineCodeSize) = 6);
+		((usqInt) (((self_in_dispatchConcretize->machineCodeSize) = 6)));
 		return;
 
 	case RetN:
@@ -5865,16 +5864,6 @@
 }
 
 
-/*	The receiver does not have a VarBaseReg; do nothing. */
-
-	/* CogIA32Compiler>>#maybeEstablishVarBase */
-static AbstractInstruction * NoDbgRegParms
-maybeEstablishVarBase(AbstractInstruction * self_in_maybeEstablishVarBase)
-{
-	return self_in_maybeEstablishVarBase;
-}
-
-
 /*	See ModR/M byte & opcode syntax
 	In addition to the notation shown above in 'Mnemonic Syntax' on page 43,
 	the following notation indicates the size and type of operands in the
@@ -9293,7 +9282,8 @@
     sqInt size;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	genLoadStackPointers(backEnd);
 	if (regArg3OrNone != NoReg) {
 		/* begin PopR: */
@@ -9385,7 +9375,10 @@
 	zeroOpcodeIndex();
 	labelCounter = 0;
 	startAddress = methodZoneBase;
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeSaveVarBase */
+	((AbstractInstruction *) backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	if (captureFramePointer) {
 		/* begin MoveR:Aw: */
 		address = cFramePointerAddress();
@@ -9403,6 +9396,8 @@
 	/* begin gen:operand:literal: */
 	anInstruction3 = genoperandoperand(MoveRAw, TempReg, address2);
 
+	/* begin maybeRestoreVarBase */
+	((AbstractInstruction *) backEnd);
 	/* begin RetN: */
 	genoperand(RetN, 0);
 	outputInstructionsForGeneratedRuntimeAt(startAddress);
@@ -9625,12 +9620,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;
 
@@ -15292,6 +15287,7 @@
 	jumpNotSI = genJumpNotSmallInteger(Arg0Reg);
 	genShiftAwaySmallIntegerTagsInScratchReg(ClassReg);
 	genRemoveSmallIntegerTagsInScratchReg(Arg1Reg);
+	/* begin MulR:R: */
 	genMulRR(backEnd, Arg1Reg, ClassReg);
 	/* begin JumpOverflow: */
 	jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0));
@@ -18210,7 +18206,7 @@
 }
 
 	/* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */
-static AbstractInstruction * NoDbgRegParms
+static sqInt NoDbgRegParms
 genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg)
 {
 	return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1);
@@ -20924,7 +20920,8 @@
     sqInt reg;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	if (profiling) {
 
 		/* Test nextProfileTick for being non-zero and call checkProfileTick: if so.
@@ -22873,7 +22870,8 @@
     sqInt size;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	genLoadStackPointers(backEnd);
 	/* begin PopR: */
 	genoperand(PopR, ClassReg);

Modified: branches/Cog/nsspursrc/vm/cogitMIPSEL.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitMIPSEL.c	2016-01-09 18:55:57 UTC (rev 3548)
+++ branches/Cog/nsspursrc/vm/cogitMIPSEL.c	2016-01-09 20:37:15 UTC (rev 3549)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	CCodeGenerator VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -782,7 +782,7 @@
 static usqInt NoDbgRegParms concretizeBrUnsignedGreaterRR(AbstractInstruction * self_in_concretizeBrUnsignedGreaterRR);
 static usqInt NoDbgRegParms concretizeBrUnsignedLessEqualRR(AbstractInstruction * self_in_concretizeBrUnsignedLessEqualRR);
 static usqInt NoDbgRegParms concretizeBrUnsignedLessRR(AbstractInstruction * self_in_concretizeBrUnsignedLessRR);
-static sqInt NoDbgRegParms concretizeCall(AbstractInstruction * self_in_concretizeCall);
+static usqInt NoDbgRegParms concretizeCall(AbstractInstruction * self_in_concretizeCall);
 static usqInt NoDbgRegParms concretizeCallFull(AbstractInstruction * self_in_concretizeCallFull);
 static sqInt NoDbgRegParms concretizeCmpCqR(AbstractInstruction * self_in_concretizeCmpCqR);
 static sqInt NoDbgRegParms concretizeCmpCwR(AbstractInstruction * self_in_concretizeCmpCwR);
@@ -791,7 +791,7 @@
 static usqInt NoDbgRegParms concretizeFill32(AbstractInstruction * self_in_concretizeFill32);
 static usqInt NoDbgRegParms concretizeJump(AbstractInstruction * self_in_concretizeJump);
 static usqInt NoDbgRegParms concretizeJumpFull(AbstractInstruction * self_in_concretizeJumpFull);
-static sqInt NoDbgRegParms concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong);
+static usqInt NoDbgRegParms concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong);
 static sqInt NoDbgRegParms concretizeJumpLongNonZero(AbstractInstruction * self_in_concretizeJumpLongNonZero);
 static sqInt NoDbgRegParms concretizeJumpLongZero(AbstractInstruction * self_in_concretizeJumpLongZero);
 static sqInt NoDbgRegParms concretizeJumpNonZero(AbstractInstruction * self_in_concretizeJumpNonZero);
@@ -832,22 +832,22 @@
 static usqInt NoDbgRegParms concretizeMulCheckOverflowRR(AbstractInstruction * self_in_concretizeMulCheckOverflowRR);
 static usqInt NoDbgRegParms concretizeNegateR(AbstractInstruction * self_in_concretizeNegateR);
 static usqInt NoDbgRegParms concretizeNop(AbstractInstruction * self_in_concretizeNop);
-static sqInt NoDbgRegParms concretizeOrCqR(AbstractInstruction * self_in_concretizeOrCqR);
+static usqInt NoDbgRegParms concretizeOrCqR(AbstractInstruction * self_in_concretizeOrCqR);
 static usqInt NoDbgRegParms concretizeOrCwR(AbstractInstruction * self_in_concretizeOrCwR);
 static usqInt NoDbgRegParms concretizeOrRR(AbstractInstruction * self_in_concretizeOrRR);
 static usqInt NoDbgRegParms concretizePopR(AbstractInstruction * self_in_concretizePopR);
 static usqInt NoDbgRegParms concretizePrefetchAw(AbstractInstruction * self_in_concretizePrefetchAw);
-static usqInt NoDbgRegParms concretizePushCq(AbstractInstruction * self_in_concretizePushCq);
+static sqInt NoDbgRegParms concretizePushCq(AbstractInstruction * self_in_concretizePushCq);
 static usqInt NoDbgRegParms concretizePushCw(AbstractInstruction * self_in_concretizePushCw);
 static usqInt NoDbgRegParms concretizePushR(AbstractInstruction * self_in_concretizePushR);
 static usqInt NoDbgRegParms concretizeRetN(AbstractInstruction * self_in_concretizeRetN);
 static usqInt NoDbgRegParms concretizeStop(AbstractInstruction * self_in_concretizeStop);
 static usqInt NoDbgRegParms concretizeSubCheckOverflowCqR(AbstractInstruction * self_in_concretizeSubCheckOverflowCqR);
 static usqInt NoDbgRegParms concretizeSubCheckOverflowRR(AbstractInstruction * self_in_concretizeSubCheckOverflowRR);
-static usqInt NoDbgRegParms concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR);
+static sqInt NoDbgRegParms concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR);
 static usqInt NoDbgRegParms concretizeSubCwR(AbstractInstruction * self_in_concretizeSubCwR);
 static usqInt NoDbgRegParms concretizeSubRR(AbstractInstruction * self_in_concretizeSubRR);
-static sqInt NoDbgRegParms concretizeTstCqR(AbstractInstruction * self_in_concretizeTstCqR);
+static usqInt NoDbgRegParms concretizeTstCqR(AbstractInstruction * self_in_concretizeTstCqR);
 static usqInt NoDbgRegParms concretizeTstCwR(AbstractInstruction * self_in_concretizeTstCwR);
 static sqInt NoDbgRegParms concretizeUnimplemented(AbstractInstruction * self_in_concretizeUnimplemented);
 static usqInt NoDbgRegParms concretizeXorCwR(AbstractInstruction * self_in_concretizeXorCwR);
@@ -909,7 +909,6 @@
 static sqInt NoDbgRegParms lwRbaseoffset(AbstractInstruction * self_in_lwRbaseoffset, sqInt destReg, sqInt baseReg, sqInt offset);
 static sqInt NoDbgRegParms machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes);
 static sqInt NoDbgRegParms machineCodeWords(AbstractInstruction * self_in_machineCodeWords);
-static AbstractInstruction * NoDbgRegParms maybeEstablishVarBase(AbstractInstruction * self_in_maybeEstablishVarBase);
 static sqInt NoDbgRegParms mfhiR(AbstractInstruction * self_in_mfhiR, sqInt destReg);
 static sqInt NoDbgRegParms mfloR(AbstractInstruction * self_in_mfloR, sqInt destReg);
 static sqInt NoDbgRegParms mipsbreak(AbstractInstruction * self_in_mipsbreak, sqInt code);
@@ -1048,7 +1047,7 @@
 static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver);
-static sqInt NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
+static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg);
 static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg);
@@ -1136,8 +1135,8 @@
 static sqInt genLongUnconditionalBackwardJump(void);
 static sqInt genLongUnconditionalForwardJump(void);
 static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs);
-static AbstractInstruction * NoDbgRegParms genMoveConstantR(sqInt constant, sqInt reg);
-static sqInt NoDbgRegParms genMoveTrueR(sqInt reg);
+static AbstractInstruction * NoDbgRegParms genMoveFalseR(sqInt reg);
+static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg);
 static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName);
 static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling);
 static sqInt genPushClosureTempsBytecode(void);
@@ -5403,7 +5402,8 @@
     sqInt size;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	genLoadStackPointers(backEnd);
 	if (regArg3OrNone != NoReg) {
 		/* begin PopR: */
@@ -5508,7 +5508,10 @@
 	zeroOpcodeIndex();
 	labelCounter = 0;
 	startAddress = methodZoneBase;
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeSaveVarBase */
+	((AbstractInstruction *) backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	if (captureFramePointer) {
 		/* begin MoveR:Aw: */
 		address = cFramePointerAddress();
@@ -5520,6 +5523,8 @@
 	/* begin gen:operand:literal: */
 	anInstruction2 = genoperandoperand(MoveRAw, SPReg, address1);
 
+	/* begin maybeRestoreVarBase */
+	((AbstractInstruction *) backEnd);
 	/* begin RetN: */
 	genoperand(RetN, 0);
 	outputInstructionsForGeneratedRuntimeAt(startAddress);
@@ -5742,12 +5747,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;
 
@@ -8588,7 +8593,7 @@
 relocateCallsInClosedPIC(CogMethod *cPIC)
 {
     sqLong callDelta;
-    usqInt entryPoint;
+    sqInt entryPoint;
     sqInt i;
     sqInt pc;
     sqLong refDelta;
@@ -11671,7 +11676,7 @@
 	the method zone. */
 
 	/* CogMIPSELCompiler>>#concretizeCall */
-static sqInt NoDbgRegParms
+static usqInt NoDbgRegParms
 concretizeCall(AbstractInstruction * self_in_concretizeCall)
 {
 	return concretizeCallFull(self_in_concretizeCall);
@@ -11841,7 +11846,7 @@
 }
 
 	/* CogMIPSELCompiler>>#concretizeJumpLong */
-static sqInt NoDbgRegParms
+static usqInt NoDbgRegParms
 concretizeJumpLong(AbstractInstruction * self_in_concretizeJumpLong)
 {
 	return concretizeJumpFull(self_in_concretizeJumpLong);
@@ -12551,7 +12556,7 @@
 }
 
 	/* CogMIPSELCompiler>>#concretizeOrCqR */
-static sqInt NoDbgRegParms
+static usqInt NoDbgRegParms
 concretizeOrCqR(AbstractInstruction * self_in_concretizeOrCqR)
 {
     sqInt aWord;
@@ -12653,7 +12658,7 @@
 }
 
 	/* CogMIPSELCompiler>>#concretizePushCq */
-static usqInt NoDbgRegParms
+static sqInt NoDbgRegParms
 concretizePushCq(AbstractInstruction * self_in_concretizePushCq)
 {
 	return concretizePushCw(self_in_concretizePushCq);
@@ -12818,7 +12823,7 @@
 }
 
 	/* CogMIPSELCompiler>>#concretizeSubCqR */
-static usqInt NoDbgRegParms
+static sqInt NoDbgRegParms
 concretizeSubCqR(AbstractInstruction * self_in_concretizeSubCqR)
 {
     sqInt aWord;
@@ -12880,7 +12885,7 @@
 }
 
 	/* CogMIPSELCompiler>>#concretizeTstCqR */
-static sqInt NoDbgRegParms
+static usqInt NoDbgRegParms
 concretizeTstCqR(AbstractInstruction * self_in_concretizeTstCqR)
 {
     sqInt aWord;
@@ -14165,23 +14170,6 @@
 	return 7;
 }
 
-
-/*	The receiver has a VarBaseReg; generate the code to set it to its value. */
-
-	/* CogMIPSELCompiler>>#maybeEstablishVarBase */
-static AbstractInstruction * NoDbgRegParms
-maybeEstablishVarBase(AbstractInstruction * self_in_maybeEstablishVarBase)
-{
-    AbstractInstruction *anInstruction;
-    sqInt quickConstant;
-
-	/* begin MoveCq:R: */
-	quickConstant = varBaseAddress();
-	/* begin gen:quickConstant:operand: */
-	anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg);
-	return self_in_maybeEstablishVarBase;
-}
-
 	/* CogMIPSELCompiler>>#mfhiR: */
 static sqInt NoDbgRegParms
 mfhiR(AbstractInstruction * self_in_mfhiR, sqInt destReg)
@@ -15638,7 +15626,6 @@
 	jumpNotSI = genJumpNotSmallInteger(Arg0Reg);
 	genShiftAwaySmallIntegerTagsInScratchReg(ClassReg);
 	genRemoveSmallIntegerTagsInScratchReg(Arg1Reg);
-	/* begin MulR:R: */
 	genMulRR(backEnd, Arg1Reg, ClassReg);
 	/* begin JumpOverflow: */
 	jumpOvfl = genConditionalBranchoperand(JumpOverflow, ((sqInt)0));
@@ -15779,7 +15766,7 @@
 	/* begin CmpR:R: */
 	genoperandoperand(CmpRR, Arg0Reg, ReceiverResultReg);
 	jumpTrue = genConditionalBranchoperand(jumpOpcode, 0);
-	/* begin genMoveConstant:R: */
+	/* begin genMoveFalseR: */
 	constant = falseObject();
 	if (shouldAnnotateObjectReference(constant)) {
 		annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -15792,7 +15779,7 @@
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
 	genoperand(RetN, 0);
-	jmpTarget(jumpTrue, genMoveConstantR(trueObject(), ReceiverResultReg));
+	jmpTarget(jumpTrue, genMoveTrueR(ReceiverResultReg));
 	/* begin genPrimReturn */
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
@@ -15847,7 +15834,7 @@
 
 	/* FP jumps are a little weird */
 	jumpCond = jumpFPOpcodeGenerator(0);
-	/* begin genMoveConstant:R: */
+	/* begin genMoveFalseR: */
 	constant = falseObject();
 	if (shouldAnnotateObjectReference(constant)) {
 		annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -15860,7 +15847,7 @@
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
 	genoperand(RetN, 0);
-	jmpTarget(jumpCond, genMoveConstantR(trueObject(), ReceiverResultReg));
+	jmpTarget(jumpCond, genMoveTrueR(ReceiverResultReg));
 	/* begin genPrimReturn */
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
@@ -18500,7 +18487,7 @@
 }
 
 	/* CogObjectRepresentationForSpur>>#genGetClassTagOf:into:scratchReg: */
-static sqInt NoDbgRegParms
+static AbstractInstruction * NoDbgRegParms
 genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg)
 {
 	return genGetInlineCacheClassTagFromintoforEntry(instReg, destReg, 1);
@@ -18908,7 +18895,7 @@
 		/* begin JumpNonZero: */
 		jumpCmp = genConditionalBranchoperand(JumpNonZero, ((sqInt)0));
 	}
-	/* begin genMoveConstant:R: */
+	/* begin genMoveTrueR: */
 	constant = trueObject();
 	if (shouldAnnotateObjectReference(constant)) {
 		annotateobjRef(gMoveCwR(constant, ReceiverResultReg), constant);
@@ -18921,7 +18908,7 @@
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
 	genoperand(RetN, 0);
-	jmpTarget(jumpCmp, genMoveConstantR(falseObject(), ReceiverResultReg));
+	jmpTarget(jumpCmp, genMoveFalseR(ReceiverResultReg));
 	/* begin genPrimReturn */
 	assert(methodOrBlockNumArgs <= (numRegArgs()));
 	/* begin RetN: */
@@ -21114,12 +21101,15 @@
 	return 0;
 }
 
-	/* SimpleStackBasedCogit>>#genMoveConstant:R: */
+	/* SimpleStackBasedCogit>>#genMoveFalseR: */
 static AbstractInstruction * NoDbgRegParms
-genMoveConstantR(sqInt constant, sqInt reg)
+genMoveFalseR(sqInt reg)
 {
     AbstractInstruction *anInstruction;
+    sqInt constant;
 
+	/* begin genMoveConstant:R: */
+	constant = falseObject();
 	return (shouldAnnotateObjectReference(constant)
 		? annotateobjRef(gMoveCwR(constant, reg), constant)
 		: (/* begin MoveCq:R: */
@@ -21128,7 +21118,7 @@
 }
 
 	/* SimpleStackBasedCogit>>#genMoveTrueR: */
-static sqInt NoDbgRegParms
+static AbstractInstruction * NoDbgRegParms
 genMoveTrueR(sqInt reg)
 {
     AbstractInstruction *anInstruction;
@@ -21201,7 +21191,8 @@
     sqInt reg;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	if (profiling) {
 
 		/* Test nextProfileTick for being non-zero and call checkProfileTick: if so.
@@ -23151,7 +23142,8 @@
     sqInt size;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	((AbstractInstruction *) backEnd);
 	genLoadStackPointers(backEnd);
 	/* begin PopR: */
 	genoperand(PopR, ClassReg);


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Sat Jan  9 10:53:52 PST 2016
   + Sat Jan  9 12:36:11 PST 2016

Modified: branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m
===================================================================
--- branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m	2016-01-09 18:55:57 UTC (rev 3548)
+++ branches/Cog/platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m	2016-01-09 20:37:15 UTC (rev 3549)
@@ -162,7 +162,6 @@
 		 * set to the native stack & frame pointers.
 		 */
 			extern void ifValidWriteBackStackPointersSaveTo(void*,void*,char**,char**);
-# if __APPLE__ && __MACH__
 #	if __i386__
 	/* see sys/ucontext.h; two different namings */
 #	  if __GNUC__ && !__INTEL_COMPILER /* icc pretends to be gcc */
@@ -185,7 +184,6 @@
 			char *savedSP, *savedFP;
 
 			ifValidWriteBackStackPointersSaveTo(fp,sp,&savedFP,&savedSP);
-# endif
 
 			printingStack = true;
 			if (printAll) {
@@ -221,7 +219,7 @@
 static void *
 printRegisterState(ucontext_t *uap)
 {
-#if __DARWIN_UNIX03 && __APPLE__ && __MACH__ && __i386__
+#if __DARWIN_UNIX03 && __i386__
 	_STRUCT_X86_THREAD_STATE32 *regs = &uap->uc_mcontext->__ss;
 	printf(	"\teax 0x%08x ebx 0x%08x ecx 0x%08x edx 0x%08x\n"
 			"\tedi 0x%08x esi 0x%08x ebp 0x%08x esp 0x%08x\n"
@@ -230,7 +228,7 @@
 			regs->__edi, regs->__edi, regs->__ebp, regs->__esp,
 			regs->__eip);
 	return (void *)(regs->__eip);
-#elif __APPLE__ && __MACH__ && __i386__
+#elif __i386__
 	_STRUCT_X86_THREAD_STATE32 *regs = &uap->uc_mcontext->ss;
 	printf(	"\teax 0x%08x ebx 0x%08x ecx 0x%08x edx 0x%08x\n"
 			"\tedi 0x%08x esi 0x%08x ebp 0x%08x esp 0x%08x\n"
@@ -239,6 +237,31 @@
 			regs->edi, regs->edi, regs->ebp, regs->esp,
 			regs->eip);
 	return (void *)(regs->eip);
+#elif __x86_64__
+	_STRUCT_X86_THREAD_STATE64 *regs = &uap->uc_mcontext->__ss;
+	printf(	"\trax 0x%016lx rbx 0x%016lx rcx 0x%016lx rdx 0x%016lx\n"
+			"\trdi 0x%016lx rsi 0x%016lx rbp 0x%016lx rsp 0x%016lx\n"
+			"\tr8  0x%016lx r9  0x%016lx r10 0x%016lx r11 0x%016lx\n"
+			"\tr12 0x%016lx r13 0x%016lx r14 0x%016lx r15 0x%016lx\n"
+			"\trip 0x%016lx\n",
+			regs->__rax, regs->__rbx, regs->__rcx, regs->__rdx,
+			regs->__rdi, regs->__rdi, regs->__rbp, regs->__rsp,
+			regs->__r8 , regs->__r9 , regs->__r10, regs->__r11,
+			regs->__r12, regs->__r13, regs->__r14, regs->__r15,
+			regs->__rip);
+	return (void *)(regs->__rip);
+# elif defined(__arm__) || defined(__arm32__)
+	_STRUCT_ARM_THREAD_STATE *regs = &uap->uc_mcontext->ss;
+	printf(	"\t r0 0x%08x r1 0x%08x r2 0x%08x r3 0x%08x\n"
+	        "\t r4 0x%08x r5 0x%08x r6 0x%08x r7 0x%08x\n"
+	        "\t r8 0x%08x r9 0x%08x r10 0x%08x fp 0x%08x\n"
+	        "\t ip 0x%08x sp 0x%08x lr 0x%08x pc 0x%08x\n"
+			"\tcpsr 0x%08x\n",
+	        regs->r[0],regs->r[1],regs->r[2],regs->r[3],
+	        regs->r[4],regs->r[5],regs->r[6],regs->r[7],
+	        regs->r[8],regs->r[9],regs->r[10],regs->r[11],
+	        regs->r[12], regs->sp, regs->lr, regs->pc, regs->cpsr);
+	return (void *)(regs->pc);
 #else
 	printf("don't know how to derive register state from a ucontext_t on this platform\n");
 	return 0;
@@ -367,11 +390,12 @@
  */
 
 /*
- * Cog has already captured CStackPointer  before calling this routine.  Record
- * the original value, capture the pointers again and determine if CFramePointer
+ * Cog has already captured CStackPointer before calling this routine.  Record
+ * the original value, capture the pointers again and see if CFramePointer
  * lies between the two stack pointers and hence is likely in use.  This is
- * necessary since optimizing C compilers for x86 may use %ebp as a general-
- * purpose register, in which case it must not be captured.
+ * necessary since optimizing C compilers for x86, x64 et al may use the frame
+ * pointer register (%ebp, %rbp et al) as a general-purpose register, in which
+ * case it must not be captured.  Assumes stacks descend.
  */
 int
 isCFramePointerInUse()
@@ -380,7 +404,6 @@
 	extern void (*ceCaptureCStackPointers)(void);
 	unsigned long currentCSP = CStackPointer;
 
-	currentCSP = CStackPointer;
 	ceCaptureCStackPointers();
 	assert(CStackPointer < currentCSP);
 	return CFramePointer >= CStackPointer && CFramePointer <= currentCSP;

Modified: branches/Cog/spur64src/vm/cogit.h
===================================================================
--- branches/Cog/spur64src/vm/cogit.h	2016-01-09 18:55:57 UTC (rev 3548)
+++ branches/Cog/spur64src/vm/cogit.h	2016-01-09 20:37:15 UTC (rev 3549)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	CCodeGenerator VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
  */
 
 

Modified: branches/Cog/spur64src/vm/cogitX64.c
===================================================================
--- branches/Cog/spur64src/vm/cogitX64.c	2016-01-09 18:55:57 UTC (rev 3548)
+++ branches/Cog/spur64src/vm/cogitX64.c	2016-01-09 20:37:15 UTC (rev 3549)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	CCodeGenerator VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1625 uuid: c1bd5626-30ae-42ed-b647-fdc16b18ddf6 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1626 uuid: 5153564f-5657-42ca-a4c9-84b55b308375 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -789,7 +789,7 @@
 static sqInt NoDbgRegParms genGetClassIndexOfNonImminto(sqInt sourceReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetClassObjectOfClassIndexintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetClassObjectOfintoscratchReginstRegIsReceiver(sqInt instReg, sqInt destReg, sqInt scratchReg, sqInt instRegIsReceiver);
-static AbstractInstruction * NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
+static sqInt NoDbgRegParms genGetClassTagOfintoscratchReg(sqInt instReg, sqInt destReg, sqInt scratchReg);
 static sqInt NoDbgRegParms genGetCompactClassIndexNonImmOfinto(sqInt instReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetDoubleValueOfinto(sqInt srcReg, sqInt destFPReg);
 static sqInt NoDbgRegParms genGetFormatOfinto(sqInt srcReg, sqInt destReg);
@@ -838,7 +838,7 @@
 static sqInt NoDbgRegParms codeGranularity(AbstractInstruction * self_in_codeGranularity);
 static sqInt NoDbgRegParms computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize);
 static sqInt NoDbgRegParms computeShiftRRSize(AbstractInstruction * self_in_computeShiftRRSize);
-static usqInt NoDbgRegParms concretizeArithCqRWithROraxOpcode(AbstractInstruction * self_in_concretizeArithCqRWithROraxOpcode, sqInt regOpcode, sqInt raxOpcode);
+static sqInt NoDbgRegParms concretizeArithCqRWithROraxOpcode(AbstractInstruction * self_in_concretizeArithCqRWithROraxOpcode, sqInt regOpcode, sqInt raxOpcode);
 static usqInt NoDbgRegParms concretizeFill32(AbstractInstruction * self_in_concretizeFill32);
 static usqInt NoDbgRegParms concretizeMoveX32rRR(AbstractInstruction * self_in_concretizeMoveX32rRR);
 static usqInt NoDbgRegParms concretizeOpRR(AbstractInstruction * self_in_concretizeOpRR, sqInt x64opcode);
@@ -879,7 +879,6 @@
 static sqInt NoDbgRegParms loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize);
 static usqInt NoDbgRegParms machineCodeAt(AbstractInstruction * self_in_machineCodeAt, sqInt anOffset);
 static sqInt NoDbgRegParms machineCodeBytes(AbstractInstruction * self_in_machineCodeBytes);
-static AbstractInstruction * NoDbgRegParms maybeEstablishVarBase(AbstractInstruction * self_in_maybeEstablishVarBase);
 static sqInt NoDbgRegParms modRMRO(AbstractInstruction * self_in_modRMRO, sqInt mod, sqInt regMode, sqInt regOpcode);
 static sqInt NoDbgRegParms numIntRegArgs(AbstractInstruction * self_in_numIntRegArgs);
 static AbstractInstruction * NoDbgRegParms padIfPossibleWithStopsFromto(AbstractInstruction * self_in_padIfPossibleWithStopsFromto, sqInt startAddr, sqInt endAddr);
@@ -926,7 +925,7 @@
 static sqInt genLongUnconditionalForwardJump(void);
 static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs);
 static AbstractInstruction * NoDbgRegParms genMoveConstantR(sqInt constant, sqInt reg);
-static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg);
+static sqInt NoDbgRegParms genMoveTrueR(sqInt reg);
 static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName);
 static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling);
 static sqInt genPushClosureTempsBytecode(void);
@@ -5070,12 +5069,18 @@
 static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2OrNone, sqInt regArg3OrNone, sqInt forCall, char *trampolineName))(void)
 
 {
+    AbstractInstruction *anInstruction;
     sqInt endAddress;
     sqInt enilopmart;
+    sqInt quickConstant;
     sqInt size;
 
 	zeroOpcodeIndex();
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeEstablishVarBase */
+	quickConstant = varBaseAddress();
+	/* begin gen:quickConstant:operand: */
+	anInstruction = genoperandoperand(MoveCqR, quickConstant, VarBaseReg);
+	((AbstractInstruction *) backEnd);
 	genLoadStackPointers(backEnd);
 	if (regArg3OrNone != NoReg) {
 		/* begin PopR: */
@@ -5152,9 +5157,11 @@
     AbstractInstruction *anInstruction1;
     AbstractInstruction *anInstruction2;
     AbstractInstruction *anInstruction3;
+    AbstractInstruction *anInstruction4;
     sqInt fixupSize;
     sqInt opcodeSize;
     sqInt quickConstant;
+    sqInt quickConstant1;
     sqInt startAddress;
 
 	/* begin allocateOpcodes:bytecodes: */
@@ -5167,7 +5174,14 @@
 	zeroOpcodeIndex();
 	labelCounter = 0;
 	startAddress = methodZoneBase;
-	maybeEstablishVarBase(backEnd);
+	/* begin maybeSaveVarBase */
+	genoperand(PushR, VarBaseReg);

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list