[Vm-dev] [commit][3118] CogVM source as per VMMaker.oscog-eem.915
commits at squeakvm.org
commits at squeakvm.org
Fri Oct 31 00:33:10 UTC 2014
Revision: 3118
Author: eliot
Date: 2014-10-30 17:33:06 -0700 (Thu, 30 Oct 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.915
Spur: Fix processWeakSurvivor: so that it answers whether a weak object refers
to a young object. The old version only scanned weak fields, igoring refs to
young objs from strong fields.
Move check for valid classes from findClassOfMethod: forReceiver: into
findClassContainingMethod:startingAt:, hence making
findClassOfMethod:forReceiver: et al more robust.
Modified Paths:
--------------
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/spursistasrc/vm/cointerp.c
branches/Cog/spursistasrc/vm/cointerp.h
branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/nsspursrc/vm/cointerp.c 2014-10-31 00:33:06 UTC (rev 3118)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
from
- CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -966,7 +966,6 @@
sqInt firstShortFormat(void);
sqInt fixedFieldsFieldWidth(void);
sqInt fixedFieldsOfClassFormatMask(void);
-static sqInt fixedFieldsOfClassFormat(sqInt classFormat) NoDbgRegParms;
static sqInt fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength) NoDbgRegParms;
static sqInt fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue) NoDbgRegParms NeverInline;
static sqInt followFieldofObject(sqInt fieldIndex, sqInt anObject) NoDbgRegParms;
@@ -1548,8 +1547,8 @@
_iss sqInt rememberedSetSize;
_iss sqInt * rememberedSet;
_iss usqInt freeListsMask;
-_iss sqInt classTableFirstPage;
_iss sqInt profileProcess;
+_iss sqInt classTableFirstPage;
_iss sqInt longRunningPrimitiveCheckSemaphore;
_iss sqInt profileSemaphore;
_iss SpurContiguousObjStack unscannedEphemerons;
@@ -2338,7 +2337,7 @@
/*540*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.914";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.915";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -42649,9 +42648,14 @@
static sqInt
processWeakSurvivor(sqInt weakObj)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt classFormat;
+ sqInt classIndex;
+ sqInt classPointer;
+ sqInt classTablePage;
sqInt hasYoungReferents;
sqInt i;
sqInt iLimiT;
+ sqInt numStrongSlots;
sqInt referent;
sqInt referent1;
sqInt weakObjShouldMourn;
@@ -42660,7 +42664,41 @@
/* N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0 - 1 going +ve */
weakObjShouldMourn = (hasYoungReferents = 0);
- for (i = (fixedFieldsOfClassFormat(formatOfClass(fetchClassOfNonImm(weakObj)))), iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
+ /* begin fixedFieldsOfClassFormat: */
+ /* begin formatOfClass: */
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(weakObj)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ classPointer = weakObj;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ classPointer = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
+l1: /* end fetchClassOfNonImm: */;
+ classFormat = ((longAt((classPointer + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1);
+ numStrongSlots = classFormat & ((1 << 16) - 1);
+ for (i = 0; i < numStrongSlots; i += 1) {
+ referent = longAt((weakObj + BaseHeaderSize) + (i << 2));
+ if (((referent & 3) == 0)
+ && (isYoungObject(referent))) {
+ hasYoungReferents = 1;
+ }
+ }
+ for (i = numStrongSlots, iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
/* Referent could be forwarded due to scavenging or a become:, don't assume. */
@@ -48672,12 +48710,6 @@
}
static sqInt
-fixedFieldsOfClassFormat(sqInt classFormat)
-{
- return classFormat & ((1 << 16) - 1);
-}
-
-static sqInt
fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt class;
@@ -65472,6 +65504,9 @@
}
do {
assert(!(isForwarded(currClass)));
+ if (!(addressCouldBeClassObj(currClass))) {
+ return GIV(nilObj);
+ }
/* begin noFixupFollowField:ofObject: */
objOop1 = longAt((currClass + BaseHeaderSize) + (MethodDictionaryIndex << 2));
if (((objOop1 & 3) == 0)
@@ -65539,59 +65574,21 @@
sqInt
findClassOfMethodforReceiver(sqInt meth, sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
- sqInt classTablePage;
- sqInt mclass;
sqInt rclass;
- sqInt tagBits;
if ((((rcvr & 3) != 0)
|| (addressCouldBeObj(rcvr)))
&& (!(((rcvr & 3) == 0)
&& (((longAt(rcvr)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = rcvr & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l1;
+ rclass = findClassContainingMethodstartingAt(meth, fetchClassOf(rcvr));
+ if (rclass != GIV(nilObj)) {
+ return rclass;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(rcvr)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = rcvr;
- goto l1;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l1;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l1;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l1: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(meth, rclass);
- if (rclass != GIV(nilObj)) {
- return rclass;
- }
- }
}
if (!((addressCouldBeObj(meth))
&& (((((usqInt) (longAt(meth))) >> 24) & 0x1F) >= 24))) {
return GIV(nilObj);
}
- mclass = safeMethodClassOf(meth);
- if (addressCouldBeClassObj(mclass)) {
- return GIV(nilObj);
- }
return findClassContainingMethodstartingAt(meth, safeMethodClassOf(meth));
}
@@ -69075,14 +69072,10 @@
static void
printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
sqInt classObj;
- sqInt classTablePage;
- sqInt mclass;
sqInt methClass;
sqInt methodSel;
sqInt rclass;
- sqInt tagBits;
if (isBlock) {
print("[] in ");
@@ -69092,52 +69085,17 @@
|| (addressCouldBeObj(anObject)))
&& (!(((anObject & 3) == 0)
&& (((longAt(anObject)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = anObject & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l2;
+ rclass = findClassContainingMethodstartingAt(aMethod, fetchClassOf(anObject));
+ if (rclass != GIV(nilObj)) {
+ methClass = rclass;
+ goto l1;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(anObject)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = anObject;
- goto l2;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l2;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l2;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l2: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(aMethod, rclass);
- if (rclass != GIV(nilObj)) {
- methClass = rclass;
- goto l1;
- }
- }
}
if (!((addressCouldBeObj(aMethod))
&& (((((usqInt) (longAt(aMethod))) >> 24) & 0x1F) >= 24))) {
methClass = GIV(nilObj);
goto l1;
}
- mclass = safeMethodClassOf(aMethod);
- if (addressCouldBeClassObj(mclass)) {
- methClass = GIV(nilObj);
- goto l1;
- }
methClass = findClassContainingMethodstartingAt(aMethod, safeMethodClassOf(aMethod));
l1: /* end findClassOfMethod:forReceiver: */;
methodSel = findSelectorOfMethod(aMethod);
Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/nsspursrc/vm/cointerp.h 2014-10-31 00:33:06 UTC (rev 3118)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2014-10-31 00:33:06 UTC (rev 3118)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
from
- CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -969,7 +969,6 @@
sqInt firstShortFormat(void);
sqInt fixedFieldsFieldWidth(void);
sqInt fixedFieldsOfClassFormatMask(void);
-static sqInt fixedFieldsOfClassFormat(sqInt classFormat) NoDbgRegParms;
static sqInt fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength) NoDbgRegParms;
static sqInt fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue) NoDbgRegParms NeverInline;
static sqInt followFieldofObject(sqInt fieldIndex, sqInt anObject) NoDbgRegParms;
@@ -1551,8 +1550,8 @@
_iss sqInt rememberedSetSize;
_iss sqInt * rememberedSet;
_iss usqInt freeListsMask;
-_iss sqInt classTableFirstPage;
_iss sqInt profileProcess;
+_iss sqInt classTableFirstPage;
_iss sqInt longRunningPrimitiveCheckSemaphore;
_iss sqInt profileSemaphore;
_iss SpurContiguousObjStack unscannedEphemerons;
@@ -2341,7 +2340,7 @@
/*540*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.914";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.915";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -42658,9 +42657,14 @@
static sqInt
processWeakSurvivor(sqInt weakObj)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt classFormat;
+ sqInt classIndex;
+ sqInt classPointer;
+ sqInt classTablePage;
sqInt hasYoungReferents;
sqInt i;
sqInt iLimiT;
+ sqInt numStrongSlots;
sqInt referent;
sqInt referent1;
sqInt weakObjShouldMourn;
@@ -42669,7 +42673,41 @@
/* N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0 - 1 going +ve */
weakObjShouldMourn = (hasYoungReferents = 0);
- for (i = (fixedFieldsOfClassFormat(formatOfClass(fetchClassOfNonImm(weakObj)))), iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
+ /* begin fixedFieldsOfClassFormat: */
+ /* begin formatOfClass: */
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(weakObj)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ classPointer = weakObj;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ classPointer = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
+l1: /* end fetchClassOfNonImm: */;
+ classFormat = ((longAt((classPointer + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1);
+ numStrongSlots = classFormat & ((1 << 16) - 1);
+ for (i = 0; i < numStrongSlots; i += 1) {
+ referent = longAt((weakObj + BaseHeaderSize) + (i << 2));
+ if (((referent & 3) == 0)
+ && (isYoungObject(referent))) {
+ hasYoungReferents = 1;
+ }
+ }
+ for (i = numStrongSlots, iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
/* Referent could be forwarded due to scavenging or a become:, don't assume. */
@@ -48681,12 +48719,6 @@
}
static sqInt
-fixedFieldsOfClassFormat(sqInt classFormat)
-{
- return classFormat & ((1 << 16) - 1);
-}
-
-static sqInt
fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt class;
@@ -65481,6 +65513,9 @@
}
do {
assert(!(isForwarded(currClass)));
+ if (!(addressCouldBeClassObj(currClass))) {
+ return GIV(nilObj);
+ }
/* begin noFixupFollowField:ofObject: */
objOop1 = longAt((currClass + BaseHeaderSize) + (MethodDictionaryIndex << 2));
if (((objOop1 & 3) == 0)
@@ -65548,59 +65583,21 @@
sqInt
findClassOfMethodforReceiver(sqInt meth, sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
- sqInt classTablePage;
- sqInt mclass;
sqInt rclass;
- sqInt tagBits;
if ((((rcvr & 3) != 0)
|| (addressCouldBeObj(rcvr)))
&& (!(((rcvr & 3) == 0)
&& (((longAt(rcvr)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = rcvr & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l1;
+ rclass = findClassContainingMethodstartingAt(meth, fetchClassOf(rcvr));
+ if (rclass != GIV(nilObj)) {
+ return rclass;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(rcvr)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = rcvr;
- goto l1;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l1;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l1;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l1: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(meth, rclass);
- if (rclass != GIV(nilObj)) {
- return rclass;
- }
- }
}
if (!((addressCouldBeObj(meth))
&& (((((usqInt) (longAt(meth))) >> 24) & 0x1F) >= 24))) {
return GIV(nilObj);
}
- mclass = safeMethodClassOf(meth);
- if (addressCouldBeClassObj(mclass)) {
- return GIV(nilObj);
- }
return findClassContainingMethodstartingAt(meth, safeMethodClassOf(meth));
}
@@ -69084,14 +69081,10 @@
static void
printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
sqInt classObj;
- sqInt classTablePage;
- sqInt mclass;
sqInt methClass;
sqInt methodSel;
sqInt rclass;
- sqInt tagBits;
if (isBlock) {
print("[] in ");
@@ -69101,52 +69094,17 @@
|| (addressCouldBeObj(anObject)))
&& (!(((anObject & 3) == 0)
&& (((longAt(anObject)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = anObject & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l2;
+ rclass = findClassContainingMethodstartingAt(aMethod, fetchClassOf(anObject));
+ if (rclass != GIV(nilObj)) {
+ methClass = rclass;
+ goto l1;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(anObject)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = anObject;
- goto l2;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l2;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l2;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l2: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(aMethod, rclass);
- if (rclass != GIV(nilObj)) {
- methClass = rclass;
- goto l1;
- }
- }
}
if (!((addressCouldBeObj(aMethod))
&& (((((usqInt) (longAt(aMethod))) >> 24) & 0x1F) >= 24))) {
methClass = GIV(nilObj);
goto l1;
}
- mclass = safeMethodClassOf(aMethod);
- if (addressCouldBeClassObj(mclass)) {
- methClass = GIV(nilObj);
- goto l1;
- }
methClass = findClassContainingMethodstartingAt(aMethod, safeMethodClassOf(aMethod));
l1: /* end findClassOfMethod:forReceiver: */;
methodSel = findSelectorOfMethod(aMethod);
Modified: branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2014-10-31 00:33:06 UTC (rev 3118)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
from
- StackInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ StackInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -716,7 +716,6 @@
sqInt firstShortFormat(void);
sqInt fixedFieldsFieldWidth(void);
sqInt fixedFieldsOfClassFormatMask(void);
-static sqInt fixedFieldsOfClassFormat(sqInt classFormat) NoDbgRegParms;
static sqInt fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength) NoDbgRegParms;
static sqInt fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue) NoDbgRegParms NeverInline;
static sqInt followFieldofObject(sqInt fieldIndex, sqInt anObject) NoDbgRegParms;
@@ -1347,8 +1346,8 @@
_iss sqInt bytesPerPage;
_iss usqInt freeListsMask;
_iss sqInt profileProcess;
-_iss sqInt classTableFirstPage;
_iss SpurContiguousObjStack unscannedEphemerons;
+_iss sqInt classTableFirstPage;
_iss usqInt firstFreeChunk;
_iss sqInt profileMethod;
_iss StackPage * mostRecentlyUsedPage;
@@ -2086,7 +2085,7 @@
0 };
char * breakSelector;
sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.914";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.915";
volatile int sendTrace;
sqInt suppressHeartbeatFlag;
@@ -28707,9 +28706,14 @@
static sqInt
processWeakSurvivor(sqInt weakObj)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt classFormat;
+ sqInt classIndex;
+ sqInt classPointer;
+ sqInt classTablePage;
sqInt hasYoungReferents;
sqInt i;
sqInt iLimiT;
+ sqInt numStrongSlots;
sqInt referent;
sqInt referent1;
sqInt weakObjShouldMourn;
@@ -28718,7 +28722,41 @@
/* N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0 - 1 going +ve */
weakObjShouldMourn = (hasYoungReferents = 0);
- for (i = (fixedFieldsOfClassFormat(formatOfClass(fetchClassOfNonImm(weakObj)))), iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
+ /* begin fixedFieldsOfClassFormat: */
+ /* begin formatOfClass: */
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(weakObj)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ classPointer = weakObj;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ classPointer = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
+l1: /* end fetchClassOfNonImm: */;
+ classFormat = ((longAt((classPointer + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1);
+ numStrongSlots = classFormat & ((1 << 16) - 1);
+ for (i = 0; i < numStrongSlots; i += 1) {
+ referent = longAt((weakObj + BaseHeaderSize) + (i << 2));
+ if (((referent & 3) == 0)
+ && (isYoungObject(referent))) {
+ hasYoungReferents = 1;
+ }
+ }
+ for (i = numStrongSlots, iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
/* Referent could be forwarded due to scavenging or a become:, don't assume. */
@@ -34747,12 +34785,6 @@
}
static sqInt
-fixedFieldsOfClassFormat(sqInt classFormat)
-{
- return classFormat & ((1 << 16) - 1);
-}
-
-static sqInt
fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt class;
@@ -51624,6 +51656,9 @@
}
do {
assert(!(isForwarded(currClass)));
+ if (!(addressCouldBeClassObj(currClass))) {
+ return GIV(nilObj);
+ }
/* begin noFixupFollowField:ofObject: */
objOop1 = longAt((currClass + BaseHeaderSize) + (MethodDictionaryIndex << 2));
if (((objOop1 & 3) == 0)
@@ -51691,59 +51726,21 @@
sqInt
findClassOfMethodforReceiver(sqInt meth, sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
- sqInt classTablePage;
- sqInt mclass;
sqInt rclass;
- sqInt tagBits;
if ((((rcvr & 3) != 0)
|| (addressCouldBeObj(rcvr)))
&& (!(((rcvr & 3) == 0)
&& (((longAt(rcvr)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = rcvr & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l1;
+ rclass = findClassContainingMethodstartingAt(meth, fetchClassOf(rcvr));
+ if (rclass != GIV(nilObj)) {
+ return rclass;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(rcvr)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = rcvr;
- goto l1;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l1;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l1;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l1: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(meth, rclass);
- if (rclass != GIV(nilObj)) {
- return rclass;
- }
- }
}
if (!((addressCouldBeObj(meth))
&& (((((usqInt) (longAt(meth))) >> 24) & 0x1F) >= 24))) {
return GIV(nilObj);
}
- mclass = safeMethodClassOf(meth);
- if (addressCouldBeClassObj(mclass)) {
- return GIV(nilObj);
- }
return findClassContainingMethodstartingAt(meth, safeMethodClassOf(meth));
}
@@ -57452,14 +57449,10 @@
static void
printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
sqInt classObj;
- sqInt classTablePage;
- sqInt mclass;
sqInt methClass;
sqInt methodSel;
sqInt rclass;
- sqInt tagBits;
if (isBlock) {
print("[] in ");
@@ -57469,52 +57462,17 @@
|| (addressCouldBeObj(anObject)))
&& (!(((anObject & 3) == 0)
&& (((longAt(anObject)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = anObject & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l2;
+ rclass = findClassContainingMethodstartingAt(aMethod, fetchClassOf(anObject));
+ if (rclass != GIV(nilObj)) {
+ methClass = rclass;
+ goto l1;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(anObject)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = anObject;
- goto l2;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l2;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l2;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l2: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(aMethod, rclass);
- if (rclass != GIV(nilObj)) {
- methClass = rclass;
- goto l1;
- }
- }
}
if (!((addressCouldBeObj(aMethod))
&& (((((usqInt) (longAt(aMethod))) >> 24) & 0x1F) >= 24))) {
methClass = GIV(nilObj);
goto l1;
}
- mclass = safeMethodClassOf(aMethod);
- if (addressCouldBeClassObj(mclass)) {
- methClass = GIV(nilObj);
- goto l1;
- }
methClass = findClassContainingMethodstartingAt(aMethod, safeMethodClassOf(aMethod));
l1: /* end findClassOfMethod:forReceiver: */;
methodSel = findSelectorOfMethod(aMethod);
Modified: branches/Cog/nsspurstacksrc/vm/interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/interp.c 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/nsspurstacksrc/vm/interp.c 2014-10-31 00:33:06 UTC (rev 3118)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
from
- StackInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ StackInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -713,7 +713,6 @@
sqInt firstShortFormat(void);
sqInt fixedFieldsFieldWidth(void);
sqInt fixedFieldsOfClassFormatMask(void);
-static sqInt fixedFieldsOfClassFormat(sqInt classFormat) NoDbgRegParms;
static sqInt fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength) NoDbgRegParms;
static sqInt fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue) NoDbgRegParms NeverInline;
static sqInt followFieldofObject(sqInt fieldIndex, sqInt anObject) NoDbgRegParms;
@@ -1344,8 +1343,8 @@
_iss sqInt bytesPerPage;
_iss usqInt freeListsMask;
_iss sqInt profileProcess;
-_iss sqInt classTableFirstPage;
_iss SpurContiguousObjStack unscannedEphemerons;
+_iss sqInt classTableFirstPage;
_iss usqInt firstFreeChunk;
_iss sqInt profileMethod;
_iss StackPage * mostRecentlyUsedPage;
@@ -2083,7 +2082,7 @@
0 };
char * breakSelector;
sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.914";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.915";
volatile int sendTrace;
sqInt suppressHeartbeatFlag;
@@ -28698,9 +28697,14 @@
static sqInt
processWeakSurvivor(sqInt weakObj)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt classFormat;
+ sqInt classIndex;
+ sqInt classPointer;
+ sqInt classTablePage;
sqInt hasYoungReferents;
sqInt i;
sqInt iLimiT;
+ sqInt numStrongSlots;
sqInt referent;
sqInt referent1;
sqInt weakObjShouldMourn;
@@ -28709,7 +28713,41 @@
/* N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0 - 1 going +ve */
weakObjShouldMourn = (hasYoungReferents = 0);
- for (i = (fixedFieldsOfClassFormat(formatOfClass(fetchClassOfNonImm(weakObj)))), iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
+ /* begin fixedFieldsOfClassFormat: */
+ /* begin formatOfClass: */
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(weakObj)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ classPointer = weakObj;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ classPointer = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
+l1: /* end fetchClassOfNonImm: */;
+ classFormat = ((longAt((classPointer + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1);
+ numStrongSlots = classFormat & ((1 << 16) - 1);
+ for (i = 0; i < numStrongSlots; i += 1) {
+ referent = longAt((weakObj + BaseHeaderSize) + (i << 2));
+ if (((referent & 3) == 0)
+ && (isYoungObject(referent))) {
+ hasYoungReferents = 1;
+ }
+ }
+ for (i = numStrongSlots, iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
/* Referent could be forwarded due to scavenging or a become:, don't assume. */
@@ -34738,12 +34776,6 @@
}
static sqInt
-fixedFieldsOfClassFormat(sqInt classFormat)
-{
- return classFormat & ((1 << 16) - 1);
-}
-
-static sqInt
fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt class;
@@ -51615,6 +51647,9 @@
}
do {
assert(!(isForwarded(currClass)));
+ if (!(addressCouldBeClassObj(currClass))) {
+ return GIV(nilObj);
+ }
/* begin noFixupFollowField:ofObject: */
objOop1 = longAt((currClass + BaseHeaderSize) + (MethodDictionaryIndex << 2));
if (((objOop1 & 3) == 0)
@@ -51682,59 +51717,21 @@
sqInt
findClassOfMethodforReceiver(sqInt meth, sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
- sqInt classTablePage;
- sqInt mclass;
sqInt rclass;
- sqInt tagBits;
if ((((rcvr & 3) != 0)
|| (addressCouldBeObj(rcvr)))
&& (!(((rcvr & 3) == 0)
&& (((longAt(rcvr)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = rcvr & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l1;
+ rclass = findClassContainingMethodstartingAt(meth, fetchClassOf(rcvr));
+ if (rclass != GIV(nilObj)) {
+ return rclass;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(rcvr)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = rcvr;
- goto l1;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l1;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l1;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l1: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(meth, rclass);
- if (rclass != GIV(nilObj)) {
- return rclass;
- }
- }
}
if (!((addressCouldBeObj(meth))
&& (((((usqInt) (longAt(meth))) >> 24) & 0x1F) >= 24))) {
return GIV(nilObj);
}
- mclass = safeMethodClassOf(meth);
- if (addressCouldBeClassObj(mclass)) {
- return GIV(nilObj);
- }
return findClassContainingMethodstartingAt(meth, safeMethodClassOf(meth));
}
@@ -57443,14 +57440,10 @@
static void
printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
sqInt classObj;
- sqInt classTablePage;
- sqInt mclass;
sqInt methClass;
sqInt methodSel;
sqInt rclass;
- sqInt tagBits;
if (isBlock) {
print("[] in ");
@@ -57460,52 +57453,17 @@
|| (addressCouldBeObj(anObject)))
&& (!(((anObject & 3) == 0)
&& (((longAt(anObject)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = anObject & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l2;
+ rclass = findClassContainingMethodstartingAt(aMethod, fetchClassOf(anObject));
+ if (rclass != GIV(nilObj)) {
+ methClass = rclass;
+ goto l1;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(anObject)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = anObject;
- goto l2;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l2;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l2;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l2: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(aMethod, rclass);
- if (rclass != GIV(nilObj)) {
- methClass = rclass;
- goto l1;
- }
- }
}
if (!((addressCouldBeObj(aMethod))
&& (((((usqInt) (longAt(aMethod))) >> 24) & 0x1F) >= 24))) {
methClass = GIV(nilObj);
goto l1;
}
- mclass = safeMethodClassOf(aMethod);
- if (addressCouldBeClassObj(mclass)) {
- methClass = GIV(nilObj);
- goto l1;
- }
methClass = findClassContainingMethodstartingAt(aMethod, safeMethodClassOf(aMethod));
l1: /* end findClassOfMethod:forReceiver: */;
methodSel = findSelectorOfMethod(aMethod);
Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
- Wed Oct 29 16:57:58 PDT 2014
+ Thu Oct 30 17:32:32 PDT 2014
Modified: branches/Cog/spursistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.c 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/spursistasrc/vm/cointerp.c 2014-10-31 00:33:06 UTC (rev 3118)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
from
- CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -965,7 +965,6 @@
sqInt firstShortFormat(void);
sqInt fixedFieldsFieldWidth(void);
sqInt fixedFieldsOfClassFormatMask(void);
-static sqInt fixedFieldsOfClassFormat(sqInt classFormat) NoDbgRegParms;
static sqInt fixedFieldsOfClass(sqInt objOop) NoDbgRegParms;
static sqInt fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength) NoDbgRegParms;
static sqInt fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue) NoDbgRegParms NeverInline;
@@ -1542,8 +1541,8 @@
_iss sqInt * freeLists;
_iss sqInt rememberedSetSize;
_iss sqInt * rememberedSet;
-_iss sqInt classTableFirstPage;
_iss usqInt freeListsMask;
+_iss sqInt classTableFirstPage;
_iss sqInt profileProcess;
_iss sqInt longRunningPrimitiveCheckSemaphore;
_iss sqInt profileSemaphore;
@@ -2333,7 +2332,7 @@
/*540*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.914]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.915]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -42958,9 +42957,14 @@
static sqInt
processWeakSurvivor(sqInt weakObj)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt classFormat;
+ sqInt classIndex;
+ sqInt classPointer;
+ sqInt classTablePage;
sqInt hasYoungReferents;
sqInt i;
sqInt iLimiT;
+ sqInt numStrongSlots;
sqInt referent;
sqInt referent1;
sqInt weakObjShouldMourn;
@@ -42969,7 +42973,41 @@
/* N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0 - 1 going +ve */
weakObjShouldMourn = (hasYoungReferents = 0);
- for (i = (fixedFieldsOfClassFormat(formatOfClass(fetchClassOfNonImm(weakObj)))), iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
+ /* begin fixedFieldsOfClassFormat: */
+ /* begin formatOfClass: */
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(weakObj)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ classPointer = weakObj;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ classPointer = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
+l1: /* end fetchClassOfNonImm: */;
+ classFormat = ((longAt((classPointer + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1);
+ numStrongSlots = classFormat & ((1 << 16) - 1);
+ for (i = 0; i < numStrongSlots; i += 1) {
+ referent = longAt((weakObj + BaseHeaderSize) + (i << 2));
+ if (((referent & 3) == 0)
+ && (isYoungObject(referent))) {
+ hasYoungReferents = 1;
+ }
+ }
+ for (i = numStrongSlots, iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
/* Referent could be forwarded due to scavenging or a become:, don't assume. */
@@ -48981,12 +49019,6 @@
}
static sqInt
-fixedFieldsOfClassFormat(sqInt classFormat)
-{
- return classFormat & ((1 << 16) - 1);
-}
-
-static sqInt
fixedFieldsOfClass(sqInt objOop)
{
return (((longAt((objOop + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1)) & ((1 << 16) - 1);
@@ -65650,6 +65682,9 @@
}
do {
assert(!(isForwarded(currClass)));
+ if (!(addressCouldBeClassObj(currClass))) {
+ return GIV(nilObj);
+ }
/* begin noFixupFollowField:ofObject: */
objOop1 = longAt((currClass + BaseHeaderSize) + (MethodDictionaryIndex << 2));
if (((objOop1 & 3) == 0)
@@ -65717,59 +65752,21 @@
sqInt
findClassOfMethodforReceiver(sqInt meth, sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
- sqInt classTablePage;
- sqInt mclass;
sqInt rclass;
- sqInt tagBits;
if ((((rcvr & 3) != 0)
|| (addressCouldBeObj(rcvr)))
&& (!(((rcvr & 3) == 0)
&& (((longAt(rcvr)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = rcvr & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l1;
+ rclass = findClassContainingMethodstartingAt(meth, fetchClassOf(rcvr));
+ if (rclass != GIV(nilObj)) {
+ return rclass;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(rcvr)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = rcvr;
- goto l1;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l1;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l1;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l1: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(meth, rclass);
- if (rclass != GIV(nilObj)) {
- return rclass;
- }
- }
}
if (!((addressCouldBeObj(meth))
&& (((((usqInt) (longAt(meth))) >> 24) & 0x1F) >= 24))) {
return GIV(nilObj);
}
- mclass = safeMethodClassOf(meth);
- if (addressCouldBeClassObj(mclass)) {
- return GIV(nilObj);
- }
return findClassContainingMethodstartingAt(meth, safeMethodClassOf(meth));
}
@@ -69257,14 +69254,10 @@
static void
printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt classIndex;
sqInt classObj;
- sqInt classTablePage;
- sqInt mclass;
sqInt methClass;
sqInt methodSel;
sqInt rclass;
- sqInt tagBits;
if (isBlock) {
print("[] in ");
@@ -69274,52 +69267,17 @@
|| (addressCouldBeObj(anObject)))
&& (!(((anObject & 3) == 0)
&& (((longAt(anObject)) & 0x3FFFFF) == 8)))) {
- /* begin fetchClassOf: */
- if (((tagBits = anObject & 3)) != 0) {
- rclass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (tagBits << 2));
- goto l2;
+ rclass = findClassContainingMethodstartingAt(aMethod, fetchClassOf(anObject));
+ if (rclass != GIV(nilObj)) {
+ methClass = rclass;
+ goto l1;
}
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(anObject)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- rclass = anObject;
- goto l2;
- }
- if (classIndex == 8) {
- rclass = GIV(nilObj);
- goto l2;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- rclass = GIV(nilObj);
- goto l2;
- }
- rclass = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
- l2: /* end fetchClassOf: */;
- if (addressCouldBeClassObj(rclass)) {
- rclass = findClassContainingMethodstartingAt(aMethod, rclass);
- if (rclass != GIV(nilObj)) {
- methClass = rclass;
- goto l1;
- }
- }
}
if (!((addressCouldBeObj(aMethod))
&& (((((usqInt) (longAt(aMethod))) >> 24) & 0x1F) >= 24))) {
methClass = GIV(nilObj);
goto l1;
}
- mclass = safeMethodClassOf(aMethod);
- if (addressCouldBeClassObj(mclass)) {
- methClass = GIV(nilObj);
- goto l1;
- }
methClass = findClassContainingMethodstartingAt(aMethod, safeMethodClassOf(aMethod));
l1: /* end findClassOfMethod:forReceiver: */;
methodSel = findSelectorOfMethod(aMethod);
Modified: branches/Cog/spursistasrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.h 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/spursistasrc/vm/cointerp.h 2014-10-31 00:33:06 UTC (rev 3118)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
Modified: branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/gcc3x-cointerp.c 2014-10-29 23:58:59 UTC (rev 3117)
+++ branches/Cog/spursistasrc/vm/gcc3x-cointerp.c 2014-10-31 00:33:06 UTC (rev 3118)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
from
- CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5
+ CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.914 uuid: bda96e1c-f22e-4b32-9ee1-620740e1fec5 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.915 uuid: 4159cf52-4807-4416-9da6-1c46ec5b9f10 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -968,7 +968,6 @@
sqInt firstShortFormat(void);
sqInt fixedFieldsFieldWidth(void);
sqInt fixedFieldsOfClassFormatMask(void);
-static sqInt fixedFieldsOfClassFormat(sqInt classFormat) NoDbgRegParms;
static sqInt fixedFieldsOfClass(sqInt objOop) NoDbgRegParms;
static sqInt fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength) NoDbgRegParms;
static sqInt fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue) NoDbgRegParms NeverInline;
@@ -1545,8 +1544,8 @@
_iss sqInt * freeLists;
_iss sqInt rememberedSetSize;
_iss sqInt * rememberedSet;
-_iss sqInt classTableFirstPage;
_iss usqInt freeListsMask;
+_iss sqInt classTableFirstPage;
_iss sqInt profileProcess;
_iss sqInt longRunningPrimitiveCheckSemaphore;
_iss sqInt profileSemaphore;
@@ -2336,7 +2335,7 @@
/*540*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.914]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.915]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -42967,9 +42966,14 @@
static sqInt
processWeakSurvivor(sqInt weakObj)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt classFormat;
+ sqInt classIndex;
+ sqInt classPointer;
+ sqInt classTablePage;
sqInt hasYoungReferents;
sqInt i;
sqInt iLimiT;
+ sqInt numStrongSlots;
sqInt referent;
sqInt referent1;
sqInt weakObjShouldMourn;
@@ -42978,7 +42982,41 @@
/* N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0 - 1 going +ve */
weakObjShouldMourn = (hasYoungReferents = 0);
- for (i = (fixedFieldsOfClassFormat(formatOfClass(fetchClassOfNonImm(weakObj)))), iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
+ /* begin fixedFieldsOfClassFormat: */
+ /* begin formatOfClass: */
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(weakObj)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ classPointer = weakObj;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ classPointer = GIV(nilObj);
+ goto l1;
+ }
+ classPointer = longAt((classTablePage + BaseHeaderSize) + ((classIndex & ((1 << 10) - 1)) << 2));
+l1: /* end fetchClassOfNonImm: */;
+ classFormat = ((longAt((classPointer + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1);
+ numStrongSlots = classFormat & ((1 << 16) - 1);
+ for (i = 0; i < numStrongSlots; i += 1) {
+ referent = longAt((weakObj + BaseHeaderSize) + (i << 2));
+ if (((referent & 3) == 0)
+ && (isYoungObject(referent))) {
+ hasYoungReferents = 1;
+ }
+ }
+ for (i = numStrongSlots, iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {
/* Referent could be forwarded due to scavenging or a become:, don't assume. */
@@ -48990,12 +49028,6 @@
}
static sqInt
-fixedFieldsOfClassFormat(sqInt classFormat)
-{
- return classFormat & ((1 << 16) - 1);
-}
-
-static sqInt
fixedFieldsOfClass(sqInt objOop)
{
return (((longAt((objOop + BaseHeaderSize) + (InstanceSpecificationIndex << 2))) >> 1)) & ((1 << 16) - 1);
@@ -65659,6 +65691,9 @@
}
do {
assert(!(isForwarded(currClass)));
+ if (!(addressCouldBeClassObj(currClass))) {
+ return GIV(nilObj);
+ }
/* begin noFixupFollowField:ofObject: */
objOop1 = longAt((currClass + BaseHeaderSize) + (MethodDictionaryIndex << 2));
if (((objOop1 & 3) == 0)
@@ -65726,59 +65761,21 @@
sqInt
findClassOfMethodforReceiver(sqInt meth, sqInt rcvr)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list