Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3329
Browse files Browse the repository at this point in the history
Oops, sqWin32Backtrace.c expects cogCodebase to be in cogit.h.
So put back the <api> pragma there-on and comment it.

Generate the newspeak VMs while we're at it.
  • Loading branch information
eliotmiranda committed Jun 7, 2023
1 parent f237888 commit 63dbb04
Show file tree
Hide file tree
Showing 41 changed files with 4,720 additions and 10,133 deletions.
3 changes: 2 additions & 1 deletion src/spur32.cog.lowcode/cogit.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3328 uuid: a1c7c55f-8829-4fcc-9a66-55ba7d1a8cef
CCodeGenerator VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
*/


Expand All @@ -26,6 +26,7 @@ extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMetho
extern sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes);
extern char * codeEntryFor(char *address);
extern char * codeEntryNameFor(char *address);
extern sqInt cogCodeBase(void);
extern sqInt cogCodeConstituents(sqInt withDetails);
extern CogMethod * cogFullBlockMethodnumCopied(sqInt aMethodObj, sqInt numCopied);
extern void cogitPostGCAction(sqInt gcMode);
Expand Down
10 changes: 6 additions & 4 deletions src/spur32.cog.lowcode/cogitARMv5.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3328 uuid: a1c7c55f-8829-4fcc-9a66-55ba7d1a8cef
CCodeGenerator VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3328 uuid: a1c7c55f-8829-4fcc-9a66-55ba7d1a8cef
StackToRegisterMappingCogit VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3328 uuid: a1c7c55f-8829-4fcc-9a66-55ba7d1a8cef " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -9411,7 +9411,9 @@ codeEntryNameFor(char *address)
}


/* used e.g. in the platform's backtrace generators */
/* used e.g. in the platform's backtrace generators. Declared api to place it
in cogit.h
*/

/* Cogit>>#cogCodeBase */
sqInt
Expand Down
10 changes: 6 additions & 4 deletions src/spur32.cog.lowcode/cogitIA32.c
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3328 uuid: a1c7c55f-8829-4fcc-9a66-55ba7d1a8cef
CCodeGenerator VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3328 uuid: a1c7c55f-8829-4fcc-9a66-55ba7d1a8cef
StackToRegisterMappingCogit VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3328 uuid: a1c7c55f-8829-4fcc-9a66-55ba7d1a8cef " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -9058,7 +9058,9 @@ codeEntryNameFor(char *address)
}


/* used e.g. in the platform's backtrace generators */
/* used e.g. in the platform's backtrace generators. Declared api to place it
in cogit.h
*/

/* Cogit>>#cogCodeBase */
sqInt
Expand Down
36 changes: 2 additions & 34 deletions src/spur32.cog.newspeak/cogit.h
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322
CCodeGenerator VMMaker.oscog-eem.3329 uuid: 31a93bfc-1d06-4008-9439-27c01b0644f9
*/


Expand All @@ -23,31 +23,24 @@
extern sqInt abortOffset(void);
extern void addCogMethodsToHeapMap(void);
extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
extern void callCogCodePopReceiver(void);
extern void callCogCodePopReceiverAndClassRegs(void);
extern void ceFree(void *pointer);
extern sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes);
extern char * codeEntryFor(char *address);
extern char * codeEntryNameFor(char *address);
extern sqInt cogCodeBase(void);
extern sqInt cogCodeConstituents(sqInt withDetails);
extern void cogitPostGCAction(sqInt gcMode);
extern sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod);
extern CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs);
extern CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop);
extern void compactCogCompiledCode(void);
extern sqInt defaultCogCodeSize(void);
extern void enterCogCodePopReceiver(void);
extern CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod);
extern void flagCogMethodForBecome(CogMethod *cogMethod);
extern void followForwardedLiteralsIn(CogMethod *cogMethod);
extern void followForwardedMethods(void);
extern void followMovableLiteralsAndUpdateYoungReferrers(void);
extern void freeBecomeFlaggedMethods(void);
extern void freeCogMethod(CogMethod *cogMethod);
extern void freeUnmarkedMachineCode(void);
extern void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress);
extern sqInt isPCWithinMethodZone(void *address);
extern sqInt isSendReturnPC(sqInt retpc);
extern void linkNSSendCacheclassTagenclosingObjecttargetcaller(NSSendCache *nsSendCache, sqInt classTag, sqInt enclosingObject, CogMethod *targetMethod, CogMethod *callingMethod);
extern void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver);
Expand All @@ -58,17 +51,12 @@ extern usqInt maxCogMethodAddress(void);
extern usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
extern sqInt mnuOffset(void);
extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
extern void printCogMethodFor(void *address);
extern void printTrampolineTable(void);
extern sqInt recordPrimTraceFunc(void);
extern void setBreakMethod(sqInt anObj);
extern void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop);
extern sqInt traceLinkedSendOffset(void);
extern void unflagBecomeFlaggedMethods(void);
extern void unlinkAllSends(void);
extern void unlinkSendsLinkedForInvalidClasses(void);
extern void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector);
extern void unlinkSendsToFree(void);
extern void unlinkSendsToMethodsSuchThatAndFreeIf(sqInt (*criterion)(CogMethod *), sqInt freeIfTrue);
extern void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue);
extern void voidCogCompiledCode(void);
Expand All @@ -78,15 +66,7 @@ extern CogMethod * methodFor(void *address);
extern sqInt methodsCompiledToMachineCodeInto(sqInt arrayObj);
extern sqInt numMethods(void);
extern sqInt numMethodsOfType(sqInt cogMethodType);
extern void printCogMethods(void);
extern void printCogMethodsOfType(sqInt cmType);
extern void printCogMethodsWithMethod(sqInt methodOop);
extern void printCogMethodsWithPrimitive(sqInt primIdx);
extern void printCogMethodsWithSelector(sqInt selectorOop);
extern void printCogYoungReferrers(void);
extern sqInt printOpenPICList(void);
extern sqInt pruneYoungReferrers(void);
EXPORT(char *) whereIsMaybeCodeThing(sqInt anOop);
extern char * whereIsMaybeCodeThing(sqInt anOop);
extern sqInt cogMethodHasExternalPrim(CogMethod *aCogMethod);
extern sqInt cogMethodHasMachineCodePrim(CogMethod *aCogMethod);
extern sqInt genQuickReturnConst(void);
Expand All @@ -99,7 +79,6 @@ extern void callCogCodePopReceiverArg1Arg0Regs(void);

/*** Global Variables ***/
extern sqInt blockNoContextSwitchOffset;
extern sqInt breakPC;
extern sqInt cbEntryOffset;
extern sqInt cbNoSwitchEntryOffset;
extern sqInt ceBaseFrameReturnTrampoline;
Expand All @@ -121,26 +100,15 @@ extern sqInt ceReturnToInterpreterTrampoline;
#if COGMTVM
extern usqIntptr_t (*ceTryLockVMOwner)(usqIntptr_t);
#endif
#if !defined(cFramePointerInUse)
extern sqInt cFramePointerInUse;
#endif
extern sqInt cmEntryOffset;
extern sqInt cmNoCheckEntryOffset;
extern usqInt methodZoneBase;
extern sqInt missOffset;
extern void (*realCECallCogCodePopReceiverAndClassRegs)(void);
extern void (*realCECallCogCodePopReceiverArg0Regs)(void);
extern void (*realCECallCogCodePopReceiverArg1Arg0Regs)(void);
extern void (*realCECallCogCodePopReceiverReg)(void);
extern void (*realCEEnterCogCodePopReceiverReg)(void);
extern int traceFlags ;
extern const char * traceFlagsMeanings[] ;
extern sqInt traceStores;


/*** Macros ***/
#define blockAlignment() 8
#define breakOnImplicitReceiver() (traceFlags & 256)
#define ceBaseFrameReturnPC() ceBaseFrameReturnTrampoline
#define ceCannotResumePC() ((usqInt)ceCannotResumeTrampoline)
#define ceReturnToInterpreterPC() ((usqInt)ceReturnToInterpreterTrampoline)
Expand Down

0 comments on commit 63dbb04

Please sign in to comment.