openj9
openj9 copied to clipboard
X64 FFI upcall thunk generation
Implement upcall thunk generation for Linux, macOS, and Windows.
@zl-wang : I'd appreciate your review of this please.
This is a straightforward implementation for functional correctness. There are some space-saving optimizations such as avoiding copies to the local stack and consuming values directly from the caller frame and using smaller-displacement instructions if the stack offsets are known to be small. Such optimizations are not required for an MVP but can be considered for implementation later.
Tests in #15310 pass (but see comments in 15310 for what needs to be done to fix Windows failures). @ChengJin01 FYI
FYI: @tajila, @pshipton, @DanHeidinga
if EAX is at the right end of RAX (i.e. loading/storing RAX makes EAX portion appear in the lower-addressed location), my comments about GPR sub-8-byte content looked like irrelevant. FPR comments stay.
Jenkins test sanity xlinux,win,osx jdk19
CI testing has passed. @zl-wang, would you mind merging please?