[Vm-dev] [commit][2891] CogVM source as per VMMaker.oscog-eem.671

commits at squeakvm.org commits at squeakvm.org
Thu Apr 10 18:41:57 UTC 2014


Revision: 2891
Author:   eliot
Date:     2014-04-10 11:41:54 -0700 (Thu, 10 Apr 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.671

Sista:
Revise counter tripping so that ceCounterTripped: repositions the
context's pc after the send preceeding the conditional branch,
instead of it being done by slower Smalltalk code (skipBackAfterJump
which for convenience may parse from the beginning of the method).

Make sure findUnofficialFiles looks in the sista dirs.

Modified Paths:
--------------
    branches/Cog/scripts/findUnofficialFiles
    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
   - Wed Apr  9 12:27:13 PDT 2014
   + Thu Apr 10 11:40:46 PDT 2014

Modified: branches/Cog/scripts/findUnofficialFiles
===================================================================
--- branches/Cog/scripts/findUnofficialFiles	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/scripts/findUnofficialFiles	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,4 +1,4 @@
 #!/bin/sh
 # List any files with an un-checked-in package version comment "* VMMaker-..."
 find ${@-src nscogsrc stacksrc spursrc spurstacksrc nsspursrc nsspurstacksrc sistasrc spursistasrc} -name .svn -prune -o \( -type f -a -name '*.[ch]' \) \
-		-exec egrep -l '\* VMMaker|\* VMConstruction' {} \;
+		-exec egrep -l '\* VMMaker|\* VMConstruction|\* Freetype-Plugin|\* Cog-' {} \;

Modified: branches/Cog/sistasrc/vm/cogit.c
===================================================================
--- branches/Cog/sistasrc/vm/cogit.c	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/cogit.c	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27 " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -797,6 +797,7 @@
 static AbstractInstruction * genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree);
 static AbstractInstruction * getInlineCacheClassTagFrominto(sqInt sourceReg, sqInt destReg);
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget);
+sqInt getJumpTargetPCAt(sqInt pc);
 static sqInt getLiteral(sqInt litIndex);
 static sqInt hasDoublePrecisionFloatingPointSupport(AbstractInstruction * self_in_hasDoublePrecisionFloatingPointSupport);
 static sqInt hasLinkRegister(AbstractInstruction * self_in_hasLinkRegister);
@@ -12035,19 +12036,20 @@
     void *jumpTarget;
     AbstractInstruction *ok;
     sqInt quickConstant;
-    sqInt reg1;
     AbstractInstruction *retry;
 
 	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);
-	retry = addDependent(counter, annotateAbsolutePCRef(gMoveAwR(((usqInt)counter), SendNumArgsReg)));
+	addDependent(counter, annotateAbsolutePCRef(gMoveAwR(((usqInt)counter), SendNumArgsReg)));
 	/* begin SubCq:R: */
 	genoperandoperand(SubCqR, 65536, SendNumArgsReg);
 	/* begin JumpCarry: */
@@ -12077,11 +12079,6 @@
 	/* begin Label */
 	abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
 	annotatewith(abstractInstruction, HasBytecodePC);
-	if ((cResultRegister(backEnd)) != TempReg) {
-		/* begin MoveR:R: */
-		reg1 = cResultRegister(backEnd);
-		genoperandoperand(MoveRR, reg1, TempReg);
-	}
 	/* begin Jump: */
 	genoperand(Jump, ((sqInt)retry));
 	jmpTarget(ok, gLabel());
@@ -12334,6 +12331,7 @@
 genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName)
 {
     AbstractInstruction *jumpMBB;
+    sqInt reg1;
 
 	opcodeIndex = 0;
 	/* begin CmpCq:R: */
@@ -12341,6 +12339,11 @@
 	/* begin JumpZero: */
 	jumpMBB = genoperand(JumpZero, ((sqInt)0));
 	compileTrampolineForcallJumpBarnumArgsargargargargsaveRegsresultReg(ceCounterTripped, 1, 1, TempReg, null, null, null, 0, null);
+	if ((cResultRegister(backEnd)) != ReceiverResultReg) {
+		/* begin MoveR:R: */
+		reg1 = cResultRegister(backEnd);
+		genoperandoperand(MoveRR, reg1, ReceiverResultReg);
+	}
 	assert(!(shouldAnnotateObjectReference(boolean)));
 	jmpTarget(jumpMBB, gAddCqR(boolean, TempReg));
 	return genTrampolineForcalledcallJumpBarnumArgsargargargargsaveRegsresultRegappendOpcodes(ceSendMustBeBoolean, trampolineName, 1, 1, TempReg, null, null, null, 0, null, 1);
@@ -15059,6 +15062,12 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+sqInt
+getJumpTargetPCAt(sqInt pc)
+{
+	return jumpTargetPCAt(backEnd, pc);
+}
+
 static sqInt
 getLiteral(sqInt litIndex)
 {

Modified: branches/Cog/sistasrc/vm/cogit.h
===================================================================
--- branches/Cog/sistasrc/vm/cogit.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/cogit.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 
@@ -38,6 +38,7 @@
 sqInt genQuickReturnConst(void);
 sqInt genQuickReturnInstVar(void);
 sqInt genQuickReturnSelf(void);
+sqInt getJumpTargetPCAt(sqInt pc);
 void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress);
 sqInt interpretOffset(void);
 sqInt isPCWithinMethodZone(char *address);

Modified: branches/Cog/sistasrc/vm/cogmethod.h
===================================================================
--- branches/Cog/sistasrc/vm/cogmethod.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/cogmethod.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 typedef struct {

Modified: branches/Cog/sistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/sistasrc/vm/cointerp.c	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/cointerp.c	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
    from
-	CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2034,7 +2034,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.670]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.671]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -11253,6 +11253,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.
+	
+	The minor case is that there is an unlikely possibility that the cointer
+	tripped but condition
+	is not a boolean, in which case a mustBeBoolean response should occur. */
 /*	Send e.g. thisContext conditionalBranchCounterTrippedOn: boolean. */
 
 sqInt
@@ -11265,8 +11276,25 @@
     sqInt methodHeader;
     char *sp;
     char *sp1;
+    char *sp11;
+    char *sp2;
     sqInt top;
 
+	if (!((condition == GIV(falseObj))
+		 || (condition == GIV(trueObj)))) {
+		/* begin ceSendMustBeBoolean: */
+		/* begin popStack */
+		top = longAt(GIV(stackPointer));
+		GIV(stackPointer) += BytesPerWord;
+		GIV(instructionPointer) = ((sqInt) top);
+		/* begin push: */
+		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
+		GIV(stackPointer) = sp2;
+		/* begin push: */
+		longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
+		GIV(stackPointer) = sp11;
+		return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorMustBeBoolean << ShiftForWord)), condition, 0);
+	}
 	counterTrippedSelector = (SelectorCounterTripped < (lengthOf(GIV(specialObjectsOop)))
 		? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorCounterTripped << ShiftForWord))
 		: 0);
@@ -11288,10 +11316,7 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
 	/* 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-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/cointerp.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 

Modified: branches/Cog/sistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/sistasrc/vm/gcc3x-cointerp.c	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/gcc3x-cointerp.c	2014-04-10 18:41:54 UTC (rev 2891)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
    from
-	CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2037,7 +2037,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.670]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.671]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -11262,6 +11262,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.
+	
+	The minor case is that there is an unlikely possibility that the cointer
+	tripped but condition
+	is not a boolean, in which case a mustBeBoolean response should occur. */
 /*	Send e.g. thisContext conditionalBranchCounterTrippedOn: boolean. */
 
 sqInt
@@ -11274,8 +11285,25 @@
     sqInt methodHeader;
     char *sp;
     char *sp1;
+    char *sp11;
+    char *sp2;
     sqInt top;
 
+	if (!((condition == GIV(falseObj))
+		 || (condition == GIV(trueObj)))) {
+		/* begin ceSendMustBeBoolean: */
+		/* begin popStack */
+		top = longAt(GIV(stackPointer));
+		GIV(stackPointer) += BytesPerWord;
+		GIV(instructionPointer) = ((sqInt) top);
+		/* begin push: */
+		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
+		GIV(stackPointer) = sp2;
+		/* begin push: */
+		longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
+		GIV(stackPointer) = sp11;
+		return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorMustBeBoolean << ShiftForWord)), condition, 0);
+	}
 	counterTrippedSelector = (SelectorCounterTripped < (lengthOf(GIV(specialObjectsOop)))
 		? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorCounterTripped << ShiftForWord))
 		: 0);
@@ -11297,10 +11325,7 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
 	/* 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-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/interp.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/sistasrc/vm/vmCallback.h
===================================================================
--- branches/Cog/sistasrc/vm/vmCallback.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/sistasrc/vm/vmCallback.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 #define VM_CALLBACK_INC 1

Modified: branches/Cog/spursistasrc/vm/cogit.c
===================================================================
--- branches/Cog/spursistasrc/vm/cogit.c	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/cogit.c	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
    from
-	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
-static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27 " __DATE__ ;
+static char __buildInfo[] = "SistaStackToRegisterMappingCogit VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -795,6 +795,7 @@
 static AbstractInstruction * genoperandoperandoperand(sqInt opcode, sqInt operandOne, sqInt operandTwo, sqInt operandThree);
 static AbstractInstruction * getInlineCacheClassTagFrominto(sqInt sourceReg, sqInt destReg);
 static AbstractInstruction * getJmpTarget(AbstractInstruction * self_in_getJmpTarget);
+sqInt getJumpTargetPCAt(sqInt pc);
 static sqInt getLiteral(sqInt litIndex);
 static sqInt hasDoublePrecisionFloatingPointSupport(AbstractInstruction * self_in_hasDoublePrecisionFloatingPointSupport);
 static sqInt hasLinkRegister(AbstractInstruction * self_in_hasLinkRegister);
@@ -12883,19 +12884,20 @@
     void *jumpTarget;
     AbstractInstruction *ok;
     sqInt quickConstant;
-    sqInt reg1;
     AbstractInstruction *retry;
 
 	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);
-	retry = addDependent(counter, annotateAbsolutePCRef(gMoveAwR(((usqInt)counter), SendNumArgsReg)));
+	addDependent(counter, annotateAbsolutePCRef(gMoveAwR(((usqInt)counter), SendNumArgsReg)));
 	/* begin SubCq:R: */
 	genoperandoperand(SubCqR, 65536, SendNumArgsReg);
 	/* begin JumpCarry: */
@@ -12925,11 +12927,6 @@
 	/* begin Label */
 	abstractInstruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
 	annotatewith(abstractInstruction, HasBytecodePC);
-	if ((cResultRegister(backEnd)) != TempReg) {
-		/* begin MoveR:R: */
-		reg1 = cResultRegister(backEnd);
-		genoperandoperand(MoveRR, reg1, TempReg);
-	}
 	/* begin Jump: */
 	genoperand(Jump, ((sqInt)retry));
 	jmpTarget(ok, gLabel());
@@ -13207,6 +13204,7 @@
 genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName)
 {
     AbstractInstruction *jumpMBB;
+    sqInt reg1;
 
 	opcodeIndex = 0;
 	/* begin CmpCq:R: */
@@ -13214,6 +13212,11 @@
 	/* begin JumpZero: */
 	jumpMBB = genoperand(JumpZero, ((sqInt)0));
 	compileTrampolineForcallJumpBarnumArgsargargargargsaveRegsresultReg(ceCounterTripped, 1, 1, TempReg, null, null, null, 0, null);
+	if ((cResultRegister(backEnd)) != ReceiverResultReg) {
+		/* begin MoveR:R: */
+		reg1 = cResultRegister(backEnd);
+		genoperandoperand(MoveRR, reg1, ReceiverResultReg);
+	}
 	assert(!(shouldAnnotateObjectReference(boolean)));
 	jmpTarget(jumpMBB, gAddCqR(boolean, TempReg));
 	return genTrampolineForcalledcallJumpBarnumArgsargargargargsaveRegsresultRegappendOpcodes(ceSendMustBeBoolean, trampolineName, 1, 1, TempReg, null, null, null, 0, null, 1);
@@ -15985,6 +15988,12 @@
 	return ((AbstractInstruction *) (((self_in_getJmpTarget->operands))[0]));
 }
 
+sqInt
+getJumpTargetPCAt(sqInt pc)
+{
+	return jumpTargetPCAt(backEnd, pc);
+}
+
 static sqInt
 getLiteral(sqInt litIndex)
 {

Modified: branches/Cog/spursistasrc/vm/cogit.h
===================================================================
--- branches/Cog/spursistasrc/vm/cogit.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/cogit.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 
@@ -39,6 +39,7 @@
 sqInt genQuickReturnConst(void);
 sqInt genQuickReturnInstVar(void);
 sqInt genQuickReturnSelf(void);
+sqInt getJumpTargetPCAt(sqInt pc);
 void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress);
 sqInt interpretOffset(void);
 sqInt isPCWithinMethodZone(char *address);

Modified: branches/Cog/spursistasrc/vm/cogmethod.h
===================================================================
--- branches/Cog/spursistasrc/vm/cogmethod.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/cogmethod.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGenerator VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 typedef struct {

Modified: branches/Cog/spursistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.c	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/cointerp.c	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
    from
-	CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1299,7 +1299,7 @@
 static void setSignalLowSpaceFlagAndSaveProcess(void);
 static void setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext);
 sqInt shiftForWord(void);
-static sqInt shortentoIndexableSize(sqInt objOop, sqInt indexableSize);
+static usqLong 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.670]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.671]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -6412,6 +6412,7 @@
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
 					}
+					null;
 					goto l4;
 				}
 				if (opType == 3) {
@@ -6421,6 +6422,7 @@
 					assert(GIV(method) == (iframeMethod(localFP)));
 					object = longAt((GIV(method) + (BaseHeaderSize)) + ((byte3 + LiteralStart) << 2));
 					longAtPointerput((localSP -= BytesPerOop), object);
+					null;
 					goto l4;
 				}
 				if (opType == 4) {
@@ -6448,6 +6450,7 @@
 					/* begin internalPush: */
 					longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
 
+					null;
 					goto l4;
 				}
 				top = longAtPointer(localSP);
@@ -14006,6 +14009,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.
+	
+	The minor case is that there is an unlikely possibility that the cointer
+	tripped but condition
+	is not a boolean, in which case a mustBeBoolean response should occur. */
 /*	Send e.g. thisContext conditionalBranchCounterTrippedOn: boolean. */
 
 sqInt
@@ -14018,9 +14032,26 @@
     sqInt methodHeader;
     char *sp;
     char *sp1;
+    char *sp11;
+    char *sp2;
     char *theSP;
     sqInt top;
 
+	if (!((condition == GIV(falseObj))
+		 || (condition == GIV(trueObj)))) {
+		/* begin ceSendMustBeBoolean: */
+		/* begin popStack */
+		top = longAt(GIV(stackPointer));
+		GIV(stackPointer) += BytesPerWord;
+		GIV(instructionPointer) = ((sqInt) top);
+		/* begin push: */
+		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
+		GIV(stackPointer) = sp2;
+		/* begin push: */
+		longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
+		GIV(stackPointer) = sp11;
+		return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorMustBeBoolean << 2)), condition, 0);
+	}
 	counterTrippedSelector = (SelectorCounterTripped < (numSlotsOf(GIV(specialObjectsOop)))
 		? longAt((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorCounterTripped << 2))
 		: 0);
@@ -14042,10 +14073,7 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
 	/* begin ensureFrameIsMarried:SP: */
 	theSP = GIV(stackPointer);
 	if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
@@ -57113,7 +57141,7 @@
 	zero if no change
 	was possible. */
 
-static sqInt
+static usqLong
 shortentoIndexableSize(sqInt objOop, sqInt indexableSize)
 {
     usqLong bytesAfter;

Modified: branches/Cog/spursistasrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/cointerp.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 

Modified: branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/gcc3x-cointerp.c	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/gcc3x-cointerp.c	2014-04-10 18:41:54 UTC (rev 2891)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
    from
-	CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1302,7 +1302,7 @@
 static void setSignalLowSpaceFlagAndSaveProcess(void);
 static void setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext);
 sqInt shiftForWord(void);
-static sqInt shortentoIndexableSize(sqInt objOop, sqInt indexableSize);
+static usqLong 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.670]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.671]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -6421,6 +6421,7 @@
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
 					}
+					null;
 					goto l4;
 				}
 				if (opType == 3) {
@@ -6430,6 +6431,7 @@
 					assert(GIV(method) == (iframeMethod(localFP)));
 					object = longAt((GIV(method) + (BaseHeaderSize)) + ((byte3 + LiteralStart) << 2));
 					longAtPointerput((localSP -= BytesPerOop), object);
+					null;
 					goto l4;
 				}
 				if (opType == 4) {
@@ -6457,6 +6459,7 @@
 					/* begin internalPush: */
 					longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
 
+					null;
 					goto l4;
 				}
 				top = longAtPointer(localSP);
@@ -14015,6 +14018,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.
+	
+	The minor case is that there is an unlikely possibility that the cointer
+	tripped but condition
+	is not a boolean, in which case a mustBeBoolean response should occur. */
 /*	Send e.g. thisContext conditionalBranchCounterTrippedOn: boolean. */
 
 sqInt
@@ -14027,9 +14041,26 @@
     sqInt methodHeader;
     char *sp;
     char *sp1;
+    char *sp11;
+    char *sp2;
     char *theSP;
     sqInt top;
 
+	if (!((condition == GIV(falseObj))
+		 || (condition == GIV(trueObj)))) {
+		/* begin ceSendMustBeBoolean: */
+		/* begin popStack */
+		top = longAt(GIV(stackPointer));
+		GIV(stackPointer) += BytesPerWord;
+		GIV(instructionPointer) = ((sqInt) top);
+		/* begin push: */
+		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), condition);
+		GIV(stackPointer) = sp2;
+		/* begin push: */
+		longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
+		GIV(stackPointer) = sp11;
+		return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorMustBeBoolean << 2)), condition, 0);
+	}
 	counterTrippedSelector = (SelectorCounterTripped < (numSlotsOf(GIV(specialObjectsOop)))
 		? longAt((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorCounterTripped << 2))
 		: 0);
@@ -14051,10 +14082,7 @@
 		resetCountersIn(mframeHomeMethod(GIV(framePointer)));
 		return condition;
 	}
-	/* begin popStack */
-	top = longAt(GIV(stackPointer));
-	GIV(stackPointer) += BytesPerWord;
-	GIV(instructionPointer) = ((sqInt) top);
+	GIV(instructionPointer) = getJumpTargetPCAt(popStack());
 	/* begin ensureFrameIsMarried:SP: */
 	theSP = GIV(stackPointer);
 	if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
@@ -57122,7 +57150,7 @@
 	zero if no change
 	was possible. */
 
-static sqInt
+static usqLong
 shortentoIndexableSize(sqInt objOop, sqInt indexableSize)
 {
     usqLong bytesAfter;

Modified: branches/Cog/spursistasrc/vm/interp.h
===================================================================
--- branches/Cog/spursistasrc/vm/interp.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/interp.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/spursistasrc/vm/vmCallback.h
===================================================================
--- branches/Cog/spursistasrc/vm/vmCallback.h	2014-04-09 19:32:17 UTC (rev 2890)
+++ branches/Cog/spursistasrc/vm/vmCallback.h	2014-04-10 18:41:54 UTC (rev 2891)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.670 uuid: 071bf6af-04c0-4256-b053-d66378b73d27
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.671 uuid: 49fb678b-0fe3-42cf-a276-c617f429951d
  */
 
 #define VM_CALLBACK_INC 1



More information about the Vm-dev mailing list