Revision: 2833
Author: eliot
Date: 2013-12-16 15:52:11 -0800 (Mon, 16 Dec 2013)
Log Message:
-----------
VMMaker.oscog-eem.563
Author: eem
Time: 16 December 2013, 3:41:22.598 pm
UUID: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
Ancestors: VMMaker.oscog-eem.562
Avoid including the instructionPointer in the context when marrying the top
frame during divorceAllFrames for voidVMState..If:. (how did this ever work??)
Fix bogus assert failure in checkIfValidObjectRef:pc:cogMethod: in Newspeak VM.
Fix Spur initial alloc on Mac OS.
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/platforms/Mac OS/vm/sqMacMemory.c
branches/Cog/platforms/Mac OS/vm/sqPlatformSpecific.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-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/cogit.c 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGenerator VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ StackToRegisterMappingCogit VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -3029,28 +3029,33 @@
if ((annotation == IsSendCall)
|| (annotation == IsNSSendCall)) {
entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- /* begin offsetAndSendTableFor:annotation:into: */
- if ((entryPoint & entryPointMask) == checkedEntryAlignment) {
- assert(annotation == IsSendCall);
- offset = cmEntryOffset;
- sendTable = sendTrampolines;
-
+ if (entryPoint <= methodZoneBase) {
+ offset = entryPoint;
}
else {
- if ((entryPoint & entryPointMask) == dynSuperEntryAlignment) {
- assert(annotation == IsNSSendCall);
- offset = cmDynSuperEntryOffset;
- sendTable = dynamicSuperSendTrampolines;
+ /* begin offsetAndSendTableFor:annotation:into: */
+ if ((entryPoint & entryPointMask) == checkedEntryAlignment) {
+ assert(annotation == IsSendCall);
+ offset = cmEntryOffset;
+ sendTable = sendTrampolines;
}
else {
- assert(annotation == IsSendCall);
- offset = cmNoCheckEntryOffset;
- sendTable = superSendTrampolines;
+ if ((entryPoint & entryPointMask) == dynSuperEntryAlignment) {
+ assert(annotation == IsNSSendCall);
+ offset = cmDynSuperEntryOffset;
+ sendTable = dynamicSuperSendTrampolines;
+ }
+ else {
+ assert(annotation == IsSendCall);
+ offset = cmNoCheckEntryOffset;
+ sendTable = superSendTrampolines;
+
+ }
}
+
}
-
selectorOrCacheTag = inlineCacheTagAt(backEnd, ((sqInt)mcpc));
if ((entryPoint > methodZoneBase)
&& ((offset != cmNoCheckEntryOffset)
Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/cogit.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGenerator VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/cogmethod.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGenerator VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
typedef struct {
Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
from
- CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1143,7 +1143,7 @@
static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
static sqInt roomToPushNArgs(sqInt n);
static void runLeakCheckerForFullGC(sqInt fullGCFlag);
-static sqInt safeObjectAfter(sqInt oop);
+static usqInt safeObjectAfter(sqInt oop);
static sqInt safePrintStringOf(sqInt oop);
usqInt scavengeThresholdAddress(void);
EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -1320,18 +1320,19 @@
_iss sqInt statCheckForEvents;
_iss sqInt statGrowMemory;
_iss sqInt statMarkCount;
-_iss sqInt cogCodeSize;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
_iss sqInt lowSpaceThreshold;
_iss sqInt rootTableOverflowed;
_iss usqLong statGCEndUsecs;
_iss sqInt statSweepCount;
+_iss sqInt cogCodeSize;
_iss usqInt compEnd;
_iss sqInt flagInterpretedMethods;
_iss sqInt metaclassNumSlots;
_iss sqInt pendingFinalizationSignals;
_iss sqInt statIOProcessEvents;
+_iss sqInt edenBytes;
_iss usqInt fwdTableLast;
_iss usqLong gcStartUsecs;
_iss sqInt lastBackwardJumpMethod;
@@ -1342,7 +1343,6 @@
_iss sqInt statMkFwdCount;
_iss sqInt tenuringThreshold;
_iss sqInt thisClassIndex;
-_iss sqInt edenBytes;
_iss sqInt externalPrimitiveTableFirstFreeIndex;
_iss sqInt forceTenureFlag;
_iss sqInt fullScreenFlag;
@@ -2030,7 +2030,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.561";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.563";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -5666,6 +5666,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -5675,6 +5676,7 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object);
+ null;
goto l4;
}
if (opType == 4) {
@@ -5688,6 +5690,7 @@
object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object2);
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -18742,7 +18745,7 @@
activeContext = longAt(GIV(framePointer) + FoxThisContext);
goto l1;
}
- activeContext = marryFrameSP(GIV(framePointer), GIV(stackPointer));
+ activeContext = marryFrameSP(GIV(framePointer), GIV(stackPointer) + BytesPerWord);
l1: /* end ensureFrameIsMarried:SP: */;
for (i = 0; i < GIV(numStackPages); i += 1) {
/* begin stackPageAt: */
@@ -22168,9 +22171,8 @@
sqInt assoc;
sqInt classObj;
CogMethod *cogMethod;
- sqInt fieldIndex;
sqInt header;
- sqInt offset;
+ sqInt litCount;
}
@@ -23724,17 +23726,15 @@
sqInt header1;
sqInt header2;
sqInt header3;
- sqInt header4;
usqInt lastWord;
sqInt newFreeChunk;
sqInt newOop;
- sqInt next;
+ usqInt next;
sqInt oop;
sqInt realHeader;
sqInt sz;
sqInt sz1;
sqInt sz2;
- sqInt sz3;
sqInt target;
usqInt w;
@@ -23745,21 +23745,7 @@
/* begin objectAfterWhileForwarding: */
header2 = longAt(oop);
if ((header2 & MarkBit) == 0) {
- /* begin objectAfter: */
- if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
- error("no objects after the end of memory");
- }
- if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
- sz2 = (longAt(oop)) & AllButTypeMask;
- }
- else {
- /* begin sizeBitsOf: */
- header3 = longAt(oop);
- sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
- ? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
- : header3 & SizeMask);
- }
- next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
+ next = ((sqInt) (objectAfter(oop)));
goto l1;
}
fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -23774,7 +23760,7 @@
else {
sz1 = realHeader & SizeMask;
}
- next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
+ next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
l1: /* end objectAfterWhileForwarding: */;
if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
@@ -23828,18 +23814,18 @@
}
/* begin safeObjectAfter: */
if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
- sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
+ sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
}
else {
/* begin sizeBitsOf: */
- header4 = longAt(newFreeChunk);
- sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
+ header3 = longAt(newFreeChunk);
+ sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
- : header4 & SizeMask);
+ : header3 & SizeMask);
}
- next = ((newFreeChunk + sz3) >= GIV(freeStart)
+ next = ((newFreeChunk + sz2) >= GIV(freeStart)
? GIV(freeStart)
- : (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
+ : (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
assert((next == GIV(freeStart))
|| (next == (oopFromChunk(GIV(compEnd)))));
if (next == GIV(freeStart)) {
@@ -49148,10 +49134,8 @@
minimumMemory = ((GIV(cogCodeSize) + dataSize) + GIV(edenBytes)) + (interpreterAllocationReserveBytes());
/* no need to include the stackZone; this is alloca'ed */
- /* + edenBytes */
- /* don't include edenBytes; this is part of the heap and so part of desiredHeapSize */
- heapSize = (GIV(cogCodeSize) + desiredHeapSize) + (interpreterAllocationReserveBytes());
+ heapSize = ((GIV(cogCodeSize) + desiredHeapSize) + GIV(edenBytes)) + (interpreterAllocationReserveBytes());
if (heapSize < minimumMemory) {
insufficientMemorySpecifiedError();
}
@@ -49163,7 +49147,7 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memLimit = (memory()) + heapSize;
memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
/* begin setMemoryLimit: */
assert((memLimit & (BytesPerWord - 1)) == 0);
@@ -50049,7 +50033,7 @@
given object or free chunk in memory. Return freeStart when
enumeration is complete. This is for assertion checking only. */
-static sqInt
+static usqInt
safeObjectAfter(sqInt oop)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt header;
Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/cointerp.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-12-16 23:52:11 UTC (rev 2833)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
from
- CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1146,7 +1146,7 @@
static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
static sqInt roomToPushNArgs(sqInt n);
static void runLeakCheckerForFullGC(sqInt fullGCFlag);
-static sqInt safeObjectAfter(sqInt oop);
+static usqInt safeObjectAfter(sqInt oop);
static sqInt safePrintStringOf(sqInt oop);
usqInt scavengeThresholdAddress(void);
EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -1323,18 +1323,19 @@
_iss sqInt statCheckForEvents;
_iss sqInt statGrowMemory;
_iss sqInt statMarkCount;
-_iss sqInt cogCodeSize;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
_iss sqInt lowSpaceThreshold;
_iss sqInt rootTableOverflowed;
_iss usqLong statGCEndUsecs;
_iss sqInt statSweepCount;
+_iss sqInt cogCodeSize;
_iss usqInt compEnd;
_iss sqInt flagInterpretedMethods;
_iss sqInt metaclassNumSlots;
_iss sqInt pendingFinalizationSignals;
_iss sqInt statIOProcessEvents;
+_iss sqInt edenBytes;
_iss usqInt fwdTableLast;
_iss usqLong gcStartUsecs;
_iss sqInt lastBackwardJumpMethod;
@@ -1345,7 +1346,6 @@
_iss sqInt statMkFwdCount;
_iss sqInt tenuringThreshold;
_iss sqInt thisClassIndex;
-_iss sqInt edenBytes;
_iss sqInt externalPrimitiveTableFirstFreeIndex;
_iss sqInt forceTenureFlag;
_iss sqInt fullScreenFlag;
@@ -2033,7 +2033,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.561";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.563";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -5675,6 +5675,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -5684,6 +5685,7 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object);
+ null;
goto l4;
}
if (opType == 4) {
@@ -5697,6 +5699,7 @@
object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
longAtPointerput((localSP -= BytesPerOop), object2);
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -18751,7 +18754,7 @@
activeContext = longAt(GIV(framePointer) + FoxThisContext);
goto l1;
}
- activeContext = marryFrameSP(GIV(framePointer), GIV(stackPointer));
+ activeContext = marryFrameSP(GIV(framePointer), GIV(stackPointer) + BytesPerWord);
l1: /* end ensureFrameIsMarried:SP: */;
for (i = 0; i < GIV(numStackPages); i += 1) {
/* begin stackPageAt: */
@@ -22177,9 +22180,8 @@
sqInt assoc;
sqInt classObj;
CogMethod *cogMethod;
- sqInt fieldIndex;
sqInt header;
- sqInt offset;
+ sqInt litCount;
}
@@ -23733,17 +23735,15 @@
sqInt header1;
sqInt header2;
sqInt header3;
- sqInt header4;
usqInt lastWord;
sqInt newFreeChunk;
sqInt newOop;
- sqInt next;
+ usqInt next;
sqInt oop;
sqInt realHeader;
sqInt sz;
sqInt sz1;
sqInt sz2;
- sqInt sz3;
sqInt target;
usqInt w;
@@ -23754,21 +23754,7 @@
/* begin objectAfterWhileForwarding: */
header2 = longAt(oop);
if ((header2 & MarkBit) == 0) {
- /* begin objectAfter: */
- if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
- error("no objects after the end of memory");
- }
- if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
- sz2 = (longAt(oop)) & AllButTypeMask;
- }
- else {
- /* begin sizeBitsOf: */
- header3 = longAt(oop);
- sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
- ? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
- : header3 & SizeMask);
- }
- next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
+ next = ((sqInt) (objectAfter(oop)));
goto l1;
}
fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -23783,7 +23769,7 @@
else {
sz1 = realHeader & SizeMask;
}
- next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
+ next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
l1: /* end objectAfterWhileForwarding: */;
if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
@@ -23837,18 +23823,18 @@
}
/* begin safeObjectAfter: */
if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
- sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
+ sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
}
else {
/* begin sizeBitsOf: */
- header4 = longAt(newFreeChunk);
- sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
+ header3 = longAt(newFreeChunk);
+ sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
- : header4 & SizeMask);
+ : header3 & SizeMask);
}
- next = ((newFreeChunk + sz3) >= GIV(freeStart)
+ next = ((newFreeChunk + sz2) >= GIV(freeStart)
? GIV(freeStart)
- : (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
+ : (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
assert((next == GIV(freeStart))
|| (next == (oopFromChunk(GIV(compEnd)))));
if (next == GIV(freeStart)) {
@@ -49157,10 +49143,8 @@
minimumMemory = ((GIV(cogCodeSize) + dataSize) + GIV(edenBytes)) + (interpreterAllocationReserveBytes());
/* no need to include the stackZone; this is alloca'ed */
- /* + edenBytes */
- /* don't include edenBytes; this is part of the heap and so part of desiredHeapSize */
- heapSize = (GIV(cogCodeSize) + desiredHeapSize) + (interpreterAllocationReserveBytes());
+ heapSize = ((GIV(cogCodeSize) + desiredHeapSize) + GIV(edenBytes)) + (interpreterAllocationReserveBytes());
if (heapSize < minimumMemory) {
insufficientMemorySpecifiedError();
}
@@ -49172,7 +49156,7 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memLimit = (memory()) + heapSize;
memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
/* begin setMemoryLimit: */
assert((memLimit & (BytesPerWord - 1)) == 0);
@@ -50058,7 +50042,7 @@
given object or free chunk in memory. Return freeStart when
enumeration is complete. This is for assertion checking only. */
-static sqInt
+static usqInt
safeObjectAfter(sqInt oop)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt header;
Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/interp.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
#define VM_PROXY_MAJOR 1
Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/nscogsrc/vm/vmCallback.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
#define VM_CALLBACK_INC 1
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
- Thu Dec 12 14:52:39 PST 2013
+ Mon Dec 16 15:49:50 PST 2013
Modified: branches/Cog/platforms/Mac OS/vm/sqMacMemory.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacMemory.c 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/platforms/Mac OS/vm/sqMacMemory.c 2013-12-16 23:52:11 UTC (rev 2833)
@@ -35,10 +35,14 @@
static int pageSize = 0;
static unsigned int pageMask = 0;
-usqInt sqGetAvailableMemory() {
+#define roundDownToPage(v) ((v)&pageMask)
+#define roundUpToPage(v) (((v)+pageSize-1)&pageMask)
+usqInt
+sqGetAvailableMemory()
+{
/******
- Note:
+ Note: (Except Spur)
For os-x this doesn't matter we just mmap 512MB for the image, and
the application allocates more out of the 4GB address for VM logic.
******/
@@ -46,52 +50,76 @@
return gMaxHeapSize >= 0xFFFFFFFFULL ? 0xFFFFFFFF : gMaxHeapSize;
}
-usqInt sqAllocateMemoryMac(sqInt minHeapSize, sqInt desiredHeapSize) {
+usqInt
+sqAllocateMemoryMac(sqInt desiredHeapSize, sqInt minHeapSize)
+{
void * debug, *actually;
- #pragma unused(minHeapSize,desiredHeapSize)
-
+#if SPURVM
pageSize= getpagesize();
pageMask= ~(pageSize - 1);
+
+ gHeapSize = roundUpToPage(desiredHeapSize);
+ debug = mmap(NULL, gHeapSize,PROT_READ|PROT_WRITE,MAP_ANON|MAP_SHARED,-1,0);
+#else
+# pragma unused(minHeapSize,desiredHeapSize)
+
+ pageSize= getpagesize();
+ pageMask= ~(pageSize - 1);
gHeapSize = gMaxHeapSize;
debug = mmap( NULL, gMaxHeapSize+pageSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED,-1,0);
- //debug = mmap( /*2147483648U-512*1024*1024*/
- // 3221225472U, gMaxHeapSize+pageSize , PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED,-1,0);
-
- if(debug == MAP_FAILED)
+#endif /* SPURVM */
+
+ if (debug == MAP_FAILED)
return 0;
mmapWasAt = debug;
actually = debug+pageSize-1;
actually = (void*) (((usqInt) actually) & pageMask);
-
+
return memoryAllocationBase = (usqInt) actually;
}
-sqInt sqGrowMemoryBy(sqInt memoryLimit, sqInt delta) {
+#if !SPURVM
+sqInt
+sqGrowMemoryBy(sqInt memoryLimit, sqInt delta)
+{
if ((usqInt) memoryLimit + (usqInt) delta - memoryAllocationBase > gMaxHeapSize)
return memoryLimit;
-
+
gHeapSize += delta;
return memoryLimit + delta;
}
-sqInt sqShrinkMemoryBy(sqInt memoryLimit, sqInt delta) {
+sqInt
+sqShrinkMemoryBy(sqInt memoryLimit, sqInt delta)
+{
return sqGrowMemoryBy(memoryLimit,0-delta);
}
-sqInt sqMemoryExtraBytesLeft(int flag) {
+sqInt
+sqMemoryExtraBytesLeft(int flag)
+{
return flag ? gMaxHeapSize - gHeapSize : 0;
}
+#endif /* ! SPURVM */
-void sqMacMemoryFree() {
+void
+sqMacMemoryFree()
+{
if (!memoryAllocationBase)
return;
+#if SPURVM
+ /* N.B. This is a hack for an unsupported configuration (NSPlugin(*/
+ /* If we really need to free memry we need to unmap all segments. */
+ /* But right now this is called only on exit and so is unnecessary. */
+ if (munmap((void *)memoryAllocationBase,gHeapSize))
+ perror("munmap");
+#else
if (munmap((void *)memoryAllocationBase,gMaxHeapSize+pageSize))
perror("munmap");
+#endif
memoryAllocationBase = 0;
}
-#define roundDownToPage(v) ((v)&pageMask)
-#define roundUpToPage(v) (((v)+pageSize-1)&pageMask)
#if COGVM
void
sqMakeMemoryExecutableFromTo(unsigned long startAddr, unsigned long endAddr)
Modified: branches/Cog/platforms/Mac OS/vm/sqPlatformSpecific.h
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqPlatformSpecific.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/platforms/Mac OS/vm/sqPlatformSpecific.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -74,10 +74,10 @@
#define allocateMemoryMinimumImageFileHeaderSize(heapSize, minimumMemory, fileStream, headerSize) \
sqAllocateMemoryMac(heapSize, minimumMemory)
-usqInt sqAllocateMemoryMac(sqInt minHeapSize, sqInt desiredHeapSize);
+usqInt sqAllocateMemoryMac(sqInt desiredHeapSize, sqInt minHeapSize);
-#define sqAllocateMemory(x,y) sqAllocateMemoryMac(x,&y);
+#define sqAllocateMemory(x,y) sqAllocateMemoryMac(&y,x)
/* override reserveExtraCHeapBytes() macro to reduce Squeak object heap size on Mac */
#undef reserveExtraCHeapBytes
Modified: branches/Cog/spursrc/vm/cogit.c
===================================================================
--- branches/Cog/spursrc/vm/cogit.c 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/spursrc/vm/cogit.c 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+ CCodeGenerator VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+ StackToRegisterMappingCogit VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -847,6 +847,7 @@
static AbstractInstruction * longJumpTargetAddress(AbstractInstruction * self_in_longJumpTargetAddress);
static AbstractInstruction * gMoveAwR(sqInt address, sqInt reg);
static AbstractInstruction * gMoveCwR(sqInt wordConstant, sqInt reg);
+static AbstractInstruction * gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg);
static AbstractInstruction * gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg);
static AbstractInstruction * gMoveRR(sqInt reg1, sqInt reg2);
static AbstractInstruction * gMulRR(sqInt reg1, sqInt reg2);
@@ -2614,18 +2615,23 @@
}
if (annotation == IsSendCall) {
entryPoint = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- /* begin offsetAndSendTableFor:annotation:into: */
- if ((entryPoint & entryPointMask) == checkedEntryAlignment) {
- offset = cmEntryOffset;
- sendTable = sendTrampolines;
-
+ if (entryPoint <= methodZoneBase) {
+ offset = entryPoint;
}
else {
- offset = cmNoCheckEntryOffset;
- sendTable = superSendTrampolines;
+ /* begin offsetAndSendTableFor:annotation:into: */
+ if ((entryPoint & entryPointMask) == checkedEntryAlignment) {
+ offset = cmEntryOffset;
+ sendTable = sendTrampolines;
+ }
+ else {
+ offset = cmNoCheckEntryOffset;
+ sendTable = superSendTrampolines;
+
+ }
+
}
-
selectorOrCacheTag = inlineCacheTagAt(backEnd, ((sqInt)mcpc));
if ((entryPoint > methodZoneBase)
&& ((offset != cmNoCheckEntryOffset)
@@ -14189,11 +14195,11 @@
genPushRegisterArgsForNumArgs(sqInt numArgs)
{
if (numArgs <= (numRegArgs())) {
+ assert((numRegArgs()) <= 2);
/* begin MoveMw:r:R: */
genoperandoperandoperand(MoveMwrR, 0, SPReg, TempReg);
/* begin MoveR:Mw:r: */
genoperandoperandoperand(MoveRMwr, ReceiverResultReg, 0, SPReg);
- assert((numRegArgs()) <= 2);
if (numArgs > 0) {
/* begin PushR: */
genoperand(PushR, Arg0Reg);
@@ -14204,6 +14210,7 @@
}
/* begin PushR: */
genoperand(PushR, TempReg);
+
}
}
@@ -15626,6 +15633,18 @@
1 & 3 collapsed to 1 for SmallIntegers, and 2 collapsed to 0 for
Characters), or
the receiver's classIndex. Generate something like this:
+ Lentry:
+ movl rSource, rDest
+ andl $0x3, rDest
+ jz LnotImm
+ andl $1, rDest
+ j Lcmp
+ LnotImm:
+ movl 0(%edx), rDest
+ andl $0x3fffff, rDest
+ Lcmp:
+ At least on a 2.2GHz Intel Core i7 it is slightly faster,
+ 136m sends/sec vs 130m sends/sec for nfib in tinyBenchmarks, than
Limm:
andl $0x1, rDest
j Lcmp
@@ -15635,44 +15654,35 @@
jnz Limm
movl 0(%edx), rDest
andl $0x3fffff, rDest
- Lcmp
+ Lcmp:
*/
static AbstractInstruction *
getInlineCacheClassTagFrominto(sqInt sourceReg, sqInt destReg)
{
AbstractInstruction *entryLabel;
- AbstractInstruction *immLabel;
AbstractInstruction *jumpCompare;
+ AbstractInstruction *jumpNotImm;
sqInt quickConstant;
- sqInt quickConstant1;
/* begin AlignmentNops: */
- genoperand(AlignmentNops, BytesPerWord);
+ genoperand(AlignmentNops, ((BytesPerWord < 8) ? 8 : BytesPerWord));
/* begin Label */
- immLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
- /* begin AndCq:R: */
- genoperandoperand(AndCqR, 1, destReg);
- /* begin Jump: */
- jumpCompare = genoperand(Jump, ((sqInt)0));
- /* begin AlignmentNops: */
- genoperand(AlignmentNops, BytesPerWord);
- /* begin Label */
entryLabel = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
/* begin MoveR:R: */
genoperandoperand(MoveRR, sourceReg, destReg);
/* begin AndCq:R: */
quickConstant = tagMask();
genoperandoperand(AndCqR, quickConstant, destReg);
- /* begin JumpNonZero: */
- genoperand(JumpNonZero, ((sqInt)immLabel));
+ /* begin JumpZero: */
+ jumpNotImm = genoperand(JumpZero, ((sqInt)0));
+ /* begin AndCq:R: */
+ genoperandoperand(AndCqR, 1, destReg);
+ /* begin Jump: */
+ jumpCompare = genoperand(Jump, ((sqInt)0));
flag("endianness");
- /* begin MoveMw:r:R: */
- genoperandoperandoperand(MoveMwrR, 0, sourceReg, destReg);
- /* begin AndCq:R: */
- quickConstant1 = classIndexMask();
- genoperandoperand(AndCqR, quickConstant1, destReg);
- jmpTarget(jumpCompare, gLabel());
+ jmpTarget(jumpNotImm, gMoveMwrR(0, sourceReg, destReg));
+ jmpTarget(jumpCompare, gAndCqR(classIndexMask(), destReg));
return entryLabel;
}
@@ -16669,6 +16679,12 @@
}
static AbstractInstruction *
+gMoveMwrR(sqInt offset, sqInt baseReg, sqInt destReg)
+{
+ return genoperandoperandoperand(MoveMwrR, offset, baseReg, destReg);
+}
+
+static AbstractInstruction *
gMoveRMwr(sqInt sourceReg, sqInt offset, sqInt baseReg)
{
return genoperandoperandoperand(MoveRMwr, sourceReg, offset, baseReg);
Modified: branches/Cog/spursrc/vm/cogit.h
===================================================================
--- branches/Cog/spursrc/vm/cogit.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/spursrc/vm/cogit.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+ CCodeGenerator VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
Modified: branches/Cog/spursrc/vm/cogmethod.h
===================================================================
--- branches/Cog/spursrc/vm/cogmethod.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/spursrc/vm/cogmethod.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+ CCodeGenerator VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
typedef struct {
Modified: branches/Cog/spursrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/cointerp.c 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/spursrc/vm/cointerp.c 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
from
- CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1457,13 +1457,13 @@
_iss usqLong longRunningPrimitiveStopUsecs;
_iss sqInt numSegInfos;
_iss sqInt statCheckForEvents;
-_iss sqInt cogCodeSize;
_iss sqInt gcMode;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
_iss usqInt lowSpaceThreshold;
_iss usqLong statGCEndUsecs;
_iss sqInt classTableIndex;
+_iss sqInt cogCodeSize;
_iss sqInt flagInterpretedMethods;
_iss usqInt freeOldSpaceStart;
_iss sqInt metaclassNumSlots;
@@ -2162,7 +2162,7 @@
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.561]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.563]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -6363,6 +6363,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -6372,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) {
@@ -6399,6 +6401,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -17879,7 +17882,7 @@
assert(pageListIsWellFormed());
}
/* begin ensureFrameIsMarried:SP: */
- theSP = GIV(stackPointer);
+ theSP = GIV(stackPointer) + BytesPerWord;
if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
? ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
: (byteAt((GIV(framePointer) + FoxIFrameFlags) + 2)) != 0)) {
@@ -22404,11 +22407,17 @@
sqInt fmt;
fmt = (((usqInt) (longAt(objOop))) >> 24) & 0x1F;
- if (fmt <= 5) {
+ if (fmt <= 4) {
+ if (fmt == 2) {
- /* pointer; may need to delve into the class format word */
+ /* array starts at 0. */
- if (((fmt >= 3) && (fmt <= 4))) {
+ return pointerForOop(objOop + (BaseHeaderSize));
+ }
+ if (fmt >= 3) {
+
+ /* indexable with inst vars; need to delve into the class format word */
+
/* begin formatOfClass: */
/* begin fetchClassOfNonImm: */
classIndex = (longAt(objOop)) & 0x3FFFFF;
@@ -22430,10 +22439,13 @@
classFormat = ((longAt((classPointer + (BaseHeaderSize)) + (InstanceSpecificationIndex << 2))) >> 1);
return pointerForOop((objOop + (BaseHeaderSize)) + ((classFormat & ((1 << 16) - 1)) << (wordSize())));
}
- return pointerForOop((objOop + (BaseHeaderSize)) + ((numSlotsOf(objOop)) << (wordSize())));
+ return 0;
}
- assert(fmt < (firstCompiledMethodFormat()));
- return pointerForOop(objOop + (BaseHeaderSize));
+ if ((fmt >= 9)
+ && (fmt < 24)) {
+ return pointerForOop(objOop + (BaseHeaderSize));
+ }
+ return 0;
}
sqInt
@@ -23084,16 +23096,30 @@
sqInt assoc;
sqInt classObj;
CogMethod *cogMethod;
- sqInt fieldIndex;
sqInt header;
- sqInt offset;
+ sqInt litCount;
sqInt referent;
sqInt referent1;
/* begin actuallyFollowNecessaryForwardingInMethod: */
- /* begin literal:ofMethod: */
- offset = (literalCountOfHeader(headerOf(methodObj))) - 1;
- assoc = longAt((methodObj + (BaseHeaderSize)) + ((offset + LiteralStart) << 2));
+ header = longAt((methodObj + (BaseHeaderSize)) + (HeaderIndex << 2));
+ if (isCogMethodReference(header)) {
+
+ /* If the method class is not used we can avoid the forwarding
+ check for both the cogMehod and the bytecoded method. */
+
+ cogMethod = ((CogMethod *) header);
+ if (!((cogMethod->cmUsesMethodClass))) {
+ goto l1;
+ }
+ followForwardedLiteralsIn(cogMethod);
+ header = (cogMethod->methodHeader);
+ }
+
+ /* Slang super expansion limitation */
+
+ litCount = (((usqInt) header) >> 10) & 0xFF;
+ assoc = longAt((methodObj + (BaseHeaderSize)) + (((litCount - 1) + LiteralStart) << 2));
if (((longAt(assoc)) & 0x3FFFFF) == 8) {
/* begin followForwarded: */
assert(isForwarded(assoc));
@@ -23103,9 +23129,7 @@
referent = longAt((referent + (BaseHeaderSize)) + (0 << 2));
}
assoc = referent;
- /* begin setMethodClassAssociationOf:to: */
/* begin storePointer:ofObject:withValue: */
- fieldIndex = ((literalCountOfHeader(headerOf(methodObj))) + LiteralStart) - 1;
assert(!(isForwarded(methodObj)));
if (isOldObject(methodObj)) {
@@ -23122,44 +23146,40 @@
}
}
}
- longAtput((methodObj + (BaseHeaderSize)) + (fieldIndex << 2), assoc);
+ longAtput((methodObj + (BaseHeaderSize)) + (((litCount + LiteralStart) - 1) << 2), assoc);
}
- classObj = longAt((assoc + (BaseHeaderSize)) + (ValueIndex << 2));
- if (((longAt(classObj)) & 0x3FFFFF) == 8) {
- /* begin followForwarded: */
- assert(isForwarded(assoc));
- referent1 = longAt((assoc + (BaseHeaderSize)) + (0 << 2));
- while (((referent1 & 3) == 0)
- && (((longAt(referent1)) & 0x3FFFFF) == 8)) {
- referent1 = longAt((referent1 + (BaseHeaderSize)) + (0 << 2));
- }
- classObj = referent1;
- /* begin storePointer:ofObject:withValue: */
- assert(!(isForwarded(assoc)));
- if (isOldObject(assoc)) {
+ if ((numSlotsOf(assoc)) >= (ValueIndex + 1)) {
+ classObj = longAt((assoc + (BaseHeaderSize)) + (ValueIndex << 2));
+ if (((longAt(classObj)) & 0x3FFFFF) == 8) {
+ /* begin followForwarded: */
+ assert(isForwarded(assoc));
+ referent1 = longAt((assoc + (BaseHeaderSize)) + (0 << 2));
+ while (((referent1 & 3) == 0)
+ && (((longAt(referent1)) & 0x3FFFFF) == 8)) {
+ referent1 = longAt((referent1 + (BaseHeaderSize)) + (0 << 2));
+ }
+ classObj = referent1;
+ /* begin storePointer:ofObject:withValue: */
+ assert(!(isForwarded(assoc)));
+ if (isOldObject(assoc)) {
- /* most stores into young objects */
+ /* most stores into young objects */
- if (((classObj & 3) == 0)
- && ((((usqInt) classObj)) < (((usqInt) GIV(newSpaceLimit))))) {
- /* begin possibleRootStoreInto: */
- if (!(((((usqInt) (longAt(assoc))) >> 29) & 1) != 0)) {
- remember(assoc);
- /* begin setIsRememberedOf:to: */
- flag("endianness");
- longAtput(assoc, (longAt(assoc)) | (1 << 29));
+ if (((classObj & 3) == 0)
+ && ((((usqInt) classObj)) < (((usqInt) GIV(newSpaceLimit))))) {
+ /* begin possibleRootStoreInto: */
+ if (!(((((usqInt) (longAt(assoc))) >> 29) & 1) != 0)) {
+ remember(assoc);
+ /* begin setIsRememberedOf:to: */
+ flag("endianness");
+ longAtput(assoc, (longAt(assoc)) | (1 << 29));
+ }
}
}
+ longAtput((assoc + (BaseHeaderSize)) + (ValueIndex << 2), classObj);
}
- longAtput((assoc + (BaseHeaderSize)) + (ValueIndex << 2), classObj);
}
- header = longAt((methodObj + (BaseHeaderSize)) + (HeaderIndex << 2));
- if (isCogMethodReference(header)) {
- cogMethod = ((CogMethod *) header);
- if ((cogMethod->cmUsesMethodClass)) {
- followForwardedLiteralsIn(cogMethod);
- }
- }
+l1: /* end actuallyFollowNecessaryForwardingInMethod: */;
}
@@ -52270,10 +52290,8 @@
minimumMemory = ((GIV(cogCodeSize) + dataSize) + edenBytes) + (interpreterAllocationReserveBytes());
/* no need to include the stackZone; this is alloca'ed */
- /* + edenBytes */
- /* don't include edenBytes; this is part of the heap and so part of desiredHeapSize */
- heapSize = (GIV(cogCodeSize) + desiredHeapSize) + (interpreterAllocationReserveBytes());
+ heapSize = ((GIV(cogCodeSize) + desiredHeapSize) + edenBytes) + (interpreterAllocationReserveBytes());
if (heapSize < minimumMemory) {
insufficientMemorySpecifiedError();
}
@@ -52285,7 +52303,7 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memLimit = (memory()) + heapSize;
memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
GIV(newSpaceStart) = baseOfHeap;
GIV(newSpaceLimit) = (baseOfHeap + edenBytes) + (interpreterAllocationReserveBytes());
Modified: branches/Cog/spursrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursrc/vm/cointerp.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/spursrc/vm/cointerp.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
Modified: branches/Cog/spursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/gcc3x-cointerp.c 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/spursrc/vm/gcc3x-cointerp.c 2013-12-16 23:52:11 UTC (rev 2833)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
from
- CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1460,13 +1460,13 @@
_iss usqLong longRunningPrimitiveStopUsecs;
_iss sqInt numSegInfos;
_iss sqInt statCheckForEvents;
-_iss sqInt cogCodeSize;
_iss sqInt gcMode;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
_iss usqInt lowSpaceThreshold;
_iss usqLong statGCEndUsecs;
_iss sqInt classTableIndex;
+_iss sqInt cogCodeSize;
_iss sqInt flagInterpretedMethods;
_iss usqInt freeOldSpaceStart;
_iss sqInt metaclassNumSlots;
@@ -2165,7 +2165,7 @@
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.561]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.563]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -6372,6 +6372,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((rcvr1 + (BaseHeaderSize)) + (byte3 << 2)));
}
+ null;
goto l4;
}
if (opType == 3) {
@@ -6381,6 +6382,7 @@
assert(GIV(method) == (iframeMethod(localFP)));
object = longAt((GIV(method) + (BaseHeaderSize)) + ((byte3 + LiteralStart) << 2));
longAtPointerput((localSP -= BytesPerOop), object);
+ null;
goto l4;
}
if (opType == 4) {
@@ -6408,6 +6410,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), longAt((litVar1 + (BaseHeaderSize)) + (ValueIndex << 2)));
+ null;
goto l4;
}
top = longAtPointer(localSP);
@@ -17888,7 +17891,7 @@
assert(pageListIsWellFormed());
}
/* begin ensureFrameIsMarried:SP: */
- theSP = GIV(stackPointer);
+ theSP = GIV(stackPointer) + BytesPerWord;
if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
? ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
: (byteAt((GIV(framePointer) + FoxIFrameFlags) + 2)) != 0)) {
@@ -22413,11 +22416,17 @@
sqInt fmt;
fmt = (((usqInt) (longAt(objOop))) >> 24) & 0x1F;
- if (fmt <= 5) {
+ if (fmt <= 4) {
+ if (fmt == 2) {
- /* pointer; may need to delve into the class format word */
+ /* array starts at 0. */
- if (((fmt >= 3) && (fmt <= 4))) {
+ return pointerForOop(objOop + (BaseHeaderSize));
+ }
+ if (fmt >= 3) {
+
+ /* indexable with inst vars; need to delve into the class format word */
+
/* begin formatOfClass: */
/* begin fetchClassOfNonImm: */
classIndex = (longAt(objOop)) & 0x3FFFFF;
@@ -22439,10 +22448,13 @@
classFormat = ((longAt((classPointer + (BaseHeaderSize)) + (InstanceSpecificationIndex << 2))) >> 1);
return pointerForOop((objOop + (BaseHeaderSize)) + ((classFormat & ((1 << 16) - 1)) << (wordSize())));
}
- return pointerForOop((objOop + (BaseHeaderSize)) + ((numSlotsOf(objOop)) << (wordSize())));
+ return 0;
}
- assert(fmt < (firstCompiledMethodFormat()));
- return pointerForOop(objOop + (BaseHeaderSize));
+ if ((fmt >= 9)
+ && (fmt < 24)) {
+ return pointerForOop(objOop + (BaseHeaderSize));
+ }
+ return 0;
}
sqInt
@@ -23093,16 +23105,30 @@
sqInt assoc;
sqInt classObj;
CogMethod *cogMethod;
- sqInt fieldIndex;
sqInt header;
- sqInt offset;
+ sqInt litCount;
sqInt referent;
sqInt referent1;
/* begin actuallyFollowNecessaryForwardingInMethod: */
- /* begin literal:ofMethod: */
- offset = (literalCountOfHeader(headerOf(methodObj))) - 1;
- assoc = longAt((methodObj + (BaseHeaderSize)) + ((offset + LiteralStart) << 2));
+ header = longAt((methodObj + (BaseHeaderSize)) + (HeaderIndex << 2));
+ if (isCogMethodReference(header)) {
+
+ /* If the method class is not used we can avoid the forwarding
+ check for both the cogMehod and the bytecoded method. */
+
+ cogMethod = ((CogMethod *) header);
+ if (!((cogMethod->cmUsesMethodClass))) {
+ goto l1;
+ }
+ followForwardedLiteralsIn(cogMethod);
+ header = (cogMethod->methodHeader);
+ }
+
+ /* Slang super expansion limitation */
+
+ litCount = (((usqInt) header) >> 10) & 0xFF;
+ assoc = longAt((methodObj + (BaseHeaderSize)) + (((litCount - 1) + LiteralStart) << 2));
if (((longAt(assoc)) & 0x3FFFFF) == 8) {
/* begin followForwarded: */
assert(isForwarded(assoc));
@@ -23112,9 +23138,7 @@
referent = longAt((referent + (BaseHeaderSize)) + (0 << 2));
}
assoc = referent;
- /* begin setMethodClassAssociationOf:to: */
/* begin storePointer:ofObject:withValue: */
- fieldIndex = ((literalCountOfHeader(headerOf(methodObj))) + LiteralStart) - 1;
assert(!(isForwarded(methodObj)));
if (isOldObject(methodObj)) {
@@ -23131,44 +23155,40 @@
}
}
}
- longAtput((methodObj + (BaseHeaderSize)) + (fieldIndex << 2), assoc);
+ longAtput((methodObj + (BaseHeaderSize)) + (((litCount + LiteralStart) - 1) << 2), assoc);
}
- classObj = longAt((assoc + (BaseHeaderSize)) + (ValueIndex << 2));
- if (((longAt(classObj)) & 0x3FFFFF) == 8) {
- /* begin followForwarded: */
- assert(isForwarded(assoc));
- referent1 = longAt((assoc + (BaseHeaderSize)) + (0 << 2));
- while (((referent1 & 3) == 0)
- && (((longAt(referent1)) & 0x3FFFFF) == 8)) {
- referent1 = longAt((referent1 + (BaseHeaderSize)) + (0 << 2));
- }
- classObj = referent1;
- /* begin storePointer:ofObject:withValue: */
- assert(!(isForwarded(assoc)));
- if (isOldObject(assoc)) {
+ if ((numSlotsOf(assoc)) >= (ValueIndex + 1)) {
+ classObj = longAt((assoc + (BaseHeaderSize)) + (ValueIndex << 2));
+ if (((longAt(classObj)) & 0x3FFFFF) == 8) {
+ /* begin followForwarded: */
+ assert(isForwarded(assoc));
+ referent1 = longAt((assoc + (BaseHeaderSize)) + (0 << 2));
+ while (((referent1 & 3) == 0)
+ && (((longAt(referent1)) & 0x3FFFFF) == 8)) {
+ referent1 = longAt((referent1 + (BaseHeaderSize)) + (0 << 2));
+ }
+ classObj = referent1;
+ /* begin storePointer:ofObject:withValue: */
+ assert(!(isForwarded(assoc)));
+ if (isOldObject(assoc)) {
- /* most stores into young objects */
+ /* most stores into young objects */
- if (((classObj & 3) == 0)
- && ((((usqInt) classObj)) < (((usqInt) GIV(newSpaceLimit))))) {
- /* begin possibleRootStoreInto: */
- if (!(((((usqInt) (longAt(assoc))) >> 29) & 1) != 0)) {
- remember(assoc);
- /* begin setIsRememberedOf:to: */
- flag("endianness");
- longAtput(assoc, (longAt(assoc)) | (1 << 29));
+ if (((classObj & 3) == 0)
+ && ((((usqInt) classObj)) < (((usqInt) GIV(newSpaceLimit))))) {
+ /* begin possibleRootStoreInto: */
+ if (!(((((usqInt) (longAt(assoc))) >> 29) & 1) != 0)) {
+ remember(assoc);
+ /* begin setIsRememberedOf:to: */
+ flag("endianness");
+ longAtput(assoc, (longAt(assoc)) | (1 << 29));
+ }
}
}
+ longAtput((assoc + (BaseHeaderSize)) + (ValueIndex << 2), classObj);
}
- longAtput((assoc + (BaseHeaderSize)) + (ValueIndex << 2), classObj);
}
- header = longAt((methodObj + (BaseHeaderSize)) + (HeaderIndex << 2));
- if (isCogMethodReference(header)) {
- cogMethod = ((CogMethod *) header);
- if ((cogMethod->cmUsesMethodClass)) {
- followForwardedLiteralsIn(cogMethod);
- }
- }
+l1: /* end actuallyFollowNecessaryForwardingInMethod: */;
}
@@ -52279,10 +52299,8 @@
minimumMemory = ((GIV(cogCodeSize) + dataSize) + edenBytes) + (interpreterAllocationReserveBytes());
/* no need to include the stackZone; this is alloca'ed */
- /* + edenBytes */
- /* don't include edenBytes; this is part of the heap and so part of desiredHeapSize */
- heapSize = (GIV(cogCodeSize) + desiredHeapSize) + (interpreterAllocationReserveBytes());
+ heapSize = ((GIV(cogCodeSize) + desiredHeapSize) + edenBytes) + (interpreterAllocationReserveBytes());
if (heapSize < minimumMemory) {
insufficientMemorySpecifiedError();
}
@@ -52294,7 +52312,7 @@
}
/* begin setHeapBase:memoryLimit:endOfMemory: */
baseOfHeap = (memory()) + GIV(cogCodeSize);
- memLimit = ((memory()) + GIV(cogCodeSize)) + heapSize;
+ memLimit = (memory()) + heapSize;
memEnd = ((memory()) + GIV(cogCodeSize)) + dataSize;
GIV(newSpaceStart) = baseOfHeap;
GIV(newSpaceLimit) = (baseOfHeap + edenBytes) + (interpreterAllocationReserveBytes());
Modified: branches/Cog/spursrc/vm/interp.h
===================================================================
--- branches/Cog/spursrc/vm/interp.h 2013-12-12 22:53:13 UTC (rev 2832)
+++ branches/Cog/spursrc/vm/interp.h 2013-12-16 23:52:11 UTC (rev 2833)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.563 uuid: 3116fc1b-f9a5-45f5-bc7e-4b5c68ec8247
*/
#define VM_PROXY_MAJOR 1
Modified: branches/Cog/spursrc/vm/vmCallback.h
===================================================================
--- branches/Cog/spursrc/vm/vmCallback.h 2013-12-12 22:53:13 UTC (rev 2832)
@@ Diff output truncated at 50000 characters. @@