Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.2738
Browse files Browse the repository at this point in the history
CoInterpreter: small tweak for VMMaker.oscog-eem.2737.  On every entry to
interpret avoid checking CReturnAddress and simply assign it.  Once set its
value never changes, so an unchecked write will be faster and takes less code.
  • Loading branch information
eliotmiranda committed Apr 3, 2020
1 parent dfc7542 commit 6e2df0d
Show file tree
Hide file tree
Showing 36 changed files with 574 additions and 502 deletions.
46 changes: 24 additions & 22 deletions nsspur64src/vm/cointerp.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
from
CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -1281,7 +1281,7 @@ extern sqInt nonIndexablePointerFormat(void);
static sqInt noUnscannedEphemerons(void);
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
extern sqInt numBytesOf(sqInt objOop);
extern usqInt numPointerSlotsOf(sqInt objOop);
extern sqInt numPointerSlotsOf(sqInt objOop);
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
extern usqInt numSlotsOf(sqInt objOop);
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
Expand Down Expand Up @@ -2641,7 +2641,7 @@ sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt ffiExceptionResponse;
sqInt checkedPluginName;
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2737";
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_*_VMMaker.oscog-eem.2738";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
int displayWidth;
int displayDepth;
Expand Down Expand Up @@ -2833,9 +2833,11 @@ interpret(void)
initialEnterSmalltalkExecutive();
return null;
}
if (!(GIV(CReturnAddress))) {
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
}
assert((GIV(CReturnAddress) == null)
|| (GIV(CReturnAddress) == (getReturnAddress())));

/* record entry time when running as a browser plug-in */
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
browserPluginInitialiseIfNeeded();
/* begin internalizeIPandSP */
assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
Expand Down Expand Up @@ -48998,7 +49000,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
sqInt iLimiT;
sqInt methodHeader;
sqInt numLiterals;
usqInt numMediatedSlots;
sqInt numMediatedSlots;
usqInt numSlots;
usqInt numSlots1;
sqInt oop;
Expand Down Expand Up @@ -55506,7 +55508,7 @@ numBytesOf(sqInt objOop)
Works with CompiledMethods, as well as ordinary objects. */

/* SpurMemoryManager>>#numPointerSlotsOf: */
usqInt
sqInt
numPointerSlotsOf(sqInt objOop)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt contextSize;
Expand Down Expand Up @@ -58749,7 +58751,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
contextSize = (sp >> 3);
l10: /* end fetchStackPointerOf: */;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
i = CtxtTempFrameStart + contextSize;
goto l11;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -58781,7 +58783,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = ((usqInt) (numLiterals + LiteralStart));
i = numLiterals + LiteralStart;
l11: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -58835,7 +58837,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
contextSize = (sp >> 3);
l12: /* end fetchStackPointerOf: */;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
i = CtxtTempFrameStart + contextSize;
goto l13;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -58867,7 +58869,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = ((usqInt) (numLiterals + LiteralStart));
i = numLiterals + LiteralStart;
l13: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -58922,7 +58924,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop11)));
contextSize = (sp >> 3);
l14: /* end fetchStackPointerOf: */;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
i = CtxtTempFrameStart + contextSize;
goto l15;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -58954,7 +58956,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = ((usqInt) (numLiterals + LiteralStart));
i = numLiterals + LiteralStart;
l15: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -62087,10 +62089,10 @@ updatePointers(void)
sqInt numLiterals1;
sqInt numLiterals2;
sqInt numLiterals3;
usqInt numPointerSlots;
usqInt numPointerSlots1;
usqInt numPointerSlots2;
usqInt numPointerSlots3;
sqInt numPointerSlots;
sqInt numPointerSlots1;
sqInt numPointerSlots2;
sqInt numPointerSlots3;
usqInt numSlots;
usqInt numSlots1;
usqInt numSlots11;
Expand Down Expand Up @@ -67245,8 +67247,8 @@ static sqInt
getErrorObjectFromPrimFailCode(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt classIndex;
usqInt clone;
usqInt errObj;
sqInt clone;
sqInt errObj;
sqInt fieldIndex;
sqInt i;
usqInt newObj;
Expand Down
4 changes: 2 additions & 2 deletions nsspur64src/vm/cointerp.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
*/


Expand Down Expand Up @@ -251,7 +251,7 @@ extern sqInt minSlotsForShortening(void);
extern sqInt nilObject(void);
extern sqInt nonIndexablePointerFormat(void);
extern sqInt numBytesOf(sqInt objOop);
extern usqInt numPointerSlotsOf(sqInt objOop);
extern sqInt numPointerSlotsOf(sqInt objOop);
extern usqInt numSlotsOf(sqInt objOop);
extern sqInt numStrongSlotsOfWeakling(sqInt objOop);
extern sqInt objectAfter(sqInt objOop);
Expand Down
46 changes: 24 additions & 22 deletions nsspur64src/vm/gcc3x-cointerp.c
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
from
CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -1284,7 +1284,7 @@ extern sqInt nonIndexablePointerFormat(void);
static sqInt noUnscannedEphemerons(void);
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
extern sqInt numBytesOf(sqInt objOop);
extern usqInt numPointerSlotsOf(sqInt objOop);
extern sqInt numPointerSlotsOf(sqInt objOop);
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
extern usqInt numSlotsOf(sqInt objOop);
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
Expand Down Expand Up @@ -2644,7 +2644,7 @@ sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt ffiExceptionResponse;
sqInt checkedPluginName;
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2737";
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_*_VMMaker.oscog-eem.2738";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
int displayWidth;
int displayDepth;
Expand Down Expand Up @@ -2842,9 +2842,11 @@ interpret(void)
initialEnterSmalltalkExecutive();
return null;
}
if (!(GIV(CReturnAddress))) {
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
}
assert((GIV(CReturnAddress) == null)
|| (GIV(CReturnAddress) == (getReturnAddress())));

/* record entry time when running as a browser plug-in */
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
browserPluginInitialiseIfNeeded();
/* begin internalizeIPandSP */
assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
Expand Down Expand Up @@ -49007,7 +49009,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
sqInt iLimiT;
sqInt methodHeader;
sqInt numLiterals;
usqInt numMediatedSlots;
sqInt numMediatedSlots;
usqInt numSlots;
usqInt numSlots1;
sqInt oop;
Expand Down Expand Up @@ -55515,7 +55517,7 @@ numBytesOf(sqInt objOop)
Works with CompiledMethods, as well as ordinary objects. */

/* SpurMemoryManager>>#numPointerSlotsOf: */
usqInt
sqInt
numPointerSlotsOf(sqInt objOop)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt contextSize;
Expand Down Expand Up @@ -58758,7 +58760,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
contextSize = (sp >> 3);
l10: /* end fetchStackPointerOf: */;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
i = CtxtTempFrameStart + contextSize;
goto l11;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -58790,7 +58792,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = ((usqInt) (numLiterals + LiteralStart));
i = numLiterals + LiteralStart;
l11: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -58844,7 +58846,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
contextSize = (sp >> 3);
l12: /* end fetchStackPointerOf: */;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
i = CtxtTempFrameStart + contextSize;
goto l13;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -58876,7 +58878,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = ((usqInt) (numLiterals + LiteralStart));
i = numLiterals + LiteralStart;
l13: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -58931,7 +58933,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop11)));
contextSize = (sp >> 3);
l14: /* end fetchStackPointerOf: */;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
i = CtxtTempFrameStart + contextSize;
goto l15;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -58963,7 +58965,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = ((usqInt) (numLiterals + LiteralStart));
i = numLiterals + LiteralStart;
l15: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -62096,10 +62098,10 @@ updatePointers(void)
sqInt numLiterals1;
sqInt numLiterals2;
sqInt numLiterals3;
usqInt numPointerSlots;
usqInt numPointerSlots1;
usqInt numPointerSlots2;
usqInt numPointerSlots3;
sqInt numPointerSlots;
sqInt numPointerSlots1;
sqInt numPointerSlots2;
sqInt numPointerSlots3;
usqInt numSlots;
usqInt numSlots1;
usqInt numSlots11;
Expand Down Expand Up @@ -67254,8 +67256,8 @@ static sqInt
getErrorObjectFromPrimFailCode(void)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt classIndex;
usqInt clone;
usqInt errObj;
sqInt clone;
sqInt errObj;
sqInt fieldIndex;
sqInt i;
usqInt newObj;
Expand Down
16 changes: 9 additions & 7 deletions nsspursrc/vm/cointerp.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
from
CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2620,7 +2620,7 @@ sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt ffiExceptionResponse;
sqInt checkedPluginName;
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2737";
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_*_VMMaker.oscog-eem.2738";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char primitiveDoMixedArithmetic = 1;
char expensiveAsserts = 0;
Expand Down Expand Up @@ -2805,9 +2805,11 @@ interpret(void)
initialEnterSmalltalkExecutive();
return null;
}
if (!(GIV(CReturnAddress))) {
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
}
assert((GIV(CReturnAddress) == null)
|| (GIV(CReturnAddress) == (getReturnAddress())));

/* record entry time when running as a browser plug-in */
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
browserPluginInitialiseIfNeeded();
/* begin internalizeIPandSP */
assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
Expand Down
2 changes: 1 addition & 1 deletion nsspursrc/vm/cointerp.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
*/


Expand Down
16 changes: 9 additions & 7 deletions nsspursrc/vm/gcc3x-cointerp.c
Expand Up @@ -2,11 +2,11 @@


/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
from
CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4
CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2737 uuid: ca691460-8bf3-48df-91dd-3132219b7bc4 " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2738 uuid: f6958436-d66a-477c-bbcb-4b6586462abe " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -2623,7 +2623,7 @@ sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt ffiExceptionResponse;
sqInt checkedPluginName;
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_VMMaker.oscog-eem.2737";
const char *interpreterVersion = "Newspeak Virtual Machine [ Open Smalltalk, Spur] CoInterpreterPrimitives_*_VMMaker.oscog-eem.2738";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
char primitiveDoMixedArithmetic = 1;
char expensiveAsserts = 0;
Expand Down Expand Up @@ -2814,9 +2814,11 @@ interpret(void)
initialEnterSmalltalkExecutive();
return null;
}
if (!(GIV(CReturnAddress))) {
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
}
assert((GIV(CReturnAddress) == null)
|| (GIV(CReturnAddress) == (getReturnAddress())));

/* record entry time when running as a browser plug-in */
GIV(CReturnAddress) = ((usqIntptr_t) (getReturnAddress()));
browserPluginInitialiseIfNeeded();
/* begin internalizeIPandSP */
assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
Expand Down

0 comments on commit 6e2df0d

Please sign in to comment.