Skip to content

Commit

Permalink
Cog VM source as per VMMaker.oscog-eem.2561
Browse files Browse the repository at this point in the history
Fix a bug in followForwardedLiteralsIn:; whether the methodObject is young or
not is important, and must be recorded.

Fix Float nan comparison again...
It was broken in  VMMaker.oscog-nice.2557
The comment of broken method tells what it should do (and what it did),
but no more what it does

Fix awfull VM crash when testing
[48 = $0] bench.

genJumpImmediate: generates not one instruction but two (Compare + Jump).
So we cannot use it as a jumpTarget (or we skip the Compare instruction!)
  • Loading branch information
eliotmiranda committed Sep 11, 2019
1 parent f6d5541 commit d7a17fd
Show file tree
Hide file tree
Showing 68 changed files with 561 additions and 586 deletions.
2 changes: 1 addition & 1 deletion nsspur64src/vm/cogit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
CCodeGenerator VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
*/


Expand Down
18 changes: 10 additions & 8 deletions nsspur64src/vm/cogitX64SysV.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
CCodeGenerator VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
from
StackToRegisterMappingCogit VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
StackToRegisterMappingCogit VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -6133,7 +6133,8 @@ endPCOf(sqInt aMethod)
? 256
: 0)
# else /* MULTIPLEBYTECODESETS */
0
(assert(!((methodUsesAlternateBytecodeSet(aMethod)))),
0)
# endif /* MULTIPLEBYTECODESETS */
;
nExts = 0;
Expand Down Expand Up @@ -6526,7 +6527,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod)
val = 0;
assert((((cogMethod->cmType)) != CMMethod)
|| (!(isForwarded((cogMethod->methodObject)))));
hasYoungObj = 0;
hasYoungObj = isYoung((cogMethod->methodObject));
if (shouldRemapOop((cogMethod->selector))) {
(cogMethod->selector = remapObj((cogMethod->selector)));
if (isYoung((cogMethod->selector))) {
Expand Down Expand Up @@ -8163,9 +8164,9 @@ gJumpFPEqual(void *jumpTarget)
AbstractInstruction *jumpUnordered;

/* begin genJumpFPOrderedAnd:to: */
jumpToTarget = genoperand(JumpFPEqual, ((sqInt)jumpTarget));
jumpUnordered = genoperand(JumpFPUnordered, ((sqInt)jumpTarget));
addDependent(jumpToTarget, jumpUnordered);
jumpToTarget = genoperand(JumpFPEqual, ((sqInt)jumpTarget));
jmpTarget(jumpUnordered, genoperandoperand(Label, (labelCounter += 1), bytecodePC));
return jumpToTarget;
}

Expand Down Expand Up @@ -16822,7 +16823,8 @@ genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInst
genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord);
}
jmpTarget(jumpTrue, returnTrue);
jmpTarget(jumpNotSmallFloat, (jumpNotFloatAtAll = genJumpImmediate(Arg0Reg)));
jmpTarget(jumpNotSmallFloat, genoperandoperand(Label, (labelCounter += 1), bytecodePC));
jumpNotFloatAtAll = genJumpImmediate(Arg0Reg);
genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg);
genCmpClassFloatCompactIndexR(SendNumArgsReg);
/* begin JumpNonZero: */
Expand Down
18 changes: 10 additions & 8 deletions nsspur64src/vm/cogitX64WIN64.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
CCodeGenerator VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
from
StackToRegisterMappingCogit VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
StackToRegisterMappingCogit VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -6141,7 +6141,8 @@ endPCOf(sqInt aMethod)
? 256
: 0)
# else /* MULTIPLEBYTECODESETS */
0
(assert(!((methodUsesAlternateBytecodeSet(aMethod)))),
0)
# endif /* MULTIPLEBYTECODESETS */
;
nExts = 0;
Expand Down Expand Up @@ -6534,7 +6535,7 @@ followForwardedLiteralsIn(CogMethod *cogMethod)
val = 0;
assert((((cogMethod->cmType)) != CMMethod)
|| (!(isForwarded((cogMethod->methodObject)))));
hasYoungObj = 0;
hasYoungObj = isYoung((cogMethod->methodObject));
if (shouldRemapOop((cogMethod->selector))) {
(cogMethod->selector = remapObj((cogMethod->selector)));
if (isYoung((cogMethod->selector))) {
Expand Down Expand Up @@ -8171,9 +8172,9 @@ gJumpFPEqual(void *jumpTarget)
AbstractInstruction *jumpUnordered;

/* begin genJumpFPOrderedAnd:to: */
jumpToTarget = genoperand(JumpFPEqual, ((sqInt)jumpTarget));
jumpUnordered = genoperand(JumpFPUnordered, ((sqInt)jumpTarget));
addDependent(jumpToTarget, jumpUnordered);
jumpToTarget = genoperand(JumpFPEqual, ((sqInt)jumpTarget));
jmpTarget(jumpUnordered, genoperandoperand(Label, (labelCounter += 1), bytecodePC));
return jumpToTarget;
}

Expand Down Expand Up @@ -16830,7 +16831,8 @@ genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInst
genoperand(RetN, (methodOrBlockNumArgs + 1) * BytesPerWord);
}
jmpTarget(jumpTrue, returnTrue);
jmpTarget(jumpNotSmallFloat, (jumpNotFloatAtAll = genJumpImmediate(Arg0Reg)));
jmpTarget(jumpNotSmallFloat, genoperandoperand(Label, (labelCounter += 1), bytecodePC));
jumpNotFloatAtAll = genJumpImmediate(Arg0Reg);
genGetCompactClassIndexNonImmOfinto(Arg0Reg, SendNumArgsReg);
genCmpClassFloatCompactIndexR(SendNumArgsReg);
/* begin JumpNonZero: */
Expand Down
40 changes: 19 additions & 21 deletions nsspur64src/vm/cointerp.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
from
CoInterpreter VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
CoInterpreter VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
*/
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b " __DATE__ ;
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;


Expand Down Expand Up @@ -1259,7 +1259,7 @@ extern sqInt nonIndexablePointerFormat(void);
static sqInt noUnscannedEphemerons(void);
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
extern sqInt numBytesOf(sqInt objOop);
extern sqInt numPointerSlotsOf(sqInt objOop);
extern usqInt numPointerSlotsOf(sqInt objOop);
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
extern usqInt numSlotsOf(sqInt objOop);
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
Expand Down Expand Up @@ -2622,7 +2622,7 @@ static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 578 */]
};
sqInt checkedPluginName;
char expensiveAsserts = 0;
const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.2558";
const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.2561";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;

Expand Down Expand Up @@ -46013,7 +46013,6 @@ becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt cop
}
followForwardedObjectFieldstoDepth(GIV(specialObjectsOop), 0);
/* begin postBecomeAction: */
/* send of break elided */;
spurPostBecomeAction(GIV(becomeEffectsFlags));
followMovableLiteralsAndUpdateYoungReferrers();
/* begin nilUncoggableMethods */
Expand Down Expand Up @@ -47902,7 +47901,7 @@ copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endS
sqInt iLimiT;
sqInt methodHeader;
sqInt numLiterals;
sqInt numMediatedSlots;
usqInt numMediatedSlots;
usqInt numSlots;
usqInt numSlots1;
sqInt oop;
Expand Down Expand Up @@ -54415,7 +54414,7 @@ numBytesOf(sqInt objOop)
Works with CompiledMethods, as well as ordinary objects. */

/* SpurMemoryManager>>#numPointerSlotsOf: */
sqInt
usqInt
numPointerSlotsOf(sqInt objOop)
{ DECL_MAYBE_SQ_GLOBAL_STRUCT
sqInt contextSize;
Expand Down Expand Up @@ -55448,7 +55447,6 @@ pinObject(sqInt objOop)
}
followForwardedObjectFieldstoDepth(GIV(specialObjectsOop), 0);
/* begin postBecomeAction: */
/* send of break elided */;
spurPostBecomeAction(GIV(becomeEffectsFlags));
followMovableLiteralsAndUpdateYoungReferrers();
/* begin nilUncoggableMethods */
Expand Down Expand Up @@ -57629,7 +57627,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
contextSize = (sp >> 3);
l10: /* end fetchStackPointerOf: */;
i = CtxtTempFrameStart + contextSize;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
goto l11;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -57661,7 +57659,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = numLiterals + LiteralStart;
i = ((usqInt) (numLiterals + LiteralStart));
l11: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -57715,7 +57713,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
contextSize = (sp >> 3);
l12: /* end fetchStackPointerOf: */;
i = CtxtTempFrameStart + contextSize;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
goto l13;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -57747,7 +57745,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = numLiterals + LiteralStart;
i = ((usqInt) (numLiterals + LiteralStart));
l13: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -57802,7 +57800,7 @@ printReferencesTo(sqInt anOop)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop11)));
contextSize = (sp >> 3);
l14: /* end fetchStackPointerOf: */;
i = CtxtTempFrameStart + contextSize;
i = ((usqInt) (CtxtTempFrameStart + contextSize));
goto l15;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -57834,7 +57832,7 @@ printReferencesTo(sqInt anOop)
}
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
i = numLiterals + LiteralStart;
i = ((usqInt) (numLiterals + LiteralStart));
l15: /* end numPointerSlotsOf: */;
while (((i -= 1)) >= 0) {
if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
Expand Down Expand Up @@ -60867,10 +60865,10 @@ updatePointers(void)
sqInt numLiterals1;
sqInt numLiterals2;
sqInt numLiterals3;
sqInt numPointerSlots;
sqInt numPointerSlots1;
sqInt numPointerSlots2;
sqInt numPointerSlots3;
usqInt numPointerSlots;
usqInt numPointerSlots1;
usqInt numPointerSlots2;
usqInt numPointerSlots3;
usqInt numSlots;
usqInt numSlots1;
usqInt numSlots11;
Expand Down Expand Up @@ -61435,7 +61433,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr)
assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj)));
contextSize = (sp >> 3);
l7: /* end fetchStackPointerOf: */;
numPointerSlots = ((usqInt) (CtxtTempFrameStart + contextSize));
numPointerSlots = CtxtTempFrameStart + contextSize;
goto l8;
}
/* begin numSlotsOf: */
Expand Down Expand Up @@ -61464,7 +61462,7 @@ updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr)
l5: /* end methodHeaderFromSavedFirstField: */;
assert((((header) & 7) == 1));
numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
numPointerSlots = ((usqInt) (numLiterals + LiteralStart));
numPointerSlots = numLiterals + LiteralStart;
l8: /* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */;
if ((fmt <= 5 /* lastPointerFormat */)
&& (numPointerSlots > 0)) {
Expand Down
4 changes: 2 additions & 2 deletions nsspur64src/vm/cointerp.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2558 uuid: ecd4b81e-cfaa-4167-a8ad-c2ebbb4e460b
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2561 uuid: 38122521-e0fd-4e4d-9903-8a99a82bac38
*/


Expand Down Expand Up @@ -245,7 +245,7 @@ extern sqInt minSlotsForShortening(void);
extern sqInt nilObject(void);
extern sqInt nonIndexablePointerFormat(void);
extern sqInt numBytesOf(sqInt objOop);
extern sqInt numPointerSlotsOf(sqInt objOop);
extern usqInt numPointerSlotsOf(sqInt objOop);
extern usqInt numSlotsOf(sqInt objOop);
extern sqInt numStrongSlotsOfWeakling(sqInt objOop);
extern sqInt objectAfter(sqInt objOop);
Expand Down
Loading

0 comments on commit d7a17fd

Please sign in to comment.