[Vm-dev] [commit][2820] CogVM source as per VMMaker.oscog-eem.545.
commits at squeakvm.org
commits at squeakvm.org
Fri Dec 6 22:44:50 UTC 2013
Revision: 2820
Author: eliot
Date: 2013-12-06 14:44:48 -0800 (Fri, 06 Dec 2013)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.545.
Fix setting of endOfMemory on load in SqueakV3 VMs.
Spur:
Slight streamlining in followForwardingPointersInStackZone:, plus fixingfollowjng of frameMethodObject vs frameMethod in machine-code frames.
Fix the concatenation of the assert-failure reason in
isValidObjStackPage:myIndex:firstPage: so that it works in C.
Slang:
Generate the CoInterpreter *before* the Cogit so that the objectMemory andinterpreter classes have initialized *before* the Cogit is generated. Otherwisethe Cogit can be generated with values from the wrong interpreter/objectMemory.
Modified Paths:
--------------
branches/Cog/nscogsrc/vm/cogit.c
branches/Cog/nscogsrc/vm/cogit.h
branches/Cog/nscogsrc/vm/cogmethod.h
branches/Cog/nscogsrc/vm/cointerp.c
branches/Cog/nscogsrc/vm/cointerp.h
branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
branches/Cog/nscogsrc/vm/interp.h
branches/Cog/nscogsrc/vm/vmCallback.h
branches/Cog/spursrc/vm/cogit.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cogmethod.h
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/interp.h
branches/Cog/spursrc/vm/vmCallback.h
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/spurstacksrc/vm/interp.h
branches/Cog/spurstacksrc/vm/vmCallback.h
branches/Cog/src/vm/cogit.c
branches/Cog/src/vm/cogit.h
branches/Cog/src/vm/cogmethod.h
branches/Cog/src/vm/cointerp.c
branches/Cog/src/vm/cointerp.h
branches/Cog/src/vm/cointerpmt.c
branches/Cog/src/vm/cointerpmt.h
branches/Cog/src/vm/gcc3x-cointerp.c
branches/Cog/src/vm/gcc3x-cointerpmt.c
branches/Cog/src/vm/interp.h
branches/Cog/src/vm/vmCallback.h
branches/Cog/stacksrc/vm/gcc3x-interp.c
branches/Cog/stacksrc/vm/interp.c
branches/Cog/stacksrc/vm/interp.h
branches/Cog/stacksrc/vm/vmCallback.h
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/cogit.c 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGenerator VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ StackToRegisterMappingCogit VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/cogit.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGenerator VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
*/
Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/cogmethod.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGenerator VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
*/
typedef struct {
Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
from
- CoInterpreter VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b
+ CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -587,7 +587,6 @@
static sqInt frameHasContext(char *theFP);
static sqInt frameIsBlockActivation(char *theFP);
static sqInt frameIsMarked(sqInt theFPInt);
-static sqInt frameMethodObject(char *theFP);
static sqInt frameMethod(char *theFP);
static sqInt frameNumArgs(char *theFP);
static char * frameOfMarriedContext(sqInt aContext);
@@ -1325,6 +1324,7 @@
_iss sqInt statCheckForEvents;
_iss sqInt statGrowMemory;
_iss sqInt statMarkCount;
+_iss sqInt cogCodeSize;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
_iss sqInt lowSpaceThreshold;
@@ -1336,7 +1336,6 @@
_iss sqInt metaclassNumSlots;
_iss sqInt pendingFinalizationSignals;
_iss sqInt statIOProcessEvents;
-_iss sqInt cogCodeSize;
_iss usqInt fwdTableLast;
_iss usqLong gcStartUsecs;
_iss sqInt lastBackwardJumpMethod;
@@ -2033,7 +2032,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.537";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.545";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -22301,10 +22300,11 @@
sqInt delta;
sqInt fieldIndex;
sqInt i;
+ sqInt newOop;
sqInt numArgs;
sqInt offset;
sqInt offset1;
- sqInt oop;
+ usqInt oop;
char *theFP;
usqInt theIPPtr;
StackPage *thePage;
@@ -22347,8 +22347,7 @@
: byteAt((theFP + FoxIFrameFlags) + 1));
offset = (FoxCallerSavedIP + BytesPerWord) + (numArgs << ShiftForWord);
oop = longAt(theFP + offset);
- if (((oop & 1) == 0)
- && (isForwarded(oop))) {
+ if (isOopForwarded(oop)) {
longAtput(theFP + offset, followForwarded(oop));
}
if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
@@ -22358,43 +22357,43 @@
longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext)));
}
if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
- oop = longAt(theFP + FoxIFReceiver);
- if (((oop & 1) == 0)
- && (isForwarded(oop))) {
- longAtput(theFP + FoxIFReceiver, followForwarded(oop));
+ oop = longAt(theFP + FoxMFReceiver);
+ if (isOopForwarded(oop)) {
+ longAtput(theFP + FoxMFReceiver, followForwarded(oop));
}
- assert(!(isForwarded(frameMethodObject(theFP))));
+ oop = ((mframeHomeMethod(theFP))->methodObject);
+ assert(!(isForwarded(oop)));
}
else {
oop = longAt(theFP + FoxIFReceiver);
- if (((oop & 1) == 0)
- && (isForwarded(oop))) {
+ if (isOopForwarded(oop)) {
longAtput(theFP + FoxIFReceiver, followForwarded(oop));
}
oop = longAt(theFP + FoxMethod);
if (isForwarded(oop)) {
- delta = (followForwarded(oop)) - oop;
+ newOop = followForwarded(oop);
+ delta = newOop - oop;
if ((theIPPtr != 0)
- && ((longAt(theIPPtr)) > (longAt(theFP + FoxMethod)))) {
+ && ((longAt(theIPPtr)) > oop)) {
longAtput(theIPPtr, (longAt(theIPPtr)) + delta);
}
longAtput(theFP + FoxIFSavedIP, (longAt(theFP + FoxIFSavedIP)) + delta);
- longAtput(theFP + FoxMethod, followForwarded(oop));
+ longAtput(theFP + FoxMethod, (oop = newOop));
}
}
/* begin followNecessaryForwardingInMethod: */
/* begin literal:ofMethod: */
- offset1 = (literalCountOfHeader(headerOf(longAt(theFP + FoxMethod)))) - 1;
- assoc = longAt(((longAt(theFP + FoxMethod)) + BaseHeaderSize) + ((offset1 + LiteralStart) << ShiftForWord));
+ offset1 = (literalCountOfHeader(headerOf(oop))) - 1;
+ assoc = longAt((oop + BaseHeaderSize) + ((offset1 + LiteralStart) << ShiftForWord));
if (isForwarded(assoc)) {
assoc = followForwarded(assoc);
/* begin setMethodClassAssociationOf:to: */
/* begin storePointer:ofObject:withValue: */
- fieldIndex = ((literalCountOfHeader(headerOf(longAt(theFP + FoxMethod)))) + LiteralStart) - 1;
- if ((((usqInt) (longAt(theFP + FoxMethod)))) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(longAt(theFP + FoxMethod), assoc);
+ fieldIndex = ((literalCountOfHeader(headerOf(oop))) + LiteralStart) - 1;
+ if ((((usqInt) oop)) < (((usqInt) GIV(youngStart)))) {
+ possibleRootStoreIntovalue(oop, assoc);
}
- longAtput(((longAt(theFP + FoxMethod)) + BaseHeaderSize) + (fieldIndex << ShiftForWord), assoc);
+ longAtput((oop + BaseHeaderSize) + (fieldIndex << ShiftForWord), assoc);
}
classObj = longAt((assoc + BaseHeaderSize) + (ValueIndex << ShiftForWord));
if (isForwarded(classObj)) {
@@ -22604,14 +22603,6 @@
}
static sqInt
-frameMethodObject(char *theFP)
-{
- return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
- ? ((mframeHomeMethod(theFP))->methodObject)
- : longAt(theFP + FoxMethod));
-}
-
-static sqInt
frameMethod(char *theFP)
{
return longAt(theFP + FoxMethod);
@@ -49478,8 +49469,8 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = (memory()) + heapSize;
- memEnd = (memory()) + dataSize;
+ memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
/* begin setMemoryLimit: */
assert((memLimit & (BytesPerWord - 1)) == 0);
GIV(memoryLimit) = memLimit;
Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/cointerp.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-12-06 22:44:48 UTC (rev 2820)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
from
- CoInterpreter VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b
+ CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -590,7 +590,6 @@
static sqInt frameHasContext(char *theFP);
static sqInt frameIsBlockActivation(char *theFP);
static sqInt frameIsMarked(sqInt theFPInt);
-static sqInt frameMethodObject(char *theFP);
static sqInt frameMethod(char *theFP);
static sqInt frameNumArgs(char *theFP);
static char * frameOfMarriedContext(sqInt aContext);
@@ -1328,6 +1327,7 @@
_iss sqInt statCheckForEvents;
_iss sqInt statGrowMemory;
_iss sqInt statMarkCount;
+_iss sqInt cogCodeSize;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
_iss sqInt lowSpaceThreshold;
@@ -1339,7 +1339,6 @@
_iss sqInt metaclassNumSlots;
_iss sqInt pendingFinalizationSignals;
_iss sqInt statIOProcessEvents;
-_iss sqInt cogCodeSize;
_iss usqInt fwdTableLast;
_iss usqLong gcStartUsecs;
_iss sqInt lastBackwardJumpMethod;
@@ -2036,7 +2035,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.537";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.545";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -22310,10 +22309,11 @@
sqInt delta;
sqInt fieldIndex;
sqInt i;
+ sqInt newOop;
sqInt numArgs;
sqInt offset;
sqInt offset1;
- sqInt oop;
+ usqInt oop;
char *theFP;
usqInt theIPPtr;
StackPage *thePage;
@@ -22356,8 +22356,7 @@
: byteAt((theFP + FoxIFrameFlags) + 1));
offset = (FoxCallerSavedIP + BytesPerWord) + (numArgs << ShiftForWord);
oop = longAt(theFP + offset);
- if (((oop & 1) == 0)
- && (isForwarded(oop))) {
+ if (isOopForwarded(oop)) {
longAtput(theFP + offset, followForwarded(oop));
}
if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
@@ -22367,43 +22366,43 @@
longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext)));
}
if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
- oop = longAt(theFP + FoxIFReceiver);
- if (((oop & 1) == 0)
- && (isForwarded(oop))) {
- longAtput(theFP + FoxIFReceiver, followForwarded(oop));
+ oop = longAt(theFP + FoxMFReceiver);
+ if (isOopForwarded(oop)) {
+ longAtput(theFP + FoxMFReceiver, followForwarded(oop));
}
- assert(!(isForwarded(frameMethodObject(theFP))));
+ oop = ((mframeHomeMethod(theFP))->methodObject);
+ assert(!(isForwarded(oop)));
}
else {
oop = longAt(theFP + FoxIFReceiver);
- if (((oop & 1) == 0)
- && (isForwarded(oop))) {
+ if (isOopForwarded(oop)) {
longAtput(theFP + FoxIFReceiver, followForwarded(oop));
}
oop = longAt(theFP + FoxMethod);
if (isForwarded(oop)) {
- delta = (followForwarded(oop)) - oop;
+ newOop = followForwarded(oop);
+ delta = newOop - oop;
if ((theIPPtr != 0)
- && ((longAt(theIPPtr)) > (longAt(theFP + FoxMethod)))) {
+ && ((longAt(theIPPtr)) > oop)) {
longAtput(theIPPtr, (longAt(theIPPtr)) + delta);
}
longAtput(theFP + FoxIFSavedIP, (longAt(theFP + FoxIFSavedIP)) + delta);
- longAtput(theFP + FoxMethod, followForwarded(oop));
+ longAtput(theFP + FoxMethod, (oop = newOop));
}
}
/* begin followNecessaryForwardingInMethod: */
/* begin literal:ofMethod: */
- offset1 = (literalCountOfHeader(headerOf(longAt(theFP + FoxMethod)))) - 1;
- assoc = longAt(((longAt(theFP + FoxMethod)) + BaseHeaderSize) + ((offset1 + LiteralStart) << ShiftForWord));
+ offset1 = (literalCountOfHeader(headerOf(oop))) - 1;
+ assoc = longAt((oop + BaseHeaderSize) + ((offset1 + LiteralStart) << ShiftForWord));
if (isForwarded(assoc)) {
assoc = followForwarded(assoc);
/* begin setMethodClassAssociationOf:to: */
/* begin storePointer:ofObject:withValue: */
- fieldIndex = ((literalCountOfHeader(headerOf(longAt(theFP + FoxMethod)))) + LiteralStart) - 1;
- if ((((usqInt) (longAt(theFP + FoxMethod)))) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(longAt(theFP + FoxMethod), assoc);
+ fieldIndex = ((literalCountOfHeader(headerOf(oop))) + LiteralStart) - 1;
+ if ((((usqInt) oop)) < (((usqInt) GIV(youngStart)))) {
+ possibleRootStoreIntovalue(oop, assoc);
}
- longAtput(((longAt(theFP + FoxMethod)) + BaseHeaderSize) + (fieldIndex << ShiftForWord), assoc);
+ longAtput((oop + BaseHeaderSize) + (fieldIndex << ShiftForWord), assoc);
}
classObj = longAt((assoc + BaseHeaderSize) + (ValueIndex << ShiftForWord));
if (isForwarded(classObj)) {
@@ -22613,14 +22612,6 @@
}
static sqInt
-frameMethodObject(char *theFP)
-{
- return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
- ? ((mframeHomeMethod(theFP))->methodObject)
- : longAt(theFP + FoxMethod));
-}
-
-static sqInt
frameMethod(char *theFP)
{
return longAt(theFP + FoxMethod);
@@ -49487,8 +49478,8 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = (memory()) + heapSize;
- memEnd = (memory()) + dataSize;
+ memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
/* begin setMemoryLimit: */
assert((memLimit & (BytesPerWord - 1)) == 0);
GIV(memoryLimit) = memLimit;
Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/interp.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
#define VM_PROXY_MAJOR 1
Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/nscogsrc/vm/vmCallback.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.537 uuid: 16e0cc2f-0c26-4d21-b1bf-1dde0d99b08b
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
#define VM_CALLBACK_INC 1
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
- Thu Dec 5 15:20:31 PST 2013
+ Fri Dec 6 14:44:27 PST 2013
Modified: branches/Cog/spursrc/vm/cogit.c
===================================================================
--- branches/Cog/spursrc/vm/cogit.c 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/cogit.c 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGenerator VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ StackToRegisterMappingCogit VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -131,7 +131,7 @@
#define BlockCreationBytecodeSize 4
#define Call 9
#define CDQ 105
-#define ClassMethodContextCompactIndex 14
+#define ClassMethodContextCompactIndex 36
#define ClassReg -5
#define ClosureFirstCopiedValueIndex 3
#define ClosureNumArgsIndex 2
@@ -1637,7 +1637,7 @@
static sqInt sendTrampolines[NumSendTrampolines];
static CogSimStackEntry simSelf;
static sqInt simSpillBase;
-static CogSimStackEntry simStack[78];
+static CogSimStackEntry simStack[80];
static sqInt simStackPtr;
static AbstractInstruction * stackCheckLabel;
static AbstractInstruction * stackOverflowCall;
Modified: branches/Cog/spursrc/vm/cogit.h
===================================================================
--- branches/Cog/spursrc/vm/cogit.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/cogit.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGenerator VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
*/
Modified: branches/Cog/spursrc/vm/cogmethod.h
===================================================================
--- branches/Cog/spursrc/vm/cogmethod.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/cogmethod.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGenerator VMMaker.oscog-eem.538 uuid: 6b6d8ba7-4913-4563-9d01-da880441f843
*/
typedef struct {
Modified: branches/Cog/spursrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/cointerp.c 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/cointerp.c 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
from
- CoInterpreter VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -628,7 +628,6 @@
static sqInt frameContext(char *theFP);
static sqInt frameHasContext(char *theFP);
static sqInt frameIsBlockActivation(char *theFP);
-static sqInt frameMethodObject(char *theFP);
static sqInt frameMethod(char *theFP);
static sqInt frameNumArgs(char *theFP);
static char * frameOfMarriedContext(sqInt aContext);
@@ -1182,6 +1181,9 @@
void printMethodReferencesTo(sqInt anOop);
static void printNameOfClasscount(sqInt classOop, sqInt cnt);
static void printNum(sqInt n);
+static void printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType);
+static void printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType);
+void printObjStack(sqInt objStack);
static void printOopShort(sqInt oop);
void printOop(sqInt oop);
static sqInt printPrimLogEntryAt(sqInt i);
@@ -1426,10 +1428,10 @@
_iss sqInt ephemeronList;
_iss sqInt needGCFlag;
_iss sqInt tempOop;
+_iss char * objStackInvalidBecause;
_iss sqInt previousRememberedSetSize;
_iss unsigned char * classTableBitmap;
_iss sqInt longRunningPrimitiveCheckMethod;
-_iss char * objStackInvalidBecause;
_iss sqInt ephemeronQueue;
_iss sqInt extraRootCount;
_iss sqInt lastMethodCacheProbeWrite;
@@ -1446,6 +1448,7 @@
_iss usqLong longRunningPrimitiveStopUsecs;
_iss sqInt numSegInfos;
_iss sqInt statCheckForEvents;
+_iss sqInt cogCodeSize;
_iss sqInt gcMode;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
@@ -1460,7 +1463,6 @@
_iss sqInt statIOProcessEvents;
_iss sqInt weakList;
_iss sqInt backwardJumpCount;
-_iss sqInt cogCodeSize;
_iss usqLong gcStartUsecs;
_iss usqInt memory;
_iss sqInt noThreadingOfGUIThread;
@@ -2151,7 +2153,7 @@
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
static usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.536]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.545]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -6352,6 +6354,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -6361,6 +6364,7 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + (BaseHeaderSize)) + ((byte3 + LiteralStart) << 2));
longAtPointerput((localSP -= BytesPerOop), object);
+ null;
goto l4;
}
if (opType == 4) {
@@ -6388,6 +6392,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -19073,8 +19078,7 @@
default:
error("Case not found and no otherwise clause");
}
- assert(isValidObjStack(freeOrNewPage));
- return freeOrNewPage;
+ stackOrNil = freeOrNewPage;
}
assert(isValidObjStackAt(objStackRootIndex));
return stackOrNil;
@@ -22733,7 +22737,6 @@
default:
error("Case not found and no otherwise clause");
}
- assert(isValidObjStack(stackOrNil));
stackOrNil;
}
firstPage = stackOrNil;
@@ -22888,11 +22891,13 @@
char *callerFP;
sqInt delta;
sqInt i;
+ sqInt newOop;
sqInt numArgs;
sqInt offset;
- sqInt oop;
+ usqInt oop;
sqInt referent;
sqInt referent1;
+ sqInt referent2;
char *theFP;
usqInt theIPPtr;
StackPage *thePage;
@@ -22960,12 +22965,13 @@
longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext)));
}
if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
- oop = longAt(theFP + FoxIFReceiver);
+ oop = longAt(theFP + FoxMFReceiver);
if (((oop & 3) == 0)
&& (((longAt(oop)) & 0x3FFFFF) == 8)) {
- longAtput(theFP + FoxIFReceiver, followForwarded(oop));
+ longAtput(theFP + FoxMFReceiver, followForwarded(oop));
}
- assert(!(isForwarded(frameMethodObject(theFP))));
+ oop = ((mframeHomeMethod(theFP))->methodObject);
+ assert(!(isForwarded(oop)));
}
else {
oop = longAt(theFP + FoxIFReceiver);
@@ -22975,16 +22981,24 @@
}
oop = longAt(theFP + FoxMethod);
if (((longAt(oop)) & 0x3FFFFF) == 8) {
- delta = (followForwarded(oop)) - oop;
+ /* begin followForwarded: */
+ assert(isForwarded(oop));
+ referent2 = longAt((oop + (BaseHeaderSize)) + (0 << 2));
+ while (((referent2 & 3) == 0)
+ && (((longAt(referent2)) & 0x3FFFFF) == 8)) {
+ referent2 = longAt((referent2 + (BaseHeaderSize)) + (0 << 2));
+ }
+ newOop = referent2;
+ delta = newOop - oop;
if ((theIPPtr != 0)
- && ((longAt(theIPPtr)) > (longAt(theFP + FoxMethod)))) {
+ && ((longAt(theIPPtr)) > oop)) {
longAtput(theIPPtr, (longAt(theIPPtr)) + delta);
}
longAtput(theFP + FoxIFSavedIP, (longAt(theFP + FoxIFSavedIP)) + delta);
- longAtput(theFP + FoxMethod, followForwarded(oop));
+ longAtput(theFP + FoxMethod, (oop = newOop));
}
}
- followNecessaryForwardingInMethod(longAt(theFP + FoxMethod));
+ followNecessaryForwardingInMethod(oop);
if (!(((callerFP = frameCallerFP(theFP))) != 0)) break;
theIPPtr = ((usqInt)(theFP + FoxCallerSavedIP));
theFP = callerFP;
@@ -23303,14 +23317,6 @@
}
static sqInt
-frameMethodObject(char *theFP)
-{
- return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
- ? ((mframeHomeMethod(theFP))->methodObject)
- : longAt(theFP + FoxMethod));
-}
-
-static sqInt
frameMethod(char *theFP)
{
return longAt(theFP + FoxMethod);
@@ -26454,6 +26460,7 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt freeOrNextPage;
sqInt index;
+ char *ns;
if (!(isValidObjStackPagemyIndex(objStackPage, myx))) {
return 0;
@@ -26466,7 +26473,10 @@
return 0;
}
if (!(isValidObjStackPagemyIndex(freeOrNextPage, myx))) {
- GIV(objStackInvalidBecause) = strcat(GIV(objStackInvalidBecause), ", on next page");
+ ns = malloc(((strlen(GIV(objStackInvalidBecause))) + (strlen(", on next page"))) + 2);
+ strcpy(ns, GIV(objStackInvalidBecause));
+ GIV(objStackInvalidBecause) = strcat(ns, ", on next page");
+
return 0;
}
freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
@@ -31432,9 +31442,9 @@
default:
error("Case not found and no otherwise clause");
}
- assert(isValidObjStack(nextPage));
nextPage;
}
+ assert(isValidObjStack(objStack));
return top;
}
@@ -50071,6 +50081,94 @@
}
static void
+printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType)
+{
+ sqInt freeOrNextPage;
+ sqInt isFirstPage;
+ sqInt isFreePage;
+ sqInt isNextPage;
+
+ isFirstPage = pageType == ObjStackMyx;
+ isNextPage = pageType == ObjStackNextx;
+ isFreePage = pageType == ObjStackFreex;
+ printObjStackPagemyIndextag(objStackPage, myx, (isFirstPage
+ ? "head"
+ : (isFreePage
+ ? "free"
+ : "next")));
+ if (isFirstPage
+ || (isNextPage)) {
+ /* begin tab */
+ /* begin printChar: */
+ putchar(' ');
+ print("next: ");
+ printHex(longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2)));
+ if (isFirstPage) {
+ print(" free: ");
+ printHex(longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2)));
+ }
+ /* begin cr */
+ printf("\n");
+ }
+ freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+ while (freeOrNextPage != 0) {
+ printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
+ freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+ }
+ freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
+ if (freeOrNextPage != 0) {
+ printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackNextx);
+ }
+}
+
+static void
+printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType)
+{
+ print(pageType);
+ /* begin space */
+ /* begin printChar: */
+ putchar(' ');
+ printHex(objStackPage);
+ /* begin space */
+ /* begin printChar: */
+ putchar(' ');
+ print("cx ");
+ printNum((longAt(objStackPage)) & 0x3FFFFF);
+ print(" (");
+ printNum(18);
+ print(") fmt ");
+ printNum((((usqInt) (longAt(objStackPage))) >> 24) & 0x1F);
+ print(" (");
+ printNum(10);
+ print(") sz ");
+ printNum(numSlotsOfAny(objStackPage));
+ print(" (");
+ printNum(ObjStackPageSlots);
+ print(") myx: ");
+ printNum(longAt((objStackPage + (BaseHeaderSize)) + (ObjStackMyx << 2)));
+ print(" (");
+ printNum(myx);
+ print((isMarked(objStackPage)
+ ? ") mkd"
+ : ") unmkd"));
+ /* begin cr */
+ printf("\n");
+}
+
+void
+printObjStack(sqInt objStack)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ if (objStack == GIV(nilObj)) {
+ print("nil");
+ /* begin cr */
+ printf("\n");
+ }
+ else {
+ printObjStackPagemyIndexpageType(objStack, longAt((objStack + (BaseHeaderSize)) + (ObjStackMyx << 2)), ObjStackMyx);
+ }
+}
+
+static void
printOopShort(sqInt oop)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt classIndex;
@@ -51929,8 +52027,8 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = (memory()) + heapSize;
- memEnd = (memory()) + dataSize;
+ memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
GIV(newSpaceStart) = baseOfHeap;
GIV(newSpaceLimit) = (baseOfHeap + edenBytes) + (interpreterAllocationReserveBytes());
/* begin newSpaceStart:newSpaceBytes:edenBytes: */
Modified: branches/Cog/spursrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursrc/vm/cointerp.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/cointerp.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
@@ -198,6 +198,7 @@
void printMethodDictionaryOf(sqInt behavior);
void printMethodDictionary(sqInt dictionary);
void printMethodReferencesTo(sqInt anOop);
+void printObjStack(sqInt objStack);
void printProcessStack(sqInt aProcess);
sqInt printProcsOnList(sqInt procList);
void printReferencesTo(sqInt anOop);
Modified: branches/Cog/spursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/gcc3x-cointerp.c 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/gcc3x-cointerp.c 2013-12-06 22:44:48 UTC (rev 2820)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
from
- CoInterpreter VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -631,7 +631,6 @@
static sqInt frameContext(char *theFP);
static sqInt frameHasContext(char *theFP);
static sqInt frameIsBlockActivation(char *theFP);
-static sqInt frameMethodObject(char *theFP);
static sqInt frameMethod(char *theFP);
static sqInt frameNumArgs(char *theFP);
static char * frameOfMarriedContext(sqInt aContext);
@@ -1185,6 +1184,9 @@
void printMethodReferencesTo(sqInt anOop);
static void printNameOfClasscount(sqInt classOop, sqInt cnt);
static void printNum(sqInt n);
+static void printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType);
+static void printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType);
+void printObjStack(sqInt objStack);
static void printOopShort(sqInt oop);
void printOop(sqInt oop);
static sqInt printPrimLogEntryAt(sqInt i);
@@ -1429,10 +1431,10 @@
_iss sqInt ephemeronList;
_iss sqInt needGCFlag;
_iss sqInt tempOop;
+_iss char * objStackInvalidBecause;
_iss sqInt previousRememberedSetSize;
_iss unsigned char * classTableBitmap;
_iss sqInt longRunningPrimitiveCheckMethod;
-_iss char * objStackInvalidBecause;
_iss sqInt ephemeronQueue;
_iss sqInt extraRootCount;
_iss sqInt lastMethodCacheProbeWrite;
@@ -1449,6 +1451,7 @@
_iss usqLong longRunningPrimitiveStopUsecs;
_iss sqInt numSegInfos;
_iss sqInt statCheckForEvents;
+_iss sqInt cogCodeSize;
_iss sqInt gcMode;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
@@ -1463,7 +1466,6 @@
_iss sqInt statIOProcessEvents;
_iss sqInt weakList;
_iss sqInt backwardJumpCount;
-_iss sqInt cogCodeSize;
_iss usqLong gcStartUsecs;
_iss usqInt memory;
_iss sqInt noThreadingOfGUIThread;
@@ -2154,7 +2156,7 @@
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
static usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.536]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.545]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -6361,6 +6363,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -6370,6 +6373,7 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + (BaseHeaderSize)) + ((byte3 + LiteralStart) << 2));
longAtPointerput((localSP -= BytesPerOop), object);
+ null;
goto l4;
}
if (opType == 4) {
@@ -6397,6 +6401,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -19082,8 +19087,7 @@
default:
error("Case not found and no otherwise clause");
}
- assert(isValidObjStack(freeOrNewPage));
- return freeOrNewPage;
+ stackOrNil = freeOrNewPage;
}
assert(isValidObjStackAt(objStackRootIndex));
return stackOrNil;
@@ -22742,7 +22746,6 @@
default:
error("Case not found and no otherwise clause");
}
- assert(isValidObjStack(stackOrNil));
stackOrNil;
}
firstPage = stackOrNil;
@@ -22897,11 +22900,13 @@
char *callerFP;
sqInt delta;
sqInt i;
+ sqInt newOop;
sqInt numArgs;
sqInt offset;
- sqInt oop;
+ usqInt oop;
sqInt referent;
sqInt referent1;
+ sqInt referent2;
char *theFP;
usqInt theIPPtr;
StackPage *thePage;
@@ -22969,12 +22974,13 @@
longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext)));
}
if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
- oop = longAt(theFP + FoxIFReceiver);
+ oop = longAt(theFP + FoxMFReceiver);
if (((oop & 3) == 0)
&& (((longAt(oop)) & 0x3FFFFF) == 8)) {
- longAtput(theFP + FoxIFReceiver, followForwarded(oop));
+ longAtput(theFP + FoxMFReceiver, followForwarded(oop));
}
- assert(!(isForwarded(frameMethodObject(theFP))));
+ oop = ((mframeHomeMethod(theFP))->methodObject);
+ assert(!(isForwarded(oop)));
}
else {
oop = longAt(theFP + FoxIFReceiver);
@@ -22984,16 +22990,24 @@
}
oop = longAt(theFP + FoxMethod);
if (((longAt(oop)) & 0x3FFFFF) == 8) {
- delta = (followForwarded(oop)) - oop;
+ /* begin followForwarded: */
+ assert(isForwarded(oop));
+ referent2 = longAt((oop + (BaseHeaderSize)) + (0 << 2));
+ while (((referent2 & 3) == 0)
+ && (((longAt(referent2)) & 0x3FFFFF) == 8)) {
+ referent2 = longAt((referent2 + (BaseHeaderSize)) + (0 << 2));
+ }
+ newOop = referent2;
+ delta = newOop - oop;
if ((theIPPtr != 0)
- && ((longAt(theIPPtr)) > (longAt(theFP + FoxMethod)))) {
+ && ((longAt(theIPPtr)) > oop)) {
longAtput(theIPPtr, (longAt(theIPPtr)) + delta);
}
longAtput(theFP + FoxIFSavedIP, (longAt(theFP + FoxIFSavedIP)) + delta);
- longAtput(theFP + FoxMethod, followForwarded(oop));
+ longAtput(theFP + FoxMethod, (oop = newOop));
}
}
- followNecessaryForwardingInMethod(longAt(theFP + FoxMethod));
+ followNecessaryForwardingInMethod(oop);
if (!(((callerFP = frameCallerFP(theFP))) != 0)) break;
theIPPtr = ((usqInt)(theFP + FoxCallerSavedIP));
theFP = callerFP;
@@ -23312,14 +23326,6 @@
}
static sqInt
-frameMethodObject(char *theFP)
-{
- return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
- ? ((mframeHomeMethod(theFP))->methodObject)
- : longAt(theFP + FoxMethod));
-}
-
-static sqInt
frameMethod(char *theFP)
{
return longAt(theFP + FoxMethod);
@@ -26463,6 +26469,7 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt freeOrNextPage;
sqInt index;
+ char *ns;
if (!(isValidObjStackPagemyIndex(objStackPage, myx))) {
return 0;
@@ -26475,7 +26482,10 @@
return 0;
}
if (!(isValidObjStackPagemyIndex(freeOrNextPage, myx))) {
- GIV(objStackInvalidBecause) = strcat(GIV(objStackInvalidBecause), ", on next page");
+ ns = malloc(((strlen(GIV(objStackInvalidBecause))) + (strlen(", on next page"))) + 2);
+ strcpy(ns, GIV(objStackInvalidBecause));
+ GIV(objStackInvalidBecause) = strcat(ns, ", on next page");
+
return 0;
}
freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
@@ -31441,9 +31451,9 @@
default:
error("Case not found and no otherwise clause");
}
- assert(isValidObjStack(nextPage));
nextPage;
}
+ assert(isValidObjStack(objStack));
return top;
}
@@ -50080,6 +50090,94 @@
}
static void
+printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType)
+{
+ sqInt freeOrNextPage;
+ sqInt isFirstPage;
+ sqInt isFreePage;
+ sqInt isNextPage;
+
+ isFirstPage = pageType == ObjStackMyx;
+ isNextPage = pageType == ObjStackNextx;
+ isFreePage = pageType == ObjStackFreex;
+ printObjStackPagemyIndextag(objStackPage, myx, (isFirstPage
+ ? "head"
+ : (isFreePage
+ ? "free"
+ : "next")));
+ if (isFirstPage
+ || (isNextPage)) {
+ /* begin tab */
+ /* begin printChar: */
+ putchar(' ');
+ print("next: ");
+ printHex(longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2)));
+ if (isFirstPage) {
+ print(" free: ");
+ printHex(longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2)));
+ }
+ /* begin cr */
+ printf("\n");
+ }
+ freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+ while (freeOrNextPage != 0) {
+ printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
+ freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+ }
+ freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
+ if (freeOrNextPage != 0) {
+ printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackNextx);
+ }
+}
+
+static void
+printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType)
+{
+ print(pageType);
+ /* begin space */
+ /* begin printChar: */
+ putchar(' ');
+ printHex(objStackPage);
+ /* begin space */
+ /* begin printChar: */
+ putchar(' ');
+ print("cx ");
+ printNum((longAt(objStackPage)) & 0x3FFFFF);
+ print(" (");
+ printNum(18);
+ print(") fmt ");
+ printNum((((usqInt) (longAt(objStackPage))) >> 24) & 0x1F);
+ print(" (");
+ printNum(10);
+ print(") sz ");
+ printNum(numSlotsOfAny(objStackPage));
+ print(" (");
+ printNum(ObjStackPageSlots);
+ print(") myx: ");
+ printNum(longAt((objStackPage + (BaseHeaderSize)) + (ObjStackMyx << 2)));
+ print(" (");
+ printNum(myx);
+ print((isMarked(objStackPage)
+ ? ") mkd"
+ : ") unmkd"));
+ /* begin cr */
+ printf("\n");
+}
+
+void
+printObjStack(sqInt objStack)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ if (objStack == GIV(nilObj)) {
+ print("nil");
+ /* begin cr */
+ printf("\n");
+ }
+ else {
+ printObjStackPagemyIndexpageType(objStack, longAt((objStack + (BaseHeaderSize)) + (ObjStackMyx << 2)), ObjStackMyx);
+ }
+}
+
+static void
printOopShort(sqInt oop)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt classIndex;
@@ -51938,8 +52036,8 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = (memory()) + heapSize;
- memEnd = (memory()) + dataSize;
+ memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
GIV(newSpaceStart) = baseOfHeap;
GIV(newSpaceLimit) = (baseOfHeap + edenBytes) + (interpreterAllocationReserveBytes());
/* begin newSpaceStart:newSpaceBytes:edenBytes: */
Modified: branches/Cog/spursrc/vm/interp.h
===================================================================
--- branches/Cog/spursrc/vm/interp.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/interp.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
#define VM_PROXY_MAJOR 1
Modified: branches/Cog/spursrc/vm/vmCallback.h
===================================================================
--- branches/Cog/spursrc/vm/vmCallback.h 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spursrc/vm/vmCallback.h 2013-12-06 22:44:48 UTC (rev 2820)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
#define VM_CALLBACK_INC 1
Modified: branches/Cog/spurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/spurstacksrc/vm/gcc3x-interp.c 2013-12-05 23:21:33 UTC (rev 2819)
+++ branches/Cog/spurstacksrc/vm/gcc3x-interp.c 2013-12-06 22:44:48 UTC (rev 2820)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.533 uuid: 596ae385-70cc-4593-98e9-244920c6d7d2
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
from
- StackInterpreter VMMaker.oscog-eem.533 uuid: 596ae385-70cc-4593-98e9-244920c6d7d2
+ StackInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9
*/
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.533 uuid: 596ae385-70cc-4593-98e9-244920c6d7d2 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.545 uuid: 36659c65-ab43-4cb4-8f2f-9fecfadfa4d9 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -506,6 +506,7 @@
sqInt floatObjectOf(double aFloat);
double floatValueOf(sqInt oop);
static sqInt flushExternalPrimitiveOf(sqInt methodObj);
+static sqInt followFieldofObject(sqInt fieldIndex, sqInt anObject);
static void followForwardedFrameContentsstackPointer(char *theFP, char *theSP);
static sqInt followForwardedInObjStackatIndex(sqInt objStack, sqInt objStackRootIndex);
static void followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth);
@@ -1017,6 +1018,9 @@
void printMethodReferencesTo(sqInt anOop);
static void printNameOfClasscount(sqInt classOop, sqInt cnt);
static void printNum(sqInt n);
+static void printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType);
+static void printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType);
+void printObjStack(sqInt objStack);
static void printOopShort(sqInt oop);
void printOop(sqInt oop);
void printProcessStack(sqInt aProcess);
@@ -1201,8 +1205,8 @@
_iss usqInt instructionPointer;
_iss SpurCircularBuffer highestObjects;
_iss sqInt totalFreeOldSpace;
+_iss usqInt endOfMemory;
_iss sqInt remapBufferCount;
-_iss usqInt endOfMemory;
_iss sqInt trueObj;
_iss sqInt falseObj;
_iss sqInt * freeLists;
@@ -1239,11 +1243,11 @@
_iss sqInt needGCFlag;
_iss sqInt numPages;
_iss sqInt tempOop;
+_iss char * objStackInvalidBecause;
_iss sqInt previousRememberedSetSize;
_iss unsigned char * classTableBitmap;
_iss sqInt longRunningPrimitiveCheckMethod;
_iss sqInt longRunningPrimitiveCheckSemaphore;
-_iss char * objStackInvalidBecause;
_iss sqInt ephemeronQueue;
_iss sqInt extraRootCount;
_iss sqInt lastMethodCacheProbeWrite;
@@ -1945,7 +1949,7 @@
0 };
char * breakSelector;
sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.533]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.545]";
volatile int sendTrace;
sqInt suppressHeartbeatFlag;
@@ -7151,7 +7155,7 @@
localSP = pointerForOop(GIV(stackPointer));
localFP = pointerForOop(GIV(framePointer));
if (popValues) {
- for (i = 0; i <= (size - 1); i += 1) {
+ for (i = 0; i < size; i += 1) {
/* Assume: have just allocated a new Array; it must be young. Thus, can use unchecked stores. */
@@ -7163,7 +7167,7 @@
localSP += size * BytesPerOop;
}
else {
- for (i = 0; i <= (size - 1); i += 1) {
+ for (i = 0; i < size; i += 1) {
/* begin storePointerUnchecked:ofObject:withValue: */
assert(!(isForwarded(array)));
longAtput((array + (BaseHeaderSize)) + (i << 2), GIV(nilObj));
@@ -7363,7 +7367,7 @@
longAtput((newClosure1 + (BaseHeaderSize)) + (ClosureNumArgsIndex << 2), ((numArgs << 1) | 1));
newClosure = newClosure1;
if (numCopied > 0) {
- for (i = 0; i <= (numCopied - 1); i += 1) {
+ for (i = 0; i < numCopied; i += 1) {
/* Assume: have just allocated a new BlockClosure; it must be young.
Thus, can use unchecked stores. */
@@ -11158,7 +11162,7 @@
else {
primitiveFunctionPointer = primitiveInvokeObjectAsMethod;
}
- for (p = 0; p <= (CacheProbeMax - 1); p += 1) {
+ for (p = 0; p < CacheProbeMax; p += 1) {
probe = (((usqInt) hash) >> p) & MethodCacheMask;
if ((GIV(methodCache)[probe + MethodCacheSelector]) == 0) {
@@ -11188,7 +11192,7 @@
/* ...and zap the following entries */
GIV(lastMethodCacheProbeWrite) = probe;
- for (p = 1; p <= (CacheProbeMax - 1); p += 1) {
+ for (p = 1; p < CacheProbeMax; p += 1) {
probe = (((usqInt) hash) >> p) & MethodCacheMask;
GIV(methodCache)[probe + MethodCacheSelector] = 0;
}
@@ -11306,7 +11310,7 @@
freeChunkWithBytesat(allocatedSize - (2 * (BaseHeaderSize)), address);
GIV(totalFreeOldSpace) += allocatedSize - (2 * (BaseHeaderSize));
assert((addressAfter(objectStartingAt((newSeg->segStart)))) == ((segLimit(newSeg)) - (bridgeSize())));
- for (i = 0; i <= (GIV(numSegments) - 1); i += 1) {
+ for (i = 0; i < GIV(numSegments); i += 1) {
assert(isInSegments(((GIV(segments)[i]).segStart)));
assert(isInSegments((segLimit(&GIV(segments)[i])) - (wordSize())));
assert((!(isInSegments(segLimit(&GIV(segments)[i]))))
@@ -11481,7 +11485,7 @@
SpurSegmentInfo *segInfo;
oldBaseAddr = GIV(oldSpaceStart) - firstSegmentShift;
- for (i = 0; i <= (GIV(numSegments) - 1); i += 1) {
+ for (i = 0; i < GIV(numSegments); i += 1) {
segInfo = (&(GIV(segments)[i]));
(segInfo->segStart = ((segInfo->segStart)) + oldBaseAddr);
(segInfo->swizzle = ((segInfo->swizzle)) - oldBaseAddr);
@@ -11497,7 +11501,7 @@
sqInt i;
usqInt numSlots;
- for (i = 0; i <= (GIV(numSegments) - 1); i += 1) {
+ for (i = 0; i < GIV(numSegments); i += 1) {
/* begin objectStartingAt: */
address = (((((&(GIV(segments)[i])))->segSize)) + ((((&(GIV(segments)[i])))->segStart))) - (2 * (BaseHeaderSize));
/* begin rawNumSlotsOf: */
@@ -14187,7 +14191,7 @@
flag("no support for remembered set overflow yet");
}
/* begin rememberedSetWithIndexDo: */
- for (i1 = 0; i1 <= (GIV(rememberedSetSize) - 1); i1 += 1) {
+ for (i1 = 0; i1 < GIV(rememberedSetSize); i1 += 1) {
if (((GIV(rememberedSet)[i1]) & ((wordSize()) - 1)) != 0) {
print("misaligned oop in remembered set @ ");
printNum(i1);
@@ -14550,7 +14554,7 @@
ok = ok && (checkOkayFields(GIV(messageSelector)));
ok = ok && (checkOkayFields(GIV(newMethod)));
ok = ok && (checkOkayFields(GIV(lkupClass)));
- for (i = 0; i <= (MethodCacheEntries - 1); i += MethodCacheEntrySize) {
+ for (i = 0; i < MethodCacheEntries; i += MethodCacheEntrySize) {
oopOrZero = GIV(methodCache)[i + MethodCacheSelector];
if (!(oopOrZero == 0)) {
ok = ok && (checkOkayFields(GIV(methodCache)[i + MethodCacheSelector]));
@@ -14719,7 +14723,7 @@
assert(pageListIsWellFormed());
}
ok = 1;
- for (i = 0; i <= (GIV(numStackPages) - 1); i += 1) {
+ for (i = 0; i < GIV(numStackPages); i += 1) {
/* begin stackPageAt: */
thePage = stackPageAtpages(i, GIV(pages));
if (!(isFree(thePage))) {
@@ -14855,7 +14859,7 @@
char *theSP;
ok = 1;
- for (i = 0; i <= (GIV(numStackPages) - 1); i += 1) {
+ for (i = 0; i < GIV(numStackPages); i += 1) {
/* begin stackPageAt: */
thePage = stackPageAtpages(i, GIV(pages));
if (!(isFree(thePage))) {
@@ -15115,7 +15119,7 @@
}
length = stSizeOf(name);
srcName = ((char *) (arrayValueOf(name)));
- for (i = 0; i <= (length - 1); i += 1) {
+ for (i = 0; i < length; i += 1) {
if (!((srcName[i]) == (className[i]))) {
return 0;
}
@@ -15463,7 +15467,7 @@
l1: /* end allocateSlots:format:classIndex: */;
}
if (((((usqInt) (longAt(objOop))) >> 24) & 0x1F) <= 5) {
- for (i = 0; i <= (numSlots - 1); i += 1) {
+ for (i = 0; i < numSlots; i += 1) {
oop = longAt((objOop + (BaseHeaderSize)) + (i << 2));
if (((oop & 3) == 0)
&& (((longAt(oop)) & 0x3FFFFF) == 8)) {
@@ -15489,7 +15493,7 @@
}
}
else {
- for (i = 0; i <= (numSlots - 1); i += 1) {
+ for (i = 0; i < numSlots; i += 1) {
/* begin storePointerUnchecked:ofObject:withValue: */
assert(!(isForwarded(newObj)));
longAtput((newObj + (BaseHeaderSize)) + (i << 2), longAt((objOop + (BaseHeaderSize)) + (i << 2)));
@@ -16331,7 +16335,7 @@
}
activeContext = marryFrameSP(GIV(framePointer), GIV(stackPointer));
l1: /* end ensureFrameIsMarried:SP: */;
- for (i = 0; i <= (GIV(numStackPages) - 1); i += 1) {
+ for (i = 0; i < GIV(numStackPages); i += 1) {
/* begin stackPageAt: */
aPage = stackPageAtpages(i, GIV(pages));
if (!(isFree(aPage))) {
@@ -16753,7 +16757,7 @@
/* begin initSpaceForAllocationCheck: */
aNewSpace = (&(eden()));
if (!(GIV(memory) == null)) {
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list