openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

X64 FFI upcall thunk generation

Open 0xdaryl opened this issue 3 years ago • 3 comments

Implement upcall thunk generation for Linux, macOS, and Windows.

0xdaryl avatar Sep 20 '22 13:09 0xdaryl

@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

0xdaryl avatar Sep 20 '22 13:09 0xdaryl

FYI: @tajila, @pshipton, @DanHeidinga

ChengJin01 avatar Sep 20 '22 17:09 ChengJin01

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.

zl-wang avatar Sep 21 '22 11:09 zl-wang

Jenkins test sanity xlinux,win,osx jdk19

0xdaryl avatar Oct 11 '22 13:10 0xdaryl

CI testing has passed. @zl-wang, would you mind merging please?

0xdaryl avatar Oct 12 '22 00:10 0xdaryl