[Vm-dev] [commit] r2372 - OSCogVM source as per VMMaker-oscog.52.

commits at squeakvm.org commits at squeakvm.org
Sun Mar 20 16:51:29 UTC 2011


Author: eliot
Date: 2011-03-20 09:51:29 -0700 (Sun, 20 Mar 2011)
New Revision: 2372

Modified:
   branches/Cog/image/VMMaker-Squeak4.1.changes
   branches/Cog/image/VMMaker-Squeak4.1.image
   branches/Cog/src/vm/cointerp.c
   branches/Cog/src/vm/gcc3x-cointerp.c
Log:
OSCogVM source as per VMMaker-oscog.52.
Fix primitiveFlushCacheByMethod for objects-as-methods.


Modified: branches/Cog/image/VMMaker-Squeak4.1.changes
===================================================================
--- branches/Cog/image/VMMaker-Squeak4.1.changes	2011-03-19 04:43:06 UTC (rev 2371)
+++ branches/Cog/image/VMMaker-Squeak4.1.changes	2011-03-20 16:51:29 UTC (rev 2372)
@@ -176680,4 +176680,35 @@
 				toFile: nil].
 		FileStream writeSourceCodeFrom: internalStream baseName: fileName isSt: true useHtml: false]! !
 
-----QUIT----{16 March 2011 . 12:38:02 pm} VMMaker-Squeak4.1.image priorSource: 7280958!
\ No newline at end of file
+----QUIT----{16 March 2011 . 12:38:02 pm} VMMaker-Squeak4.1.image priorSource: 7280958!
+
+----STARTUP----{20 March 2011 . 9:21:20 am} as /Users/eliot/Cog/oscog/Cog.squeakvm.org/image/VMMaker-Squeak4.1.image!
+
+
+'From Squeak4.1 of 17 April 2010 [latest update: #9957] on 20 March 2011 at 9:28:42 am'!
+!CoInterpreterPrimitives methodsFor: 'system control primitives' stamp: 'eem 3/20/2011 09:28' prior: 34750917!
+primitiveFlushCacheByMethod
+	"The receiver is a compiledMethod.  Clear all entries in the method lookup cache that
+	 refer to this method, presumably because it has been redefined, overridden or removed.
+	 Override to flush appropriate machine code caches also."
+	| probe oldMethod primIdx |
+	oldMethod := self stackTop.
+	probe := 0.
+	1 to: MethodCacheEntries do:
+		[:i |
+		(methodCache at: probe + MethodCacheMethod) = oldMethod ifTrue:
+			[methodCache at: probe + MethodCacheSelector put: 0].
+		probe := probe + MethodCacheEntrySize].
+	(self isOopCompiledMethod: oldMethod) ifTrue:
+		[primIdx := self primitiveIndexOf: oldMethod.
+		 primIdx = PrimitiveExternalCallIndex ifTrue:
+			["It's primitiveExternalCall"
+			self flushExternalPrimitiveOf: oldMethod].
+		 (self methodHasCogMethod: oldMethod) ifTrue:
+			[cogit unlinkSendsTo: (self cogMethodOf: oldMethod)]]! !
+
+----End fileIn of /Users/eliot/Cog/CoInterpreterPrimitives-primitiveFlushCacheByMethod.st----!
+
+"VMMaker"!
+
+----QUIT----{20 March 2011 . 9:46:19 am} VMMaker-Squeak4.1.image priorSource: 7282422!
\ No newline at end of file

Modified: branches/Cog/image/VMMaker-Squeak4.1.image
===================================================================
(Binary files differ)

Modified: branches/Cog/src/vm/cointerp.c
===================================================================
--- branches/Cog/src/vm/cointerp.c	2011-03-19 04:43:06 UTC (rev 2371)
+++ branches/Cog/src/vm/cointerp.c	2011-03-20 16:51:29 UTC (rev 2372)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker-oscog.51 uuid: d213bf61-5898-475b-8a5c-e4a9bdad2415
+	CCodeGeneratorGlobalStructure VMMaker-oscog.52 uuid: 1241a856-8570-4725-a069-a6d3d8a8a222
    from
-	CoInterpreter VMMaker-oscog.51 uuid: d213bf61-5898-475b-8a5c-e4a9bdad2415
+	CoInterpreter VMMaker-oscog.52 uuid: 1241a856-8570-4725-a069-a6d3d8a8a222
  */
-static char __buildInfo[] = "CoInterpreter VMMaker-oscog.51 uuid: d213bf61-5898-475b-8a5c-e4a9bdad2415 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker-oscog.52 uuid: 1241a856-8570-4725-a069-a6d3d8a8a222 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1863,7 +1863,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.51]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.52]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 static volatile int sendTrace;
 
@@ -28496,15 +28496,18 @@
 		}
 		probe += MethodCacheEntrySize;
 	}
-	/* begin primitiveIndexOf: */
-	primBits = (((usqInt) (headerOf(oldMethod))) >> 1) & 268435967;
-	primIdx = (primBits & 511) + (((usqInt) primBits) >> 19);
-	if (primIdx == PrimitiveExternalCallIndex) {
-		flushExternalPrimitiveOf(oldMethod);
+	if (((oldMethod & 1) == 0)
+	 && (((((usqInt) (longAt(oldMethod))) >> 8) & 15) >= 12)) {
+		/* begin primitiveIndexOf: */
+		primBits = (((usqInt) (headerOf(oldMethod))) >> 1) & 268435967;
+		primIdx = (primBits & 511) + (((usqInt) primBits) >> 19);
+		if (primIdx == PrimitiveExternalCallIndex) {
+			flushExternalPrimitiveOf(oldMethod);
+		}
+		if (methodHasCogMethod(oldMethod)) {
+			unlinkSendsTo(cogMethodOf(oldMethod));
+		}
 	}
-	if (methodHasCogMethod(oldMethod)) {
-		unlinkSendsTo(cogMethodOf(oldMethod));
-	}
 }
 
 

Modified: branches/Cog/src/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/src/vm/gcc3x-cointerp.c	2011-03-19 04:43:06 UTC (rev 2371)
+++ branches/Cog/src/vm/gcc3x-cointerp.c	2011-03-20 16:51:29 UTC (rev 2372)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker-oscog.51 uuid: d213bf61-5898-475b-8a5c-e4a9bdad2415
+	CCodeGeneratorGlobalStructure VMMaker-oscog.52 uuid: 1241a856-8570-4725-a069-a6d3d8a8a222
    from
-	CoInterpreter VMMaker-oscog.51 uuid: d213bf61-5898-475b-8a5c-e4a9bdad2415
+	CoInterpreter VMMaker-oscog.52 uuid: 1241a856-8570-4725-a069-a6d3d8a8a222
  */
-static char __buildInfo[] = "CoInterpreter VMMaker-oscog.51 uuid: d213bf61-5898-475b-8a5c-e4a9bdad2415 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker-oscog.52 uuid: 1241a856-8570-4725-a069-a6d3d8a8a222 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1866,7 +1866,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.51]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.52]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 static volatile int sendTrace;
 
@@ -28500,15 +28500,18 @@
 		}
 		probe += MethodCacheEntrySize;
 	}
-	/* begin primitiveIndexOf: */
-	primBits = (((usqInt) (headerOf(oldMethod))) >> 1) & 268435967;
-	primIdx = (primBits & 511) + (((usqInt) primBits) >> 19);
-	if (primIdx == PrimitiveExternalCallIndex) {
-		flushExternalPrimitiveOf(oldMethod);
+	if (((oldMethod & 1) == 0)
+	 && (((((usqInt) (longAt(oldMethod))) >> 8) & 15) >= 12)) {
+		/* begin primitiveIndexOf: */
+		primBits = (((usqInt) (headerOf(oldMethod))) >> 1) & 268435967;
+		primIdx = (primBits & 511) + (((usqInt) primBits) >> 19);
+		if (primIdx == PrimitiveExternalCallIndex) {
+			flushExternalPrimitiveOf(oldMethod);
+		}
+		if (methodHasCogMethod(oldMethod)) {
+			unlinkSendsTo(cogMethodOf(oldMethod));
+		}
 	}
-	if (methodHasCogMethod(oldMethod)) {
-		unlinkSendsTo(cogMethodOf(oldMethod));
-	}
 }
 
 



More information about the Vm-dev mailing list