[Vm-dev] [commit][3077] CogVM source as per VMMaker.oscog-eem.879
commits at squeakvm.org
commits at squeakvm.org
Sat Sep 13 00:35:47 UTC 2014
Revision: 3077
Author: eliot
Date: 2014-09-12 17:35:44 -0700 (Fri, 12 Sep 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.879
Back out of saneMethodClassAssociation assert in
initialPCForHeader:method:. Newspeak falls foul of this.
Modified Paths:
--------------
branches/Cog/nscogsrc/vm/cointerp.c
branches/Cog/nscogsrc/vm/cointerp.h
branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
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/cointerp.c
branches/Cog/sistasrc/vm/cointerp.h
branches/Cog/sistasrc/vm/gcc3x-cointerp.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
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/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2014-09-12 20:57:39 UTC (rev 3076)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2014-09-13 00:35:44 UTC (rev 3077)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
from
- CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1109,7 +1109,6 @@
static usqInt iframeMethod(char *theFP) NoDbgRegParms;
static sqInt imageFormatVersion(void);
sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
-static sqInt initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod) NoDbgRegParms;
sqInt integerArg(sqInt index);
void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
static sqInt isBaseFrame(char *theFP) NoDbgRegParms;
@@ -1225,7 +1224,6 @@
EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext);
static sqInt reverseDisplayFromto(sqInt startIndex, sqInt endIndex) NoDbgRegParms;
static sqInt safeMethodClassOf(sqInt methodPointer) NoDbgRegParms;
-static sqInt saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals) NoDbgRegParms;
void setBreakSelector(char *aString);
void setFullScreenFlag(sqInt value);
EXPORT(void (*setInterruptCheckChain(void (*aFunction)(void)))()) ;
@@ -2088,7 +2086,7 @@
/* 574 */ (void (*)(void))0,
/* 575 */ (void (*)(void))0,
0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.878";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.879";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -5457,7 +5455,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), GIV(nilObj));
}
- localIP = pointerForOop((initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1);
+ localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)) - 1);
if (((((sqInt) methodHeader)) < 0
? methodHeader & (65536 << SmallIntegerShift)
: (methodHeader & 536871934) != 0)) {
@@ -13228,7 +13226,7 @@
/* Store the error code if the method starts with a long store temp. No instructionPointer skip because we're heading for machine code. */
- initialPC = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) + (((((sqInt) methodHeader)) < 0
+ initialPC = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)) + (((((sqInt) methodHeader)) < 0
? 3
: 0));
if (GIV(primFailCode) != 0) {
@@ -13348,7 +13346,7 @@
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)) - 1;
if (((((sqInt) methodHeader)) < 0
? methodHeader & (65536 << SmallIntegerShift)
: (methodHeader & 536871934) != 0)) {
@@ -19881,9 +19879,7 @@
longAtput((sp81 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp81;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -20116,9 +20112,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -46405,19 +46399,6 @@
}
-/* Answer the initial PC for a method; used only in methods that build a
- frame. Hence add an assert to check that there's a sane
- methodClassAssociation.
- */
-
-static sqInt
-initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod)
-{
- assert(saneMethodClassAssociationInnumLiterals(theMethod, literalCountOfMethodHeader(methodHeader)));
- return (theMethod + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize);
-}
-
-
/* Like #stackIntegerValue: but access method arguments left-to-right */
sqInt
@@ -50730,19 +50711,6 @@
return maybeClass;
}
-static sqInt
-saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals)
-{
- sqInt shouldBeAssoc;
-
- shouldBeAssoc = longAt((methodObj + BaseHeaderSize) + (((numLiterals - 1) + LiteralStart) << ShiftForWord));
-
- return (((shouldBeAssoc & 1) == 0)
- && (((((usqInt) (longAt(shouldBeAssoc))) >> (instFormatFieldLSB())) & 15) <= 4))
- && (((numSlotsOf(shouldBeAssoc)) > ValueIndex)
- && (addressCouldBeClassObj(longAt((shouldBeAssoc + BaseHeaderSize) + (ValueIndex << ShiftForWord)))));
-}
-
void
setBreakSelector(char *aString)
{
@@ -51350,9 +51318,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod));
@@ -52944,7 +52910,7 @@
index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
if (!((index & 1))) {
- GIV(primFailCode) = PrimErrBadArgument;
+ (GIV(primFailCode) = PrimErrBadArgument);
return;
}
hdr = longAt(aContext);
@@ -53128,7 +53094,7 @@
stSize = (sp1 >> 1);
l2: /* end fetchStackPointerOf: */;
if (!(((index >= 1) && (index <= stSize)))) {
- GIV(primFailCode) = PrimErrBadIndex;
+ (GIV(primFailCode) = PrimErrBadIndex);
return;
}
/* begin subscript:with:storing:format: */
@@ -53174,7 +53140,7 @@
assert((senderOop & 1));
spouseFP = pointerForOop(senderOop - 1);
if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
- GIV(primFailCode) = PrimErrBadIndex;
+ (GIV(primFailCode) = PrimErrBadIndex);
return;
}
if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {
@@ -54385,7 +54351,7 @@
assert(pageListIsWellFormed());
if (GIV(fullGCLock) > 0) {
- GIV(primFailCode) = PrimErrInappropriate;
+ (GIV(primFailCode) = PrimErrInappropriate);
return;
}
incrementalGC();
Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h 2014-09-12 20:57:39 UTC (rev 3076)
+++ branches/Cog/nscogsrc/vm/cointerp.h 2014-09-13 00:35:44 UTC (rev 3077)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
*/
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2014-09-12 20:57:39 UTC (rev 3076)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2014-09-13 00:35:44 UTC (rev 3077)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
from
- CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -1112,7 +1112,6 @@
static usqInt iframeMethod(char *theFP) NoDbgRegParms;
static sqInt imageFormatVersion(void);
sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
-static sqInt initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod) NoDbgRegParms;
sqInt integerArg(sqInt index);
void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
static sqInt isBaseFrame(char *theFP) NoDbgRegParms;
@@ -1228,7 +1227,6 @@
EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext);
static sqInt reverseDisplayFromto(sqInt startIndex, sqInt endIndex) NoDbgRegParms;
static sqInt safeMethodClassOf(sqInt methodPointer) NoDbgRegParms;
-static sqInt saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals) NoDbgRegParms;
void setBreakSelector(char *aString);
void setFullScreenFlag(sqInt value);
EXPORT(void (*setInterruptCheckChain(void (*aFunction)(void)))()) ;
@@ -2091,7 +2089,7 @@
/* 574 */ (void (*)(void))0,
/* 575 */ (void (*)(void))0,
0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.878";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.879";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -5466,7 +5464,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), GIV(nilObj));
}
- localIP = pointerForOop((initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1);
+ localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)) - 1);
if (((((sqInt) methodHeader)) < 0
? methodHeader & (65536 << SmallIntegerShift)
: (methodHeader & 536871934) != 0)) {
@@ -13237,7 +13235,7 @@
/* Store the error code if the method starts with a long store temp. No instructionPointer skip because we're heading for machine code. */
- initialPC = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) + (((((sqInt) methodHeader)) < 0
+ initialPC = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)) + (((((sqInt) methodHeader)) < 0
? 3
: 0));
if (GIV(primFailCode) != 0) {
@@ -13357,7 +13355,7 @@
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)) - 1;
if (((((sqInt) methodHeader)) < 0
? methodHeader & (65536 << SmallIntegerShift)
: (methodHeader & 536871934) != 0)) {
@@ -19890,9 +19888,7 @@
longAtput((sp81 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp81;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -20125,9 +20121,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -46414,19 +46408,6 @@
}
-/* Answer the initial PC for a method; used only in methods that build a
- frame. Hence add an assert to check that there's a sane
- methodClassAssociation.
- */
-
-static sqInt
-initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod)
-{
- assert(saneMethodClassAssociationInnumLiterals(theMethod, literalCountOfMethodHeader(methodHeader)));
- return (theMethod + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize);
-}
-
-
/* Like #stackIntegerValue: but access method arguments left-to-right */
sqInt
@@ -50739,19 +50720,6 @@
return maybeClass;
}
-static sqInt
-saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals)
-{
- sqInt shouldBeAssoc;
-
- shouldBeAssoc = longAt((methodObj + BaseHeaderSize) + (((numLiterals - 1) + LiteralStart) << ShiftForWord));
-
- return (((shouldBeAssoc & 1) == 0)
- && (((((usqInt) (longAt(shouldBeAssoc))) >> (instFormatFieldLSB())) & 15) <= 4))
- && (((numSlotsOf(shouldBeAssoc)) > ValueIndex)
- && (addressCouldBeClassObj(longAt((shouldBeAssoc + BaseHeaderSize) + (ValueIndex << ShiftForWord)))));
-}
-
void
setBreakSelector(char *aString)
{
@@ -51359,9 +51327,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod));
@@ -52953,7 +52919,7 @@
index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
if (!((index & 1))) {
- GIV(primFailCode) = PrimErrBadArgument;
+ (GIV(primFailCode) = PrimErrBadArgument);
return;
}
hdr = longAt(aContext);
@@ -53137,7 +53103,7 @@
stSize = (sp1 >> 1);
l2: /* end fetchStackPointerOf: */;
if (!(((index >= 1) && (index <= stSize)))) {
- GIV(primFailCode) = PrimErrBadIndex;
+ (GIV(primFailCode) = PrimErrBadIndex);
return;
}
/* begin subscript:with:storing:format: */
@@ -53183,7 +53149,7 @@
assert((senderOop & 1));
spouseFP = pointerForOop(senderOop - 1);
if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
- GIV(primFailCode) = PrimErrBadIndex;
+ (GIV(primFailCode) = PrimErrBadIndex);
return;
}
if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {
@@ -54394,7 +54360,7 @@
assert(pageListIsWellFormed());
if (GIV(fullGCLock) > 0) {
- GIV(primFailCode) = PrimErrInappropriate;
+ (GIV(primFailCode) = PrimErrInappropriate);
return;
}
incrementalGC();
Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c 2014-09-12 20:57:39 UTC (rev 3076)
+++ branches/Cog/nsspursrc/vm/cointerp.c 2014-09-13 00:35:44 UTC (rev 3077)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
from
- CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -296,6 +296,7 @@
#define PrimErrBadMethod 12
#define PrimErrBadNumArgs 5
#define PrimErrBadReceiver 2
+#define PrimErrGenericFailure 1
#define PrimErrInappropriate 6
#define PrimErrLimitExceeded 15
#define PrimErrNamedInternal 13
@@ -989,6 +990,7 @@
usqLong headerForSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex);
static sqInt hiddenRootSlots(void);
sqInt identityHashHalfWordMask(void);
+static sqInt imageSegmentVersion(void);
void incrementalGC(void);
sqInt indexablePointersFormat(void);
static void inFreeTreeReplacewith(sqInt treeNode, sqInt newNode) NoDbgRegParms;
@@ -1285,7 +1287,6 @@
static usqInt iframeMethod(char *theFP) NoDbgRegParms;
static sqInt imageFormatVersion(void);
sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
-static sqInt initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod) NoDbgRegParms;
sqInt integerArg(sqInt index);
void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
static sqInt isBaseFrame(char *theFP) NoDbgRegParms;
@@ -1398,7 +1399,6 @@
EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext);
static sqInt reverseDisplayFromto(sqInt startIndex, sqInt endIndex) NoDbgRegParms;
static sqInt safeMethodClassOf(sqInt methodPointer) NoDbgRegParms;
-static sqInt saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals) NoDbgRegParms;
void setBreakSelector(char *aString);
void setFullScreenFlag(sqInt value);
EXPORT(void (*setInterruptCheckChain(void (*aFunction)(void)))()) ;
@@ -2324,7 +2324,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.878";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.879";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -6360,7 +6360,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), GIV(nilObj));
}
- localIP = pointerForOop((initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1);
+ localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1);
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -15048,7 +15048,7 @@
/* Store the error code if the method starts with a long store temp. No instructionPointer skip because we're heading for machine code. */
- initialPC = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) + (3);
+ initialPC = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) + (3);
if (GIV(primFailCode) != 0) {
if ((byteAt(initialPC)) == (((((sqInt) methodHeader)) < 0
? AltLongStoreBytecode
@@ -15166,7 +15166,7 @@
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -22401,9 +22401,7 @@
longAtput((sp81 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp81;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * 4)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -22633,9 +22631,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * 4)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -36637,8 +36633,17 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt arrayOfRoots;
sqInt ecode;
+ sqInt endSeg;
+ sqInt firstIn;
+ sqInt firstOut;
+ sqInt hdrBaseIn;
+ sqInt hdrBaseOut;
+ sqInt lastIn;
+ sqInt lastOut;
+ sqInt lastSeg;
sqInt outPointerArray;
sqInt segmentWordArray;
+ sqInt versionOffset;
outPointerArray = longAt(GIV(stackPointer));
segmentWordArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -36661,7 +36666,11 @@
}
return;
}
+ /* begin storeImageSegmentInto:outPointers:roots: */
ecode = PrimErrUnsupported;
+ goto l1;
+
+l1: /* end storeImageSegmentInto:outPointers:roots: */;
if (ecode == PrimNoErr) {
/* begin pop: */
GIV(stackPointer) += 3 * BytesPerWord;
@@ -46858,6 +46867,25 @@
return 0x3FFFFF;
}
+
+/* a more complex version that tells both the word reversal and the
+ endianness of the machine
+ it came from. Low half of word is e.g. 6521. Top byte is top byte of
+ #doesNotUnderstand: on
+ this machine. ($d on the Mac or $s on the PC) */
+
+static sqInt
+imageSegmentVersion(void)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt wholeWord;
+
+
+ /* first data word, 'does' */
+
+ wholeWord = long32At((longAt((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorDoesNotUnderstand << 2))) + (BaseHeaderSize));
+ return (imageFormatVersion()) | (wholeWord & 0xFF000000UL);
+}
+
void
incrementalGC(void)
{
@@ -57144,19 +57172,6 @@
}
-/* Answer the initial PC for a method; used only in methods that build a
- frame. Hence add an assert to check that there's a sane
- methodClassAssociation.
- */
-
-static sqInt
-initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod)
-{
- assert(saneMethodClassAssociationInnumLiterals(theMethod, literalCountOfMethodHeader(methodHeader)));
- return (theMethod + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize);
-}
-
-
/* Like #stackIntegerValue: but access method arguments left-to-right */
sqInt
@@ -62595,29 +62610,6 @@
return maybeClass;
}
-static sqInt
-saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals)
-{
- sqInt referent;
- sqInt shouldBeAssoc;
-
- shouldBeAssoc = longAt((methodObj + (BaseHeaderSize)) + (((numLiterals - 1) + LiteralStart) << 2));
- if (((longAt(shouldBeAssoc)) & (0x3FFFFF - 8)) == 0) {
- /* begin followForwarded: */
- assert(isUnambiguouslyForwarder(shouldBeAssoc));
- referent = longAt((shouldBeAssoc + (BaseHeaderSize)) + (0 << 2));
- while (((referent & 3) == 0)
- && (((longAt(referent)) & 0x3FFFFF) == 8)) {
- referent = longAt((referent + (BaseHeaderSize)) + (0 << 2));
- }
- shouldBeAssoc = referent;
- }
- return (((shouldBeAssoc & 3) == 0)
- && (((((usqInt) (longAt(shouldBeAssoc))) >> 24) & 0x1F) <= 5))
- && (((numSlotsOf(shouldBeAssoc)) > ValueIndex)
- && (addressCouldBeClassObj(noFixupFollowFieldofObject(ValueIndex, shouldBeAssoc))));
-}
-
void
setBreakSelector(char *aString)
{
@@ -63338,9 +63330,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod));
@@ -64777,7 +64767,7 @@
index = longAt(GIV(stackPointer));
if (!((index & 1))) {
- (GIV(primFailCode) = PrimErrBadArgument);
+ GIV(primFailCode) = PrimErrBadArgument;
return;
}
index = (index >> 1);
@@ -64994,7 +64984,7 @@
stSize = (sp1 >> 1);
l2: /* end fetchStackPointerOf: */;
if (!(((index >= 1) && (index <= stSize)))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
/* begin subscript:with:format: */
@@ -65019,7 +65009,7 @@
assert((senderOop & 1));
spouseFP = pointerForOop(senderOop - 1);
if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
value = ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())
@@ -65082,7 +65072,7 @@
index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
if (!((index & 1))) {
- (GIV(primFailCode) = PrimErrBadArgument);
+ GIV(primFailCode) = PrimErrBadArgument;
return;
}
hdr = long64At(aContext);
@@ -65328,7 +65318,7 @@
stSize = (sp1 >> 1);
l2: /* end fetchStackPointerOf: */;
if (!(((index >= 1) && (index <= stSize)))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
/* begin subscript:with:storing:format: */
@@ -65384,7 +65374,7 @@
assert((senderOop & 1));
spouseFP = pointerForOop(senderOop - 1);
if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {
Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h 2014-09-12 20:57:39 UTC (rev 3076)
+++ branches/Cog/nsspursrc/vm/cointerp.h 2014-09-13 00:35:44 UTC (rev 3077)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
*/
Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2014-09-12 20:57:39 UTC (rev 3076)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2014-09-13 00:35:44 UTC (rev 3077)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
from
- CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -299,6 +299,7 @@
#define PrimErrBadMethod 12
#define PrimErrBadNumArgs 5
#define PrimErrBadReceiver 2
+#define PrimErrGenericFailure 1
#define PrimErrInappropriate 6
#define PrimErrLimitExceeded 15
#define PrimErrNamedInternal 13
@@ -992,6 +993,7 @@
usqLong headerForSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex);
static sqInt hiddenRootSlots(void);
sqInt identityHashHalfWordMask(void);
+static sqInt imageSegmentVersion(void);
void incrementalGC(void);
sqInt indexablePointersFormat(void);
static void inFreeTreeReplacewith(sqInt treeNode, sqInt newNode) NoDbgRegParms;
@@ -1288,7 +1290,6 @@
static usqInt iframeMethod(char *theFP) NoDbgRegParms;
static sqInt imageFormatVersion(void);
sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
-static sqInt initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod) NoDbgRegParms;
sqInt integerArg(sqInt index);
void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
static sqInt isBaseFrame(char *theFP) NoDbgRegParms;
@@ -1401,7 +1402,6 @@
EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext);
static sqInt reverseDisplayFromto(sqInt startIndex, sqInt endIndex) NoDbgRegParms;
static sqInt safeMethodClassOf(sqInt methodPointer) NoDbgRegParms;
-static sqInt saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals) NoDbgRegParms;
void setBreakSelector(char *aString);
void setFullScreenFlag(sqInt value);
EXPORT(void (*setInterruptCheckChain(void (*aFunction)(void)))()) ;
@@ -2327,7 +2327,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.878";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.879";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -6369,7 +6369,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), GIV(nilObj));
}
- localIP = pointerForOop((initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1);
+ localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1);
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -15057,7 +15057,7 @@
/* Store the error code if the method starts with a long store temp. No instructionPointer skip because we're heading for machine code. */
- initialPC = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) + (3);
+ initialPC = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) + (3);
if (GIV(primFailCode) != 0) {
if ((byteAt(initialPC)) == (((((sqInt) methodHeader)) < 0
? AltLongStoreBytecode
@@ -15175,7 +15175,7 @@
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -22410,9 +22410,7 @@
longAtput((sp81 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp81;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * 4)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -22642,9 +22640,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader1)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * 4)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod1));
@@ -36646,8 +36642,17 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt arrayOfRoots;
sqInt ecode;
+ sqInt endSeg;
+ sqInt firstIn;
+ sqInt firstOut;
+ sqInt hdrBaseIn;
+ sqInt hdrBaseOut;
+ sqInt lastIn;
+ sqInt lastOut;
+ sqInt lastSeg;
sqInt outPointerArray;
sqInt segmentWordArray;
+ sqInt versionOffset;
outPointerArray = longAt(GIV(stackPointer));
segmentWordArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -36670,7 +36675,11 @@
}
return;
}
+ /* begin storeImageSegmentInto:outPointers:roots: */
ecode = PrimErrUnsupported;
+ goto l1;
+
+l1: /* end storeImageSegmentInto:outPointers:roots: */;
if (ecode == PrimNoErr) {
/* begin pop: */
GIV(stackPointer) += 3 * BytesPerWord;
@@ -46867,6 +46876,25 @@
return 0x3FFFFF;
}
+
+/* a more complex version that tells both the word reversal and the
+ endianness of the machine
+ it came from. Low half of word is e.g. 6521. Top byte is top byte of
+ #doesNotUnderstand: on
+ this machine. ($d on the Mac or $s on the PC) */
+
+static sqInt
+imageSegmentVersion(void)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt wholeWord;
+
+
+ /* first data word, 'does' */
+
+ wholeWord = long32At((longAt((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorDoesNotUnderstand << 2))) + (BaseHeaderSize));
+ return (imageFormatVersion()) | (wholeWord & 0xFF000000UL);
+}
+
void
incrementalGC(void)
{
@@ -57153,19 +57181,6 @@
}
-/* Answer the initial PC for a method; used only in methods that build a
- frame. Hence add an assert to check that there's a sane
- methodClassAssociation.
- */
-
-static sqInt
-initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod)
-{
- assert(saneMethodClassAssociationInnumLiterals(theMethod, literalCountOfMethodHeader(methodHeader)));
- return (theMethod + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize);
-}
-
-
/* Like #stackIntegerValue: but access method arguments left-to-right */
sqInt
@@ -62604,29 +62619,6 @@
return maybeClass;
}
-static sqInt
-saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals)
-{
- sqInt referent;
- sqInt shouldBeAssoc;
-
- shouldBeAssoc = longAt((methodObj + (BaseHeaderSize)) + (((numLiterals - 1) + LiteralStart) << 2));
- if (((longAt(shouldBeAssoc)) & (0x3FFFFF - 8)) == 0) {
- /* begin followForwarded: */
- assert(isUnambiguouslyForwarder(shouldBeAssoc));
- referent = longAt((shouldBeAssoc + (BaseHeaderSize)) + (0 << 2));
- while (((referent & 3) == 0)
- && (((longAt(referent)) & 0x3FFFFF) == 8)) {
- referent = longAt((referent + (BaseHeaderSize)) + (0 << 2));
- }
- shouldBeAssoc = referent;
- }
- return (((shouldBeAssoc & 3) == 0)
- && (((((usqInt) (longAt(shouldBeAssoc))) >> 24) & 0x1F) <= 5))
- && (((numSlotsOf(shouldBeAssoc)) > ValueIndex)
- && (addressCouldBeClassObj(noFixupFollowFieldofObject(ValueIndex, shouldBeAssoc))));
-}
-
void
setBreakSelector(char *aString)
{
@@ -63347,9 +63339,7 @@
longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
GIV(stackPointer) = sp8;
GIV(framePointer) = GIV(stackPointer);
- /* begin initialPCForHeader:method: */
- assert(saneMethodClassAssociationInnumLiterals(GIV(newMethod), literalCountOfMethodHeader(methodHeader)));
- initialIP = ((sqInt) ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize)));
+ initialIP = (GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize);
if (activateCogMethod) {
/* begin push: */
longAtput((sp10 = GIV(stackPointer) - BytesPerWord), ((usqInt)cogMethod));
@@ -64786,7 +64776,7 @@
index = longAt(GIV(stackPointer));
if (!((index & 1))) {
- (GIV(primFailCode) = PrimErrBadArgument);
+ GIV(primFailCode) = PrimErrBadArgument;
return;
}
index = (index >> 1);
@@ -65003,7 +64993,7 @@
stSize = (sp1 >> 1);
l2: /* end fetchStackPointerOf: */;
if (!(((index >= 1) && (index <= stSize)))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
/* begin subscript:with:format: */
@@ -65028,7 +65018,7 @@
assert((senderOop & 1));
spouseFP = pointerForOop(senderOop - 1);
if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
value = ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())
@@ -65091,7 +65081,7 @@
index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
if (!((index & 1))) {
- (GIV(primFailCode) = PrimErrBadArgument);
+ GIV(primFailCode) = PrimErrBadArgument;
return;
}
hdr = long64At(aContext);
@@ -65337,7 +65327,7 @@
stSize = (sp1 >> 1);
l2: /* end fetchStackPointerOf: */;
if (!(((index >= 1) && (index <= stSize)))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
/* begin subscript:with:storing:format: */
@@ -65393,7 +65383,7 @@
assert((senderOop & 1));
spouseFP = pointerForOop(senderOop - 1);
if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
- (GIV(primFailCode) = PrimErrBadIndex);
+ GIV(primFailCode) = PrimErrBadIndex;
return;
}
if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {
Modified: branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2014-09-12 20:57:39 UTC (rev 3076)
+++ branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c 2014-09-13 00:35:44 UTC (rev 3077)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
from
- StackInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d
+ StackInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade
*/
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.878 uuid: 4165e5c9-05a2-4795-9295-8b309fa52e2d " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.879 uuid: 44c718be-2a51-4e7e-9553-5def29daaade " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -264,6 +264,7 @@
#define PrimErrBadMethod 12
#define PrimErrBadNumArgs 5
#define PrimErrBadReceiver 2
+#define PrimErrGenericFailure 1
#define PrimErrInappropriate 6
#define PrimErrLimitExceeded 15
#define PrimErrNamedInternal 13
@@ -741,6 +742,7 @@
usqLong headerForSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex);
static sqInt hiddenRootSlots(void);
sqInt identityHashHalfWordMask(void);
+static sqInt imageSegmentVersion(void);
void incrementalGC(void);
sqInt indexablePointersFormat(void);
static void inFreeTreeReplacewith(sqInt treeNode, sqInt newNode) NoDbgRegParms;
@@ -1055,7 +1057,6 @@
static sqInt imageFormatVersion(void);
sqInt implicitReceiverFormixinimplementing(sqInt rcvr, sqInt mixin, sqInt selector);
sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
-static sqInt initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod) NoDbgRegParms;
sqInt integerArg(sqInt index);
static sqInt interpreterAllocationReserveBytes(void);
void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
@@ -1179,7 +1180,6 @@
static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void)) NoDbgRegParms;
static sqInt roomToPushNArgs(sqInt n) NoDbgRegParms;
static sqInt safeMethodClassOf(sqInt methodPointer) NoDbgRegParms;
-static sqInt saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals) NoDbgRegParms;
EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr);
void setBreakSelector(char *aString);
@@ -2073,7 +2073,7 @@
0 };
char * breakSelector;
sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.878";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.879";
volatile int sendTrace;
sqInt suppressHeartbeatFlag;
@@ -5844,7 +5844,7 @@
/* begin internalPush: */
longAtPointerput((localSP -= BytesPerOop), GIV(nilObj));
}
- localIP = pointerForOop((initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1);
+ localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1);
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -20471,7 +20471,7 @@
longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp7;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader1, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader1 & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -24969,8 +24969,17 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt arrayOfRoots;
sqInt ecode;
+ sqInt endSeg;
+ sqInt firstIn;
+ sqInt firstOut;
+ sqInt hdrBaseIn;
+ sqInt hdrBaseOut;
+ sqInt lastIn;
+ sqInt lastOut;
+ sqInt lastSeg;
sqInt outPointerArray;
sqInt segmentWordArray;
+ sqInt versionOffset;
outPointerArray = longAt(GIV(stackPointer));
segmentWordArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -24993,7 +25002,11 @@
}
return;
}
+ /* begin storeImageSegmentInto:outPointers:roots: */
ecode = PrimErrUnsupported;
+ goto l1;
+
+l1: /* end storeImageSegmentInto:outPointers:roots: */;
if (ecode == PrimNoErr) {
/* begin pop: */
GIV(stackPointer) += 3 * BytesPerWord;
@@ -35530,6 +35543,25 @@
return 0x3FFFFF;
}
+
+/* a more complex version that tells both the word reversal and the
+ endianness of the machine
+ it came from. Low half of word is e.g. 6521. Top byte is top byte of
+ #doesNotUnderstand: on
+ this machine. ($d on the Mac or $s on the PC) */
+
+static sqInt
+imageSegmentVersion(void)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt wholeWord;
+
+
+ /* first data word, 'does' */
+
+ wholeWord = long32At((longAt((GIV(specialObjectsOop) + (BaseHeaderSize)) + (SelectorDoesNotUnderstand << 2))) + (BaseHeaderSize));
+ return (imageFormatVersion()) | (wholeWord & 0xFF000000UL);
+}
+
void
incrementalGC(void)
{
@@ -46633,19 +46665,6 @@
}
-/* Answer the initial PC for a method; used only in methods that build a
- frame. Hence add an assert to check that there's a sane
- methodClassAssociation.
- */
-
-static sqInt
-initialPCForHeadermethod(sqInt methodHeader, sqInt theMethod)
-{
- assert(saneMethodClassAssociationInnumLiterals(theMethod, literalCountOfMethodHeader(methodHeader)));
- return (theMethod + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * BytesPerOop)) + (BaseHeaderSize);
-}
-
-
/* Like #stackIntegerValue: but access method arguments left-to-right */
sqInt
@@ -49352,7 +49371,7 @@
longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp7;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader1, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader1))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader1 & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -53106,30 +53125,7 @@
return maybeClass;
}
-static sqInt
-saneMethodClassAssociationInnumLiterals(sqInt methodObj, sqInt numLiterals)
-{
- sqInt referent;
- sqInt shouldBeAssoc;
- shouldBeAssoc = longAt((methodObj + (BaseHeaderSize)) + (((numLiterals - 1) + LiteralStart) << 2));
- if (((longAt(shouldBeAssoc)) & (0x3FFFFF - 8)) == 0) {
- /* begin followForwarded: */
- assert(isUnambiguouslyForwarder(shouldBeAssoc));
- referent = longAt((shouldBeAssoc + (BaseHeaderSize)) + (0 << 2));
- while (((referent & 3) == 0)
- && (((longAt(referent)) & 0x3FFFFF) == 8)) {
- referent = longAt((referent + (BaseHeaderSize)) + (0 << 2));
- }
- shouldBeAssoc = referent;
- }
- return (((shouldBeAssoc & 3) == 0)
- && (((((usqInt) (longAt(shouldBeAssoc))) >> 24) & 0x1F) <= 5))
- && (((numSlotsOf(shouldBeAssoc)) > ValueIndex)
- && (addressCouldBeClassObj(noFixupFollowFieldofObject(ValueIndex, shouldBeAssoc))));
-}
-
-
/* Send the calllback message to Alien class with the supplied arg(s). Use
either the
1 arg invokeCallbackContext: or the 4 arg
@@ -53284,7 +53280,7 @@
longAtput((sp9 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp9;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -53446,7 +53442,7 @@
longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp7;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -54233,7 +54229,7 @@
longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp7;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -57830,7 +57826,7 @@
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader2, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader2))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader2 & (65536 << SmallIntegerShift)) {
/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
@@ -58059,7 +58055,7 @@
longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp7;
}
- GIV(instructionPointer) = (initialPCForHeadermethod(methodHeader2, GIV(newMethod))) - 1;
+ GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + (literalCountOfMethodHeader(methodHeader2))) * 4)) + (BaseHeaderSize)) - 1;
if (methodHeader2 & (65536 << SmallIntegerShift)) {
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list