[foreign+linkToNative] RFR: Fill out missing Windows upcall stub generation

Jorn Vernee jbvernee at xs4all.nl
Fri Feb 8 20:42:30 UTC 2019


Hi,

I'd like to contribute a patch that fills out the missing upcall stub 
generation code for Windows. AFAICT this was only the spill/fill XMM 
registers based on what was being done in stubGenerator_x86_64.cpp for 
JNI upcalls. FWIW, the tests were already passing without that, so I 
don't think it's currently being tested actually, and tbh I'm not sure 
how to test that properly. Any ways, it seems good to follow the spec 
(which says that only xmm0 - xmm5 are volatile regs).

saving/loading mxcsr was not being done for Windows, but I think it 
should be, since the specification says that at least the top 10 bits 
are non-volatile (i.e. callee saved) [1].

I've also added use of LinkToNativeInvoker in Windowsx64ABI for 
applicable cases. I ran the jdk_foreign tests which all pass (should I 
run any other tests?)

Webrev : 
http://cr.openjdk.java.net/~jvernee/panama/webrevs/winstubgen/webrev.00/

Cheers,
Jorn

[1] : 
https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2017#mxcsr


More information about the panama-dev mailing list