Skip to content

Commit

Permalink
CogVM source as per Name: VMMaker.oscog-eem.3127
Browse files Browse the repository at this point in the history
Revise primitiveSuspend to no longer just remove a process from its
condition variable list if waiting on a condition variable. Instead
also back up the process one bytecode so that the blocking send will
be retried if and when the process is resumed.

Distinguish between a process being runnable but not active from a
blocked process by the class of myList.  If myList is LinkedList the
process is runnable.  Hence keep track of the class of LinkedList.

Refactor convertToInterpreterFrame: to convertFrame:toInterpreterFrame:
to facilitate implementation in the Cogit (a send byetcode is not a
suspension point in machien code, hence a machien code caller of a
blocking primtiive must be converted to an interpreter frame).

Fix formatting bug in longPrintOop:.

Cog: several places can use startPCOfMethodHeader: instead of startPCOfMethod:

convertToInterpreterFrame: needs to assert validInstructionPointer:..., not
just evaluate it.

Interpreter: better to test process having a context first in printAllStacks.
  • Loading branch information
eliotmiranda committed Jan 2, 2022
1 parent c376667 commit b266a59
Show file tree
Hide file tree
Showing 68 changed files with 16,676 additions and 12,442 deletions.
2 changes: 1 addition & 1 deletion src/plugins/DESPlugin/DESPlugin.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3119 uuid: c0b40a55-50ca-4dd9-8b6f-d355a6dd5e1f
VMPluginCodeGenerator VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
from
DESPlugin CryptographyPlugins-eem.27 uuid: 63bc0f04-a4d3-4347-84fc-20b64ea64093
*/
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/DSAPrims/DSAPrims.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3119 uuid: c0b40a55-50ca-4dd9-8b6f-d355a6dd5e1f
VMPluginCodeGenerator VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
from
DSAPlugin CryptographyPlugins-eem.27 uuid: 63bc0f04-a4d3-4347-84fc-20b64ea64093
*/
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/MD5Plugin/MD5Plugin.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3119 uuid: c0b40a55-50ca-4dd9-8b6f-d355a6dd5e1f
VMPluginCodeGenerator VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
from
MD5Plugin CryptographyPlugins-eem.27 uuid: 63bc0f04-a4d3-4347-84fc-20b64ea64093
*/
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/SHA2Plugin/SHA2Plugin.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3119 uuid: c0b40a55-50ca-4dd9-8b6f-d355a6dd5e1f
VMPluginCodeGenerator VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
from
SHA2Plugin CryptographyPlugins-eem.27 uuid: 63bc0f04-a4d3-4347-84fc-20b64ea64093
*/
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
ThreadedFFIPlugin VMMaker.oscog-eem.2999 uuid: c7933314-4edf-4570-b6d8-3891b13c233d
ThreadedFFIPlugin VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
*/

#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7__) || defined(__arm32__) || defined(ARM32) || defined(_M_ARM)
Expand Down
2 changes: 1 addition & 1 deletion src/spur32.cog.lowcode/cogit.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3116 uuid: d757936e-c3f3-48be-9435-9a3a60b14615
CCodeGenerator VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
*/


Expand Down
20 changes: 9 additions & 11 deletions src/spur32.cog.lowcode/cogitARMv5.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3115 uuid: e71c2bb2-05b8-4d1e-a837-c31a9bcc2148
CCodeGenerator VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3115 uuid: e71c2bb2-05b8-4d1e-a837-c31a9bcc2148
StackToRegisterMappingCogit VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3115 uuid: e71c2bb2-05b8-4d1e-a837-c31a9bcc2148 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -10033,7 +10033,6 @@ collectCogMethodConstituent(CogMethod *cogMethod)
sqInt bcpc;
sqInt bsOffset;
sqInt byte;
sqInt cm;
CogBlockMethod *cogBlockMethod;
sqInt data;
BytecodeDescriptor *descriptor;
Expand Down Expand Up @@ -10064,10 +10063,9 @@ collectCogMethodConstituent(CogMethod *cogMethod)
/* isFrameless ? */
return positive32BitIntegerFor(((usqInt)cogMethod));
}
cm = (cogMethod->methodObject);

/* +1 for first address */
nSlots = ((((byteSizeOf(cm)) - (startPCOfMethod(cm))) * 2) + (minSlotsForShortening())) + 1;
nSlots = ((((byteSizeOf((cogMethod->methodObject))) - (startPCOfMethodHeader((cogMethod->methodHeader)))) * 2) + (minSlotsForShortening())) + 1;
data = instantiateClassindexableSize(splObj(ClassArray), nSlots);
if (!data) {
return null;
Expand Down Expand Up @@ -11507,7 +11505,7 @@ static sqInt NoDbgRegParms
deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader)
{
return (((primitiveIndexOfMethodheader(aMethodObj, aMethodHeader)) > 0)
&& ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject((startPCOfMethod(aMethodObj)) + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj)))
&& ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject((startPCOfMethodHeader(aMethodHeader)) + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj)))
? (sizeOfCallPrimitiveBytecode(aMethodHeader)) + (sizeOfLongStoreTempBytecode(aMethodHeader))
: 0);
}
Expand Down Expand Up @@ -15142,7 +15140,7 @@ methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt compareP
}
}
}
for (bi = (startPCOfMethod(methodA)); bi <= endPCA; bi += 1) {
for (bi = (startPCOfMethodHeader(headerA)); bi <= endPCA; bi += 1) {
if ((fetchByteofObject(bi, methodA)) != (fetchByteofObject(bi, methodB))) {
return 0;
}
Expand Down Expand Up @@ -28569,7 +28567,7 @@ compilePrimitive(void)
}
if ((code == CompletePrimitive)
&& (!(((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethod(methodObj)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) {
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethodHeader(methodHeader)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) {
return 0;
}
if (code == UnimplementedPrimitive) {
Expand Down Expand Up @@ -31281,7 +31279,7 @@ compileFrameBuild(void)
genoperand(PushR, SendNumArgsReg);
}
if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethod(methodObj)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethodHeader(methodHeader)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
compileGetErrorCode();
}
stackCheckLabel = compileStackOverflowCheck(canContextSwitchIfActivatingheader(methodObj, methodHeader));
Expand Down Expand Up @@ -31504,7 +31502,7 @@ compileTwoPathFrameBuild(void)
genoperand(PushR, SendNumArgsReg);
}
if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethod(methodObj)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethodHeader(methodHeader)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
compileGetErrorCode();
}
stackCheckLabel = compileStackOverflowCheck(canContextSwitchIfActivatingheader(methodObj, methodHeader));
Expand Down
20 changes: 9 additions & 11 deletions src/spur32.cog.lowcode/cogitIA32.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Automatically generated by
CCodeGenerator VMMaker.oscog-eem.3115 uuid: e71c2bb2-05b8-4d1e-a837-c31a9bcc2148
CCodeGenerator VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
from
StackToRegisterMappingCogit VMMaker.oscog-eem.3115 uuid: e71c2bb2-05b8-4d1e-a837-c31a9bcc2148
StackToRegisterMappingCogit VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1
*/
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3115 uuid: e71c2bb2-05b8-4d1e-a837-c31a9bcc2148 " __DATE__ ;
static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.3127 uuid: 4d6dd04c-143e-41c0-90bb-ed55b27ff3f1 " __DATE__ ;
char *__cogitBuildInfo = __buildInfo;


Expand Down Expand Up @@ -9699,7 +9699,6 @@ collectCogMethodConstituent(CogMethod *cogMethod)
sqInt bcpc;
sqInt bsOffset;
sqInt byte;
sqInt cm;
CogBlockMethod *cogBlockMethod;
sqInt data;
BytecodeDescriptor *descriptor;
Expand Down Expand Up @@ -9730,10 +9729,9 @@ collectCogMethodConstituent(CogMethod *cogMethod)
/* isFrameless ? */
return positive32BitIntegerFor(((usqInt)cogMethod));
}
cm = (cogMethod->methodObject);

/* +1 for first address */
nSlots = ((((byteSizeOf(cm)) - (startPCOfMethod(cm))) * 2) + (minSlotsForShortening())) + 1;
nSlots = ((((byteSizeOf((cogMethod->methodObject))) - (startPCOfMethodHeader((cogMethod->methodHeader)))) * 2) + (minSlotsForShortening())) + 1;
data = instantiateClassindexableSize(splObj(ClassArray), nSlots);
if (!data) {
return null;
Expand Down Expand Up @@ -11302,7 +11300,7 @@ static sqInt NoDbgRegParms
deltaToSkipPrimAndErrorStoreInheader(sqInt aMethodObj, sqInt aMethodHeader)
{
return (((primitiveIndexOfMethodheader(aMethodObj, aMethodHeader)) > 0)
&& ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject((startPCOfMethod(aMethodObj)) + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj)))
&& ((longStoreBytecodeForHeader(aMethodHeader)) == (fetchByteofObject((startPCOfMethodHeader(aMethodHeader)) + (sizeOfCallPrimitiveBytecode(aMethodHeader)), aMethodObj)))
? (sizeOfCallPrimitiveBytecode(aMethodHeader)) + (sizeOfLongStoreTempBytecode(aMethodHeader))
: 0);
}
Expand Down Expand Up @@ -14814,7 +14812,7 @@ methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt compareP
}
}
}
for (bi = (startPCOfMethod(methodA)); bi <= endPCA; bi += 1) {
for (bi = (startPCOfMethodHeader(headerA)); bi <= endPCA; bi += 1) {
if ((fetchByteofObject(bi, methodA)) != (fetchByteofObject(bi, methodB))) {
return 0;
}
Expand Down Expand Up @@ -26094,7 +26092,7 @@ compilePrimitive(void)
}
if ((code == CompletePrimitive)
&& (!(((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethod(methodObj)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) {
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethodHeader(methodHeader)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))))) {
return 0;
}
if (code == UnimplementedPrimitive) {
Expand Down Expand Up @@ -28751,7 +28749,7 @@ compileFrameBuild(void)
genoperand(PushR, SendNumArgsReg);
}
if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethod(methodObj)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethodHeader(methodHeader)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
compileGetErrorCode();
}
stackCheckLabel = compileStackOverflowCheck(canContextSwitchIfActivatingheader(methodObj, methodHeader));
Expand Down Expand Up @@ -28960,7 +28958,7 @@ compileTwoPathFrameBuild(void)
genoperand(PushR, SendNumArgsReg);
}
if (((primitiveIndexOfMethodheader(methodObj, methodHeader)) > 0)
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethod(methodObj)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
&& ((longStoreBytecodeForHeader(methodHeader)) == (fetchByteofObject((startPCOfMethodHeader(methodHeader)) + (sizeOfCallPrimitiveBytecode(methodHeader)), methodObj)))) {
compileGetErrorCode();
}
stackCheckLabel = compileStackOverflowCheck(canContextSwitchIfActivatingheader(methodObj, methodHeader));
Expand Down
Loading

0 comments on commit b266a59

Please sign in to comment.