Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3315
Browse files Browse the repository at this point in the history
Fix a regression in the ARM64 (non-Apple) and RISCV64 FFI plugins introduced
by VMMaker.oscog-eem.3309/VMMaker.oscog-eem.3310. I had forgot to push up
alignCurrentArgOf:to:
  • Loading branch information
eliotmiranda committed Mar 28, 2023
1 parent 06e0b0b commit b958008
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 31 deletions.
26 changes: 13 additions & 13 deletions src/plugins/SqueakFFIPrims/ARM64AppleFFIPlugin.c
@@ -1,9 +1,9 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322
VMPluginCodeGenerator VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b
from
ThreadedARM64AppleFFIPlugin VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322
ThreadedARM64AppleFFIPlugin VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b
*/
static char __buildInfo[] = "ThreadedARM64AppleFFIPlugin VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322 " __DATE__ ;
static char __buildInfo[] = "ThreadedARM64AppleFFIPlugin VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b " __DATE__ ;


#include "config.h"
Expand Down Expand Up @@ -177,7 +177,7 @@ static char __buildInfo[] = "ThreadedARM64AppleFFIPlugin VMMaker.oscog-eem.3310
#define MaxNumArgs 15
#define NumFloatRegArgs 8
#define NumIntRegArgs 8
#define PluginVersionInfo " VMMaker.oscog-eem.3310"
#define PluginVersionInfo " VMMaker.oscog-eem.3315"

typedef struct {
char *argVector;
Expand Down Expand Up @@ -552,7 +552,7 @@ extern sqInt trueObject(void);
extern
#endif
struct VirtualMachine* interpreterProxy;
static const char *moduleName = "ARM64AppleFFIPlugin VMMaker.oscog-eem.3310 " INT_EXT;
static const char *moduleName = "ARM64AppleFFIPlugin VMMaker.oscog-eem.3315 " INT_EXT;


/*** Macros ***/
Expand Down Expand Up @@ -1544,9 +1544,9 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
return FFIErrorCallFrameTooBig;
}
/* begin alignCurrentArgOf:to: */
misAlignedBytes22 = (((sqInt)((calloutState->currentArg)))) & (7);
misAlignedBytes22 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes22 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (8 - misAlignedBytes22));
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes22));
}
memcpy((calloutState->currentArg), ptrAddress, structSize);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize);
Expand Down Expand Up @@ -1623,9 +1623,9 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
return FFIErrorCallFrameTooBig;
}
/* begin alignCurrentArgOf:to: */
misAlignedBytes31 = (((sqInt)((calloutState->currentArg)))) & (7);
misAlignedBytes31 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes31 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (8 - misAlignedBytes31));
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes31));
}
memcpy((calloutState->currentArg), ptrAddress, structSize1);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize1);
Expand Down Expand Up @@ -2956,9 +2956,9 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
return FFIErrorCallFrameTooBig;
}
/* begin alignCurrentArgOf:to: */
misAlignedBytes2 = (((sqInt)((calloutState->currentArg)))) & (7);
misAlignedBytes2 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes2 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (8 - misAlignedBytes2));
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes2));
}
memcpy((calloutState->currentArg), ptrAddress, structSize);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize);
Expand Down Expand Up @@ -3035,9 +3035,9 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
return FFIErrorCallFrameTooBig;
}
/* begin alignCurrentArgOf:to: */
misAlignedBytes3 = (((sqInt)((calloutState->currentArg)))) & (7);
misAlignedBytes3 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes3 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (8 - misAlignedBytes3));
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes3));
}
memcpy((calloutState->currentArg), ptrAddress, structSize1);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize1);
Expand Down
38 changes: 29 additions & 9 deletions src/plugins/SqueakFFIPrims/ARM64FFIPlugin.c
@@ -1,9 +1,9 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322
VMPluginCodeGenerator VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b
from
ThreadedARM64FFIPlugin VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322
ThreadedARM64FFIPlugin VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b
*/
static char __buildInfo[] = "ThreadedARM64FFIPlugin VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322 " __DATE__ ;
static char __buildInfo[] = "ThreadedARM64FFIPlugin VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b " __DATE__ ;


#include "config.h"
Expand Down Expand Up @@ -177,7 +177,7 @@ static char __buildInfo[] = "ThreadedARM64FFIPlugin VMMaker.oscog-eem.3310 uuid:
#define MaxNumArgs 15
#define NumFloatRegArgs 8
#define NumIntRegArgs 8
#define PluginVersionInfo " VMMaker.oscog-eem.3310"
#define PluginVersionInfo " VMMaker.oscog-eem.3315"

typedef struct {
char *argVector;
Expand Down Expand Up @@ -552,7 +552,7 @@ extern sqInt trueObject(void);
extern
#endif
struct VirtualMachine* interpreterProxy;
static const char *moduleName = "ARM64FFIPlugin VMMaker.oscog-eem.3310 " INT_EXT;
static const char *moduleName = "ARM64FFIPlugin VMMaker.oscog-eem.3315 " INT_EXT;


/*** Macros ***/
Expand Down Expand Up @@ -1266,6 +1266,8 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
sqInt isStringObj;
sqInt isStruct;
sqInt length;
sqInt misAlignedBytes;
sqInt misAlignedBytes1;
sqInt nilOop;
sqInt oopClass;
char *pointer;
Expand Down Expand Up @@ -1390,7 +1392,11 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
if ((((calloutState->currentArg)) + roundedSize) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes));
}
memcpy((calloutState->currentArg), ptrAddress, structSize);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize);
}
Expand Down Expand Up @@ -1460,7 +1466,11 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
if ((((calloutState->currentArg)) + roundedSize1) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes1 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes1 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes1));
}
memcpy((calloutState->currentArg), ptrAddress, structSize1);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize1);
}
Expand Down Expand Up @@ -2563,6 +2573,8 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
sqInt argSpecSize1;
sqInt availableRegisterSpace;
sqInt availableRegisterSpace1;
sqInt misAlignedBytes;
sqInt misAlignedBytes1;
void *ptrAddress;
sqInt ptrClass;
sqInt roundedSize;
Expand Down Expand Up @@ -2616,7 +2628,11 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
if ((((calloutState->currentArg)) + roundedSize) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes));
}
memcpy((calloutState->currentArg), ptrAddress, structSize);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize);
}
Expand Down Expand Up @@ -2686,7 +2702,11 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
if ((((calloutState->currentArg)) + roundedSize1) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes1 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes1 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes1));
}
memcpy((calloutState->currentArg), ptrAddress, structSize1);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize1);
}
Expand Down
38 changes: 29 additions & 9 deletions src/plugins/SqueakFFIPrims/RiscV64FFIPlugin.c
@@ -1,9 +1,9 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322
VMPluginCodeGenerator VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b
from
ThreadedRiscV64FFIPlugin VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322
ThreadedRiscV64FFIPlugin VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b
*/
static char __buildInfo[] = "ThreadedRiscV64FFIPlugin VMMaker.oscog-eem.3310 uuid: ccb9d141-68dd-4a1a-86b9-906b72753322 " __DATE__ ;
static char __buildInfo[] = "ThreadedRiscV64FFIPlugin VMMaker.oscog-eem.3315 uuid: 9f1219c6-2ad5-4cb2-9e1d-572ad6ec934b " __DATE__ ;


#include "config.h"
Expand Down Expand Up @@ -177,7 +177,7 @@ static char __buildInfo[] = "ThreadedRiscV64FFIPlugin VMMaker.oscog-eem.3310 uui
#define MaxNumArgs 15
#define NumFloatRegArgs 8
#define NumIntRegArgs 8
#define PluginVersionInfo " VMMaker.oscog-eem.3310"
#define PluginVersionInfo " VMMaker.oscog-eem.3315"

typedef struct {
char *argVector;
Expand Down Expand Up @@ -551,7 +551,7 @@ extern sqInt trueObject(void);
extern
#endif
struct VirtualMachine* interpreterProxy;
static const char *moduleName = "RiscV64FFIPlugin VMMaker.oscog-eem.3310 " INT_EXT;
static const char *moduleName = "RiscV64FFIPlugin VMMaker.oscog-eem.3315 " INT_EXT;


/*** Macros ***/
Expand Down Expand Up @@ -1282,6 +1282,8 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
sqInt isStringObj;
sqInt isStruct;
sqInt length;
sqInt misAlignedBytes;
sqInt misAlignedBytes1;
sqInt nilOop;
sqInt oopClass;
char *pointer;
Expand Down Expand Up @@ -1406,7 +1408,11 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
if ((((calloutState->currentArg)) + roundedSize) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes));
}
memcpy((calloutState->currentArg), ptrAddress, structSize);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize);
}
Expand Down Expand Up @@ -1476,7 +1482,11 @@ ffiArgumentSpecClassin(sqInt oop, sqInt argSpec, sqInt argClass, CalloutState *c
if ((((calloutState->currentArg)) + roundedSize1) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes1 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes1 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes1));
}
memcpy((calloutState->currentArg), ptrAddress, structSize1);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize1);
}
Expand Down Expand Up @@ -2596,6 +2606,8 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
sqInt argSpecSize1;
sqInt availableRegisterSpace;
sqInt availableRegisterSpace1;
sqInt misAlignedBytes;
sqInt misAlignedBytes1;
void *ptrAddress;
sqInt ptrClass;
sqInt roundedSize;
Expand Down Expand Up @@ -2649,7 +2661,11 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
if ((((calloutState->currentArg)) + roundedSize) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes));
}
memcpy((calloutState->currentArg), ptrAddress, structSize);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize);
}
Expand Down Expand Up @@ -2719,7 +2735,11 @@ ffiPushStructureContentsOfin(sqInt oop, CalloutState *calloutState)
if ((((calloutState->currentArg)) + roundedSize1) > ((calloutState->limit))) {
return FFIErrorCallFrameTooBig;
}
alignCurrentArgOfto(calloutState, 8);
/* begin alignCurrentArgOf:to: */
misAlignedBytes1 = (((sqInt)((calloutState->currentArg)))) & (BytesPerWord - 1);
if (misAlignedBytes1 != 0) {
(calloutState->currentArg = ((calloutState->currentArg)) + (BytesPerWord - misAlignedBytes1));
}
memcpy((calloutState->currentArg), ptrAddress, structSize1);
(calloutState->currentArg = ((calloutState->currentArg)) + roundedSize1);
}
Expand Down

0 comments on commit b958008

Please sign in to comment.