[Vm-dev] [commit][3230] CogVM source as per VMMaker.oscog-eem.1022
commits at squeakvm.org
commits at squeakvm.org
Thu Jan 15 21:47:09 UTC 2015
Revision: 3230
Author: eliot
Date: 2015-01-15 13:47:03 -0800 (Thu, 15 Jan 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1022
Fix monumental blunder in jitted store-check code. The saved registers mask
needs to be the *or* of the value reg and the caller-saved registers, not the
*and*!!
Bow to the inevitable and add a manual override for primitive accessor depth.
Use it in at: & at:put:. If manual override is not used then the automatically
computed depth is too deep because of context access.
Slang:
Eliminate null expressions in and: and or: if
generateDeadCode is false.
Sista:
Added super calls in conditionnal jumps generation in order not to generate
counters for optimized methods.
Added unconditionnal single bytecode 217. This bytecode can be used in two case:
- when a method is discarded, all its bytecodes are replaced by the
unconditional trap and its cogVMState is flushed
- in optimized methods, in a branch that wants to trigger dynamic deoptimization
Modified Paths:
--------------
branches/Cog/nscogsrc/vm/cogit.c
branches/Cog/nscogsrc/vm/cogit.h
branches/Cog/nscogsrc/vm/cointerp.c
branches/Cog/nscogsrc/vm/cointerp.h
branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
branches/Cog/nsspursrc/vm/cogit.c
branches/Cog/nsspursrc/vm/cogit.h
branches/Cog/nsspursrc/vm/cointerp.c
branches/Cog/nsspursrc/vm/cointerp.h
branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
branches/Cog/nsspurstacksrc/vm/interp.c
branches/Cog/sistasrc/vm/cogit.c
branches/Cog/sistasrc/vm/cogit.h
branches/Cog/sistasrc/vm/cointerp.c
branches/Cog/sistasrc/vm/cointerp.h
branches/Cog/sistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursistasrc/vm/cogit.c
branches/Cog/spursistasrc/vm/cogit.h
branches/Cog/spursistasrc/vm/cointerp.c
branches/Cog/spursistasrc/vm/cointerp.h
branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/cogit.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spurstack64src/vm/gcc3x-interp.c
branches/Cog/spurstack64src/vm/interp.c
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/src/vm/cogit.c
branches/Cog/src/vm/cogit.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/stacksrc/vm/gcc3x-interp.c
branches/Cog/stacksrc/vm/interp.c
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nscogsrc/vm/cogit.c 2015-01-15 21:47:03 UTC (rev 3230)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286
+ CCodeGenerator VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -8691,8 +8691,7 @@
rcvrClass = fetchClassOf(receiver);
cogMethod = mframeHomeMethodExport();
if (!((cogMethod->cmRefersToYoung))) {
- if (((inlineCacheTagsMayBeObjects())
- && (isYoung(rcvrClass)))
+ if ((isYoung(rcvrClass))
|| ((mixin != receiver)
&& (isYoung(mixin)))) {
ensureInYoungReferrers(cogMethod);
@@ -8892,11 +8891,7 @@
are markable/remappable objects. */
entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- tagCouldBeObj = (inlineCacheTagsMayBeObjects())
- || ((entryPoint1 < methodZoneBase)
- || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment)
- || (((entryPoint1 & entryPointMask) == checkedEntryAlignment)
- && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))));
+ tagCouldBeObj = 1;
if (tagCouldBeObj) {
if (couldBeObject(cacheTag1)) {
if (!(asserta(checkValidOopReference(cacheTag1)))) {
@@ -12623,11 +12618,7 @@
are markable/remappable objects. */
entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- tagCouldBeObj1 = (inlineCacheTagsMayBeObjects())
- || ((entryPoint1 < methodZoneBase)
- || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment)
- || (((entryPoint1 & entryPointMask) == checkedEntryAlignment)
- && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))));
+ tagCouldBeObj1 = 1;
cacheTagMarked = tagCouldBeObj1
&& (cacheTagIsMarked(cacheTag1));
if (entryPoint1 > methodZoneBase) {
@@ -12782,11 +12773,7 @@
are markable/remappable objects. */
entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- tagCouldBeObj1 = (inlineCacheTagsMayBeObjects())
- || ((entryPoint1 < methodZoneBase)
- || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment)
- || (((entryPoint1 & entryPointMask) == checkedEntryAlignment)
- && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))));
+ tagCouldBeObj1 = 1;
if (tagCouldBeObj1) {
markAndTraceLiteralIfYoung(cacheTag1);
}
@@ -13584,8 +13571,7 @@
static sqInt
processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
{
- return (processorHasDivQuoRem(ignoredPrimIndex))
- && (mclassIsSmallInteger(ignoredPrimIndex));
+ return mclassIsSmallInteger(ignoredPrimIndex);
}
static sqInt
@@ -13603,8 +13589,7 @@
static sqInt
processorHasMultiplyAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
{
- return (processorHasMultiply(ignoredPrimIndex))
- && (mclassIsSmallInteger(ignoredPrimIndex));
+ return mclassIsSmallInteger(ignoredPrimIndex);
}
static sqInt
@@ -13899,11 +13884,7 @@
are markable/remappable objects. */
entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- tagCouldBeObj1 = (inlineCacheTagsMayBeObjects())
- || ((entryPoint1 < methodZoneBase)
- || (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment)
- || (((entryPoint1 & entryPointMask) == checkedEntryAlignment)
- && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))));
+ tagCouldBeObj1 = 1;
if (tagCouldBeObj1
&& (couldBeObject(cacheTag1))) {
mappedCacheTag = remapObject(cacheTag1);
@@ -13926,8 +13907,7 @@
/* First look at the classTag entry. This is an inline cache tag and so might not be an object. */
- if ((inlineCacheTagsMayBeObjects())
- && (couldBeObject(oop))) {
+ if (couldBeObject(oop)) {
mappedOop = remapOop(oop);
if (mappedOop != oop) {
unalignedLongAtput(backEnd, cacheAddress, mappedOop);
@@ -16510,7 +16490,7 @@
/* begin JumpNonZero: */
jmpAlreadyRoot = genoperand(JumpNonZero, ((sqInt)0));
assert(destReg == ReceiverResultReg);
- CallRTregistersToBeSavedMask(ceStoreCheckTrampoline, (registerMaskFor(sourceReg)) & (callerSavedRegMask()));
+ CallRTregistersToBeSavedMask(ceStoreCheckTrampoline, (registerMaskFor(sourceReg)) | (callerSavedRegMask()));
jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, jmpTarget(jmpAlreadyRoot, gLabel()))));
return 0;
}
@@ -18914,8 +18894,7 @@
if (numCleanBlocks > 0) {
addCleanBlockStarts();
}
- if (!(1
- && (maybeAllocAndInitIRCs()))) {
+ if (!(maybeAllocAndInitIRCs())) {
/* Inaccurate error code, but it'll do. This will likely never fail. */
Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nscogsrc/vm/cogit.h 2015-01-15 21:47:03 UTC (rev 3230)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286
+ CCodeGenerator VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
*/
Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2015-01-15 21:47:03 UTC (rev 3230)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
from
- CoInterpreter VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5
+ CoInterpreter VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -221,7 +221,6 @@
#define HashBits 0x1FFE0000
#define HashBitsOffset 17
#define HashMaskUnshifted 0xFFF
-#define HeaderFlagBitPosition 29
#define HeaderIndex 0
#define HeaderTypeClass 1
#define HeaderTypeFree 2
@@ -261,6 +260,7 @@
#define MethodCacheSize 4096
#define MethodDictionaryIndex 1
#define MethodHeaderArgCountShift 25
+#define MethodHeaderFlagBitPosition 29
#define MethodHeaderTempCountShift 19
#define MethodIndex 3
#define MFMethodFlagHasContextFlag 1
@@ -1384,6 +1384,7 @@
_iss usqLong nextWakeupUsecs;
_iss sqInt statMarkCount;
_iss sqInt cogCompiledCodeCompactionCalledFor;
+_iss sqInt flagInterpretedMethods;
_iss sqInt gcMode;
_iss sqInt highestRunnableProcessPriority;
_iss sqInt lastCoggableInterpretedBlockMethod;
@@ -1400,7 +1401,6 @@
_iss sqInt cogCodeSize;
_iss usqInt compEnd;
_iss sqInt externalPrimitiveTableFirstFreeIndex;
-_iss sqInt flagInterpretedMethods;
_iss sqInt thisClassIndex;
_iss sqInt edenBytes;
_iss usqInt fwdTableLast;
@@ -2101,7 +2101,7 @@
/* 575 */ (void (*)(void))0,
0 };
char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1017";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1022";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -4835,6 +4835,7 @@
GIV(framePointer) = localFP;
ceEnterCogCodePopReceiverReg();
+ null;
goto l300;
}
localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4852,7 +4853,7 @@
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- /* return self */
+ null;
l300: /* end baseFrameReturn */;
goto l299;
}
@@ -5325,10 +5326,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -7955,7 +7955,7 @@
/* bytecodePrimBitShift */
{
sqInt integerArgument;
- sqLong integerReceiver;
+ usqInt integerReceiver;
sqInt shifted;
char *sp;
@@ -8015,7 +8015,7 @@
null;
goto l108;
}
- shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+ shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
}
shifted = positive32BitIntegerFor(shifted);
/* begin pop:thenPush: */
@@ -10909,7 +10909,7 @@
/* bytecodePrimBitShift */
{
sqInt integerArgument;
- sqLong integerReceiver;
+ usqInt integerReceiver;
sqInt shifted;
char *sp;
@@ -10969,7 +10969,7 @@
null;
goto l243;
}
- shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+ shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
}
shifted = positive32BitIntegerFor(shifted);
/* begin pop:thenPush: */
@@ -13849,9 +13849,7 @@
char *sp1;
char *sp2;
- assert(((numRegArgs()) > 0)
- && (((numRegArgs()) <= 2)
- && (((cogMethod->cmNumArgs)) <= (numRegArgs()))));
+ assert(((cogMethod->cmNumArgs)) <= (numRegArgs()));
if (((cogMethod->cmNumArgs)) == 2) {
longAtput(GIV(stackPointer) + (3 * BytesPerWord), longAt(GIV(stackPointer)));
/* begin push: */
@@ -15328,11 +15326,10 @@
|| (((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) >= 12))) {
return 1;
}
- hasYoung = (!0)
- && (isYoungObject((((ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F)) == 0
+ hasYoung = isYoungObject((((ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(oop - BaseHeaderSize)) & AllButTypeMask
: (/* begin fetchPointer:ofObject: */
- longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord())))))));
+ longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord()))))));
if (((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) >= 12) {
i = ((literalCountOfMethodHeader(methodHeaderOf(oop))) + LiteralStart) - 1;
}
@@ -17050,10 +17047,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -17684,6 +17680,13 @@
return ((SelectorCannotInterpret < SelectorDoesNotUnderstand) ? SelectorDoesNotUnderstand : SelectorCannotInterpret);
}
+
+/* In the Sista VM the flag bit in the method header is taken to identify
+ optimized methods.
+ In other VMs it can be used to flag methods that are interpreted, if it
+ has been requested
+ from the image header flags. */
+
static void
maybeFlagMethodAsInterpreted(sqInt aMethod)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
@@ -17695,7 +17698,7 @@
realHeader = (isCogMethodReference(rawHeader)
? ((((CogMethod *) rawHeader))->methodHeader)
: rawHeader);
- realHeader = realHeader | ((((1 << HeaderFlagBitPosition) << 1) | 1));
+ realHeader = realHeader | ((((1 << MethodHeaderFlagBitPosition) << 1) | 1));
if (isCogMethodReference(rawHeader)) {
((((CogMethod *) rawHeader))->methodHeader = realHeader);
}
@@ -19182,6 +19185,7 @@
GIV(flagInterpretedMethods) = (headerFlags & 8) != 0;
GIV(preemptionYields) = (headerFlags & 16) == 0;
GIV(noThreadingOfGUIThread) = (headerFlags & 32) != 0;
+
/* begin getWord32FromFile:swap: */
w5 = 0;
sqImageFileRead((&w5), sizeof(int), 1, f);
@@ -19291,30 +19295,25 @@
initializeObjectMemory(bytesToShift);
/* begin checkAssumedCompactClasses */
/* begin checkCompactIndex:isClass:named: */
- if ((ClassArrayCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << (shiftForWord())))) != (fetchPointerofObject(ClassArrayCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << (shiftForWord())))) != (fetchPointerofObject(ClassArrayCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("Array");
}
/* begin checkCompactIndex:isClass:named: */
- if ((ClassLargeNegativeIntegerCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargeNegativeInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargeNegativeIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargeNegativeInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargeNegativeIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("LargeNegativeInteger");
}
/* begin checkCompactIndex:isClass:named: */
- if ((ClassLargePositiveIntegerCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargePositiveIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargePositiveIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("LargePositiveInteger");
}
/* begin checkCompactIndex:isClass:named: */
- if ((ClassFloatCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())))) != (fetchPointerofObject(ClassFloatCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())))) != (fetchPointerofObject(ClassFloatCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("Float");
}
/* begin checkCompactIndex:isClass:named: */
;
/* begin checkCompactIndex:isClass:named: */
- if ((ClassMethodContextCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMethodContext << (shiftForWord())))) != (fetchPointerofObject(ClassMethodContextCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMethodContext << (shiftForWord())))) != (fetchPointerofObject(ClassMethodContextCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("MethodContext");
}
GIV(classByteArrayCompactIndex) = compactIndexOfClass(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteArray << (shiftForWord()))));
@@ -20231,10 +20230,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -24419,7 +24417,7 @@
primitiveBitShift(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt integerArgument;
- sqLong integerReceiver;
+ usqInt integerReceiver;
sqInt shifted;
char *sp;
@@ -24466,7 +24464,7 @@
}
return;
}
- shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+ shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
}
shifted = positive32BitIntegerFor(shifted);
/* begin pop:thenPush: */
@@ -37364,10 +37362,9 @@
endSeg = (segmentWordArray + (sizeBitsOf(segmentWordArray))) - BaseHeaderSize;
data = longAt(segmentWordArray + BaseHeaderSize);
if (!(((data & 0xFFFF) == (imageFormatVersion()))
- || ((!0)
- && ((data & 0xFFFF) == ((BytesPerWord == 4
+ || ((data & 0xFFFF) == ((BytesPerWord == 4
? 6504
- : 68002)))))) {
+ : 68002))))) {
/* low 2 bytes */
/* Not readable -- try again with reversed bytes... */
@@ -37380,10 +37377,9 @@
}
data = longAt(segmentWordArray + BaseHeaderSize);
if (!(((data & 0xFFFF) == (imageFormatVersion()))
- || ((!0)
- && ((data & 0xFFFF) == ((BytesPerWord == 4
+ || ((data & 0xFFFF) == ((BytesPerWord == 4
? 6504
- : 68002)))))) {
+ : 68002))))) {
/* low 2 bytes */
/* Still NG -- put things back and fail */
@@ -41993,8 +41989,7 @@
if (fmt1 <= 4) {
if (fmt1 >= 3) {
if (fmt1 == 4) {
- if (1
- && (GIV(weakRootCount) >= 0)) {
+ if (GIV(weakRootCount) >= 0) {
/* And remember as weak root */
@@ -43900,10 +43895,9 @@
sqImageFileSeek(f, imageOffset);
version = (firstVersion = getWord32FromFileswap(f, 0));
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 0;
}
sqImageFileSeek(f, imageOffset);
@@ -43912,10 +43906,9 @@
sqImageFileRead((&w2), sizeof(int), 1, f);
version = byteSwapped(w2);
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 1;
}
if (imageOffset == 0) {
@@ -43928,10 +43921,9 @@
sqImageFileRead((&w), sizeof(int), 1, f);
version = w;
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 0;
}
sqImageFileSeek(f, 512);
@@ -43940,10 +43932,9 @@
sqImageFileRead((&w1), sizeof(int), 1, f);
version = byteSwapped(w1);
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 1;
}
}
@@ -46061,10 +46052,9 @@
ctxtOrNilOrZero = 0;
goto l1;
}
- if (!((198 == 0)
- || (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
+ if (!(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
- : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)))) {
+ : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0))) {
theMethod1 = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
? ((mframeHomeMethod(theFP))->methodObject)
: longAt(theFP + FoxMethod));
@@ -48675,13 +48665,11 @@
&& (((fieldOop = longAt((objOop + BaseHeaderSize) + (SuperclassIndex << (shiftForWord())))),
(((fieldOop & 1) == 0)
&& ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
- || (0
- && (isPointers(followForwarded(fieldOop))))))
+ || (0)))
&& (((fieldOop = longAt((objOop + BaseHeaderSize) + (MethodDictionaryIndex << (shiftForWord())))),
(((fieldOop & 1) == 0)
&& ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
- || (0
- && (isPointers(followForwarded(fieldOop))))))
+ || (0)))
&& (((longAt((objOop + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) & 1)))))));
}
@@ -49119,13 +49107,12 @@
&& (((((usqInt)anObject)) >= (startOfMemory()))
&& (((((usqInt)anObject)) < GIV(freeStart))
&& (((longAt(anObject)) & TypeMask) != HeaderTypeGC)))))
- && ((!0)
&& (addressCouldBeClassObj((classObj = ((anObject & 1)
? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << (shiftForWord())))
: (((ccIndex = (((usqInt) (longAt(anObject))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(anObject - BaseHeaderSize)) & AllButTypeMask
: (/* begin fetchPointer:ofObject: */
- longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord()))))))))))) {
+ longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord())))))))))) {
if ((classObj == methClass)
|| ((methClass == null)
|| (methClass == GIV(nilObj)))) {
@@ -51139,10 +51126,9 @@
readableFormat(sqInt imageVersion)
{
return (imageVersion == (imageFormatVersion()))
- || ((!0)
- && (imageVersion == ((BytesPerWord == 4
+ || (imageVersion == ((BytesPerWord == 4
? 6504
- : 68002))));
+ : 68002)));
}
@@ -54560,10 +54546,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer1)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -55056,10 +55041,9 @@
handlerOrNilOrZero = 0;
goto l1;
}
- if (!((198 == 0)
- || (((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
+ if (!(((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
- : (byteAt((theFP1 + FoxIFrameFlags) + 3)) != 0)))) {
+ : (byteAt((theFP1 + FoxIFrameFlags) + 3)) != 0))) {
theMethod = ((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
? ((mframeHomeMethod(theFP1))->methodObject)
: longAt(theFP1 + FoxMethod));
Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nscogsrc/vm/cointerp.h 2015-01-15 21:47:03 UTC (rev 3230)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
*/
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2015-01-15 21:47:03 UTC (rev 3230)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
from
- CoInterpreter VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5
+ CoInterpreter VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -224,7 +224,6 @@
#define HashBits 0x1FFE0000
#define HashBitsOffset 17
#define HashMaskUnshifted 0xFFF
-#define HeaderFlagBitPosition 29
#define HeaderIndex 0
#define HeaderTypeClass 1
#define HeaderTypeFree 2
@@ -264,6 +263,7 @@
#define MethodCacheSize 4096
#define MethodDictionaryIndex 1
#define MethodHeaderArgCountShift 25
+#define MethodHeaderFlagBitPosition 29
#define MethodHeaderTempCountShift 19
#define MethodIndex 3
#define MFMethodFlagHasContextFlag 1
@@ -1387,6 +1387,7 @@
_iss usqLong nextWakeupUsecs;
_iss sqInt statMarkCount;
_iss sqInt cogCompiledCodeCompactionCalledFor;
+_iss sqInt flagInterpretedMethods;
_iss sqInt gcMode;
_iss sqInt highestRunnableProcessPriority;
_iss sqInt lastCoggableInterpretedBlockMethod;
@@ -1403,7 +1404,6 @@
_iss sqInt cogCodeSize;
_iss usqInt compEnd;
_iss sqInt externalPrimitiveTableFirstFreeIndex;
-_iss sqInt flagInterpretedMethods;
_iss sqInt thisClassIndex;
_iss sqInt edenBytes;
_iss usqInt fwdTableLast;
@@ -2104,7 +2104,7 @@
/* 575 */ (void (*)(void))0,
0 };
char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1017";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1022";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -4844,6 +4844,7 @@
GIV(framePointer) = localFP;
ceEnterCogCodePopReceiverReg();
+ null;
goto l300;
}
localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4861,7 +4862,7 @@
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- /* return self */
+ null;
l300: /* end baseFrameReturn */;
goto l299;
}
@@ -5334,10 +5335,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -7964,7 +7964,7 @@
/* bytecodePrimBitShift */
{
sqInt integerArgument;
- sqLong integerReceiver;
+ usqInt integerReceiver;
sqInt shifted;
char *sp;
@@ -8024,7 +8024,7 @@
null;
goto l108;
}
- shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+ shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
}
shifted = positive32BitIntegerFor(shifted);
/* begin pop:thenPush: */
@@ -10918,7 +10918,7 @@
/* bytecodePrimBitShift */
{
sqInt integerArgument;
- sqLong integerReceiver;
+ usqInt integerReceiver;
sqInt shifted;
char *sp;
@@ -10978,7 +10978,7 @@
null;
goto l243;
}
- shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+ shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
}
shifted = positive32BitIntegerFor(shifted);
/* begin pop:thenPush: */
@@ -13858,9 +13858,7 @@
char *sp1;
char *sp2;
- assert(((numRegArgs()) > 0)
- && (((numRegArgs()) <= 2)
- && (((cogMethod->cmNumArgs)) <= (numRegArgs()))));
+ assert(((cogMethod->cmNumArgs)) <= (numRegArgs()));
if (((cogMethod->cmNumArgs)) == 2) {
longAtput(GIV(stackPointer) + (3 * BytesPerWord), longAt(GIV(stackPointer)));
/* begin push: */
@@ -15337,11 +15335,10 @@
|| (((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) >= 12))) {
return 1;
}
- hasYoung = (!0)
- && (isYoungObject((((ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F)) == 0
+ hasYoung = isYoungObject((((ccIndex = (((usqInt) (longAt(oop))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(oop - BaseHeaderSize)) & AllButTypeMask
: (/* begin fetchPointer:ofObject: */
- longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord())))))));
+ longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord()))))));
if (((((usqInt) (longAt(oop))) >> (instFormatFieldLSB())) & 15) >= 12) {
i = ((literalCountOfMethodHeader(methodHeaderOf(oop))) + LiteralStart) - 1;
}
@@ -17059,10 +17056,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -17693,6 +17689,13 @@
return ((SelectorCannotInterpret < SelectorDoesNotUnderstand) ? SelectorDoesNotUnderstand : SelectorCannotInterpret);
}
+
+/* In the Sista VM the flag bit in the method header is taken to identify
+ optimized methods.
+ In other VMs it can be used to flag methods that are interpreted, if it
+ has been requested
+ from the image header flags. */
+
static void
maybeFlagMethodAsInterpreted(sqInt aMethod)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
@@ -17704,7 +17707,7 @@
realHeader = (isCogMethodReference(rawHeader)
? ((((CogMethod *) rawHeader))->methodHeader)
: rawHeader);
- realHeader = realHeader | ((((1 << HeaderFlagBitPosition) << 1) | 1));
+ realHeader = realHeader | ((((1 << MethodHeaderFlagBitPosition) << 1) | 1));
if (isCogMethodReference(rawHeader)) {
((((CogMethod *) rawHeader))->methodHeader = realHeader);
}
@@ -19191,6 +19194,7 @@
GIV(flagInterpretedMethods) = (headerFlags & 8) != 0;
GIV(preemptionYields) = (headerFlags & 16) == 0;
GIV(noThreadingOfGUIThread) = (headerFlags & 32) != 0;
+
/* begin getWord32FromFile:swap: */
w5 = 0;
sqImageFileRead((&w5), sizeof(int), 1, f);
@@ -19300,30 +19304,25 @@
initializeObjectMemory(bytesToShift);
/* begin checkAssumedCompactClasses */
/* begin checkCompactIndex:isClass:named: */
- if ((ClassArrayCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << (shiftForWord())))) != (fetchPointerofObject(ClassArrayCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << (shiftForWord())))) != (fetchPointerofObject(ClassArrayCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("Array");
}
/* begin checkCompactIndex:isClass:named: */
- if ((ClassLargeNegativeIntegerCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargeNegativeInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargeNegativeIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargeNegativeInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargeNegativeIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("LargeNegativeInteger");
}
/* begin checkCompactIndex:isClass:named: */
- if ((ClassLargePositiveIntegerCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargePositiveIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << (shiftForWord())))) != (fetchPointerofObject(ClassLargePositiveIntegerCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("LargePositiveInteger");
}
/* begin checkCompactIndex:isClass:named: */
- if ((ClassFloatCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())))) != (fetchPointerofObject(ClassFloatCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassFloat << (shiftForWord())))) != (fetchPointerofObject(ClassFloatCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("Float");
}
/* begin checkCompactIndex:isClass:named: */
;
/* begin checkCompactIndex:isClass:named: */
- if ((ClassMethodContextCompactIndex != 0)
- && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMethodContext << (shiftForWord())))) != (fetchPointerofObject(ClassMethodContextCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord()))))))) {
+ if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMethodContext << (shiftForWord())))) != (fetchPointerofObject(ClassMethodContextCompactIndex - 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))))) {
invalidCompactClassError("MethodContext");
}
GIV(classByteArrayCompactIndex) = compactIndexOfClass(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassByteArray << (shiftForWord()))));
@@ -20240,10 +20239,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -24428,7 +24426,7 @@
primitiveBitShift(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt integerArgument;
- sqLong integerReceiver;
+ usqInt integerReceiver;
sqInt shifted;
char *sp;
@@ -24475,7 +24473,7 @@
}
return;
}
- shifted = ((unsigned sqLong)integerReceiver) >> (0 - integerArgument);
+ shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
}
shifted = positive32BitIntegerFor(shifted);
/* begin pop:thenPush: */
@@ -37373,10 +37371,9 @@
endSeg = (segmentWordArray + (sizeBitsOf(segmentWordArray))) - BaseHeaderSize;
data = longAt(segmentWordArray + BaseHeaderSize);
if (!(((data & 0xFFFF) == (imageFormatVersion()))
- || ((!0)
- && ((data & 0xFFFF) == ((BytesPerWord == 4
+ || ((data & 0xFFFF) == ((BytesPerWord == 4
? 6504
- : 68002)))))) {
+ : 68002))))) {
/* low 2 bytes */
/* Not readable -- try again with reversed bytes... */
@@ -37389,10 +37386,9 @@
}
data = longAt(segmentWordArray + BaseHeaderSize);
if (!(((data & 0xFFFF) == (imageFormatVersion()))
- || ((!0)
- && ((data & 0xFFFF) == ((BytesPerWord == 4
+ || ((data & 0xFFFF) == ((BytesPerWord == 4
? 6504
- : 68002)))))) {
+ : 68002))))) {
/* low 2 bytes */
/* Still NG -- put things back and fail */
@@ -42002,8 +41998,7 @@
if (fmt1 <= 4) {
if (fmt1 >= 3) {
if (fmt1 == 4) {
- if (1
- && (GIV(weakRootCount) >= 0)) {
+ if (GIV(weakRootCount) >= 0) {
/* And remember as weak root */
@@ -43909,10 +43904,9 @@
sqImageFileSeek(f, imageOffset);
version = (firstVersion = getWord32FromFileswap(f, 0));
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 0;
}
sqImageFileSeek(f, imageOffset);
@@ -43921,10 +43915,9 @@
sqImageFileRead((&w2), sizeof(int), 1, f);
version = byteSwapped(w2);
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 1;
}
if (imageOffset == 0) {
@@ -43937,10 +43930,9 @@
sqImageFileRead((&w), sizeof(int), 1, f);
version = w;
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 0;
}
sqImageFileSeek(f, 512);
@@ -43949,10 +43941,9 @@
sqImageFileRead((&w1), sizeof(int), 1, f);
version = byteSwapped(w1);
if ((version == (imageFormatVersion()))
- || ((!0)
- && (version == ((BytesPerWord == 4
+ || (version == ((BytesPerWord == 4
? 6504
- : 68002))))) {
+ : 68002)))) {
return 1;
}
}
@@ -46070,10 +46061,9 @@
ctxtOrNilOrZero = 0;
goto l1;
}
- if (!((198 == 0)
- || (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
+ if (!(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
- : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)))) {
+ : (byteAt((theFP + FoxIFrameFlags) + 3)) != 0))) {
theMethod1 = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
? ((mframeHomeMethod(theFP))->methodObject)
: longAt(theFP + FoxMethod));
@@ -48684,13 +48674,11 @@
&& (((fieldOop = longAt((objOop + BaseHeaderSize) + (SuperclassIndex << (shiftForWord())))),
(((fieldOop & 1) == 0)
&& ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
- || (0
- && (isPointers(followForwarded(fieldOop))))))
+ || (0)))
&& (((fieldOop = longAt((objOop + BaseHeaderSize) + (MethodDictionaryIndex << (shiftForWord())))),
(((fieldOop & 1) == 0)
&& ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
- || (0
- && (isPointers(followForwarded(fieldOop))))))
+ || (0)))
&& (((longAt((objOop + BaseHeaderSize) + (InstanceSpecificationIndex << (shiftForWord())))) & 1)))))));
}
@@ -49128,13 +49116,12 @@
&& (((((usqInt)anObject)) >= (startOfMemory()))
&& (((((usqInt)anObject)) < GIV(freeStart))
&& (((longAt(anObject)) & TypeMask) != HeaderTypeGC)))))
- && ((!0)
&& (addressCouldBeClassObj((classObj = ((anObject & 1)
? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << (shiftForWord())))
: (((ccIndex = (((usqInt) (longAt(anObject))) >> (compactClassFieldLSB())) & 0x1F)) == 0
? (longAt(anObject - BaseHeaderSize)) & AllButTypeMask
: (/* begin fetchPointer:ofObject: */
- longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord()))))))))))) {
+ longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << (shiftForWord())))) + BaseHeaderSize) + ((ccIndex - 1) << (shiftForWord())))))))))) {
if ((classObj == methClass)
|| ((methClass == null)
|| (methClass == GIV(nilObj)))) {
@@ -51148,10 +51135,9 @@
readableFormat(sqInt imageVersion)
{
return (imageVersion == (imageFormatVersion()))
- || ((!0)
- && (imageVersion == ((BytesPerWord == 4
+ || (imageVersion == ((BytesPerWord == 4
? 6504
- : 68002))));
+ : 68002)));
}
@@ -54569,10 +54555,9 @@
GIV(primFailCode) = PrimErrWritePastObject;
}
}
- if (FailImbalancedPrimitives
- && ((!GIV(primFailCode))
+ if ((!GIV(primFailCode))
&& ((GIV(framePointer) == savedFramePointer1)
- && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))))) {
+ && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {
/* Don't fail if primitive has done something radical, e.g. perform: */
@@ -55065,10 +55050,9 @@
handlerOrNilOrZero = 0;
goto l1;
}
- if (!((198 == 0)
- || (((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
+ if (!(((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
- : (byteAt((theFP1 + FoxIFrameFlags) + 3)) != 0)))) {
+ : (byteAt((theFP1 + FoxIFrameFlags) + 3)) != 0))) {
theMethod = ((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
? ((mframeHomeMethod(theFP1))->methodObject)
: longAt(theFP1 + FoxMethod));
Modified: branches/Cog/nsspursrc/vm/cogit.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.c 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nsspursrc/vm/cogit.c 2015-01-15 21:47:03 UTC (rev 3230)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286
+ CCodeGenerator VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286
+ StackToRegisterMappingCogit VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -8674,9 +8674,8 @@
if ((((cPIC->cPICNumCases)) >= numPICCases)
|| (((errorSelectorOrNil != null)
&& (errorSelectorOrNil != SelectorDoesNotUnderstand))
- || ((inlineCacheTagIsYoung(cacheTag))
|| ((newTargetMethodOrNil == null)
- || (isYoung(newTargetMethodOrNil)))))) {
+ || (isYoung(newTargetMethodOrNil))))) {
result = patchToOpenPICFornumArgsreceiver((cPIC->selector), (cPIC->cmNumArgs), receiver);
assert(!result);
return ceSendFromInLineCacheMiss(cPIC);
@@ -8710,10 +8709,8 @@
rcvrClass = fetchClassOf(receiver);
cogMethod = mframeHomeMethodExport();
if (!((cogMethod->cmRefersToYoung))) {
- if (((inlineCacheTagsMayBeObjects())
- && (isYoung(rcvrClass)))
- || ((mixin != receiver)
- && (isYoung(mixin)))) {
+ if ((mixin != receiver)
+ && (isYoung(mixin))) {
ensureInYoungReferrers(cogMethod);
}
}
@@ -8826,10 +8823,9 @@
cacheTag = inlineCacheTagForInstance(receiver);
if (((errorSelectorOrNil != null)
&& (errorSelectorOrNil != SelectorDoesNotUnderstand))
- || ((inlineCacheTagIsYoung(cacheTag))
|| (((inlineCacheTagAt(backEnd, outerReturn)) == 0)
|| ((newTargetMethodOrNil == null)
- || (isYoung(newTargetMethodOrNil)))))) {
+ || (isYoung(newTargetMethodOrNil))))) {
result = patchToOpenPICFornumArgsreceiver((targetMethod->selector), (targetMethod->cmNumArgs), receiver);
assert(!result);
return ceSendFromInLineCacheMiss(targetMethod);
@@ -8913,11 +8909,10 @@
are markable/remappable objects. */
entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- tagCouldBeObj = (inlineCacheTagsMayBeObjects())
- || ((entryPoint1 < methodZoneBase)
+ tagCouldBeObj = (entryPoint1 < methodZoneBase)
|| (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment)
|| (((entryPoint1 & entryPointMask) == checkedEntryAlignment)
- && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))));
+ && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC)));
if (tagCouldBeObj) {
if (couldBeObject(cacheTag1)) {
if (!(asserta(checkValidOopReference(cacheTag1)))) {
@@ -12640,11 +12635,10 @@
are markable/remappable objects. */
entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- tagCouldBeObj1 = (inlineCacheTagsMayBeObjects())
- || ((entryPoint1 < methodZoneBase)
+ tagCouldBeObj1 = (entryPoint1 < methodZoneBase)
|| (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment)
|| (((entryPoint1 & entryPointMask) == checkedEntryAlignment)
- && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))));
+ && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC)));
if (tagCouldBeObj1) {
if (markAndTraceCacheTagLiteralinatpc(cacheTag1, ((CogMethod *) cogMethod), ((usqInt)mcpc))) {
codeModified = 1;
@@ -12725,8 +12719,7 @@
# if NewspeakVM
indexOfIRC = (theIRCs = 0);
- if (1
- && (numIRCs > 0)) {
+ if (numIRCs > 0) {
assert((noAssertMethodClassAssociationOf(methodObj)) != (nilObject()));
/* begin allocateNPinnedSlots: */
objOop = allocatePinnedSlots(numIRCs * NumOopsPerIRC);
@@ -13501,8 +13494,7 @@
static sqInt
processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
{
- return (processorHasDivQuoRem(ignoredPrimIndex))
- && (mclassIsSmallInteger(ignoredPrimIndex));
+ return mclassIsSmallInteger(ignoredPrimIndex);
}
static sqInt
@@ -13520,8 +13512,7 @@
static sqInt
processorHasMultiplyAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
{
- return (processorHasMultiply(ignoredPrimIndex))
- && (mclassIsSmallInteger(ignoredPrimIndex));
+ return mclassIsSmallInteger(ignoredPrimIndex);
}
static sqInt
@@ -13816,11 +13807,10 @@
are markable/remappable objects. */
entryPoint1 = callTargetFromReturnAddress(backEnd, ((sqInt)mcpc));
- tagCouldBeObj1 = (inlineCacheTagsMayBeObjects())
- || ((entryPoint1 < methodZoneBase)
+ tagCouldBeObj1 = (entryPoint1 < methodZoneBase)
|| (((entryPoint1 & entryPointMask) == uncheckedEntryAlignment)
|| (((entryPoint1 & entryPointMask) == checkedEntryAlignment)
- && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC))));
+ && ((((((CogMethod *) (entryPoint1 - cmEntryOffset)))->cmType)) == CMOpenPIC)));
if (tagCouldBeObj1
&& (couldBeObject(cacheTag1))) {
mappedCacheTag = remapObject(cacheTag1);
@@ -14907,8 +14897,7 @@
if ((((sqInt)(rawHeaderOf((cogMethod->methodObject))))) == (((sqInt)cogMethod))) {
rawHeaderOfput((cogMethod->methodObject), (cogMethod->methodHeader));
- if (1
- && (((cogMethod->nextMethodOrIRCs)) != 0)) {
+ if (((cogMethod->nextMethodOrIRCs)) != 0) {
/* begin freeIRCs: */
maybeIRCs = (cogMethod->nextMethodOrIRCs);
if (oopisGreaterThan(maybeIRCs, nilObject())) {
@@ -15418,8 +15407,7 @@
static void
genConvertCharacterToSmallIntegerInReg(sqInt reg)
{
- assert(((characterTag()) == 2)
- && (((numCharacterBits()) + 1) == (numSmallIntegerBits())));
+ assert(((numCharacterBits()) + 1) == (numSmallIntegerBits()));
/* begin LogicalShiftRightCq:R: */
genoperandoperand(LogicalShiftRightCqR, 1, reg);
}
@@ -15452,8 +15440,7 @@
static void
genConvertSmallIntegerToCharacterInReg(sqInt reg)
{
- assert(((characterTag()) == 2)
- && (((numCharacterBits()) + 1) == (numSmallIntegerBits())));
+ assert(((numCharacterBits()) + 1) == (numSmallIntegerBits()));
/* begin LogicalShiftLeftCq:R: */
genoperandoperand(LogicalShiftLeftCqR, 1, reg);
}
@@ -18148,7 +18135,7 @@
/* begin JumpNonZero: */
jmpAlreadyRemembered = genoperand(JumpNonZero, ((sqInt)0));
assert(destReg == ReceiverResultReg);
- CallRTregistersToBeSavedMask(ceStoreCheckTrampoline, (registerMaskFor(valueReg)) & (callerSavedRegMask()));
+ CallRTregistersToBeSavedMask(ceStoreCheckTrampoline, (registerMaskFor(valueReg)) | (callerSavedRegMask()));
jmpTarget(jmpImmediate, jmpTarget(jmpDestYoung, jmpTarget(jmpSourceOld, jmpTarget(jmpAlreadyRemembered, gLabel()))));
return 0;
}
@@ -20635,8 +20622,7 @@
if (numCleanBlocks > 0) {
addCleanBlockStarts();
}
- if (!(1
- && (maybeAllocAndInitIRCs()))) {
+ if (!(maybeAllocAndInitIRCs())) {
/* Inaccurate error code, but it'll do. This will likely never fail. */
@@ -23722,8 +23708,7 @@
if ((methodOrBlockNumArgs <= 2)
&& (methodOrBlockNumArgs > 0)) {
regsSet = regsSet | (registerMaskFor(Arg0Reg));
- if ((2 > 1)
- && (methodOrBlockNumArgs > 1)) {
+ if (methodOrBlockNumArgs > 1) {
regsSet = regsSet | (registerMaskFor(Arg1Reg));
}
}
@@ -23778,8 +23763,7 @@
}
else {
if (numArgs > 0) {
- if ((2 > 1)
- && (numArgs > 1)) {
+ if (numArgs > 1) {
ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 2);
ssAllocateRequiredRegupThrough(Arg1Reg, simStackPtr - 1);
}
@@ -23787,8 +23771,7 @@
ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 1);
}
}
- if ((2 > 1)
- && (numArgs > 1)) {
+ if (numArgs > 1) {
popToReg(simStackAt(simStackPtr), Arg1Reg);
}
if (numArgs > 0) {
@@ -23842,8 +23825,7 @@
Also check for any arg registers in use by other args. */
if (numArgs > 0) {
- if ((2 > 1)
- && (numArgs > 1)) {
+ if (numArgs > 1) {
ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 2);
ssAllocateRequiredRegupThrough(Arg1Reg, simStackPtr - 1);
}
@@ -23851,8 +23833,7 @@
ssAllocateRequiredRegupThrough(Arg0Reg, simStackPtr - 1);
}
}
- if ((2 > 1)
- && (numArgs > 1)) {
+ if (numArgs > 1) {
popToReg(simStackAt(simStackPtr), Arg1Reg);
}
if (numArgs > 0) {
Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nsspursrc/vm/cogit.h 2015-01-15 21:47:03 UTC (rev 3230)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.1016 uuid: 656d7591-7ea4-4c5f-9d13-c6a0bd8b8286
+ CCodeGenerator VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
*/
Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c 2015-01-15 00:03:32 UTC (rev 3229)
+++ branches/Cog/nsspursrc/vm/cointerp.c 2015-01-15 21:47:03 UTC (rev 3230)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1017 uuid: 5684df46-8489-43e5-b2ac-6406ef739cf5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1022 uuid: 69a59ffb-cfbd-4b9e-af74-7c2eb662beac
from
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list