[Vm-dev] [commit][2893] CogVM source as per VMMaker.oscog-eem.673

commits at squeakvm.org commits at squeakvm.org
Fri Apr 11 19:55:50 UTC 2014


Revision: 2893
Author:   eliot
Date:     2014-04-11 12:55:48 -0700 (Fri, 11 Apr 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.673

Sista:
We cannot back-up the machine-code pc in ceCounterTripped: because there isn't
always a send preceeding the jump (e.g. in and: [] and or: [] chains).  Instead,
prevent subsequent counter trips (to reduce the number of necessary
skipBackBeforeJump sends in the image) by nilling out SelectorCounterTripped. The
image-level optimization code will both restore the selector and back-up the pc.

Modified Paths:
--------------
    branches/Cog/sistasrc/vm/cogit.c
    branches/Cog/sistasrc/vm/cogit.h
    branches/Cog/sistasrc/vm/cogmethod.h
    branches/Cog/sistasrc/vm/cointerp.c
    branches/Cog/sistasrc/vm/cointerp.h
    branches/Cog/sistasrc/vm/gcc3x-cointerp.c
    branches/Cog/sistasrc/vm/interp.h
    branches/Cog/sistasrc/vm/vmCallback.h
    branches/Cog/spursistasrc/vm/cogit.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogmethod.h
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/interp.h
    branches/Cog/spursistasrc/vm/vmCallback.h

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


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Fri Apr 11 11:49:37 PDT 2014
   + Fri Apr 11 12:54:42 PDT 2014

Modified: branches/Cog/sistasrc/vm/cogit.c
===================================================================
--- branches/Cog/sistasrc/vm/cogit.c	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/cogit.c	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	CCodeGenerator VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -12041,15 +12041,15 @@
 	ssFlushTo(simStackPtr - 1);
 	desc = ssTop();
 	ssPop(1);
-	/* begin Label */
-	retry = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
 	popToReg(desc, TempReg);
 	ssAllocateRequiredReg(SendNumArgsReg);
 	counter = (&(counters[counterIndex]));
 	counterIndex += 1;
 	flag("will need to use MoveAw32:R: if 64 bits");
 	assert(BytesPerWord == CounterBytes);
-	addDependent(counter, annotateAbsolutePCRef(gMoveAwR(((usqInt)counter), SendNumArgsReg)));
+	/* begin MoveAw:R: */
+	retry = genoperandoperand(MoveAwR, ((usqInt)counter), SendNumArgsReg);
+	addDependent(counter, annotateAbsolutePCRef(retry));
 	/* begin SubCq:R: */
 	genoperandoperand(SubCqR, 65536, SendNumArgsReg);
 	/* begin JumpCarry: */
@@ -12339,10 +12339,10 @@
 	/* begin JumpZero: */
 	jumpMBB = genoperand(JumpZero, ((sqInt)0));
 	compileTrampolineForcallJumpBarnumArgsargargargargsaveRegsresultReg(ceCounterTripped, 1, 1, TempReg, null, null, null, 0, null);
-	if ((cResultRegister(backEnd)) != ReceiverResultReg) {
+	if ((cResultRegister(backEnd)) != TempReg) {
 		/* begin MoveR:R: */
 		reg1 = cResultRegister(backEnd);
-		genoperandoperand(MoveRR, reg1, ReceiverResultReg);
+		genoperandoperand(MoveRR, reg1, TempReg);
 	}
 	assert(!(shouldAnnotateObjectReference(boolean)));
 	jmpTarget(jumpMBB, gAddCqR(boolean, TempReg));

Modified: branches/Cog/sistasrc/vm/cogit.h
===================================================================
--- branches/Cog/sistasrc/vm/cogit.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/cogit.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	CCodeGenerator VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 

Modified: branches/Cog/sistasrc/vm/cogmethod.h
===================================================================
--- branches/Cog/sistasrc/vm/cogmethod.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/cogmethod.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	CCodeGenerator VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 typedef struct {

Modified: branches/Cog/sistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/sistasrc/vm/cointerp.c	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/cointerp.c	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
    from
-	CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2039,7 +2039,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.672]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.673]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -11261,12 +11261,17 @@
 
 
 /*	Two things are going on here. The main one is catching a counter trip and
-	attempting to send the SelectorCounterTripped selector. In this case, if
-	the send can be made, the
-	pc should be backed up to the return address of the send that yields the
-	boolean to be
-	tested, so that after potential optimization, computation proceeds by
-	retryying the jump.
+	attempting to send the SelectorCounterTripped selector. In this case we
+	would like to back-up
+	 the pc to the return address of the send that
+	yields the boolean to be tested, so that
+	after potential optimization, computation proceeds by retrying the jump.
+	But we cannot,
+	since there may be no send, just a pop (as in and: [] and or: [] chains).
+	In this case we also
+	want to prevent further callbacks until optimization is complete. So we
+	nil-out the
+	SelectorCounterTripped entry in the specialSelectorArray.
 	
 	The minor case is that there is an unlikely possibility that the cointer
 	tripped but condition
@@ -11286,14 +11291,15 @@
     char *sp11;
     char *sp2;
     sqInt top;
+    sqInt top1;
 
 	if (!((condition == GIV(falseObj))
 		 || (condition == GIV(trueObj)))) {
 		/* begin ceSendMustBeBoolean: */
 		/* begin popStack */
-		top = longAt(GIV(stackPointer));
+		top1 = longAt(GIV(stackPointer));
 		GIV(stackPointer) += BytesPerWord;
-		GIV(instructionPointer) = ((sqInt) top);
+		GIV(instructionPointer) = ((sqInt) top1);
 		/* begin push: */
 		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
 		GIV(stackPointer) = sp2;
@@ -11323,7 +11329,16 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
+	/* begin splObj:put: */
+	/* begin storePointer:ofObject:withValue: */
+	if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
+		possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
+	}
+	longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorCounterTripped << ShiftForWord), GIV(nilObj));
+	/* begin popStack */
+	top = longAt(GIV(stackPointer));
+	GIV(stackPointer) += BytesPerWord;
+	GIV(instructionPointer) = ((sqInt) top);
 	/* begin ensureFrameIsMarried:SP: */
 	if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
 		? ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0

Modified: branches/Cog/sistasrc/vm/cointerp.h
===================================================================
--- branches/Cog/sistasrc/vm/cointerp.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/cointerp.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 

Modified: branches/Cog/sistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/sistasrc/vm/gcc3x-cointerp.c	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/gcc3x-cointerp.c	2014-04-11 19:55:48 UTC (rev 2893)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
    from
-	CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2042,7 +2042,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.672]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.673]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -11270,12 +11270,17 @@
 
 
 /*	Two things are going on here. The main one is catching a counter trip and
-	attempting to send the SelectorCounterTripped selector. In this case, if
-	the send can be made, the
-	pc should be backed up to the return address of the send that yields the
-	boolean to be
-	tested, so that after potential optimization, computation proceeds by
-	retryying the jump.
+	attempting to send the SelectorCounterTripped selector. In this case we
+	would like to back-up
+	 the pc to the return address of the send that
+	yields the boolean to be tested, so that
+	after potential optimization, computation proceeds by retrying the jump.
+	But we cannot,
+	since there may be no send, just a pop (as in and: [] and or: [] chains).
+	In this case we also
+	want to prevent further callbacks until optimization is complete. So we
+	nil-out the
+	SelectorCounterTripped entry in the specialSelectorArray.
 	
 	The minor case is that there is an unlikely possibility that the cointer
 	tripped but condition
@@ -11295,14 +11300,15 @@
     char *sp11;
     char *sp2;
     sqInt top;
+    sqInt top1;
 
 	if (!((condition == GIV(falseObj))
 		 || (condition == GIV(trueObj)))) {
 		/* begin ceSendMustBeBoolean: */
 		/* begin popStack */
-		top = longAt(GIV(stackPointer));
+		top1 = longAt(GIV(stackPointer));
 		GIV(stackPointer) += BytesPerWord;
-		GIV(instructionPointer) = ((sqInt) top);
+		GIV(instructionPointer) = ((sqInt) top1);
 		/* begin push: */
 		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
 		GIV(stackPointer) = sp2;
@@ -11332,7 +11338,16 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
+	/* begin splObj:put: */
+	/* begin storePointer:ofObject:withValue: */
+	if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
+		possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
+	}
+	longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorCounterTripped << ShiftForWord), GIV(nilObj));
+	/* begin popStack */
+	top = longAt(GIV(stackPointer));
+	GIV(stackPointer) += BytesPerWord;
+	GIV(instructionPointer) = ((sqInt) top);
 	/* begin ensureFrameIsMarried:SP: */
 	if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
 		? ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0

Modified: branches/Cog/sistasrc/vm/interp.h
===================================================================
--- branches/Cog/sistasrc/vm/interp.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/interp.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/sistasrc/vm/vmCallback.h
===================================================================
--- branches/Cog/sistasrc/vm/vmCallback.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/sistasrc/vm/vmCallback.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 #define VM_CALLBACK_INC 1

Modified: branches/Cog/spursistasrc/vm/cogit.c
===================================================================
--- branches/Cog/spursistasrc/vm/cogit.c	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/cogit.c	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	CCodeGenerator VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -12889,15 +12889,15 @@
 	ssFlushTo(simStackPtr - 1);
 	desc = ssTop();
 	ssPop(1);
-	/* begin Label */
-	retry = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
 	popToReg(desc, TempReg);
 	ssAllocateRequiredReg(SendNumArgsReg);
 	counter = (&(counters[counterIndex]));
 	counterIndex += 1;
 	flag("will need to use MoveAw32:R: if 64 bits");
 	assert(BytesPerWord == CounterBytes);
-	addDependent(counter, annotateAbsolutePCRef(gMoveAwR(((usqInt)counter), SendNumArgsReg)));
+	/* begin MoveAw:R: */
+	retry = genoperandoperand(MoveAwR, ((usqInt)counter), SendNumArgsReg);
+	addDependent(counter, annotateAbsolutePCRef(retry));
 	/* begin SubCq:R: */
 	genoperandoperand(SubCqR, 65536, SendNumArgsReg);
 	/* begin JumpCarry: */
@@ -13212,10 +13212,10 @@
 	/* begin JumpZero: */
 	jumpMBB = genoperand(JumpZero, ((sqInt)0));
 	compileTrampolineForcallJumpBarnumArgsargargargargsaveRegsresultReg(ceCounterTripped, 1, 1, TempReg, null, null, null, 0, null);
-	if ((cResultRegister(backEnd)) != ReceiverResultReg) {
+	if ((cResultRegister(backEnd)) != TempReg) {
 		/* begin MoveR:R: */
 		reg1 = cResultRegister(backEnd);
-		genoperandoperand(MoveRR, reg1, ReceiverResultReg);
+		genoperandoperand(MoveRR, reg1, TempReg);
 	}
 	assert(!(shouldAnnotateObjectReference(boolean)));
 	jmpTarget(jumpMBB, gAddCqR(boolean, TempReg));

Modified: branches/Cog/spursistasrc/vm/cogit.h
===================================================================
--- branches/Cog/spursistasrc/vm/cogit.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/cogit.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	CCodeGenerator VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 

Modified: branches/Cog/spursistasrc/vm/cogmethod.h
===================================================================
--- branches/Cog/spursistasrc/vm/cogmethod.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/cogmethod.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
+	CCodeGenerator VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 typedef struct {

Modified: branches/Cog/spursistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.c	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/cointerp.c	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
    from
-	CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1299,7 +1299,7 @@
 static void setSignalLowSpaceFlagAndSaveProcess(void);
 static void setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext);
 sqInt shiftForWord(void);
-static usqLong shortentoIndexableSize(sqInt objOop, sqInt indexableSize);
+static sqInt shortentoIndexableSize(sqInt objOop, sqInt indexableSize);
 static sqInt shortPrintContext(sqInt aContext);
 static sqInt shortPrintFrameAndCallers(char *theFP);
 EXPORT(void) shortPrintFramesInPage(StackPage *thePage);
@@ -2196,7 +2196,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.672]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.673]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5386,6 +5386,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l148;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -5400,7 +5401,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = byteAtPointer(++localIP);
 
-					/* return self */
+					null;
 				l148:	/* end baseFrameReturn */;
 					goto l145;
 				}
@@ -14010,12 +14011,17 @@
 
 
 /*	Two things are going on here. The main one is catching a counter trip and
-	attempting to send the SelectorCounterTripped selector. In this case, if
-	the send can be made, the
-	pc should be backed up to the return address of the send that yields the
-	boolean to be
-	tested, so that after potential optimization, computation proceeds by
-	retryying the jump.
+	attempting to send the SelectorCounterTripped selector. In this case we
+	would like to back-up
+	 the pc to the return address of the send that
+	yields the boolean to be tested, so that
+	after potential optimization, computation proceeds by retrying the jump.
+	But we cannot,
+	since there may be no send, just a pop (as in and: [] and or: [] chains).
+	In this case we also
+	want to prevent further callbacks until optimization is complete. So we
+	nil-out the
+	SelectorCounterTripped entry in the specialSelectorArray.
 	
 	The minor case is that there is an unlikely possibility that the cointer
 	tripped but condition
@@ -14036,14 +14042,15 @@
     char *sp2;
     char *theSP;
     sqInt top;
+    sqInt top1;
 
 	if (!((condition == GIV(falseObj))
 		 || (condition == GIV(trueObj)))) {
 		/* begin ceSendMustBeBoolean: */
 		/* begin popStack */
-		top = longAt(GIV(stackPointer));
+		top1 = longAt(GIV(stackPointer));
 		GIV(stackPointer) += BytesPerWord;
-		GIV(instructionPointer) = ((sqInt) top);
+		GIV(instructionPointer) = ((sqInt) top1);
 		/* begin push: */
 		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
 		GIV(stackPointer) = sp2;
@@ -14073,7 +14080,29 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
+	/* begin splObj:put: */
+	/* begin storePointer:ofObject:withValue: */
+	assert(!(isForwarded(GIV(specialObjectsOop))));
+	if (isOldObject(GIV(specialObjectsOop))) {
+
+		/* most stores into young objects */
+
+		if (((GIV(nilObj) & 3) == 0)
+		 && ((((usqInt) GIV(nilObj))) < (((usqInt) GIV(newSpaceLimit))))) {
+			/* begin possibleRootStoreInto: */
+			if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) {
+				remember(GIV(specialObjectsOop));
+				/* begin setIsRememberedOf:to: */
+				flag("endianness");
+				longAtput(GIV(specialObjectsOop), (longAt(GIV(specialObjectsOop))) | (1 << 29));
+			}
+		}
+	}
+	longAtput((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorCounterTripped << 2), GIV(nilObj));
+	/* begin popStack */
+	top = longAt(GIV(stackPointer));
+	GIV(stackPointer) += BytesPerWord;
+	GIV(instructionPointer) = ((sqInt) top);
 	/* begin ensureFrameIsMarried:SP: */
 	theSP = GIV(stackPointer);
 	if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
@@ -57147,7 +57176,7 @@
 	zero if no change
 	was possible. */
 
-static usqLong
+static sqInt
 shortentoIndexableSize(sqInt objOop, sqInt indexableSize)
 {
     usqLong bytesAfter;

Modified: branches/Cog/spursistasrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/cointerp.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 

Modified: branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/gcc3x-cointerp.c	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/gcc3x-cointerp.c	2014-04-11 19:55:48 UTC (rev 2893)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
    from
-	CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1302,7 +1302,7 @@
 static void setSignalLowSpaceFlagAndSaveProcess(void);
 static void setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext);
 sqInt shiftForWord(void);
-static usqLong shortentoIndexableSize(sqInt objOop, sqInt indexableSize);
+static sqInt shortentoIndexableSize(sqInt objOop, sqInt indexableSize);
 static sqInt shortPrintContext(sqInt aContext);
 static sqInt shortPrintFrameAndCallers(char *theFP);
 EXPORT(void) shortPrintFramesInPage(StackPage *thePage);
@@ -2199,7 +2199,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.672]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.673]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5395,6 +5395,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l148;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -5409,7 +5410,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = byteAtPointer(++localIP);
 
-					/* return self */
+					null;
 				l148:	/* end baseFrameReturn */;
 					goto l145;
 				}
@@ -14019,12 +14020,17 @@
 
 
 /*	Two things are going on here. The main one is catching a counter trip and
-	attempting to send the SelectorCounterTripped selector. In this case, if
-	the send can be made, the
-	pc should be backed up to the return address of the send that yields the
-	boolean to be
-	tested, so that after potential optimization, computation proceeds by
-	retryying the jump.
+	attempting to send the SelectorCounterTripped selector. In this case we
+	would like to back-up
+	 the pc to the return address of the send that
+	yields the boolean to be tested, so that
+	after potential optimization, computation proceeds by retrying the jump.
+	But we cannot,
+	since there may be no send, just a pop (as in and: [] and or: [] chains).
+	In this case we also
+	want to prevent further callbacks until optimization is complete. So we
+	nil-out the
+	SelectorCounterTripped entry in the specialSelectorArray.
 	
 	The minor case is that there is an unlikely possibility that the cointer
 	tripped but condition
@@ -14045,14 +14051,15 @@
     char *sp2;
     char *theSP;
     sqInt top;
+    sqInt top1;
 
 	if (!((condition == GIV(falseObj))
 		 || (condition == GIV(trueObj)))) {
 		/* begin ceSendMustBeBoolean: */
 		/* begin popStack */
-		top = longAt(GIV(stackPointer));
+		top1 = longAt(GIV(stackPointer));
 		GIV(stackPointer) += BytesPerWord;
-		GIV(instructionPointer) = ((sqInt) top);
+		GIV(instructionPointer) = ((sqInt) top1);
 		/* begin push: */
 		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
 		GIV(stackPointer) = sp2;
@@ -14082,7 +14089,29 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
+	/* begin splObj:put: */
+	/* begin storePointer:ofObject:withValue: */
+	assert(!(isForwarded(GIV(specialObjectsOop))));
+	if (isOldObject(GIV(specialObjectsOop))) {
+
+		/* most stores into young objects */
+
+		if (((GIV(nilObj) & 3) == 0)
+		 && ((((usqInt) GIV(nilObj))) < (((usqInt) GIV(newSpaceLimit))))) {
+			/* begin possibleRootStoreInto: */
+			if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> 29) & 1) != 0)) {
+				remember(GIV(specialObjectsOop));
+				/* begin setIsRememberedOf:to: */
+				flag("endianness");
+				longAtput(GIV(specialObjectsOop), (longAt(GIV(specialObjectsOop))) | (1 << 29));
+			}
+		}
+	}
+	longAtput((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorCounterTripped << 2), GIV(nilObj));
+	/* begin popStack */
+	top = longAt(GIV(stackPointer));
+	GIV(stackPointer) += BytesPerWord;
+	GIV(instructionPointer) = ((sqInt) top);
 	/* begin ensureFrameIsMarried:SP: */
 	theSP = GIV(stackPointer);
 	if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
@@ -57156,7 +57185,7 @@
 	zero if no change
 	was possible. */
 
-static usqLong
+static sqInt
 shortentoIndexableSize(sqInt objOop, sqInt indexableSize)
 {
     usqLong bytesAfter;

Modified: branches/Cog/spursistasrc/vm/interp.h
===================================================================
--- branches/Cog/spursistasrc/vm/interp.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/interp.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/spursistasrc/vm/vmCallback.h
===================================================================
--- branches/Cog/spursistasrc/vm/vmCallback.h	2014-04-11 18:50:26 UTC (rev 2892)
+++ branches/Cog/spursistasrc/vm/vmCallback.h	2014-04-11 19:55:48 UTC (rev 2893)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.672 uuid: 21493732-2e31-4b57-a8ae-aa6e6a9e4c3c
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.673 uuid: a10ccba5-8338-4cc4-ae49-a11440780603
  */
 
 #define VM_CALLBACK_INC 1



More information about the Vm-dev mailing list