Skip to content

Commit

Permalink
NewspeakVM source as per VMMaker.oscog-eem.3339 [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
marceltaeumel committed Nov 21, 2023
1 parent 10d61ee commit b88b000
Show file tree
Hide file tree
Showing 15 changed files with 486 additions and 1,001 deletions.
6 changes: 1 addition & 5 deletions src/spur32.cog.newspeak/cogit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
CCodeGenerator VMMaker.oscog-eem.3339 uuid: b1c834e2-5de7-464c-aeb5-4f2a7b8812d6
*/


Expand Down Expand Up @@ -97,9 +97,6 @@ extern usqIntptr_t (*ceGetFP)(void);
extern usqIntptr_t (*ceGetSP)(void);
extern void (*ceInvokeInterpret)(void);
extern sqInt ceReturnToInterpreterTrampoline;
#if COGMTVM
extern usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t);
#endif
extern sqInt cmEntryOffset;
extern sqInt cmNoCheckEntryOffset;
extern usqInt methodZoneBase;
Expand All @@ -125,7 +122,6 @@ extern int traceFlags ;
#define recordOverflowTrace() (traceFlags & 32)
#define recordPrimTrace() (traceFlags & 8)
#define recordSendTrace() (traceFlags & 2)
#define tryLockVMOwnerTo(value) ceTryLockVMOwner(value)
#define numRegArgs() 2
#define fullBlockEntryOffset() cbEntryOffset
#define fullBlockNoContextSwitchEntryOffset() cbNoSwitchEntryOffset
Expand Down
72 changes: 24 additions & 48 deletions src/spur32.cog.newspeak/cogitARMv5.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
CCodeGenerator VMMaker.oscog-eem.3339 uuid: b1c834e2-5de7-464c-aeb5-4f2a7b8812d6
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
StackToRegisterMappingCogit VMMaker.oscog-eem.3339 uuid: b1c834e2-5de7-464c-aeb5-4f2a7b8812d6
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3339 uuid: b1c834e2-5de7-464c-aeb5-4f2a7b8812d6 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -273,7 +273,7 @@ char *__cogitBuildInfo = __buildInfo;
#define NumSendTrampolines 4
#define NumSpecialSelectors 32
#define NumStoreTrampolines 5
#define NumTrampolines (83 + (COGMTVM ? 1 : 0) + (IMMUTABILITY ? 5 : 0))
#define NumTrampolines (83 + (IMMUTABILITY ? 5 : 0))
#define OrCqR 109
#define OrCqRR 125
#define OrCwR 117
Expand Down Expand Up @@ -968,7 +968,6 @@ static sqInt NoDbgRegParms genConvertCharacterToCodeInReg(sqInt reg);
static sqInt NoDbgRegParms genConvertIntegerToCharacterInReg(sqInt reg);
static sqInt NoDbgRegParms genCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock);
static sqInt NoDbgRegParms genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch);
static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch);
static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegifForwarderifNotForwarder(sqInt reg, sqInt scratch, void *fwdJumpTarget, void *nonFwdJumpTargetOrZero);
static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegupdatingMwr(sqInt reg, sqInt scratch, sqInt offset, sqInt baseReg);
static sqInt NoDbgRegParms genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg);
Expand Down Expand Up @@ -2599,9 +2598,6 @@ void (*ceEnterCogCodePopReceiverReg)(void);
usqIntptr_t (*ceGetFP)(void);
usqIntptr_t (*ceGetSP)(void);
void (*ceInvokeInterpret)(void);
#if COGMTVM
usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t);
#endif
void (*realCECallCogCodePopReceiverAndClassRegs)(void);
void (*realCECallCogCodePopReceiverArg0Regs)(void);
void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void);
Expand Down Expand Up @@ -2672,7 +2668,6 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define reportError(n) warning("compilation error")
#define setHasMovableLiteral(b) (hasMovableLiteral = (b))
#define setHasYoungReferent(b) (hasYoungReferent = (b))
#define tryLockVMOwnerTo(value) ceTryLockVMOwner(value)
#define varBaseAddress() varBaseAddress
#define nextOpenPIC methodObject
#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work
Expand All @@ -2685,6 +2680,7 @@ void (*realCEEnterCogCodePopReceiverReg)(void);
#define literalInstructionAt(index) (&literals[index])
#define fullBlockEntryOffset() cbEntryOffset
#define fullBlockNoContextSwitchEntryOffset() cbNoSwitchEntryOffset
#define needsFrame() needsFrame
#define fixupAtIndex(index) (&fixups[index])
#define simNativeStackAt(index) (simNativeStack + (index))
#define simSelf() simStack
Expand Down Expand Up @@ -13008,11 +13004,6 @@ initializeBackend(void)
void
initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
{
sqInt fixupSize;
sqInt numberOfAbstractOpcodes;
sqInt opcodeSize;
usqInt startAddress1;

initializeBackend();
sqMakeMemoryExecutableFromToCodeToDataDelta(startAddress, endAddress,
# if DUAL_MAPPED_CODE_ZONE
Expand All @@ -13032,25 +13023,6 @@ initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress)
methodCount = 0;
assertValidDualZone();
/* begin maybeGenerateCacheFlush */
/* begin generateVMOwnerLockFunctions */
# if COGMTVM
/* begin allocateOpcodes:bytecodes: */
numberOfAbstractOpcodes = numLowLevelLockOpcodes(backEnd);
numAbstractOpcodes = numberOfAbstractOpcodes;
opcodeSize = (sizeof(CogAbstractInstruction)) * numAbstractOpcodes;
fixupSize = (sizeof(CogBytecodeFixup)) * numAbstractOpcodes;
abstractOpcodes = alloca(opcodeSize + fixupSize);
bzero(abstractOpcodes, opcodeSize + fixupSize);
fixups = ((void *)((((usqInt)abstractOpcodes)) + opcodeSize));
zeroOpcodeIndexForNewOpcodes();
labelCounter = 0;
zeroOpcodeIndex();
startAddress1 = methodZoneBase;
generateLowLevelTryLock(backEnd, vmOwnerAddress());
outputInstructionsForGeneratedRuntimeAt(startAddress1);
recordGeneratedRunTimeaddress("ceTryLockVMOwner", startAddress1);
ceTryLockVMOwner = ((usqIntptr_t (*)(usqIntptr_t)) startAddress1);
# endif // COGMTVM
genGetLeafCallStackPointers();
generateStackPointerCapture();
generateTrampolines();
Expand Down Expand Up @@ -22780,17 +22752,6 @@ genEnsureObjInRegNotForwardedscratchReg(sqInt reg, sqInt scratch)
return 0;
}

/* CogObjectRepresentationForSpur>>#genEnsureOopInRegNotForwarded:scratchReg: */
static sqInt NoDbgRegParms
genEnsureOopInRegNotForwardedscratchReg(sqInt reg, sqInt scratch)
{
AbstractInstruction *instruction;

/* begin genEnsureOopInRegNotForwarded:scratchReg:jumpBackTo: */
instruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
return genEnsureOopInRegNotForwardedscratchRegifForwarderifNotForwarder(reg, scratch, instruction, 0);
}


/* Make sure that the oop in reg is not forwarded.
Use the fact that isForwardedObjectClassIndexPun is a power of two to save
Expand Down Expand Up @@ -22909,10 +22870,12 @@ static sqInt NoDbgRegParms
genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch, sqInt index, sqInt objReg)
{
AbstractInstruction *abstractInstruction;
AbstractInstruction *abstractInstruction1;
AbstractInstruction *anInstruction;
AbstractInstruction *anInstruction1;
AbstractInstruction *anInstruction2;
AbstractInstruction *imm;
AbstractInstruction *inst;
AbstractInstruction *loop;
AbstractInstruction *ok;
sqInt quickConstant;
Expand Down Expand Up @@ -22957,9 +22920,19 @@ genEnsureOopInRegNotForwardedscratchRegupdatingSlotin(sqInt reg, sqInt scratch,
assert((reg == Arg0Reg)
&& ((scratch == TempReg)
&& (objReg == ReceiverResultReg)));
/* begin CallRT: */
abstractInstruction = genoperand(Call, ceStoreCheckContextReceiverTrampoline);
(abstractInstruction->annotation = IsRelativeCall);
if (needsFrame()) {
/* begin CallRT: */
abstractInstruction = genoperand(Call, ceStoreCheckContextReceiverTrampoline);
(abstractInstruction->annotation = IsRelativeCall);
}
else {
/* begin saveAndRestoreLinkRegAround: */
inst = genoperand(PushR, LinkReg);
/* begin CallRT: */
abstractInstruction1 = genoperand(Call, ceStoreCheckContextReceiverTrampoline);
(abstractInstruction1->annotation = IsRelativeCall);
genoperand(PopR, LinkReg);
}
/* begin Jump: */
genoperand(Jump, ((sqInt)loop));
jmpTarget(ok, jmpTarget(imm, genoperandoperand(Label, (labelCounter += 1), bytecodePC)));
Expand Down Expand Up @@ -30699,6 +30672,7 @@ genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sen
AbstractInstruction *anInstruction;
AbstractInstruction *anInstruction1;
sqInt annotation;
AbstractInstruction *instruction;

assert(needsFrame);
/* begin annotationForSendTable: */
Expand Down Expand Up @@ -30733,7 +30707,9 @@ genMarshalledSendnumArgssendTable(sqInt selectorIndex, sqInt numArgs, sqInt *sen
l2: /* end annotationForSendTable: */;
if ((annotation == IsSuperSend)
|| (((annotation >= IsDirectedSuperSend) && (annotation <= IsDirectedSuperBindingSend)))) {
genEnsureOopInRegNotForwardedscratchReg(ReceiverResultReg, TempReg);
/* begin genEnsureOopInRegNotForwarded:scratchReg:jumpBackTo: */
instruction = genoperandoperand(Label, (labelCounter += 1), bytecodePC);
genEnsureOopInRegNotForwardedscratchRegifForwarderifNotForwarder(ReceiverResultReg, TempReg, instruction, 0);
}
if (numArgs >= (NumSendTrampolines - 1)) {
/* begin checkQuickConstant:forInstruction: */
Expand Down
Loading

0 comments on commit b88b000

Please sign in to comment.