[Vm-dev] [commit] r2514 - CogVM source as per
VMMaker.oscog-eem.138.
Eliot Miranda
eliot.miranda at gmail.com
Fri Nov 18 18:38:51 UTC 2011
This "fix", 138, is badly broken. Please use 139 instead.
On Thu, Nov 17, 2011 at 5:18 PM, <commits at squeakvm.org> wrote:
>
> Author: eliot
> Date: 2011-11-17 17:18:02 -0800 (Thu, 17 Nov 2011)
> New Revision: 2514
>
> Modified:
> branches/Cog/nscogsrc/vm/cogit.c
> branches/Cog/nscogsrc/vm/cogit.h
> branches/Cog/nscogsrc/vm/cogmethod.h
> branches/Cog/nscogsrc/vm/cointerp.c
> branches/Cog/nscogsrc/vm/cointerp.h
> branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
> branches/Cog/nscogsrc/vm/interp.h
> branches/Cog/nscogsrc/vm/vmCallback.h
> branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
> branches/Cog/src/vm/cogit.c
> branches/Cog/src/vm/cogit.h
> branches/Cog/src/vm/cogmethod.h
> branches/Cog/src/vm/cointerp.c
> branches/Cog/src/vm/cointerp.h
> branches/Cog/src/vm/cointerpmt.c
> branches/Cog/src/vm/cointerpmt.h
> branches/Cog/src/vm/gcc3x-cointerp.c
> branches/Cog/src/vm/gcc3x-cointerpmt.c
> branches/Cog/src/vm/interp.h
> branches/Cog/src/vm/vmCallback.h
> Log:
> CogVM source as per VMMaker.oscog-eem.138.
> Fix frameless foo: arg instVar := instVar code gen bug (failure to pop
> spills on frameless return). Use more hex printing in frame/oop printing.
>
>
> Modified: branches/Cog/nscogsrc/vm/cogit.c
> ===================================================================
> --- branches/Cog/nscogsrc/vm/cogit.c 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/nscogsrc/vm/cogit.c 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,9 @@
> /* Automatically generated by
> - CCodeGenerator VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + CCodeGenerator VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - StackToRegisterMappingCogit VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + StackToRegisterMappingCogit VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "StackToRegisterMappingCogit
> VMMaker.oscog-eem.135 uuid: 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba " __DATE__
> ;
> +static char __buildInfo[] = "StackToRegisterMappingCogit
> VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__
> ;
> char *__cogitBuildInfo = __buildInfo;
>
>
> @@ -805,6 +805,7 @@
> sqInt isSendReturnPC(sqInt retpc);
> static sqInt isSmallIntegerTagNonZero(void);
> static sqInt isUnconditionalBranch(BytecodeDescriptor *
> self_in_isUnconditionalBranch);
> +static sqInt isValidFramelessRegister(sqInt reg);
> static AbstractInstruction * gJumpFPEqual(void *jumpTarget);
> static AbstractInstruction * gJumpFPGreaterOrEqual(void *jumpTarget);
> static AbstractInstruction * gJumpFPGreater(void *jumpTarget);
> @@ -963,6 +964,7 @@
> static void ssFlushTo(sqInt index);
> static void ssFlushUpThroughReceiverVariable(sqInt slotIndex);
> static void ssFlushUpThroughTemporaryVariable(sqInt tempIndex);
> +static void ssPopSpillsFrom(sqInt index);
> static void ssPop(sqInt n);
> static sqInt ssPushAnnotatedConstant(sqInt literal);
> static sqInt ssPushBaseoffset(sqInt reg, sqInt offset);
> @@ -12493,6 +12495,7 @@
> genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord);
> }
> else {
> + ssPopSpillsFrom(methodOrBlockNumArgs - 1);
> /* begin RetN: */
> offset = ((methodOrBlockNumArgs > (numRegArgs()))
> || (regArgsHaveBeenPushed)
> @@ -13254,6 +13257,16 @@
> }
>
>
> +/* Answer if the receiver is valid in a frameless method. */
> +
> +static sqInt
> +isValidFramelessRegister(sqInt reg)
> +{
> + return (reg == ReceiverResultReg)
> + || (reg == Arg0Reg);
> +}
> +
> +
> /* Floating-point jumps are a little weird on some processors. Defer
> to
> the backEnd to allow it to generate any special code it may need
> to. */
>
> @@ -16539,7 +16552,10 @@
> }
> if (simSpillBase <= index) {
> for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <=
> index; i += 1) {
> - assert(needsFrame);
> + assert(needsFrame
> + || (((((simStackAt(i)->type)) == SSBaseOffset)
> + || (((simStackAt(i)->type)) == SSRegister))
> + &&
> (isValidFramelessRegister((simStackAt(i)->registerr)))));
> ensureSpilledAtfrom(simStackAt(i),
> frameOffsetOfTemporary(i), FPReg);
> }
> simSpillBase = index + 1;
> @@ -16588,7 +16604,24 @@
> }
> }
>
> +
> +/* Pop any spilled items on the sim stack from index, used to balance
> the
> + stack on return.
> + */
> +
> static void
> +ssPopSpillsFrom(sqInt index)
> +{
> + sqInt i;
> +
> + for (i = index; i <= simStackPtr; i += 1) {
> + if ((simStackAt(i)->spilled)) {
> + popToReg(ssTop(), TempReg);
> + }
> + }
> +}
> +
> +static void
> ssPop(sqInt n)
> {
> assert(((simStackPtr - n) >= (methodOrBlockNumTemps - 1))
>
> Modified: branches/Cog/nscogsrc/vm/cogit.h
> ===================================================================
> --- branches/Cog/nscogsrc/vm/cogit.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/nscogsrc/vm/cogit.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGenerator VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + CCodeGenerator VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
>
>
> Modified: branches/Cog/nscogsrc/vm/cogmethod.h
> ===================================================================
> --- branches/Cog/nscogsrc/vm/cogmethod.h 2011-11-15 00:39:49 UTC
> (rev 2513)
> +++ branches/Cog/nscogsrc/vm/cogmethod.h 2011-11-18 01:18:02 UTC
> (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGenerator VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + CCodeGenerator VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
> typedef struct {
>
> Modified: branches/Cog/nscogsrc/vm/cointerp.c
> ===================================================================
> --- branches/Cog/nscogsrc/vm/cointerp.c 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/nscogsrc/vm/cointerp.c 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,9 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc " __DATE__ ;
> +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
> char *__interpBuildInfo = __buildInfo;
>
>
> @@ -330,6 +330,7 @@
> sqInt interpret(void);
> static void activateCoggedNewMethod(sqInt inInterpreter);
> static void activateNewMethod(void);
> +sqInt activeProcess(void);
> EXPORT(sqInt) addGCRoot(sqInt *varLoc);
> static void addLastLinktoList(sqInt proc, sqInt aList);
> static void addNewMethodToCache(sqInt class);
> @@ -586,6 +587,7 @@
> sqInt integerArg(sqInt index);
> sqInt integerObjectOf(sqInt value);
> sqInt integerValueOf(sqInt objectPointer);
> +EXPORT(sqInt) internalIsImmutable(sqInt oop);
> usqInt interpretAddress(void);
> static sqInt interpreterAllocationReserveBytes(void);
> static sqInt interpretMethodFromMachineCode(void);
> @@ -1898,7 +1900,7 @@
> /* 575 */ (void (*)(void))0,
> 0 };
> static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /*
> 4097 */])(void);
> -const char *interpreterVersion = "Newspeak Virtual Machine
> CoInterpreter_VMMaker.oscog-eem.137";
> +const char *interpreterVersion = "Newspeak Virtual Machine
> CoInterpreter_VMMaker.oscog-eem.138";
> sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /*
> 10 */;
> volatile int sendTrace;
>
> @@ -8924,6 +8926,16 @@
> }
>
>
> +/* Answer the current activeProcess. */
> +/* useful for VM debugging */
> +
> +sqInt
> +activeProcess(void)
> +{
> + return longAt(((longAt(((longAt((GIV(specialObjectsOop) +
> BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) +
> BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) +
> (ActiveProcessIndex << ShiftForWord));
> +}
> +
> +
> /* Add the given variable location to the extra roots table */
>
> EXPORT(sqInt)
> @@ -19120,7 +19132,13 @@
> }
> }
>
> +EXPORT(sqInt)
> +internalIsImmutable(sqInt oop)
> +{
> + return ((longAt(oop)) & ImmutabilityBit) != 0;
> +}
>
> +
> /* This is used for asserts that check that inline cache editing
> results in
> valid addresses.
> In the C VM interpret is presumed to come before any primitives and
> so it
> @@ -20424,13 +20442,17 @@
> goto l1;
> }
> l1: /* end lengthOf: */;
> - if ((lastIndex - startIP) > 100) {
> - lastIndex = startIP + 100;
> + if ((lastIndex - startIP) > 104) {
> + lastIndex = startIP + 103;
> }
> bytecodesPerLine = 8;
> for (index = startIP; index <= lastIndex; index += 1) {
> byte = byteAt((oop + BaseHeaderSize) + (index - 1));
> printf(" %02x/%-3d", byte,byte);
> + if ((index == lastIndex)
> + && ((lengthOf(oop)) > index)) {
> + print("...");
> + }
> if ((((index - startIP) + 1) % bytecodesPerLine) ==
> 0) {
> /* begin cr */
> printf("\n");
> @@ -38290,7 +38312,7 @@
>
> void
> printContext(sqInt aContext)
> -{
> +{ DECL_MAYBE_SQ_GLOBAL_STRUCT
> sqInt i;
> sqInt ip;
> void *p;
> @@ -38341,17 +38363,22 @@
> print("sender ");
> shortPrintOop(sender);
> print("ip ");
> - printNum(ip);
> - print(" (");
> - printNum((ip >> 1));
> - /* begin space */
> - /* begin printChar: */
> - putchar(' ');
> - printHex((ip >> 1));
> - /* begin printChar: */
> - putchar(')');
> - /* begin cr */
> - printf("\n");
> + if (ip == GIV(nilObj)) {
> + shortPrintOop(ip);
> + }
> + else {
> + printNum(ip);
> + print(" (");
> + printNum((ip >> 1));
> + /* begin space */
> + /* begin printChar: */
> + putchar(' ');
> + printHex((ip >> 1));
> + /* begin printChar: */
> + putchar(')');
> + /* begin cr */
> + printf("\n");
> + }
> }
> sp = longAt((aContext + BaseHeaderSize) + (StackPointerIndex <<
> ShiftForWord));
> sp = ((sp < ((lengthOf(aContext)) - ReceiverIndex)) ? sp :
> ((lengthOf(aContext)) - ReceiverIndex));
> @@ -41906,6 +41933,7 @@
> shortPrintContext(sqInt aContext)
> {
> sqInt home;
> + char *theFP;
>
> if (!(((aContext & 1) == 0)
> && (((((usqInt) (longAt(aContext))) >> 12) & 31) ==
> ClassMethodContextCompactIndex))) {
> @@ -41916,14 +41944,20 @@
> return;
> }
> home = findHomeForContext(aContext);
> - printNum(aContext);
> + printHex(aContext);
> if (((longAt((aContext + BaseHeaderSize) + (SenderIndex <<
> ShiftForWord))) & 1)) {
> - if ((checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer)))
> - && (isMachineCodeFrame(frameOfMarriedContext(aContext))))
> {
> - print(" m ");
> + if (checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer))) {
> + if (isMachineCodeFrame((theFP =
> frameOfMarriedContext(aContext)))) {
> + print(" M (");
> + }
> + else {
> + print(" I (");
> + }
> + printHex(theFP);
> + print(") ");
> }
> else {
> - print(" i ");
> + print(" w ");
> }
> }
> else {
> @@ -41998,7 +42032,7 @@
> void
> shortPrintFrameAndNCallers(char *theFP, sqInt n)
> { DECL_MAYBE_SQ_GLOBAL_STRUCT
> - if ((n > 0)
> + if ((n != 0)
> && ((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
> && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1))))
> && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
> shortPrintFrame(theFP);
> @@ -45643,6 +45677,7 @@
> {"", "callbackEnter", (void*)callbackEnter},
> {"", "callbackLeave", (void*)callbackLeave},
> {"", "dumpImage", (void*)dumpImage},
> + {"", "internalIsImmutable", (void*)internalIsImmutable},
> {"", "moduleUnloaded", (void*)moduleUnloaded},
> {"", "primitiveAddLargeIntegers", (void*)primitiveAddLargeIntegers},
> {"", "primitiveBitAndLargeIntegers",
> (void*)primitiveBitAndLargeIntegers},
>
> Modified: branches/Cog/nscogsrc/vm/cointerp.h
> ===================================================================
> --- branches/Cog/nscogsrc/vm/cointerp.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/nscogsrc/vm/cointerp.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,10 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
>
> /*** Function Prototypes ***/
> +sqInt activeProcess(void);
> sqInt addressCouldBeObj(sqInt address);
> sqInt addressCouldBeOop(sqInt address);
> usqInt argumentCountAddress(void);
>
> Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
> ===================================================================
> --- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2011-11-15 00:39:49 UTC
> (rev 2513)
> +++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2011-11-18 01:18:02 UTC
> (rev 2514)
> @@ -2,11 +2,11 @@
>
>
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc " __DATE__ ;
> +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
> char *__interpBuildInfo = __buildInfo;
>
>
> @@ -333,6 +333,7 @@
> sqInt interpret(void);
> static void activateCoggedNewMethod(sqInt inInterpreter);
> static void activateNewMethod(void);
> +sqInt activeProcess(void);
> EXPORT(sqInt) addGCRoot(sqInt *varLoc);
> static void addLastLinktoList(sqInt proc, sqInt aList);
> static void addNewMethodToCache(sqInt class);
> @@ -589,6 +590,7 @@
> sqInt integerArg(sqInt index);
> sqInt integerObjectOf(sqInt value);
> sqInt integerValueOf(sqInt objectPointer);
> +EXPORT(sqInt) internalIsImmutable(sqInt oop);
> usqInt interpretAddress(void);
> static sqInt interpreterAllocationReserveBytes(void);
> static sqInt interpretMethodFromMachineCode(void);
> @@ -1901,7 +1903,7 @@
> /* 575 */ (void (*)(void))0,
> 0 };
> static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /*
> 4097 */])(void);
> -const char *interpreterVersion = "Newspeak Virtual Machine
> CoInterpreter_VMMaker.oscog-eem.137";
> +const char *interpreterVersion = "Newspeak Virtual Machine
> CoInterpreter_VMMaker.oscog-eem.138";
> sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /*
> 10 */;
> volatile int sendTrace;
>
> @@ -8928,6 +8930,16 @@
> }
>
>
> +/* Answer the current activeProcess. */
> +/* useful for VM debugging */
> +
> +sqInt
> +activeProcess(void)
> +{
> + return longAt(((longAt(((longAt((GIV(specialObjectsOop) +
> BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) +
> BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) +
> (ActiveProcessIndex << ShiftForWord));
> +}
> +
> +
> /* Add the given variable location to the extra roots table */
>
> EXPORT(sqInt)
> @@ -19124,7 +19136,13 @@
> }
> }
>
> +EXPORT(sqInt)
> +internalIsImmutable(sqInt oop)
> +{
> + return ((longAt(oop)) & ImmutabilityBit) != 0;
> +}
>
> +
> /* This is used for asserts that check that inline cache editing
> results in
> valid addresses.
> In the C VM interpret is presumed to come before any primitives and
> so it
> @@ -20428,13 +20446,17 @@
> goto l1;
> }
> l1: /* end lengthOf: */;
> - if ((lastIndex - startIP) > 100) {
> - lastIndex = startIP + 100;
> + if ((lastIndex - startIP) > 104) {
> + lastIndex = startIP + 103;
> }
> bytecodesPerLine = 8;
> for (index = startIP; index <= lastIndex; index += 1) {
> byte = byteAt((oop + BaseHeaderSize) + (index - 1));
> printf(" %02x/%-3d", byte,byte);
> + if ((index == lastIndex)
> + && ((lengthOf(oop)) > index)) {
> + print("...");
> + }
> if ((((index - startIP) + 1) % bytecodesPerLine) ==
> 0) {
> /* begin cr */
> printf("\n");
> @@ -38294,7 +38316,7 @@
>
> void
> printContext(sqInt aContext)
> -{
> +{ DECL_MAYBE_SQ_GLOBAL_STRUCT
> sqInt i;
> sqInt ip;
> void *p;
> @@ -38345,17 +38367,22 @@
> print("sender ");
> shortPrintOop(sender);
> print("ip ");
> - printNum(ip);
> - print(" (");
> - printNum((ip >> 1));
> - /* begin space */
> - /* begin printChar: */
> - putchar(' ');
> - printHex((ip >> 1));
> - /* begin printChar: */
> - putchar(')');
> - /* begin cr */
> - printf("\n");
> + if (ip == GIV(nilObj)) {
> + shortPrintOop(ip);
> + }
> + else {
> + printNum(ip);
> + print(" (");
> + printNum((ip >> 1));
> + /* begin space */
> + /* begin printChar: */
> + putchar(' ');
> + printHex((ip >> 1));
> + /* begin printChar: */
> + putchar(')');
> + /* begin cr */
> + printf("\n");
> + }
> }
> sp = longAt((aContext + BaseHeaderSize) + (StackPointerIndex <<
> ShiftForWord));
> sp = ((sp < ((lengthOf(aContext)) - ReceiverIndex)) ? sp :
> ((lengthOf(aContext)) - ReceiverIndex));
> @@ -41910,6 +41937,7 @@
> shortPrintContext(sqInt aContext)
> {
> sqInt home;
> + char *theFP;
>
> if (!(((aContext & 1) == 0)
> && (((((usqInt) (longAt(aContext))) >> 12) & 31) ==
> ClassMethodContextCompactIndex))) {
> @@ -41920,14 +41948,20 @@
> return;
> }
> home = findHomeForContext(aContext);
> - printNum(aContext);
> + printHex(aContext);
> if (((longAt((aContext + BaseHeaderSize) + (SenderIndex <<
> ShiftForWord))) & 1)) {
> - if ((checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer)))
> - && (isMachineCodeFrame(frameOfMarriedContext(aContext))))
> {
> - print(" m ");
> + if (checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer))) {
> + if (isMachineCodeFrame((theFP =
> frameOfMarriedContext(aContext)))) {
> + print(" M (");
> + }
> + else {
> + print(" I (");
> + }
> + printHex(theFP);
> + print(") ");
> }
> else {
> - print(" i ");
> + print(" w ");
> }
> }
> else {
> @@ -42002,7 +42036,7 @@
> void
> shortPrintFrameAndNCallers(char *theFP, sqInt n)
> { DECL_MAYBE_SQ_GLOBAL_STRUCT
> - if ((n > 0)
> + if ((n != 0)
> && ((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
> && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1))))
> && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
> shortPrintFrame(theFP);
> @@ -45647,6 +45681,7 @@
> {"", "callbackEnter", (void*)callbackEnter},
> {"", "callbackLeave", (void*)callbackLeave},
> {"", "dumpImage", (void*)dumpImage},
> + {"", "internalIsImmutable", (void*)internalIsImmutable},
> {"", "moduleUnloaded", (void*)moduleUnloaded},
> {"", "primitiveAddLargeIntegers", (void*)primitiveAddLargeIntegers},
> {"", "primitiveBitAndLargeIntegers",
> (void*)primitiveBitAndLargeIntegers},
>
> Modified: branches/Cog/nscogsrc/vm/interp.h
> ===================================================================
> --- branches/Cog/nscogsrc/vm/interp.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/nscogsrc/vm/interp.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
> #define VM_PROXY_MAJOR 1
>
> Modified: branches/Cog/nscogsrc/vm/vmCallback.h
> ===================================================================
> --- branches/Cog/nscogsrc/vm/vmCallback.h 2011-11-15 00:39:49 UTC
> (rev 2513)
> +++ branches/Cog/nscogsrc/vm/vmCallback.h 2011-11-18 01:18:02 UTC
> (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
> #define VM_CALLBACK_INC 1
>
>
> Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
> ___________________________________________________________________
> Modified: checkindate
> - Wed Nov 9 11:39:06 PST 2011
> + Thu Nov 17 17:17:12 PST 2011
>
> Modified: branches/Cog/src/vm/cogit.c
> ===================================================================
> --- branches/Cog/src/vm/cogit.c 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/cogit.c 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,9 @@
> /* Automatically generated by
> - CCodeGenerator VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + CCodeGenerator VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - StackToRegisterMappingCogit VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + StackToRegisterMappingCogit VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "StackToRegisterMappingCogit
> VMMaker.oscog-eem.135 uuid: 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba " __DATE__
> ;
> +static char __buildInfo[] = "StackToRegisterMappingCogit
> VMMaker.oscog-eem.138 uuid: f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__
> ;
> char *__cogitBuildInfo = __buildInfo;
>
>
> @@ -798,6 +798,7 @@
> sqInt isSendReturnPC(sqInt retpc);
> static sqInt isSmallIntegerTagNonZero(void);
> static sqInt isUnconditionalBranch(BytecodeDescriptor *
> self_in_isUnconditionalBranch);
> +static sqInt isValidFramelessRegister(sqInt reg);
> static AbstractInstruction * gJumpFPEqual(void *jumpTarget);
> static AbstractInstruction * gJumpFPGreaterOrEqual(void *jumpTarget);
> static AbstractInstruction * gJumpFPGreater(void *jumpTarget);
> @@ -951,6 +952,7 @@
> static void ssFlushTo(sqInt index);
> static void ssFlushUpThroughReceiverVariable(sqInt slotIndex);
> static void ssFlushUpThroughTemporaryVariable(sqInt tempIndex);
> +static void ssPopSpillsFrom(sqInt index);
> static void ssPop(sqInt n);
> static sqInt ssPushAnnotatedConstant(sqInt literal);
> static sqInt ssPushBaseoffset(sqInt reg, sqInt offset);
> @@ -12281,6 +12283,7 @@
> genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord);
> }
> else {
> + ssPopSpillsFrom(methodOrBlockNumArgs - 1);
> /* begin RetN: */
> offset = ((methodOrBlockNumArgs > (numRegArgs()))
> || (regArgsHaveBeenPushed)
> @@ -13042,6 +13045,16 @@
> }
>
>
> +/* Answer if the receiver is valid in a frameless method. */
> +
> +static sqInt
> +isValidFramelessRegister(sqInt reg)
> +{
> + return (reg == ReceiverResultReg)
> + || (reg == Arg0Reg);
> +}
> +
> +
> /* Floating-point jumps are a little weird on some processors. Defer
> to
> the backEnd to allow it to generate any special code it may need
> to. */
>
> @@ -16054,7 +16067,10 @@
> }
> if (simSpillBase <= index) {
> for (i = (((simSpillBase < 0) ? 0 : simSpillBase)); i <=
> index; i += 1) {
> - assert(needsFrame);
> + assert(needsFrame
> + || (((((simStackAt(i)->type)) == SSBaseOffset)
> + || (((simStackAt(i)->type)) == SSRegister))
> + &&
> (isValidFramelessRegister((simStackAt(i)->registerr)))));
> ensureSpilledAtfrom(simStackAt(i),
> frameOffsetOfTemporary(i), FPReg);
> }
> simSpillBase = index + 1;
> @@ -16103,7 +16119,24 @@
> }
> }
>
> +
> +/* Pop any spilled items on the sim stack from index, used to balance
> the
> + stack on return.
> + */
> +
> static void
> +ssPopSpillsFrom(sqInt index)
> +{
> + sqInt i;
> +
> + for (i = index; i <= simStackPtr; i += 1) {
> + if ((simStackAt(i)->spilled)) {
> + popToReg(ssTop(), TempReg);
> + }
> + }
> +}
> +
> +static void
> ssPop(sqInt n)
> {
> assert(((simStackPtr - n) >= (methodOrBlockNumTemps - 1))
>
> Modified: branches/Cog/src/vm/cogit.h
> ===================================================================
> --- branches/Cog/src/vm/cogit.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/cogit.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGenerator VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + CCodeGenerator VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
>
>
> Modified: branches/Cog/src/vm/cogmethod.h
> ===================================================================
> --- branches/Cog/src/vm/cogmethod.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/cogmethod.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGenerator VMMaker.oscog-eem.135 uuid:
> 1c85e5ef-0fe8-4a1e-9421-ff0d53845fba
> + CCodeGenerator VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
> typedef struct {
>
> Modified: branches/Cog/src/vm/cointerp.c
> ===================================================================
> --- branches/Cog/src/vm/cointerp.c 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/cointerp.c 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,9 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc " __DATE__ ;
> +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
> char *__interpBuildInfo = __buildInfo;
>
>
> @@ -327,6 +327,7 @@
> sqInt interpret(void);
> static void activateCoggedNewMethod(sqInt inInterpreter);
> static void activateNewMethod(void);
> +sqInt activeProcess(void);
> EXPORT(sqInt) addGCRoot(sqInt *varLoc);
> static void addLastLinktoList(sqInt proc, sqInt aList);
> static void addNewMethodToCache(sqInt class);
> @@ -1889,7 +1890,7 @@
> /* 575 */ (void (*)(void))0,
> 0 };
> static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /*
> 4097 */])(void);
> -const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter
> VMMaker.oscog-eem.137]";
> +const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter
> VMMaker.oscog-eem.138]";
> sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /*
> 10 */;
> volatile int sendTrace;
>
> @@ -8684,6 +8685,16 @@
> }
>
>
> +/* Answer the current activeProcess. */
> +/* useful for VM debugging */
> +
> +sqInt
> +activeProcess(void)
> +{
> + return longAt(((longAt(((longAt((GIV(specialObjectsOop) +
> BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) +
> BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) +
> (ActiveProcessIndex << ShiftForWord));
> +}
> +
> +
> /* Add the given variable location to the extra roots table */
>
> EXPORT(sqInt)
> @@ -19755,13 +19766,17 @@
> goto l1;
> }
> l1: /* end lengthOf: */;
> - if ((lastIndex - startIP) > 100) {
> - lastIndex = startIP + 100;
> + if ((lastIndex - startIP) > 104) {
> + lastIndex = startIP + 103;
> }
> bytecodesPerLine = 8;
> for (index = startIP; index <= lastIndex; index += 1) {
> byte = byteAt((oop + BaseHeaderSize) + (index - 1));
> printf(" %02x/%-3d", byte,byte);
> + if ((index == lastIndex)
> + && ((lengthOf(oop)) > index)) {
> + print("...");
> + }
> if ((((index - startIP) + 1) % bytecodesPerLine) ==
> 0) {
> /* begin cr */
> printf("\n");
> @@ -37608,7 +37623,7 @@
>
> void
> printContext(sqInt aContext)
> -{
> +{ DECL_MAYBE_SQ_GLOBAL_STRUCT
> sqInt i;
> sqInt ip;
> void *p;
> @@ -37659,17 +37674,22 @@
> print("sender ");
> shortPrintOop(sender);
> print("ip ");
> - printNum(ip);
> - print(" (");
> - printNum((ip >> 1));
> - /* begin space */
> - /* begin printChar: */
> - putchar(' ');
> - printHex((ip >> 1));
> - /* begin printChar: */
> - putchar(')');
> - /* begin cr */
> - printf("\n");
> + if (ip == GIV(nilObj)) {
> + shortPrintOop(ip);
> + }
> + else {
> + printNum(ip);
> + print(" (");
> + printNum((ip >> 1));
> + /* begin space */
> + /* begin printChar: */
> + putchar(' ');
> + printHex((ip >> 1));
> + /* begin printChar: */
> + putchar(')');
> + /* begin cr */
> + printf("\n");
> + }
> }
> sp = longAt((aContext + BaseHeaderSize) + (StackPointerIndex <<
> ShiftForWord));
> sp = ((sp < ((lengthOf(aContext)) - ReceiverIndex)) ? sp :
> ((lengthOf(aContext)) - ReceiverIndex));
> @@ -41224,6 +41244,7 @@
> shortPrintContext(sqInt aContext)
> {
> sqInt home;
> + char *theFP;
>
> if (!(((aContext & 1) == 0)
> && (((((usqInt) (longAt(aContext))) >> 12) & 31) ==
> ClassMethodContextCompactIndex))) {
> @@ -41234,14 +41255,20 @@
> return;
> }
> home = findHomeForContext(aContext);
> - printNum(aContext);
> + printHex(aContext);
> if (((longAt((aContext + BaseHeaderSize) + (SenderIndex <<
> ShiftForWord))) & 1)) {
> - if ((checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer)))
> - && (isMachineCodeFrame(frameOfMarriedContext(aContext))))
> {
> - print(" m ");
> + if (checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer))) {
> + if (isMachineCodeFrame((theFP =
> frameOfMarriedContext(aContext)))) {
> + print(" M (");
> + }
> + else {
> + print(" I (");
> + }
> + printHex(theFP);
> + print(") ");
> }
> else {
> - print(" i ");
> + print(" w ");
> }
> }
> else {
> @@ -41316,7 +41343,7 @@
> void
> shortPrintFrameAndNCallers(char *theFP, sqInt n)
> { DECL_MAYBE_SQ_GLOBAL_STRUCT
> - if ((n > 0)
> + if ((n != 0)
> && ((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
> && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1))))
> && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
> shortPrintFrame(theFP);
>
> Modified: branches/Cog/src/vm/cointerp.h
> ===================================================================
> --- branches/Cog/src/vm/cointerp.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/cointerp.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,10 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
>
> /*** Function Prototypes ***/
> +sqInt activeProcess(void);
> sqInt addressCouldBeObj(sqInt address);
> sqInt addressCouldBeOop(sqInt address);
> usqInt argumentCountAddress(void);
>
> Modified: branches/Cog/src/vm/cointerpmt.c
> ===================================================================
> --- branches/Cog/src/vm/cointerpmt.c 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/cointerpmt.c 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,9 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - CoInterpreterMT VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CoInterpreterMT VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc " __DATE__ ;
> +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
> char *__interpBuildInfo = __buildInfo;
>
>
> @@ -370,7 +370,7 @@
> sqInt interpret(void);
> static void activateCoggedNewMethod(sqInt inInterpreter);
> static void activateNewMethod(void);
> -static sqInt activeProcess(void);
> +sqInt activeProcess(void);
> EXPORT(sqInt) addGCRoot(sqInt *varLoc);
> static void addLastLinktoList(sqInt proc, sqInt aList);
> static void addNewMethodToCache(sqInt class);
> @@ -1989,7 +1989,7 @@
> /* 575 */ (void (*)(void))0,
> 0 };
> static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /*
> 4097 */])(void);
> -const char *interpreterVersion = "Croquet Closure Cog MT VM
> [CoInterpreterMT VMMaker.oscog-eem.137]";
> +const char *interpreterVersion = "Croquet Closure Cog MT VM
> [CoInterpreterMT VMMaker.oscog-eem.138]";
> sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /*
> 10 */;
> volatile int sendTrace;
> sqInt willNotThreadWarnCount;
> @@ -8787,8 +8787,9 @@
>
>
> /* Answer the current activeProcess. */
> +/* useful for VM debugging */
>
> -static sqInt
> +sqInt
> activeProcess(void)
> {
> return longAt(((longAt(((longAt((GIV(specialObjectsOop) +
> BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) +
> BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) +
> (ActiveProcessIndex << ShiftForWord));
> @@ -20488,13 +20489,17 @@
> goto l1;
> }
> l1: /* end lengthOf: */;
> - if ((lastIndex - startIP) > 100) {
> - lastIndex = startIP + 100;
> + if ((lastIndex - startIP) > 104) {
> + lastIndex = startIP + 103;
> }
> bytecodesPerLine = 8;
> for (index = startIP; index <= lastIndex; index += 1) {
> byte = byteAt((oop + BaseHeaderSize) + (index - 1));
> printf(" %02x/%-3d", byte,byte);
> + if ((index == lastIndex)
> + && ((lengthOf(oop)) > index)) {
> + print("...");
> + }
> if ((((index - startIP) + 1) % bytecodesPerLine) ==
> 0) {
> /* begin cr */
> printf("\n");
> @@ -38935,7 +38940,7 @@
>
> void
> printContext(sqInt aContext)
> -{
> +{ DECL_MAYBE_SQ_GLOBAL_STRUCT
> sqInt i;
> sqInt ip;
> void *p;
> @@ -38986,17 +38991,22 @@
> print("sender ");
> shortPrintOop(sender);
> print("ip ");
> - printNum(ip);
> - print(" (");
> - printNum((ip >> 1));
> - /* begin space */
> - /* begin printChar: */
> - putchar(' ');
> - printHex((ip >> 1));
> - /* begin printChar: */
> - putchar(')');
> - /* begin cr */
> - printf("\n");
> + if (ip == GIV(nilObj)) {
> + shortPrintOop(ip);
> + }
> + else {
> + printNum(ip);
> + print(" (");
> + printNum((ip >> 1));
> + /* begin space */
> + /* begin printChar: */
> + putchar(' ');
> + printHex((ip >> 1));
> + /* begin printChar: */
> + putchar(')');
> + /* begin cr */
> + printf("\n");
> + }
> }
> sp = longAt((aContext + BaseHeaderSize) + (StackPointerIndex <<
> ShiftForWord));
> sp = ((sp < ((lengthOf(aContext)) - ReceiverIndex)) ? sp :
> ((lengthOf(aContext)) - ReceiverIndex));
> @@ -42652,6 +42662,7 @@
> shortPrintContext(sqInt aContext)
> {
> sqInt home;
> + char *theFP;
>
> if (!(((aContext & 1) == 0)
> && (((((usqInt) (longAt(aContext))) >> 12) & 31) ==
> ClassMethodContextCompactIndex))) {
> @@ -42662,14 +42673,20 @@
> return;
> }
> home = findHomeForContext(aContext);
> - printNum(aContext);
> + printHex(aContext);
> if (((longAt((aContext + BaseHeaderSize) + (SenderIndex <<
> ShiftForWord))) & 1)) {
> - if ((checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer)))
> - && (isMachineCodeFrame(frameOfMarriedContext(aContext))))
> {
> - print(" m ");
> + if (checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer))) {
> + if (isMachineCodeFrame((theFP =
> frameOfMarriedContext(aContext)))) {
> + print(" M (");
> + }
> + else {
> + print(" I (");
> + }
> + printHex(theFP);
> + print(") ");
> }
> else {
> - print(" i ");
> + print(" w ");
> }
> }
> else {
> @@ -42744,7 +42761,7 @@
> void
> shortPrintFrameAndNCallers(char *theFP, sqInt n)
> { DECL_MAYBE_SQ_GLOBAL_STRUCT
> - if ((n > 0)
> + if ((n != 0)
> && ((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
> && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1))))
> && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
> shortPrintFrame(theFP);
>
> Modified: branches/Cog/src/vm/cointerpmt.h
> ===================================================================
> --- branches/Cog/src/vm/cointerpmt.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/cointerpmt.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,9 +1,10 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
>
> /*** Function Prototypes ***/
> +sqInt activeProcess(void);
> sqInt addressCouldBeObj(sqInt address);
> sqInt addressCouldBeOop(sqInt address);
> usqInt argumentCountAddress(void);
>
> Modified: branches/Cog/src/vm/gcc3x-cointerp.c
> ===================================================================
> --- branches/Cog/src/vm/gcc3x-cointerp.c 2011-11-15 00:39:49 UTC
> (rev 2513)
> +++ branches/Cog/src/vm/gcc3x-cointerp.c 2011-11-18 01:18:02 UTC
> (rev 2514)
> @@ -2,11 +2,11 @@
>
>
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc " __DATE__ ;
> +static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
> char *__interpBuildInfo = __buildInfo;
>
>
> @@ -330,6 +330,7 @@
> sqInt interpret(void);
> static void activateCoggedNewMethod(sqInt inInterpreter);
> static void activateNewMethod(void);
> +sqInt activeProcess(void);
> EXPORT(sqInt) addGCRoot(sqInt *varLoc);
> static void addLastLinktoList(sqInt proc, sqInt aList);
> static void addNewMethodToCache(sqInt class);
> @@ -1892,7 +1893,7 @@
> /* 575 */ (void (*)(void))0,
> 0 };
> static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /*
> 4097 */])(void);
> -const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter
> VMMaker.oscog-eem.137]";
> +const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter
> VMMaker.oscog-eem.138]";
> sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /*
> 10 */;
> volatile int sendTrace;
>
> @@ -8688,6 +8689,16 @@
> }
>
>
> +/* Answer the current activeProcess. */
> +/* useful for VM debugging */
> +
> +sqInt
> +activeProcess(void)
> +{
> + return longAt(((longAt(((longAt((GIV(specialObjectsOop) +
> BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) +
> BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) +
> (ActiveProcessIndex << ShiftForWord));
> +}
> +
> +
> /* Add the given variable location to the extra roots table */
>
> EXPORT(sqInt)
> @@ -19759,13 +19770,17 @@
> goto l1;
> }
> l1: /* end lengthOf: */;
> - if ((lastIndex - startIP) > 100) {
> - lastIndex = startIP + 100;
> + if ((lastIndex - startIP) > 104) {
> + lastIndex = startIP + 103;
> }
> bytecodesPerLine = 8;
> for (index = startIP; index <= lastIndex; index += 1) {
> byte = byteAt((oop + BaseHeaderSize) + (index - 1));
> printf(" %02x/%-3d", byte,byte);
> + if ((index == lastIndex)
> + && ((lengthOf(oop)) > index)) {
> + print("...");
> + }
> if ((((index - startIP) + 1) % bytecodesPerLine) ==
> 0) {
> /* begin cr */
> printf("\n");
> @@ -37612,7 +37627,7 @@
>
> void
> printContext(sqInt aContext)
> -{
> +{ DECL_MAYBE_SQ_GLOBAL_STRUCT
> sqInt i;
> sqInt ip;
> void *p;
> @@ -37663,17 +37678,22 @@
> print("sender ");
> shortPrintOop(sender);
> print("ip ");
> - printNum(ip);
> - print(" (");
> - printNum((ip >> 1));
> - /* begin space */
> - /* begin printChar: */
> - putchar(' ');
> - printHex((ip >> 1));
> - /* begin printChar: */
> - putchar(')');
> - /* begin cr */
> - printf("\n");
> + if (ip == GIV(nilObj)) {
> + shortPrintOop(ip);
> + }
> + else {
> + printNum(ip);
> + print(" (");
> + printNum((ip >> 1));
> + /* begin space */
> + /* begin printChar: */
> + putchar(' ');
> + printHex((ip >> 1));
> + /* begin printChar: */
> + putchar(')');
> + /* begin cr */
> + printf("\n");
> + }
> }
> sp = longAt((aContext + BaseHeaderSize) + (StackPointerIndex <<
> ShiftForWord));
> sp = ((sp < ((lengthOf(aContext)) - ReceiverIndex)) ? sp :
> ((lengthOf(aContext)) - ReceiverIndex));
> @@ -41228,6 +41248,7 @@
> shortPrintContext(sqInt aContext)
> {
> sqInt home;
> + char *theFP;
>
> if (!(((aContext & 1) == 0)
> && (((((usqInt) (longAt(aContext))) >> 12) & 31) ==
> ClassMethodContextCompactIndex))) {
> @@ -41238,14 +41259,20 @@
> return;
> }
> home = findHomeForContext(aContext);
> - printNum(aContext);
> + printHex(aContext);
> if (((longAt((aContext + BaseHeaderSize) + (SenderIndex <<
> ShiftForWord))) & 1)) {
> - if ((checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer)))
> - && (isMachineCodeFrame(frameOfMarriedContext(aContext))))
> {
> - print(" m ");
> + if (checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer))) {
> + if (isMachineCodeFrame((theFP =
> frameOfMarriedContext(aContext)))) {
> + print(" M (");
> + }
> + else {
> + print(" I (");
> + }
> + printHex(theFP);
> + print(") ");
> }
> else {
> - print(" i ");
> + print(" w ");
> }
> }
> else {
> @@ -41320,7 +41347,7 @@
> void
> shortPrintFrameAndNCallers(char *theFP, sqInt n)
> { DECL_MAYBE_SQ_GLOBAL_STRUCT
> - if ((n > 0)
> + if ((n != 0)
> && ((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
> && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1))))
> && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
> shortPrintFrame(theFP);
>
> Modified: branches/Cog/src/vm/gcc3x-cointerpmt.c
> ===================================================================
> --- branches/Cog/src/vm/gcc3x-cointerpmt.c 2011-11-15 00:39:49 UTC
> (rev 2513)
> +++ branches/Cog/src/vm/gcc3x-cointerpmt.c 2011-11-18 01:18:02 UTC
> (rev 2514)
> @@ -2,11 +2,11 @@
>
>
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> from
> - CoInterpreterMT VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CoInterpreterMT VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
> -static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc " __DATE__ ;
> +static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d " __DATE__ ;
> char *__interpBuildInfo = __buildInfo;
>
>
> @@ -373,7 +373,7 @@
> sqInt interpret(void);
> static void activateCoggedNewMethod(sqInt inInterpreter);
> static void activateNewMethod(void);
> -static sqInt activeProcess(void);
> +sqInt activeProcess(void);
> EXPORT(sqInt) addGCRoot(sqInt *varLoc);
> static void addLastLinktoList(sqInt proc, sqInt aList);
> static void addNewMethodToCache(sqInt class);
> @@ -1992,7 +1992,7 @@
> /* 575 */ (void (*)(void))0,
> 0 };
> static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /*
> 4097 */])(void);
> -const char *interpreterVersion = "Croquet Closure Cog MT VM
> [CoInterpreterMT VMMaker.oscog-eem.137]";
> +const char *interpreterVersion = "Croquet Closure Cog MT VM
> [CoInterpreterMT VMMaker.oscog-eem.138]";
> sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /*
> 10 */;
> volatile int sendTrace;
> sqInt willNotThreadWarnCount;
> @@ -8791,8 +8791,9 @@
>
>
> /* Answer the current activeProcess. */
> +/* useful for VM debugging */
>
> -static sqInt
> +sqInt
> activeProcess(void)
> {
> return longAt(((longAt(((longAt((GIV(specialObjectsOop) +
> BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) +
> BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) +
> (ActiveProcessIndex << ShiftForWord));
> @@ -20492,13 +20493,17 @@
> goto l1;
> }
> l1: /* end lengthOf: */;
> - if ((lastIndex - startIP) > 100) {
> - lastIndex = startIP + 100;
> + if ((lastIndex - startIP) > 104) {
> + lastIndex = startIP + 103;
> }
> bytecodesPerLine = 8;
> for (index = startIP; index <= lastIndex; index += 1) {
> byte = byteAt((oop + BaseHeaderSize) + (index - 1));
> printf(" %02x/%-3d", byte,byte);
> + if ((index == lastIndex)
> + && ((lengthOf(oop)) > index)) {
> + print("...");
> + }
> if ((((index - startIP) + 1) % bytecodesPerLine) ==
> 0) {
> /* begin cr */
> printf("\n");
> @@ -38939,7 +38944,7 @@
>
> void
> printContext(sqInt aContext)
> -{
> +{ DECL_MAYBE_SQ_GLOBAL_STRUCT
> sqInt i;
> sqInt ip;
> void *p;
> @@ -38990,17 +38995,22 @@
> print("sender ");
> shortPrintOop(sender);
> print("ip ");
> - printNum(ip);
> - print(" (");
> - printNum((ip >> 1));
> - /* begin space */
> - /* begin printChar: */
> - putchar(' ');
> - printHex((ip >> 1));
> - /* begin printChar: */
> - putchar(')');
> - /* begin cr */
> - printf("\n");
> + if (ip == GIV(nilObj)) {
> + shortPrintOop(ip);
> + }
> + else {
> + printNum(ip);
> + print(" (");
> + printNum((ip >> 1));
> + /* begin space */
> + /* begin printChar: */
> + putchar(' ');
> + printHex((ip >> 1));
> + /* begin printChar: */
> + putchar(')');
> + /* begin cr */
> + printf("\n");
> + }
> }
> sp = longAt((aContext + BaseHeaderSize) + (StackPointerIndex <<
> ShiftForWord));
> sp = ((sp < ((lengthOf(aContext)) - ReceiverIndex)) ? sp :
> ((lengthOf(aContext)) - ReceiverIndex));
> @@ -42656,6 +42666,7 @@
> shortPrintContext(sqInt aContext)
> {
> sqInt home;
> + char *theFP;
>
> if (!(((aContext & 1) == 0)
> && (((((usqInt) (longAt(aContext))) >> 12) & 31) ==
> ClassMethodContextCompactIndex))) {
> @@ -42666,14 +42677,20 @@
> return;
> }
> home = findHomeForContext(aContext);
> - printNum(aContext);
> + printHex(aContext);
> if (((longAt((aContext + BaseHeaderSize) + (SenderIndex <<
> ShiftForWord))) & 1)) {
> - if ((checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer)))
> - && (isMachineCodeFrame(frameOfMarriedContext(aContext))))
> {
> - print(" m ");
> + if (checkIsStillMarriedContextcurrentFP(aContext,
> GIV(framePointer))) {
> + if (isMachineCodeFrame((theFP =
> frameOfMarriedContext(aContext)))) {
> + print(" M (");
> + }
> + else {
> + print(" I (");
> + }
> + printHex(theFP);
> + print(") ");
> }
> else {
> - print(" i ");
> + print(" w ");
> }
> }
> else {
> @@ -42748,7 +42765,7 @@
> void
> shortPrintFrameAndNCallers(char *theFP, sqInt n)
> { DECL_MAYBE_SQ_GLOBAL_STRUCT
> - if ((n > 0)
> + if ((n != 0)
> && ((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
> && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1))))
> && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
> shortPrintFrame(theFP);
>
> Modified: branches/Cog/src/vm/interp.h
> ===================================================================
> --- branches/Cog/src/vm/interp.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/interp.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
> #define VM_PROXY_MAJOR 1
>
> Modified: branches/Cog/src/vm/vmCallback.h
> ===================================================================
> --- branches/Cog/src/vm/vmCallback.h 2011-11-15 00:39:49 UTC (rev 2513)
> +++ branches/Cog/src/vm/vmCallback.h 2011-11-18 01:18:02 UTC (rev 2514)
> @@ -1,5 +1,5 @@
> /* Automatically generated by
> - CCodeGeneratorGlobalStructure VMMaker.oscog-eem.137 uuid:
> fbe64d98-6b1a-4c5b-b3f3-d2b1091406dc
> + CCodeGeneratorGlobalStructure VMMaker.oscog-eem.138 uuid:
> f9a63bdf-7bbc-4ae5-9634-ecd6fd814c9d
> */
>
> #define VM_CALLBACK_INC 1
>
>
--
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20111118/edb0049c/attachment-0001.htm
More information about the Vm-dev
mailing list