[Vm-dev] [commit][2760] CogVM source as per VMMaker.oscog-eem.314
commits at squeakvm.org
commits at squeakvm.org
Mon Jul 29 22:32:47 UTC 2013
Revision: 2760
Author: eliot
Date: 2013-07-29 15:32:45 -0700 (Mon, 29 Jul 2013)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.314
Fix bug in transferTo:(from:) when doing a code compaction when
ensuring there is a machine code method when switching to a
process whose context has a machine code pc.
Add an assert to commenceCogCompiledCodeCompaction to catch
the actual bug (pushing the instructionPointer twice).
Improve inlining via inlineSend:directReturn:exitVar:in: by refactoring
argAssignmentsFor:args:in:'s innards. Now global variables are
inlined if they are only read within the code being inlined.
Implement warningat in term of warning so one only has to remember
to set a breakpoint in warning, not both.
Modified Paths:
--------------
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/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
Property Changed:
----------------
branches/Cog/
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Property changes on: branches/Cog
___________________________________________________________________
Modified: svn:ignore
- ChangeHistory
MVALOG
README.*
*.app
*.dmg
*.msi
*.tgz
*.zip
cogastlinux
cogdbglinux
coglinux
cogmtlinux
cogwin
cogmtwin
nsvmlinux
nsvmlinuxast
nsvmlinuxdbg
nsvmwin
+ ChangeHistory
MVALOG
README.*
*.app
*.dmg
*.msi
*.tgz
*.zip
cogastlinux
cogastlinuxpt
cogdbglinux
cogdbglinuxpt
coglinux
coglinuxpt
cogmtlinux
cogwin
cogmtwin
nsvmlinux
nsvmlinuxpt
nsvmlinuxast
nsvmlinuxastpt
nsvmlinuxdbg
nsvmlinuxdbgpt
nsvmwin
Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2013-07-25 23:57:06 UTC (rev 2759)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2013-07-29 22:32:45 UTC (rev 2760)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.312 uuid: c3721341-0803-4acd-aa1e-48ab09aca8e3
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.314 uuid: e8cba0d1-78b9-4058-820f-62d6e02e180b
from
- CoInterpreter VMMaker.oscog-eem.312 uuid: c3721341-0803-4acd-aa1e-48ab09aca8e3
+ CoInterpreter VMMaker.oscog-eem.314 uuid: e8cba0d1-78b9-4058-820f-62d6e02e180b
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.312 uuid: c3721341-0803-4acd-aa1e-48ab09aca8e3 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.314 uuid: e8cba0d1-78b9-4058-820f-62d6e02e180b " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -41,7 +41,13 @@
}
void
warningat(char *s, int l) { /* ditto with line number. */
- printf("\n%s %d\n", s,l);
+#if 0
+ printf("\n%s %d\n", s, l);
+#else /* use alloca to call warning so one does not have to remember to set two breakpoints... */
+ char *sl = alloca(strlen(s) + 16);
+ sprintf(sl, "%s %d", s, l);
+ warning(sl);
+#endif
}
#pragma auto_inline on
@@ -1979,7 +1985,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.312";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.314";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -4137,7 +4143,6 @@
/* commonReturn */
{
sqInt aMethodObj;
- StackPage *aPage;
sqInt callerContextOrNil;
sqInt callerContextOrNil1;
sqInt callerContextOrNil2;
@@ -4366,8 +4371,7 @@
currentCtx = callerContextOrNil2;
assert(isContext(currentCtx));
/* begin freeStackPage: */
- aPage = GIV(stackPage);
- freeStackPageNoAssert(aPage);
+ freeStackPageNoAssert(GIV(stackPage));
assert(pageListIsWellFormed());
while (!((((longAt((currentCtx + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
&& ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage))) {
@@ -14436,7 +14440,6 @@
char *sp1;
char *sp2;
char *sp3;
- char *theFP;
StackPage *thePage;
sqInt value;
@@ -14486,14 +14489,13 @@
Make the interior frame the top frame. */
/* begin findFrameAbove:inPage: */
- theFP = GIV(framePointer);
fp = (thePage->headFP);
- if (fp == theFP) {
+ if (fp == GIV(framePointer)) {
frameAbove = 0;
goto l1;
}
while (((callerFP = frameCallerFP(fp))) != 0) {
- if (callerFP == theFP) {
+ if (callerFP == GIV(framePointer)) {
frameAbove = fp;
goto l1;
}
@@ -14705,8 +14707,6 @@
sqInt
ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
- sqInt aMethodOop;
sqInt canLinkCacheTag;
sqInt ccIndex;
sqInt ccIndex1;
@@ -14758,8 +14758,7 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(1ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -14773,10 +14772,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -14790,8 +14789,7 @@
&& ((((((usqInt) (longAt(GIV(newMethod)))) >> 8) & 15) >= 12)
&& (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))))) {
/* begin cogMethodOf: */
- aMethodOop = GIV(newMethod);
- methodHeader1 = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
assert((isNonIntegerObject(methodHeader1))
&& ((((usqInt)methodHeader1)) < (startOfMemory())));
cogMethod = ((CogMethod *) methodHeader1);
@@ -14897,11 +14895,9 @@
sqInt firstBytecode;
sqInt methodHeader;
sqInt methodHeader1;
- sqInt object;
sqInt primBits;
sqInt primitiveIndex;
char *sp;
- sqInt theClass;
sqInt top;
assert(((rcvr & 1))
@@ -14927,8 +14923,7 @@
&& ((((((usqInt) (longAt(aMethodObj))) >> 8) & 15) >= 12)
&& (isCogMethodReference(longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))))) {
/* begin push: */
- object = GIV(instructionPointer);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
executeCogMethodFromUnlinkedSendwithReceiver(cogMethodOf(aMethodObj), rcvr);
assert(0);
@@ -14950,7 +14945,6 @@
: ((primBits = ((usqInt) methodHeader) >> 1),
(primBits & 511) + ((((usqInt) primBits) >> 19) & 512)));
/* begin functionPointerFor:inClass: */
- theClass = GIV(nilObj);
primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex
? 0
: primitiveTable[primitiveIndex])));
@@ -14974,7 +14968,6 @@
sqInt
ceNonLocalReturn(sqInt returnValue)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- StackPage *aPage;
sqInt callerContextOrNil;
sqInt callerContextOrNil1;
sqInt callerContextOrNil2;
@@ -15209,8 +15202,7 @@
currentCtx = callerContextOrNil2;
assert(isContext(currentCtx));
/* begin freeStackPage: */
- aPage = GIV(stackPage);
- freeStackPageNoAssert(aPage);
+ freeStackPageNoAssert(GIV(stackPage));
assert(pageListIsWellFormed());
while (1) {
assert(isContext(currentCtx));
@@ -15299,18 +15291,16 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt aMethodObj;
char *sp;
- StackPage *thePage;
assert(((anOop & 1))
|| (addressCouldBeObj(anOop)));
flag("are you really sure setStackPageAndLimit: is needed?");
/* begin setStackPageAndLimit: */
- thePage = GIV(stackPage);
- GIV(stackPage) = thePage;
+ GIV(stackPage) = GIV(stackPage);
if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
GIV(stackLimit) = (GIV(stackPage)->stackLimit);
}
- markStackPageMostRecentlyUsed(thePage);
+ markStackPageMostRecentlyUsed(GIV(stackPage));
assert(!(isMachineCodeFrame(GIV(framePointer))));
/* begin setMethod: */
/* begin iframeMethod: */
@@ -15345,7 +15335,6 @@
sqInt
ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
sqInt ccIndex;
sqInt class;
CogMethod *cogMethod;
@@ -15378,8 +15367,7 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(2ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -15393,10 +15381,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -15429,7 +15417,6 @@
sqInt
ceSendFromInLineCacheMiss(CogMethod *oPIC)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
sqInt ccIndex;
sqInt class;
CogMethod *cogMethod;
@@ -15465,9 +15452,8 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(3ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
selector = (oPIC->selector);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -15481,10 +15467,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -15548,8 +15534,6 @@
sqInt
ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt numArgs)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
- sqInt aMethodOop;
sqInt canLinkCacheTag;
sqInt ccIndex;
sqInt class;
@@ -15601,8 +15585,7 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(4ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -15616,10 +15599,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -15640,8 +15623,7 @@
&& ((((((usqInt) (longAt(GIV(newMethod)))) >> 8) & 15) >= 12)
&& (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))))) {
/* begin cogMethodOf: */
- aMethodOop = GIV(newMethod);
- methodHeader1 = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
assert((isNonIntegerObject(methodHeader1))
&& ((((usqInt)methodHeader1)) < (startOfMemory())));
cogMethod = ((CogMethod *) methodHeader1);
@@ -17588,6 +17570,10 @@
startTime = ioUTCMicrosecondsNow();
if (GIV(instructionPointer) != 0) {
+
+ /* better not have already been pushed */
+
+ assert((((usqInt)(stackTop()))) != GIV(instructionPointer));
/* begin push: */
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
@@ -18318,10 +18304,12 @@
sqInt i;
sqInt newClosure;
sqInt newClosure1;
+ char *theSP;
assert(isMachineCodeFrame(GIV(framePointer)));
/* begin ensureFrameIsMarried:SP: */
VM_LABEL(13ensureFrameIsMarriedSP);
+ theSP = GIV(stackPointer) + ((1 + numCopied) * BytesPerWord);
if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
? ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
: (byteAt((GIV(framePointer) + FoxIFrameFlags) + 2)) != 0)) {
@@ -18329,7 +18317,7 @@
context = longAt(GIV(framePointer) + FoxThisContext);
goto l1;
}
- context = marryFrameSP(GIV(framePointer), GIV(stackPointer) + ((1 + numCopied) * BytesPerWord));
+ context = marryFrameSP(GIV(framePointer), theSP);
l1: /* end ensureFrameIsMarried:SP: */;
/* begin closureIn:numArgs:instructionPointer:numCopiedValues: */
VM_LABEL(2closureInnumArgsinstructionPointernumCopiedValues);
@@ -23998,11 +23986,9 @@
static void
initializeMemoryFirstFree(sqInt firstFree)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- usqInt end;
sqInt fwdBlockBytes;
usqInt i;
sqInt newEndOfMemory;
- usqInt start;
sqInt totalReserve;
fwdBlockBytes = GIV(totalObjectCount) & ((WordMask - BytesPerWord) + 1);
@@ -24030,10 +24016,8 @@
GIV(freeStart) = firstFree;
GIV(scavengeThreshold) = (((GIV(freeStart) + GIV(edenBytes)) < GIV(reserveStart)) ? (GIV(freeStart) + GIV(edenBytes)) : GIV(reserveStart));
/* begin maybeFillWithAllocationCheckFillerFrom:to: */
- start = GIV(freeStart);
- end = GIV(scavengeThreshold);
if (AllocationCheckFiller != 0) {
- for (i = start; i <= end; i += BytesPerWord) {
+ for (i = GIV(freeStart); i <= GIV(scavengeThreshold); i += BytesPerWord) {
longAtput(i, (AllocationCheckFiller == 182275669
? i
: AllocationCheckFiller));
@@ -27652,7 +27636,6 @@
sqInt methodHeader1;
sqInt numLiterals;
sqInt numLiterals1;
- sqInt oop1;
sqInt parentField;
void *pointer;
void *pointer1;
@@ -27839,8 +27822,7 @@
goto l2;
}
/* begin lastPointerOf:recordWeakRoot: */
- oop1 = child;
- header3 = longAt(oop1);
+ header3 = longAt(child);
fmt = (((usqInt) header3) >> 8) & 15;
if (fmt <= 4) {
if (fmt >= 3) {
@@ -27853,18 +27835,18 @@
if (!(((GIV(weakRootCount) += 1)) <= WeakRootTableSize)) {
error("weakRoots table overflow");
}
- GIV(weakRoots)[GIV(weakRootCount)] = oop1;
+ GIV(weakRoots)[GIV(weakRootCount)] = child;
}
- lastFieldOffset1 = (nonWeakFieldsOf(oop1)) << ShiftForWord;
+ lastFieldOffset1 = (nonWeakFieldsOf(child)) << ShiftForWord;
goto l5;
}
if (((((usqInt) header3) >> 12) & 31) == ClassMethodContextCompactIndex) {
/* begin setTraceFlagOnContextsFramesPageIfNeeded: */
- if ((((longAt((oop1 + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
- && (!(isWidowedContext(oop1)))) {
+ if ((((longAt((child + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
+ && (!(isWidowedContext(child)))) {
/* begin stackPageFor: */
/* begin frameOfMarriedContext: */
- value = longAt((oop1 + BaseHeaderSize) + (SenderIndex << ShiftForWord));
+ value = longAt((child + BaseHeaderSize) + (SenderIndex << ShiftForWord));
/* begin withoutSmallIntegerTags: */
assert((value & 1));
pointer = ((char *) (pointerForOop(value - 1)));
@@ -27879,28 +27861,28 @@
}
}
/* begin fetchStackPointerOf: */
- sp = longAt((oop1 + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
+ sp = longAt((child + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
if (!((sp & 1))) {
contextSize = 0;
goto l4;
}
- assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(oop1)));
+ assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(child)));
contextSize = (sp >> 1);
l4: /* end fetchStackPointerOf: */;
- assert((ReceiverIndex + contextSize) < (lengthOfbaseHeaderformat(oop1, header3, fmt)));
+ assert((ReceiverIndex + contextSize) < (lengthOfbaseHeaderformat(child, header3, fmt)));
lastFieldOffset1 = (CtxtTempFrameStart + contextSize) * BytesPerWord;
goto l5;
}
}
/* begin sizeBitsOfSafe: */
- header11 = longAt(oop1);
+ header11 = longAt(child);
type1 = ((header11 & SizeMask) == 0
? HeaderTypeSizeAndClass
: ((header11 & CompactClassMask) == 0
? HeaderTypeClass
: HeaderTypeShort));
sz = (type1 == HeaderTypeSizeAndClass
- ? (longAt(oop1 - (BytesPerWord * 2))) & AllButTypeMask
+ ? (longAt(child - (BytesPerWord * 2))) & AllButTypeMask
: header11 & SizeMask);
lastFieldOffset1 = sz - BaseHeaderSize;
goto l5;
@@ -27911,7 +27893,7 @@
}
/* begin literalCountOfHeader: */
/* begin headerOf: */
- methodHeader = longAt((oop1 + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((child + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
headerPointer = (isCogMethodReference(methodHeader)
? (assert(((((CogMethod *) methodHeader)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
(((CogMethod *) methodHeader)->methodHeader))
@@ -31615,6 +31597,7 @@
sqInt frameNumArgs1;
sqInt i;
sqInt methodHeader;
+ sqInt methodPointer;
sqInt newCopy;
sqInt objHeader;
sqInt rcvr;
@@ -31687,7 +31670,8 @@
/* begin rawHeaderOf:put: */
/* begin headerOf: */
- methodHeader = longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodPointer = longAt(GIV(stackPointer));
+ methodHeader = longAt((methodPointer + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
cogMethodOrMethodHeader = (isCogMethodReference(methodHeader)
? (assert(((((CogMethod *) methodHeader)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
(((CogMethod *) methodHeader)->methodHeader))
@@ -37831,7 +37815,6 @@
static void
primitiveInterruptSemaphore(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt anObject;
sqInt arg;
sqInt ccIndex;
sqInt top;
@@ -37854,12 +37837,11 @@
}
else {
/* begin splObj:put: */
- anObject = GIV(nilObj);
/* begin storePointer:ofObject:withValue: */
if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(GIV(specialObjectsOop), anObject);
+ possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
}
- longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheInterruptSemaphore << ShiftForWord), anObject);
+ longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheInterruptSemaphore << ShiftForWord), GIV(nilObj));
}
}
@@ -37874,8 +37856,6 @@
sqInt ccIndex;
sqInt i;
sqInt lookupClass;
- sqInt object;
- sqInt object1;
sqInt runArgs;
sqInt runReceiver;
char *sp;
@@ -37900,12 +37880,10 @@
GIV(stackPointer) += BytesPerWord;
runReceiver = top;
/* begin push: */
- object = GIV(newMethod);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
GIV(stackPointer) = sp;
/* begin push: */
- object1 = GIV(messageSelector);
- longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1);
+ longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(messageSelector));
GIV(stackPointer) = sp1;
/* begin push: */
longAtput((sp2 = GIV(stackPointer) - BytesPerWord), runArgs);
@@ -38594,7 +38572,6 @@
sqInt activeContext;
sqInt ccIndex;
sqInt flushState;
- sqInt object;
sqInt sema;
char *sp;
@@ -38626,8 +38603,7 @@
}
if (flushState) {
/* begin push: */
- object = GIV(instructionPointer);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
activeContext = voidVMStateForSnapshot();
marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
@@ -38652,7 +38628,6 @@
static void
primitiveLowSpaceSemaphore(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt anObject;
sqInt arg;
sqInt ccIndex;
sqInt top;
@@ -38675,12 +38650,11 @@
}
else {
/* begin splObj:put: */
- anObject = GIV(nilObj);
/* begin storePointer:ofObject:withValue: */
if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(GIV(specialObjectsOop), anObject);
+ possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
}
- longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheLowSpaceSemaphore << ShiftForWord), anObject);
+ longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheLowSpaceSemaphore << ShiftForWord), GIV(nilObj));
}
}
@@ -40396,7 +40370,6 @@
sqInt activeContext;
sqInt ccIndex;
sqInt flushState;
- sqInt object;
sqInt sema;
char *sp;
@@ -40433,8 +40406,7 @@
GIV(profileSemaphore) = sema;
if (flushState) {
/* begin push: */
- object = GIV(instructionPointer);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
activeContext = voidVMStateForSnapshot();
marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
@@ -42015,9 +41987,7 @@
sqInt deltaMsecs;
usqInt msecs;
sqInt msecsObj;
- sqInt oop;
sqInt sema;
- sqInt valuePointer;
msecsObj = longAt(GIV(stackPointer));
sema = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -42047,12 +42017,10 @@
}
else {
/* begin storePointer:ofObject:withValue: */
- oop = GIV(specialObjectsOop);
- valuePointer = GIV(nilObj);
- if ((((usqInt) oop)) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(oop, valuePointer);
+ if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
+ possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
}
- longAtput((oop + BaseHeaderSize) + (TheTimerSemaphore << ShiftForWord), valuePointer);
+ longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheTimerSemaphore << ShiftForWord), GIV(nilObj));
GIV(nextWakeupUsecs) = 0;
}
/* begin pop: */
@@ -42069,11 +42037,9 @@
primitiveSignalAtUTCMicroseconds(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt ccIndex;
- sqInt oop;
sqInt sema;
usqLong usecs;
sqInt usecsObj;
- sqInt valuePointer;
usecsObj = longAt(GIV(stackPointer));
sema = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -42099,12 +42065,10 @@
}
else {
/* begin storePointer:ofObject:withValue: */
- oop = GIV(specialObjectsOop);
- valuePointer = GIV(nilObj);
- if ((((usqInt) oop)) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(oop, valuePointer);
+ if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
+ possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
}
- longAtput((oop + BaseHeaderSize) + (TheTimerSemaphore << ShiftForWord), valuePointer);
+ longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheTimerSemaphore << ShiftForWord), GIV(nilObj));
GIV(nextWakeupUsecs) = 0;
}
/* begin pop: */
@@ -43082,7 +43046,6 @@
char *sp;
char *sp1;
sqInt tempLink;
- sqInt valuePointer;
process = longAt(GIV(stackPointer));
if (process == (longAt(((longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) + BaseHeaderSize) + (ValueIndex << ShiftForWord))) + BaseHeaderSize) + (ActiveProcessIndex << ShiftForWord)))) {
@@ -43177,11 +43140,10 @@
l1: /* end removeProcess:fromList: */;
if (!GIV(primFailCode)) {
/* begin storePointer:ofObject:withValue: */
- valuePointer = GIV(nilObj);
if ((((usqInt) process)) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(process, valuePointer);
+ possibleRootStoreIntovalue(process, GIV(nilObj));
}
- longAtput((process + BaseHeaderSize) + (MyListIndex << ShiftForWord), valuePointer);
+ longAtput((process + BaseHeaderSize) + (MyListIndex << ShiftForWord), GIV(nilObj));
/* begin pop:thenPush: */
longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), myList);
GIV(stackPointer) = sp1;
@@ -48051,7 +48013,6 @@
EXPORT(sqInt)
reestablishContextPriorToCallback(sqInt callbackContext)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- StackPage *aPage;
sqInt calloutContext;
sqInt index;
char *sp;
@@ -48102,8 +48063,7 @@
if ((longAt(theFP + FoxSavedFP)) == 0) {
/* begin freeStackPage: */
- aPage = GIV(stackPage);
- freeStackPageNoAssert(aPage);
+ freeStackPageNoAssert(GIV(stackPage));
assert(pageListIsWellFormed());
}
else {
@@ -48376,7 +48336,6 @@
EXPORT(sqInt)
returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- StackPage *aPage;
sqInt calloutMethodContext;
sqInt index;
char *sp;
@@ -48427,8 +48386,7 @@
if ((longAt(theFP + FoxSavedFP)) == 0) {
/* begin freeStackPage: */
- aPage = GIV(stackPage);
- freeStackPageNoAssert(aPage);
+ freeStackPageNoAssert(GIV(stackPage));
assert(pageListIsWellFormed());
}
else {
@@ -50311,8 +50269,6 @@
sqInt numArgs;
sqInt numTemps;
sqInt object;
- sqInt object1;
- sqInt object2;
sqInt oop;
sqInt oop1;
sqInt oop2;
@@ -50346,8 +50302,7 @@
(GIV(primFailCode) = PrimErrBadNumArgs); return;
}
/* begin push: */
- object2 = GIV(instructionPointer);
- longAtput((sp12 = GIV(stackPointer) - BytesPerWord), object2);
+ longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp12;
/* update state of active process */
@@ -50473,8 +50428,7 @@
marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
if (!GIV(primFailCode)) {
/* begin push: */
- object = GIV(falseObj);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(falseObj));
GIV(stackPointer) = sp;
}
else {
@@ -50536,7 +50490,7 @@
longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
GIV(stackPointer) = sp3;
/* begin push: */
- object1 = (VMBIGENDIAN
+ object = (VMBIGENDIAN
? ((1 + (numArgs << ((BytesPerWord * 8) - 8))) + ((0
? 1 << ((BytesPerWord * 8) - 16)
: 0))) + ((0
@@ -50547,7 +50501,7 @@
: 0))) + ((0
? 1 << 24
: 0)));
- longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object1);
+ longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object);
GIV(stackPointer) = sp4;
/* begin push: */
longAtput((sp5 = GIV(stackPointer) - BytesPerWord), 0);
@@ -52418,9 +52372,9 @@
}
-/* Record a process to be awoken on the next interpreter cycle. */
/* Record a process to be awoken on the next interpreter cycle.
- Reimplement to record the source of the switch for debugging. */
+ Reimplement to record the source of the switch for debugging,
+ and to cope with possible code compaction in makeBaseFrameFor:. */
static void
transferTofrom(sqInt newProc, sqInt sourceCode)
@@ -52430,20 +52384,14 @@
sqInt aProcess;
sqInt index;
StackPage *lastUsedPage;
- char *lifp;
- usqInt lip;
- char *lisp;
StackPage *lruOrFree;
sqInt newContext;
StackPage *newPage;
- sqInt object;
sqInt oldProc;
sqInt sched;
char *sp;
- char *theFP;
char *theFrame;
StackPage *thePage;
- char *theSP;
sqInt top;
sqInt value;
@@ -52458,8 +52406,7 @@
}
GIV(statProcessSwitch) += 1;
/* begin push: */
- object = GIV(instructionPointer);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
/* begin externalWriteBackHeadFramePointers */
assert((GIV(framePointer) - GIV(stackPointer)) < LargeContextSize);
@@ -52474,24 +52421,20 @@
(GIV(stackPage)->headSP = GIV(stackPointer));
assert(pageListIsWellFormed());
/* begin assertValidExecutionPointe:r:s: */
- lip = GIV(instructionPointer);
- lifp = GIV(framePointer);
- lisp = GIV(stackPointer);
- assertValidExecutionPointersimbarline(lip, lifp, lisp, !((((usqInt)(longAt(lifp + FoxMethod)))) < (startOfMemory())), __LINE__);
+ assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
+ GIV(instructionPointer) = 0;
sched = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SchedulerAssociation << ShiftForWord))) + BaseHeaderSize) + (ValueIndex << ShiftForWord));
oldProc = longAt((sched + BaseHeaderSize) + (ActiveProcessIndex << ShiftForWord));
/* begin ensureFrameIsMarried:SP: */
VM_LABEL(26ensureFrameIsMarriedSP);
- theFP = GIV(framePointer);
- theSP = GIV(stackPointer);
- if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
- ? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
- : (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
- assert(isContext(frameContext(theFP)));
- activeContext = longAt(theFP + FoxThisContext);
+ if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
+ ? ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
+ : (byteAt((GIV(framePointer) + FoxIFrameFlags) + 2)) != 0)) {
+ assert(isContext(frameContext(GIV(framePointer))));
+ activeContext = longAt(GIV(framePointer) + FoxThisContext);
goto l1;
}
- activeContext = marryFrameSP(theFP, theSP);
+ activeContext = marryFrameSP(GIV(framePointer), GIV(stackPointer));
l1: /* end ensureFrameIsMarried:SP: */;
/* begin storePointer:ofObject:withValue: */
if ((((usqInt) oldProc)) < (((usqInt) GIV(youngStart)))) {
Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h 2013-07-25 23:57:06 UTC (rev 2759)
+++ branches/Cog/nscogsrc/vm/cointerp.h 2013-07-29 22:32:45 UTC (rev 2760)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.312 uuid: c3721341-0803-4acd-aa1e-48ab09aca8e3
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.314 uuid: e8cba0d1-78b9-4058-820f-62d6e02e180b
*/
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-07-25 23:57:06 UTC (rev 2759)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2013-07-29 22:32:45 UTC (rev 2760)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.312 uuid: c3721341-0803-4acd-aa1e-48ab09aca8e3
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.314 uuid: e8cba0d1-78b9-4058-820f-62d6e02e180b
from
- CoInterpreter VMMaker.oscog-eem.312 uuid: c3721341-0803-4acd-aa1e-48ab09aca8e3
+ CoInterpreter VMMaker.oscog-eem.314 uuid: e8cba0d1-78b9-4058-820f-62d6e02e180b
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.312 uuid: c3721341-0803-4acd-aa1e-48ab09aca8e3 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.314 uuid: e8cba0d1-78b9-4058-820f-62d6e02e180b " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -44,7 +44,13 @@
}
void
warningat(char *s, int l) { /* ditto with line number. */
- printf("\n%s %d\n", s,l);
+#if 0
+ printf("\n%s %d\n", s, l);
+#else /* use alloca to call warning so one does not have to remember to set two breakpoints... */
+ char *sl = alloca(strlen(s) + 16);
+ sprintf(sl, "%s %d", s, l);
+ warning(sl);
+#endif
}
#pragma auto_inline on
@@ -1982,7 +1988,7 @@
/* 575 */ (void (*)(void))0,
0 };
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.312";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.314";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
volatile int sendTrace;
@@ -4146,7 +4152,6 @@
/* commonReturn */
{
sqInt aMethodObj;
- StackPage *aPage;
sqInt callerContextOrNil;
sqInt callerContextOrNil1;
sqInt callerContextOrNil2;
@@ -4375,8 +4380,7 @@
currentCtx = callerContextOrNil2;
assert(isContext(currentCtx));
/* begin freeStackPage: */
- aPage = GIV(stackPage);
- freeStackPageNoAssert(aPage);
+ freeStackPageNoAssert(GIV(stackPage));
assert(pageListIsWellFormed());
while (!((((longAt((currentCtx + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
&& ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage))) {
@@ -14445,7 +14449,6 @@
char *sp1;
char *sp2;
char *sp3;
- char *theFP;
StackPage *thePage;
sqInt value;
@@ -14495,14 +14498,13 @@
Make the interior frame the top frame. */
/* begin findFrameAbove:inPage: */
- theFP = GIV(framePointer);
fp = (thePage->headFP);
- if (fp == theFP) {
+ if (fp == GIV(framePointer)) {
frameAbove = 0;
goto l1;
}
while (((callerFP = frameCallerFP(fp))) != 0) {
- if (callerFP == theFP) {
+ if (callerFP == GIV(framePointer)) {
frameAbove = fp;
goto l1;
}
@@ -14714,8 +14716,6 @@
sqInt
ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
- sqInt aMethodOop;
sqInt canLinkCacheTag;
sqInt ccIndex;
sqInt ccIndex1;
@@ -14767,8 +14767,7 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(1ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -14782,10 +14781,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -14799,8 +14798,7 @@
&& ((((((usqInt) (longAt(GIV(newMethod)))) >> 8) & 15) >= 12)
&& (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))))) {
/* begin cogMethodOf: */
- aMethodOop = GIV(newMethod);
- methodHeader1 = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
assert((isNonIntegerObject(methodHeader1))
&& ((((usqInt)methodHeader1)) < (startOfMemory())));
cogMethod = ((CogMethod *) methodHeader1);
@@ -14906,11 +14904,9 @@
sqInt firstBytecode;
sqInt methodHeader;
sqInt methodHeader1;
- sqInt object;
sqInt primBits;
sqInt primitiveIndex;
char *sp;
- sqInt theClass;
sqInt top;
assert(((rcvr & 1))
@@ -14936,8 +14932,7 @@
&& ((((((usqInt) (longAt(aMethodObj))) >> 8) & 15) >= 12)
&& (isCogMethodReference(longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))))) {
/* begin push: */
- object = GIV(instructionPointer);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
executeCogMethodFromUnlinkedSendwithReceiver(cogMethodOf(aMethodObj), rcvr);
assert(0);
@@ -14959,7 +14954,6 @@
: ((primBits = ((usqInt) methodHeader) >> 1),
(primBits & 511) + ((((usqInt) primBits) >> 19) & 512)));
/* begin functionPointerFor:inClass: */
- theClass = GIV(nilObj);
primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex
? 0
: primitiveTable[primitiveIndex])));
@@ -14983,7 +14977,6 @@
sqInt
ceNonLocalReturn(sqInt returnValue)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- StackPage *aPage;
sqInt callerContextOrNil;
sqInt callerContextOrNil1;
sqInt callerContextOrNil2;
@@ -15218,8 +15211,7 @@
currentCtx = callerContextOrNil2;
assert(isContext(currentCtx));
/* begin freeStackPage: */
- aPage = GIV(stackPage);
- freeStackPageNoAssert(aPage);
+ freeStackPageNoAssert(GIV(stackPage));
assert(pageListIsWellFormed());
while (1) {
assert(isContext(currentCtx));
@@ -15308,18 +15300,16 @@
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt aMethodObj;
char *sp;
- StackPage *thePage;
assert(((anOop & 1))
|| (addressCouldBeObj(anOop)));
flag("are you really sure setStackPageAndLimit: is needed?");
/* begin setStackPageAndLimit: */
- thePage = GIV(stackPage);
- GIV(stackPage) = thePage;
+ GIV(stackPage) = GIV(stackPage);
if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
GIV(stackLimit) = (GIV(stackPage)->stackLimit);
}
- markStackPageMostRecentlyUsed(thePage);
+ markStackPageMostRecentlyUsed(GIV(stackPage));
assert(!(isMachineCodeFrame(GIV(framePointer))));
/* begin setMethod: */
/* begin iframeMethod: */
@@ -15354,7 +15344,6 @@
sqInt
ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
sqInt ccIndex;
sqInt class;
CogMethod *cogMethod;
@@ -15387,8 +15376,7 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(2ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -15402,10 +15390,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -15438,7 +15426,6 @@
sqInt
ceSendFromInLineCacheMiss(CogMethod *oPIC)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
sqInt ccIndex;
sqInt class;
CogMethod *cogMethod;
@@ -15474,9 +15461,8 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(3ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
selector = (oPIC->selector);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -15490,10 +15476,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -15557,8 +15543,6 @@
sqInt
ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt numArgs)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aMethodObj;
- sqInt aMethodOop;
sqInt canLinkCacheTag;
sqInt ccIndex;
sqInt class;
@@ -15610,8 +15594,7 @@
/* begin ifAppropriateCompileToNativeCode:selector: */
VM_LABEL(4ifAppropriateCompileToNativeCodeselector);
- aMethodObj = GIV(newMethod);
- methodHeader = longAt((aMethodObj + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
if (isCogMethodReference(methodHeader)) {
/* makeBaseFrame: can create cog methods with nil selectors. */
@@ -15625,10 +15608,10 @@
if ((((((sqInt) methodHeader)) < 0
? (((usqInt) methodHeader) >> 1) & 65535
: (((usqInt) methodHeader) >> 10) & 255)) <= maxLiteralCountForCompile) {
- cogselector(aMethodObj, selector);
+ cogselector(GIV(newMethod), selector);
}
else {
- maybeFlagMethodAsInterpreted(aMethodObj);
+ maybeFlagMethodAsInterpreted(GIV(newMethod));
}
}
}
@@ -15649,8 +15632,7 @@
&& ((((((usqInt) (longAt(GIV(newMethod)))) >> 8) & 15) >= 12)
&& (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord)))))) {
/* begin cogMethodOf: */
- aMethodOop = GIV(newMethod);
- methodHeader1 = longAt((aMethodOop + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
assert((isNonIntegerObject(methodHeader1))
&& ((((usqInt)methodHeader1)) < (startOfMemory())));
cogMethod = ((CogMethod *) methodHeader1);
@@ -17597,6 +17579,10 @@
startTime = ioUTCMicrosecondsNow();
if (GIV(instructionPointer) != 0) {
+
+ /* better not have already been pushed */
+
+ assert((((usqInt)(stackTop()))) != GIV(instructionPointer));
/* begin push: */
longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
@@ -18327,10 +18313,12 @@
sqInt i;
sqInt newClosure;
sqInt newClosure1;
+ char *theSP;
assert(isMachineCodeFrame(GIV(framePointer)));
/* begin ensureFrameIsMarried:SP: */
VM_LABEL(13ensureFrameIsMarriedSP);
+ theSP = GIV(stackPointer) + ((1 + numCopied) * BytesPerWord);
if (((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
? ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
: (byteAt((GIV(framePointer) + FoxIFrameFlags) + 2)) != 0)) {
@@ -18338,7 +18326,7 @@
context = longAt(GIV(framePointer) + FoxThisContext);
goto l1;
}
- context = marryFrameSP(GIV(framePointer), GIV(stackPointer) + ((1 + numCopied) * BytesPerWord));
+ context = marryFrameSP(GIV(framePointer), theSP);
l1: /* end ensureFrameIsMarried:SP: */;
/* begin closureIn:numArgs:instructionPointer:numCopiedValues: */
VM_LABEL(2closureInnumArgsinstructionPointernumCopiedValues);
@@ -24007,11 +23995,9 @@
static void
initializeMemoryFirstFree(sqInt firstFree)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- usqInt end;
sqInt fwdBlockBytes;
usqInt i;
sqInt newEndOfMemory;
- usqInt start;
sqInt totalReserve;
fwdBlockBytes = GIV(totalObjectCount) & ((WordMask - BytesPerWord) + 1);
@@ -24039,10 +24025,8 @@
GIV(freeStart) = firstFree;
GIV(scavengeThreshold) = (((GIV(freeStart) + GIV(edenBytes)) < GIV(reserveStart)) ? (GIV(freeStart) + GIV(edenBytes)) : GIV(reserveStart));
/* begin maybeFillWithAllocationCheckFillerFrom:to: */
- start = GIV(freeStart);
- end = GIV(scavengeThreshold);
if (AllocationCheckFiller != 0) {
- for (i = start; i <= end; i += BytesPerWord) {
+ for (i = GIV(freeStart); i <= GIV(scavengeThreshold); i += BytesPerWord) {
longAtput(i, (AllocationCheckFiller == 182275669
? i
: AllocationCheckFiller));
@@ -27661,7 +27645,6 @@
sqInt methodHeader1;
sqInt numLiterals;
sqInt numLiterals1;
- sqInt oop1;
sqInt parentField;
void *pointer;
void *pointer1;
@@ -27848,8 +27831,7 @@
goto l2;
}
/* begin lastPointerOf:recordWeakRoot: */
- oop1 = child;
- header3 = longAt(oop1);
+ header3 = longAt(child);
fmt = (((usqInt) header3) >> 8) & 15;
if (fmt <= 4) {
if (fmt >= 3) {
@@ -27862,18 +27844,18 @@
if (!(((GIV(weakRootCount) += 1)) <= WeakRootTableSize)) {
error("weakRoots table overflow");
}
- GIV(weakRoots)[GIV(weakRootCount)] = oop1;
+ GIV(weakRoots)[GIV(weakRootCount)] = child;
}
- lastFieldOffset1 = (nonWeakFieldsOf(oop1)) << ShiftForWord;
+ lastFieldOffset1 = (nonWeakFieldsOf(child)) << ShiftForWord;
goto l5;
}
if (((((usqInt) header3) >> 12) & 31) == ClassMethodContextCompactIndex) {
/* begin setTraceFlagOnContextsFramesPageIfNeeded: */
- if ((((longAt((oop1 + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
- && (!(isWidowedContext(oop1)))) {
+ if ((((longAt((child + BaseHeaderSize) + (SenderIndex << ShiftForWord))) & 1))
+ && (!(isWidowedContext(child)))) {
/* begin stackPageFor: */
/* begin frameOfMarriedContext: */
- value = longAt((oop1 + BaseHeaderSize) + (SenderIndex << ShiftForWord));
+ value = longAt((child + BaseHeaderSize) + (SenderIndex << ShiftForWord));
/* begin withoutSmallIntegerTags: */
assert((value & 1));
pointer = ((char *) (pointerForOop(value - 1)));
@@ -27888,28 +27870,28 @@
}
}
/* begin fetchStackPointerOf: */
- sp = longAt((oop1 + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
+ sp = longAt((child + BaseHeaderSize) + (StackPointerIndex << ShiftForWord));
if (!((sp & 1))) {
contextSize = 0;
goto l4;
}
- assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(oop1)));
+ assert((ReceiverIndex + ((sp >> 1))) < (lengthOf(child)));
contextSize = (sp >> 1);
l4: /* end fetchStackPointerOf: */;
- assert((ReceiverIndex + contextSize) < (lengthOfbaseHeaderformat(oop1, header3, fmt)));
+ assert((ReceiverIndex + contextSize) < (lengthOfbaseHeaderformat(child, header3, fmt)));
lastFieldOffset1 = (CtxtTempFrameStart + contextSize) * BytesPerWord;
goto l5;
}
}
/* begin sizeBitsOfSafe: */
- header11 = longAt(oop1);
+ header11 = longAt(child);
type1 = ((header11 & SizeMask) == 0
? HeaderTypeSizeAndClass
: ((header11 & CompactClassMask) == 0
? HeaderTypeClass
: HeaderTypeShort));
sz = (type1 == HeaderTypeSizeAndClass
- ? (longAt(oop1 - (BytesPerWord * 2))) & AllButTypeMask
+ ? (longAt(child - (BytesPerWord * 2))) & AllButTypeMask
: header11 & SizeMask);
lastFieldOffset1 = sz - BaseHeaderSize;
goto l5;
@@ -27920,7 +27902,7 @@
}
/* begin literalCountOfHeader: */
/* begin headerOf: */
- methodHeader = longAt((oop1 + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodHeader = longAt((child + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
headerPointer = (isCogMethodReference(methodHeader)
? (assert(((((CogMethod *) methodHeader)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
(((CogMethod *) methodHeader)->methodHeader))
@@ -31624,6 +31606,7 @@
sqInt frameNumArgs1;
sqInt i;
sqInt methodHeader;
+ sqInt methodPointer;
sqInt newCopy;
sqInt objHeader;
sqInt rcvr;
@@ -31696,7 +31679,8 @@
/* begin rawHeaderOf:put: */
/* begin headerOf: */
- methodHeader = longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
+ methodPointer = longAt(GIV(stackPointer));
+ methodHeader = longAt((methodPointer + BaseHeaderSize) + (HeaderIndex << ShiftForWord));
cogMethodOrMethodHeader = (isCogMethodReference(methodHeader)
? (assert(((((CogMethod *) methodHeader)->objectHeader)) == (nullHeaderForMachineCodeMethod())),
(((CogMethod *) methodHeader)->methodHeader))
@@ -37840,7 +37824,6 @@
static void
primitiveInterruptSemaphore(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt anObject;
sqInt arg;
sqInt ccIndex;
sqInt top;
@@ -37863,12 +37846,11 @@
}
else {
/* begin splObj:put: */
- anObject = GIV(nilObj);
/* begin storePointer:ofObject:withValue: */
if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(GIV(specialObjectsOop), anObject);
+ possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
}
- longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheInterruptSemaphore << ShiftForWord), anObject);
+ longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheInterruptSemaphore << ShiftForWord), GIV(nilObj));
}
}
@@ -37883,8 +37865,6 @@
sqInt ccIndex;
sqInt i;
sqInt lookupClass;
- sqInt object;
- sqInt object1;
sqInt runArgs;
sqInt runReceiver;
char *sp;
@@ -37909,12 +37889,10 @@
GIV(stackPointer) += BytesPerWord;
runReceiver = top;
/* begin push: */
- object = GIV(newMethod);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
GIV(stackPointer) = sp;
/* begin push: */
- object1 = GIV(messageSelector);
- longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1);
+ longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(messageSelector));
GIV(stackPointer) = sp1;
/* begin push: */
longAtput((sp2 = GIV(stackPointer) - BytesPerWord), runArgs);
@@ -38603,7 +38581,6 @@
sqInt activeContext;
sqInt ccIndex;
sqInt flushState;
- sqInt object;
sqInt sema;
char *sp;
@@ -38635,8 +38612,7 @@
}
if (flushState) {
/* begin push: */
- object = GIV(instructionPointer);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
activeContext = voidVMStateForSnapshot();
marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
@@ -38661,7 +38637,6 @@
static void
primitiveLowSpaceSemaphore(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt anObject;
sqInt arg;
sqInt ccIndex;
sqInt top;
@@ -38684,12 +38659,11 @@
}
else {
/* begin splObj:put: */
- anObject = GIV(nilObj);
/* begin storePointer:ofObject:withValue: */
if ((((usqInt) GIV(specialObjectsOop))) < (((usqInt) GIV(youngStart)))) {
- possibleRootStoreIntovalue(GIV(specialObjectsOop), anObject);
+ possibleRootStoreIntovalue(GIV(specialObjectsOop), GIV(nilObj));
}
- longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheLowSpaceSemaphore << ShiftForWord), anObject);
+ longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (TheLowSpaceSemaphore << ShiftForWord), GIV(nilObj));
}
}
@@ -40405,7 +40379,6 @@
sqInt activeContext;
sqInt ccIndex;
sqInt flushState;
- sqInt object;
sqInt sema;
char *sp;
@@ -40442,8 +40415,7 @@
GIV(profileSemaphore) = sema;
if (flushState) {
/* begin push: */
- object = GIV(instructionPointer);
- longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
+ longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
GIV(stackPointer) = sp;
activeContext = voidVMStateForSnapshot();
marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
@@ -42024,9 +41996,7 @@
sqInt deltaMsecs;
usqInt msecs;
sqInt msecsObj;
- sqInt oop;
sqInt sema;
- sqInt valuePointer;
msecsObj = longAt(GIV(stackPointer));
sema = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -42056,12 +42026,10 @@
}
else {
/* begin storePointer:ofObject:withValue: */
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list