[Vm-dev] [commit][3097] CogVM source as per VMMaker.oscog-eem.895
commits at squeakvm.org
commits at squeakvm.org
Wed Oct 8 19:18:08 UTC 2014
Revision: 3097
Author: eliot
Date: 2014-10-08 12:18:05 -0700 (Wed, 08 Oct 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.895
Compile the NewspeakV4 bytecode extPushPseudoVariableOrOuter frameless when
pushing nil, true, false. This means the scanMethod and scanBlock:
implementations must maintain extA and extB.
Rename "explicit outer" foo to "enclosing object" foo
Modified Paths:
--------------
branches/Cog/nscogsrc/vm/cogit.c
branches/Cog/nscogsrc/vm/cogit.h
branches/Cog/nscogsrc/vm/cointerp.c
branches/Cog/nscogsrc/vm/cointerp.h
branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
branches/Cog/nsspursrc/vm/cogit.c
branches/Cog/nsspursrc/vm/cogit.h
branches/Cog/nsspursrc/vm/cointerp.c
branches/Cog/nsspursrc/vm/cointerp.h
branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
branches/Cog/nsspurstacksrc/vm/interp.c
branches/Cog/sistasrc/vm/cogit.c
branches/Cog/sistasrc/vm/cogit.h
branches/Cog/sistasrc/vm/cointerp.c
branches/Cog/sistasrc/vm/cointerp.h
branches/Cog/sistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursistasrc/vm/cogit.c
branches/Cog/spursistasrc/vm/cogit.h
branches/Cog/spursistasrc/vm/cointerp.c
branches/Cog/spursistasrc/vm/cointerp.h
branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
branches/Cog/spursrc/vm/cogit.c
branches/Cog/spursrc/vm/cogit.h
branches/Cog/spursrc/vm/cointerp.c
branches/Cog/spursrc/vm/cointerp.h
branches/Cog/spursrc/vm/gcc3x-cointerp.c
branches/Cog/spurstacksrc/vm/gcc3x-interp.c
branches/Cog/spurstacksrc/vm/interp.c
branches/Cog/src/vm/cogit.c
branches/Cog/src/vm/cogit.h
branches/Cog/src/vm/cointerp.c
branches/Cog/src/vm/cointerp.h
branches/Cog/src/vm/cointerpmt.c
branches/Cog/src/vm/cointerpmt.h
branches/Cog/src/vm/gcc3x-cointerp.c
branches/Cog/src/vm/gcc3x-cointerpmt.c
branches/Cog/stacksrc/vm/gcc3x-interp.c
branches/Cog/stacksrc/vm/interp.c
Property Changed:
----------------
branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nscogsrc/vm/cogit.c 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ CCodeGenerator VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ StackToRegisterMappingCogit VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -964,7 +964,7 @@
static sqInt genPushConstantOneBytecode(void);
static sqInt genPushConstantTrueBytecode(void);
static sqInt genPushConstantZeroBytecode(void);
-static sqInt genPushExplicitOuterReceiverBytecode(void);
+static sqInt genPushEnclosingObjectBytecode(void);
static sqInt genPushLiteralConstantBytecode(void);
static sqInt genPushLiteralIndex(sqInt literalIndex) NoDbgRegParms;
static sqInt genPushLiteralVariable16CasesBytecode(void);
@@ -1073,7 +1073,7 @@
static sqInt genPrimitiveSubtract(void);
static sqInt genPushActiveContextBytecode(void);
static sqInt genPushClosureCopyCopiedValuesBytecode(void);
-static sqInt genPushExplicitOuterReceiver(sqInt level) NoDbgRegParms;
+static sqInt genPushEnclosingObjectAt(sqInt level) NoDbgRegParms;
static sqInt genPushImplicitReceiverBytecode(void);
static sqInt genPushLiteralVariable(sqInt literalIndex) NoDbgRegParms;
static sqInt genPushLiteral(sqInt literal) NoDbgRegParms;
@@ -1114,6 +1114,7 @@
static void marshallSendArguments(sqInt numArgs) NoDbgRegParms;
static void mergeafterContinuation(BytecodeFixup *fixup, sqInt mergeWithContinuation) NoDbgRegParms;
static sqInt methodAbortTrampolineFor(sqInt numArgs) NoDbgRegParms;
+static sqInt needsFrameIfExtBGT2(sqInt stackDelta) NoDbgRegParms;
static sqInt needsFrameIfMod16GENumArgs(sqInt stackDelta) NoDbgRegParms;
static sqInt needsFrameIfStackGreaterThanOne(sqInt stackDelta) NoDbgRegParms;
static sqInt numberOfSpillsInTopNItems(sqInt n) NoDbgRegParms;
@@ -1194,8 +1195,8 @@
static sqInt ceClosureCopyTrampoline;
static sqInt ceCPICMissTrampoline;
static sqInt ceCreateNewArrayTrampoline;
+static sqInt ceEnclosingObjectTrampoline;
void (*ceEnterCogCodePopReceiverReg)(void);
-static sqInt ceExplicitReceiverTrampoline;
static sqInt ceFetchContextInstVarTrampoline;
unsigned long (*ceGetSP)(void);
static sqInt ceImplicitReceiverTrampoline;
@@ -1386,7 +1387,7 @@
{ duplicateTopBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushActiveContextBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushNewArrayBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0 },
- { genPushExplicitOuterReceiverBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0 },
+ { genPushEnclosingObjectBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0 },
{ genPushRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genStoreRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genStoreAndPopRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -1580,7 +1581,7 @@
{ genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
- { genExtPushPseudoVariableOrOuterBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { genExtPushPseudoVariableOrOuterBytecode, 0, needsFrameIfExtBGT2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushConstantZeroBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushConstantOneBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0 },
@@ -9638,7 +9639,6 @@
else {
bytecodeSetOffset = 0;
}
- extA = (extB = 0);
/* begin ensureNoForwardedLiteralsIn: */
methodObj = aMethodObj;
cogMethod = compileCogMethod(aSelectorOop);
@@ -11062,7 +11062,7 @@
Generate the class fetch and cache probe inline for speed.
Smashes Arg1Reg, RegClass and caller-saved regs. */
- ceExplicitReceiverTrampoline = genTrampolineForcalledargresult(ceExplicitReceiverAt, "ceExplicitReceiverTrampoline", SendNumArgsReg, ReceiverResultReg);
+ ceEnclosingObjectTrampoline = genTrampolineForcalledargresult(ceEnclosingObjectAt, "ceEnclosingObjectTrampoline", SendNumArgsReg, ReceiverResultReg);
opcodeIndex = 0;
/* begin MoveMw:r:R: */
genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, ReceiverResultReg);
@@ -17336,7 +17336,7 @@
/* 77 01001101 Push false [* 1:true, 2:nil, 3:thisContext, ..., -N:
- pushExplicitOuter: N, N = Extend B]
+ pushEnclosingObjectAt: N, N = Extend B]
*/
static sqInt
@@ -17362,7 +17362,7 @@
default:
if (ext < 0) {
- return genPushExplicitOuterReceiver(0 - ext);
+ return genPushEnclosingObjectAt(0 - ext);
}
warning("undefined extension for extPushPseudoVariableOrOuter");
return unknownBytecode();
@@ -17942,16 +17942,16 @@
}
-/* Uncached push explicit outer send receiver */
+/* Uncached push enclosing object */
static sqInt
-genPushExplicitOuterReceiverBytecode(void)
+genPushEnclosingObjectBytecode(void)
{
sqInt levelOop;
levelOop = getLiteral(byte1);
assert((levelOop & 1));
- return genPushExplicitOuterReceiver((levelOop >> 1));
+ return genPushEnclosingObjectAt((levelOop >> 1));
}
static sqInt
@@ -20722,17 +20722,16 @@
}
-/* Uncached push explicit outer send receiver */
+/* Uncached push enclosing object */
static sqInt
-genPushExplicitOuterReceiver(sqInt level)
+genPushEnclosingObjectAt(sqInt level)
{
- assert(needsFrame);
(optStatus.isReceiverResultRegLive = 0);
ssAllocateCallReg(SendNumArgsReg);
/* begin MoveCq:R: */
genoperandoperand(MoveCqR, level, SendNumArgsReg);
- CallRT(ceExplicitReceiverTrampoline);
+ CallRT(ceEnclosingObjectTrampoline);
return ssPushRegister(ReceiverResultReg);
}
@@ -22097,6 +22096,13 @@
}
static sqInt
+needsFrameIfExtBGT2(sqInt stackDelta)
+{
+ return (extB < 0)
+ || (extB > 2);
+}
+
+static sqInt
needsFrameIfMod16GENumArgs(sqInt stackDelta)
{
return (byte0 % 16) >= methodOrBlockNumArgs;
@@ -22249,11 +22255,15 @@
inBlock = 1;
pc = (blockStart->startpc);
end = ((blockStart->startpc)) + ((blockStart->span));
- framelessStackDelta = (nExts = 0);
+ framelessStackDelta = (nExts = (extA = (extB = 0)));
pushingNils = 1;
while (pc < end) {
byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset;
descriptor = generatorAt(byte0);
+ if ((descriptor->isExtension)) {
+ loadSubsequentBytesForDescriptorat(descriptor, pc);
+ ((descriptor->generator))();
+ }
if (!needsFrame) {
if ((((descriptor->needsFrameFunction)) == null)
|| (((descriptor->needsFrameFunction))(framelessStackDelta))) {
@@ -22290,9 +22300,12 @@
pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation)
? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)
: 0));
- nExts = ((descriptor->isExtension)
- ? nExts + 1
- : 0);
+ if ((descriptor->isExtension)) {
+ nExts += 1;
+ }
+ else {
+ nExts = (extA = (extB = 0));
+ }
prevBCDescriptor = descriptor;
}
if (!needsFrame) {
@@ -22337,10 +22350,14 @@
return 0;
}
pc = (latestContinuation = initialPC);
- numBlocks = (framelessStackDelta = (nExts = 0));
+ numBlocks = (framelessStackDelta = (nExts = (extA = (extB = 0))));
while (pc <= endPC) {
byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset;
descriptor = generatorAt(byte0);
+ if ((descriptor->isExtension)) {
+ loadSubsequentBytesForDescriptorat(descriptor, pc);
+ ((descriptor->generator))();
+ }
if (((descriptor->isReturn))
&& (pc >= latestContinuation)) {
endPC = pc;
@@ -22379,9 +22396,12 @@
# endif /* NewspeakVM */
pc += (descriptor->numBytes);
- nExts = ((descriptor->isExtension)
- ? nExts + 1
- : 0);
+ if ((descriptor->isExtension)) {
+ nExts += 1;
+ }
+ else {
+ nExts = (extA = (extB = 0));
+ }
prevBCDescriptor = descriptor;
}
return numBlocks;
Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nscogsrc/vm/cogit.h 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ CCodeGenerator VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nscogsrc/vm/cointerp.c 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
from
- CoInterpreter VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -406,7 +406,7 @@
sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
sqInt ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
-sqInt ceExplicitReceiverAt(sqInt level);
+sqInt ceEnclosingObjectAt(sqInt level);
sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceNewArraySlotSize(sqInt slotSize);
@@ -1054,10 +1054,10 @@
sqInt doSignalSemaphoreWithIndex(sqInt index);
static void dummyReferToProxy(void);
EXPORT(sqInt) dumpImage(sqInt fileName);
+static sqInt enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static sqInt ensureCallerContext(char *theFP) NoDbgRegParms;
static void ensureImageFormatIsUpToDate(sqInt swapBytes) NoDbgRegParms;
static char * establishFrameForContextToReturnTo(sqInt contextToReturnTo) NoDbgRegParms;
-static sqInt explicitOuterReceiverwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static void externalDivorceFrameandContext(char *theFP, sqInt ctxt) NoDbgRegParms;
static char * externalEnsureIsBaseFrame(char *aFramePtr) NoDbgRegParms;
static sqInt externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) NoDbgRegParms;
@@ -2084,7 +2084,7 @@
/* 574 */ (void (*)(void))0,
/* 575 */ (void (*)(void))0,
0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.891";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.895";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -6002,14 +6002,14 @@
}
break;
case 139:
- /* pushExplicitOuterReceiverBytecode */
+ /* pushEnclosingObjectBytecode */
{
sqInt anIntOop;
sqInt litIndex;
sqInt n;
sqInt object;
- VM_LABEL(0pushExplicitOuterReceiverBytecode);
+ VM_LABEL(0pushEnclosingObjectBytecode);
litIndex = byteAtPointer(++localIP);
/* begin literal: */
assert(GIV(method) == (iframeMethod(localFP)));
@@ -6021,7 +6021,7 @@
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
/* begin internalPush: */
- object = explicitOuterReceiverwithObjectwithMixin(n, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)));
+ object = enclosingObjectAtwithObjectwithMixin(n, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)));
longAtPointerput((localSP -= BytesPerOop), object);
}
break;
@@ -9361,7 +9361,7 @@
break;
default:
thing = (extB < 0
- ? explicitOuterReceiverwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
+ ? enclosingObjectAtwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
: (error("undefined extension for extPushPseudoVariableOrOuter"),
GIV(nilObj)));
@@ -14382,9 +14382,9 @@
}
sqInt
-ceExplicitReceiverAt(sqInt level)
+ceEnclosingObjectAt(sqInt level)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- return explicitOuterReceiverwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
+ return enclosingObjectAtwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
}
sqInt
@@ -44673,6 +44673,52 @@
}
+/* This is used to implement the innards of the pushEnclosingObjectBytecode,
+ used for explicit outer sends in NS2/NS3. */
+
+static sqInt
+enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt aClass;
+ sqInt ccIndex;
+ sqInt count;
+ sqInt enclosingObject;
+ sqInt mixinApplication;
+ sqInt mixinOrMixinApplication;
+ sqInt targetMixin;
+
+ enclosingObject = anObject;
+ targetMixin = mixin;
+ count = 0;
+ while (count < n) {
+ count += 1;
+ if ((targetMixin == GIV(nilObj))
+ || (enclosingObject == GIV(nilObj))) {
+ return GIV(nilObj);
+ }
+ /* begin findApplicationOfTargetMixin:startingAtNonMetaClass: */
+ aClass = ((enclosingObject & 1)
+ ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+ : (((ccIndex = (((usqInt) (longAt(enclosingObject))) >> (compactClassFieldLSB())) & 0x1F)) == 0
+ ? (longAt(enclosingObject - BaseHeaderSize)) & AllButTypeMask
+ : longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+ mixinOrMixinApplication = aClass;
+ while (!((mixinOrMixinApplication == GIV(nilObj))
+ || ((mixinOrMixinApplication == targetMixin)
+ || ((longAt((mixinOrMixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord))) == targetMixin)))) {
+ mixinOrMixinApplication = longAt((mixinOrMixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
+ }
+ mixinApplication = mixinOrMixinApplication;
+ if (mixinApplication == GIV(nilObj)) {
+ return GIV(nilObj);
+ }
+ enclosingObject = longAt((mixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
+ targetMixin = longAt((targetMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
+ }
+ return enclosingObject;
+}
+
+
/* Answerr the caller context for a frame. If the frame has a caller
frame that doesn't have a context, then marry the caller frame. */
@@ -44898,53 +44944,6 @@
}
-/* This is used to implement the innards of the
- pushExplicitOuterReceiverBytecode, used for explicit outer sends in
- NS2/NS3. */
-
-static sqInt
-explicitOuterReceiverwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
-{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aClass;
- sqInt ccIndex;
- sqInt count;
- sqInt explicitReceiver;
- sqInt mixinApplication;
- sqInt mixinOrMixinApplication;
- sqInt targetMixin;
-
- explicitReceiver = anObject;
- targetMixin = mixin;
- count = 0;
- while (count < n) {
- count += 1;
- if ((targetMixin == GIV(nilObj))
- || (explicitReceiver == GIV(nilObj))) {
- return GIV(nilObj);
- }
- /* begin findApplicationOfTargetMixin:startingAtNonMetaClass: */
- aClass = ((explicitReceiver & 1)
- ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
- : (((ccIndex = (((usqInt) (longAt(explicitReceiver))) >> (compactClassFieldLSB())) & 0x1F)) == 0
- ? (longAt(explicitReceiver - BaseHeaderSize)) & AllButTypeMask
- : longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
- mixinOrMixinApplication = aClass;
- while (!((mixinOrMixinApplication == GIV(nilObj))
- || ((mixinOrMixinApplication == targetMixin)
- || ((longAt((mixinOrMixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord))) == targetMixin)))) {
- mixinOrMixinApplication = longAt((mixinOrMixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
- }
- mixinApplication = mixinOrMixinApplication;
- if (mixinApplication == GIV(nilObj)) {
- return GIV(nilObj);
- }
- explicitReceiver = longAt((mixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
- targetMixin = longAt((targetMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
- }
- return explicitReceiver;
-}
-
-
/* Divorce a single frame and its context. If it is not the top frame of a
stack this means splitting its stack. */
Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nscogsrc/vm/cointerp.h 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
@@ -36,7 +36,7 @@
sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
sqInt ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
-sqInt ceExplicitReceiverAt(sqInt level);
+sqInt ceEnclosingObjectAt(sqInt level);
sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceNewArraySlotSize(sqInt slotSize);
Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c 2014-10-08 19:18:05 UTC (rev 3097)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
from
- CoInterpreter VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476
+ CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.891 uuid: 2b1ec85c-bd1d-4299-938a-80aef455e476 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -409,7 +409,7 @@
sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
sqInt ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
-sqInt ceExplicitReceiverAt(sqInt level);
+sqInt ceEnclosingObjectAt(sqInt level);
sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceNewArraySlotSize(sqInt slotSize);
@@ -1057,10 +1057,10 @@
sqInt doSignalSemaphoreWithIndex(sqInt index);
static void dummyReferToProxy(void);
EXPORT(sqInt) dumpImage(sqInt fileName);
+static sqInt enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static sqInt ensureCallerContext(char *theFP) NoDbgRegParms;
static void ensureImageFormatIsUpToDate(sqInt swapBytes) NoDbgRegParms;
static char * establishFrameForContextToReturnTo(sqInt contextToReturnTo) NoDbgRegParms;
-static sqInt explicitOuterReceiverwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static void externalDivorceFrameandContext(char *theFP, sqInt ctxt) NoDbgRegParms;
static char * externalEnsureIsBaseFrame(char *aFramePtr) NoDbgRegParms;
static sqInt externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) NoDbgRegParms;
@@ -2087,7 +2087,7 @@
/* 574 */ (void (*)(void))0,
/* 575 */ (void (*)(void))0,
0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.891";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.895";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -6011,14 +6011,14 @@
}
BREAK;
CASE(139)
- /* pushExplicitOuterReceiverBytecode */
+ /* pushEnclosingObjectBytecode */
{
sqInt anIntOop;
sqInt litIndex;
sqInt n;
sqInt object;
- VM_LABEL(0pushExplicitOuterReceiverBytecode);
+ VM_LABEL(0pushEnclosingObjectBytecode);
litIndex = byteAtPointer(++localIP);
/* begin literal: */
assert(GIV(method) == (iframeMethod(localFP)));
@@ -6030,7 +6030,7 @@
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
/* begin internalPush: */
- object = explicitOuterReceiverwithObjectwithMixin(n, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)));
+ object = enclosingObjectAtwithObjectwithMixin(n, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)));
longAtPointerput((localSP -= BytesPerOop), object);
}
BREAK;
@@ -9370,7 +9370,7 @@
break;
default:
thing = (extB < 0
- ? explicitOuterReceiverwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
+ ? enclosingObjectAtwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
: (error("undefined extension for extPushPseudoVariableOrOuter"),
GIV(nilObj)));
@@ -14391,9 +14391,9 @@
}
sqInt
-ceExplicitReceiverAt(sqInt level)
+ceEnclosingObjectAt(sqInt level)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- return explicitOuterReceiverwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
+ return enclosingObjectAtwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
}
sqInt
@@ -44682,6 +44682,52 @@
}
+/* This is used to implement the innards of the pushEnclosingObjectBytecode,
+ used for explicit outer sends in NS2/NS3. */
+
+static sqInt
+enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt aClass;
+ sqInt ccIndex;
+ sqInt count;
+ sqInt enclosingObject;
+ sqInt mixinApplication;
+ sqInt mixinOrMixinApplication;
+ sqInt targetMixin;
+
+ enclosingObject = anObject;
+ targetMixin = mixin;
+ count = 0;
+ while (count < n) {
+ count += 1;
+ if ((targetMixin == GIV(nilObj))
+ || (enclosingObject == GIV(nilObj))) {
+ return GIV(nilObj);
+ }
+ /* begin findApplicationOfTargetMixin:startingAtNonMetaClass: */
+ aClass = ((enclosingObject & 1)
+ ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+ : (((ccIndex = (((usqInt) (longAt(enclosingObject))) >> (compactClassFieldLSB())) & 0x1F)) == 0
+ ? (longAt(enclosingObject - BaseHeaderSize)) & AllButTypeMask
+ : longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+ mixinOrMixinApplication = aClass;
+ while (!((mixinOrMixinApplication == GIV(nilObj))
+ || ((mixinOrMixinApplication == targetMixin)
+ || ((longAt((mixinOrMixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord))) == targetMixin)))) {
+ mixinOrMixinApplication = longAt((mixinOrMixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
+ }
+ mixinApplication = mixinOrMixinApplication;
+ if (mixinApplication == GIV(nilObj)) {
+ return GIV(nilObj);
+ }
+ enclosingObject = longAt((mixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
+ targetMixin = longAt((targetMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
+ }
+ return enclosingObject;
+}
+
+
/* Answerr the caller context for a frame. If the frame has a caller
frame that doesn't have a context, then marry the caller frame. */
@@ -44907,53 +44953,6 @@
}
-/* This is used to implement the innards of the
- pushExplicitOuterReceiverBytecode, used for explicit outer sends in
- NS2/NS3. */
-
-static sqInt
-explicitOuterReceiverwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
-{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aClass;
- sqInt ccIndex;
- sqInt count;
- sqInt explicitReceiver;
- sqInt mixinApplication;
- sqInt mixinOrMixinApplication;
- sqInt targetMixin;
-
- explicitReceiver = anObject;
- targetMixin = mixin;
- count = 0;
- while (count < n) {
- count += 1;
- if ((targetMixin == GIV(nilObj))
- || (explicitReceiver == GIV(nilObj))) {
- return GIV(nilObj);
- }
- /* begin findApplicationOfTargetMixin:startingAtNonMetaClass: */
- aClass = ((explicitReceiver & 1)
- ? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
- : (((ccIndex = (((usqInt) (longAt(explicitReceiver))) >> (compactClassFieldLSB())) & 0x1F)) == 0
- ? (longAt(explicitReceiver - BaseHeaderSize)) & AllButTypeMask
- : longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
- mixinOrMixinApplication = aClass;
- while (!((mixinOrMixinApplication == GIV(nilObj))
- || ((mixinOrMixinApplication == targetMixin)
- || ((longAt((mixinOrMixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord))) == targetMixin)))) {
- mixinOrMixinApplication = longAt((mixinOrMixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
- }
- mixinApplication = mixinOrMixinApplication;
- if (mixinApplication == GIV(nilObj)) {
- return GIV(nilObj);
- }
- explicitReceiver = longAt((mixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
- targetMixin = longAt((targetMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
- }
- return explicitReceiver;
-}
-
-
/* Divorce a single frame and its context. If it is not the top frame of a
stack this means splitting its stack. */
Modified: branches/Cog/nsspursrc/vm/cogit.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.c 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nsspursrc/vm/cogit.c 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ CCodeGenerator VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
from
- StackToRegisterMappingCogit VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ StackToRegisterMappingCogit VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;
@@ -1090,7 +1090,7 @@
static sqInt genPrimitiveSubtract(void);
static sqInt genPushActiveContextBytecode(void);
static sqInt genPushClosureCopyCopiedValuesBytecode(void);
-static sqInt genPushExplicitOuterReceiver(sqInt level) NoDbgRegParms;
+static sqInt genPushEnclosingObjectAt(sqInt level) NoDbgRegParms;
static sqInt genPushImplicitReceiverBytecode(void);
static sqInt genPushLiteralVariable(sqInt literalIndex) NoDbgRegParms;
static sqInt genPushLiteral(sqInt literal) NoDbgRegParms;
@@ -1131,6 +1131,7 @@
static void marshallSendArguments(sqInt numArgs) NoDbgRegParms;
static void mergeafterContinuation(BytecodeFixup *fixup, sqInt mergeWithContinuation) NoDbgRegParms;
static sqInt methodAbortTrampolineFor(sqInt numArgs) NoDbgRegParms;
+static sqInt needsFrameIfExtBGT2(sqInt stackDelta) NoDbgRegParms;
static sqInt needsFrameIfMod16GENumArgs(sqInt stackDelta) NoDbgRegParms;
static sqInt needsFrameIfStackGreaterThanOne(sqInt stackDelta) NoDbgRegParms;
static sqInt numberOfSpillsInTopNItems(sqInt n) NoDbgRegParms;
@@ -1208,8 +1209,8 @@
static unsigned long (*ceCheckFeaturesFunction)(void);
sqInt ceCheckForInterruptTrampoline;
static sqInt ceCPICMissTrampoline;
+static sqInt ceEnclosingObjectTrampoline;
void (*ceEnterCogCodePopReceiverReg)(void);
-static sqInt ceExplicitReceiverTrampoline;
static sqInt ceFetchContextInstVarTrampoline;
unsigned long (*ceGetSP)(void);
static sqInt ceImplicitReceiverTrampoline;
@@ -1598,7 +1599,7 @@
{ genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushTemporaryVariableBytecode, 0, needsFrameIfMod16GENumArgs, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushReceiverBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
- { genExtPushPseudoVariableOrOuterBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { genExtPushPseudoVariableOrOuterBytecode, 0, needsFrameIfExtBGT2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushConstantZeroBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genPushConstantOneBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 },
{ genSpecialSelectorArithmetic, 0, 0, 0, AddRR, 1, 0, 0, 0, 0, 1, 0, 0, 0 },
@@ -9595,7 +9596,6 @@
else {
bytecodeSetOffset = 0;
}
- extA = (extB = 0);
ensureNoForwardedLiteralsIn(aMethodObj);
methodObj = aMethodObj;
cogMethod = compileCogMethod(aSelectorOop);
@@ -11184,7 +11184,7 @@
Generate the class fetch and cache probe inline for speed.
Smashes Arg1Reg, RegClass and caller-saved regs. */
- ceExplicitReceiverTrampoline = genTrampolineForcalledargresult(ceExplicitReceiverAt, "ceExplicitReceiverTrampoline", SendNumArgsReg, ReceiverResultReg);
+ ceEnclosingObjectTrampoline = genTrampolineForcalledargresult(ceEnclosingObjectAt, "ceEnclosingObjectTrampoline", SendNumArgsReg, ReceiverResultReg);
opcodeIndex = 0;
/* begin MoveMw:r:R: */
genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, ReceiverResultReg);
@@ -19122,7 +19122,7 @@
/* 77 01001101 Push false [* 1:true, 2:nil, 3:thisContext, ..., -N:
- pushExplicitOuter: N, N = Extend B]
+ pushEnclosingObjectAt: N, N = Extend B]
*/
static sqInt
@@ -19148,7 +19148,7 @@
default:
if (ext < 0) {
- return genPushExplicitOuterReceiver(0 - ext);
+ return genPushEnclosingObjectAt(0 - ext);
}
warning("undefined extension for extPushPseudoVariableOrOuter");
return unknownBytecode();
@@ -22526,17 +22526,16 @@
}
-/* Uncached push explicit outer send receiver */
+/* Uncached push enclosing object */
static sqInt
-genPushExplicitOuterReceiver(sqInt level)
+genPushEnclosingObjectAt(sqInt level)
{
- assert(needsFrame);
(optStatus.isReceiverResultRegLive = 0);
ssAllocateCallReg(SendNumArgsReg);
/* begin MoveCq:R: */
genoperandoperand(MoveCqR, level, SendNumArgsReg);
- CallRT(ceExplicitReceiverTrampoline);
+ CallRT(ceEnclosingObjectTrampoline);
return ssPushRegister(ReceiverResultReg);
}
@@ -23925,6 +23924,13 @@
}
static sqInt
+needsFrameIfExtBGT2(sqInt stackDelta)
+{
+ return (extB < 0)
+ || (extB > 2);
+}
+
+static sqInt
needsFrameIfMod16GENumArgs(sqInt stackDelta)
{
return (byte0 % 16) >= methodOrBlockNumArgs;
@@ -24077,11 +24083,15 @@
inBlock = 1;
pc = (blockStart->startpc);
end = ((blockStart->startpc)) + ((blockStart->span));
- framelessStackDelta = (nExts = 0);
+ framelessStackDelta = (nExts = (extA = (extB = 0)));
pushingNils = 1;
while (pc < end) {
byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset;
descriptor = generatorAt(byte0);
+ if ((descriptor->isExtension)) {
+ loadSubsequentBytesForDescriptorat(descriptor, pc);
+ ((descriptor->generator))();
+ }
if (!needsFrame) {
if ((((descriptor->needsFrameFunction)) == null)
|| (((descriptor->needsFrameFunction))(framelessStackDelta))) {
@@ -24118,9 +24128,12 @@
pc = (pc + ((descriptor->numBytes))) + (((descriptor->isBlockCreation)
? ((descriptor->spanFunction))(descriptor, pc, nExts, methodObj)
: 0));
- nExts = ((descriptor->isExtension)
- ? nExts + 1
- : 0);
+ if ((descriptor->isExtension)) {
+ nExts += 1;
+ }
+ else {
+ nExts = (extA = (extB = 0));
+ }
prevBCDescriptor = descriptor;
}
if (!needsFrame) {
@@ -24165,10 +24178,14 @@
return 0;
}
pc = (latestContinuation = initialPC);
- numBlocks = (framelessStackDelta = (nExts = 0));
+ numBlocks = (framelessStackDelta = (nExts = (extA = (extB = 0))));
while (pc <= endPC) {
byte0 = (fetchByteofObject(pc, methodObj)) + bytecodeSetOffset;
descriptor = generatorAt(byte0);
+ if ((descriptor->isExtension)) {
+ loadSubsequentBytesForDescriptorat(descriptor, pc);
+ ((descriptor->generator))();
+ }
if (((descriptor->isReturn))
&& (pc >= latestContinuation)) {
endPC = pc;
@@ -24207,9 +24224,12 @@
# endif /* NewspeakVM */
pc += (descriptor->numBytes);
- nExts = ((descriptor->isExtension)
- ? nExts + 1
- : 0);
+ if ((descriptor->isExtension)) {
+ nExts += 1;
+ }
+ else {
+ nExts = (extA = (extB = 0));
+ }
prevBCDescriptor = descriptor;
}
return numBlocks;
Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nsspursrc/vm/cogit.h 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGenerator VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ CCodeGenerator VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nsspursrc/vm/cointerp.c 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,9 +1,9 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
from
- CoInterpreter VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -415,7 +415,7 @@
sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
sqInt ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
-sqInt ceExplicitReceiverAt(sqInt level);
+sqInt ceEnclosingObjectAt(sqInt level);
sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceNewArraySlotSize(sqInt slotSize);
@@ -1229,10 +1229,10 @@
sqInt doSignalSemaphoreWithIndex(sqInt index);
static void dummyReferToProxy(void);
EXPORT(sqInt) dumpImage(sqInt fileName);
+static sqInt enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static sqInt ensureCallerContext(char *theFP) NoDbgRegParms;
static void ensureImageFormatIsUpToDate(sqInt swapBytes) NoDbgRegParms;
static char * establishFrameForContextToReturnTo(sqInt contextToReturnTo) NoDbgRegParms;
-static sqInt explicitOuterReceiverwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static void externalDivorceFrameandContext(char *theFP, sqInt ctxt) NoDbgRegParms;
static char * externalEnsureIsBaseFrame(char *aFramePtr) NoDbgRegParms;
static sqInt externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) NoDbgRegParms;
@@ -2322,7 +2322,7 @@
/*540*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.890";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.895";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -5614,6 +5614,7 @@
GIV(framePointer) = localFP;
ceEnterCogCodePopReceiverReg();
+ null;
goto l294;
}
localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -5631,7 +5632,7 @@
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- /* return self */
+ null;
l294: /* end baseFrameReturn */;
goto l293;
}
@@ -10610,7 +10611,7 @@
break;
default:
thing = (extB < 0
- ? explicitOuterReceiverwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
+ ? enclosingObjectAtwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
: (error("undefined extension for extPushPseudoVariableOrOuter"),
GIV(nilObj)));
@@ -16259,9 +16260,9 @@
}
sqInt
-ceExplicitReceiverAt(sqInt level)
+ceEnclosingObjectAt(sqInt level)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- return explicitOuterReceiverwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
+ return enclosingObjectAtwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
}
sqInt
@@ -55140,6 +55141,77 @@
}
+/* This is used to implement the innards of the pushEnclosingObjectBytecode,
+ used for explicit outer sends in NS2/NS3. */
+
+static sqInt
+enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt aClass;
+ sqInt classIndex;
+ sqInt classTablePage;
+ sqInt count;
+ sqInt enclosingObject;
+ sqInt mixinApplication;
+ sqInt mixinOrMixinApplication;
+ sqInt tagBits;
+ sqInt targetMixin;
+
+ enclosingObject = anObject;
+ targetMixin = mixin;
+ count = 0;
+ while (count < n) {
+ count += 1;
+ if ((targetMixin == GIV(nilObj))
+ || (enclosingObject == GIV(nilObj))) {
+ return GIV(nilObj);
+ }
+ /* begin findApplicationOfTargetMixin:startingAtNonMetaClass: */
+ /* begin fetchClassOf: */
+ if (((tagBits = enclosingObject & 3)) != 0) {
+ aClass = longAt((GIV(classTableFirstPage) + (BaseHeaderSize)) + (tagBits << 2));
+ goto l1;
+ }
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(enclosingObject)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ aClass = enclosingObject;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ aClass = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ aClass = GIV(nilObj);
+ goto l1;
+ }
+ aClass = longAt((classTablePage + (BaseHeaderSize)) + ((classIndex & ((1 << 10) - 1)) << 2));
+ l1: /* end fetchClassOf: */;
+ mixinOrMixinApplication = aClass;
+ while (!((mixinOrMixinApplication == GIV(nilObj))
+ || ((mixinOrMixinApplication == targetMixin)
+ || ((longAt((mixinOrMixinApplication + (BaseHeaderSize)) + (MixinIndex << 2))) == targetMixin)))) {
+ mixinOrMixinApplication = longAt((mixinOrMixinApplication + (BaseHeaderSize)) + (SuperclassIndex << 2));
+ }
+ mixinApplication = mixinOrMixinApplication;
+ if (mixinApplication == GIV(nilObj)) {
+ return GIV(nilObj);
+ }
+ enclosingObject = longAt((mixinApplication + (BaseHeaderSize)) + (EnclosingObjectIndex << 2));
+ targetMixin = longAt((targetMixin + (BaseHeaderSize)) + (EnclosingMixinIndex << 2));
+ }
+ return enclosingObject;
+}
+
+
/* Answerr the caller context for a frame. If the frame has a caller
frame that doesn't have a context, then marry the caller frame. */
@@ -55527,78 +55599,6 @@
}
-/* This is used to implement the innards of the
- pushExplicitOuterReceiverBytecode, used for explicit outer sends in
- NS2/NS3. */
-
-static sqInt
-explicitOuterReceiverwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
-{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- sqInt aClass;
- sqInt classIndex;
- sqInt classTablePage;
- sqInt count;
- sqInt explicitReceiver;
- sqInt mixinApplication;
- sqInt mixinOrMixinApplication;
- sqInt tagBits;
- sqInt targetMixin;
-
- explicitReceiver = anObject;
- targetMixin = mixin;
- count = 0;
- while (count < n) {
- count += 1;
- if ((targetMixin == GIV(nilObj))
- || (explicitReceiver == GIV(nilObj))) {
- return GIV(nilObj);
- }
- /* begin findApplicationOfTargetMixin:startingAtNonMetaClass: */
- /* begin fetchClassOf: */
- if (((tagBits = explicitReceiver & 3)) != 0) {
- aClass = longAt((GIV(classTableFirstPage) + (BaseHeaderSize)) + (tagBits << 2));
- goto l1;
- }
- /* begin fetchClassOfNonImm: */
- classIndex = (longAt(explicitReceiver)) & 0x3FFFFF;
- if (classIndex <= 0x1F) {
- if (classIndex == 0x1F) {
- aClass = explicitReceiver;
- goto l1;
- }
- if (classIndex == 8) {
- aClass = GIV(nilObj);
- goto l1;
- }
- }
- assert(classIndex >= (arrayClassIndexPun()));
- /* begin classOrNilAtIndex: */
- assert((classIndex <= (tagMask()))
- || (classIndex >= (arrayClassIndexPun())));
- classTablePage = longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + ((((usqInt) classIndex) >> 10) << 2));
- if (classTablePage == GIV(nilObj)) {
- aClass = GIV(nilObj);
- goto l1;
- }
- aClass = longAt((classTablePage + (BaseHeaderSize)) + ((classIndex & ((1 << 10) - 1)) << 2));
- l1: /* end fetchClassOf: */;
- mixinOrMixinApplication = aClass;
- while (!((mixinOrMixinApplication == GIV(nilObj))
- || ((mixinOrMixinApplication == targetMixin)
- || ((longAt((mixinOrMixinApplication + (BaseHeaderSize)) + (MixinIndex << 2))) == targetMixin)))) {
- mixinOrMixinApplication = longAt((mixinOrMixinApplication + (BaseHeaderSize)) + (SuperclassIndex << 2));
- }
- mixinApplication = mixinOrMixinApplication;
- if (mixinApplication == GIV(nilObj)) {
- return GIV(nilObj);
- }
- explicitReceiver = longAt((mixinApplication + (BaseHeaderSize)) + (EnclosingObjectIndex << 2));
- targetMixin = longAt((targetMixin + (BaseHeaderSize)) + (EnclosingMixinIndex << 2));
- }
- return explicitReceiver;
-}
-
-
/* Divorce a single frame and its context. If it is not the top frame of a
stack this means splitting its stack. */
Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nsspursrc/vm/cointerp.h 2014-10-08 19:18:05 UTC (rev 3097)
@@ -1,5 +1,5 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
@@ -38,7 +38,7 @@
sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
sqInt ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
-sqInt ceExplicitReceiverAt(sqInt level);
+sqInt ceEnclosingObjectAt(sqInt level);
sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceNewArraySlotSize(sqInt slotSize);
Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2014-10-05 21:56:54 UTC (rev 3096)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c 2014-10-08 19:18:05 UTC (rev 3097)
@@ -2,11 +2,11 @@
/* Automatically generated by
- CCodeGeneratorGlobalStructure VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ CCodeGeneratorGlobalStructure VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
from
- CoInterpreter VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703
+ CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3
*/
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.890 uuid: 4cec861e-a7df-45b3-8298-ecb127ee6703 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.895 uuid: 2c674935-8b94-45ff-b8fc-59fb78830eb3 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;
@@ -418,7 +418,7 @@
sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
sqInt ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
-sqInt ceExplicitReceiverAt(sqInt level);
+sqInt ceEnclosingObjectAt(sqInt level);
sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
sqInt ceNewArraySlotSize(sqInt slotSize);
@@ -1232,10 +1232,10 @@
sqInt doSignalSemaphoreWithIndex(sqInt index);
static void dummyReferToProxy(void);
EXPORT(sqInt) dumpImage(sqInt fileName);
+static sqInt enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static sqInt ensureCallerContext(char *theFP) NoDbgRegParms;
static void ensureImageFormatIsUpToDate(sqInt swapBytes) NoDbgRegParms;
static char * establishFrameForContextToReturnTo(sqInt contextToReturnTo) NoDbgRegParms;
-static sqInt explicitOuterReceiverwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
static void externalDivorceFrameandContext(char *theFP, sqInt ctxt) NoDbgRegParms;
static char * externalEnsureIsBaseFrame(char *aFramePtr) NoDbgRegParms;
static sqInt externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop) NoDbgRegParms;
@@ -2325,7 +2325,7 @@
/*540*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*560*/ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
};
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.890";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.895";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;
@@ -5623,6 +5623,7 @@
GIV(framePointer) = localFP;
ceEnterCogCodePopReceiverReg();
+ null;
goto l294;
}
localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -5640,7 +5641,7 @@
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
- /* return self */
+ null;
l294: /* end baseFrameReturn */;
goto l293;
}
@@ -10619,7 +10620,7 @@
break;
default:
thing = (extB < 0
- ? explicitOuterReceiverwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
+ ? enclosingObjectAtwithObjectwithMixin(0 - extB, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)))
: (error("undefined extension for extPushPseudoVariableOrOuter"),
GIV(nilObj)));
@@ -16268,9 +16269,9 @@
}
sqInt
-ceExplicitReceiverAt(sqInt level)
+ceEnclosingObjectAt(sqInt level)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
- return explicitOuterReceiverwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
+ return enclosingObjectAtwithObjectwithMixin(level, longAt(GIV(framePointer) + FoxMFReceiver), methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject)));
}
sqInt
@@ -55149,6 +55150,77 @@
}
+/* This is used to implement the innards of the pushEnclosingObjectBytecode,
+ used for explicit outer sends in NS2/NS3. */
+
+static sqInt
+enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
+{ DECL_MAYBE_SQ_GLOBAL_STRUCT
+ sqInt aClass;
+ sqInt classIndex;
+ sqInt classTablePage;
+ sqInt count;
+ sqInt enclosingObject;
+ sqInt mixinApplication;
+ sqInt mixinOrMixinApplication;
+ sqInt tagBits;
+ sqInt targetMixin;
+
+ enclosingObject = anObject;
+ targetMixin = mixin;
+ count = 0;
+ while (count < n) {
+ count += 1;
+ if ((targetMixin == GIV(nilObj))
+ || (enclosingObject == GIV(nilObj))) {
+ return GIV(nilObj);
+ }
+ /* begin findApplicationOfTargetMixin:startingAtNonMetaClass: */
+ /* begin fetchClassOf: */
+ if (((tagBits = enclosingObject & 3)) != 0) {
+ aClass = longAt((GIV(classTableFirstPage) + (BaseHeaderSize)) + (tagBits << 2));
+ goto l1;
+ }
+ /* begin fetchClassOfNonImm: */
+ classIndex = (longAt(enclosingObject)) & 0x3FFFFF;
+ if (classIndex <= 0x1F) {
+ if (classIndex == 0x1F) {
+ aClass = enclosingObject;
+ goto l1;
+ }
+ if (classIndex == 8) {
+ aClass = GIV(nilObj);
+ goto l1;
+ }
+ }
+ assert(classIndex >= (arrayClassIndexPun()));
+ /* begin classOrNilAtIndex: */
+ assert((classIndex <= (tagMask()))
+ || (classIndex >= (arrayClassIndexPun())));
+ classTablePage = longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + ((((usqInt) classIndex) >> 10) << 2));
+ if (classTablePage == GIV(nilObj)) {
+ aClass = GIV(nilObj);
+ goto l1;
+ }
@@ Diff output truncated at 50000 characters. @@
More information about the Vm-dev
mailing list