State of the ppc64le loom port

Reingruber, Richard richard.reingruber at sap.com
Thu Apr 14 06:15:12 UTC 2022


Hi,

I wanted to let everybody on the list know that the ppc64le port of loom now
passes a test where a continuation runs, then yields and then runs again in
interpreted mode. This requires moving the stack frames that represent the
continuation to the java heap when yield is called (internally "freeze") and
vice versa (internally "thaw") when run is called.

I expected to reach this point earlier but I didn't ;)
I expect to progress a little faster now :)

/tldr

Even though the test itself [1] is almost trivial, the patch that constitutes
the port [2][3] is already substantial (but with just a few shared code changes).

What took me the longest was understanding how to implement the platform
dependent method (`new_heap_frame()`) that is supposed to allocate a call frame
on the heap given its caller frame and understanding the shared code driving the
freezing. The shared code makes use of the preexisting `class frame` and I
assumed that the interpreted frames on the heap should be very similar to the
frames on the stack but I was wrong. I had to follow the procedure how on x86
interpreted frames are allocated which is very different to ppc64le: w/o
alignment and padding, w/o abi section, with an unextended sp that points to the
last call parameter. And I found out the hard and long way with a lot of
accumulating off-by-one errors. I have added diagrams to the ppc64le versions of
`new_heap_frame()`[4] and `new_stack_frame()`[5]. They certainly helped me.

Rebasing after the ongoing cleanups is a little bit of an effort too, but I'm
very much in favour of that work. Ideally I would have started after that.

Richard.


[1] 'Trivial' run, yield, run again continuation test:
    https://github.com/reinrich/loom/blob/91d5cf041b89748b6647f539720979b6c147b804/test/jdk/jdk/internal/vm/Continuation/BasicExp.java#L82
[2] Port squashed into one commit: https://github.com/reinrich/loom/commit/91d5cf041b89748b6647f539720979b6c147b804
[3] Branch with port: https://github.com/reinrich/loom/tree/ppc_port
[4] Allocating a heap frame:
    https://github.com/reinrich/loom/blob/91d5cf041b89748b6647f539720979b6c147b804/src/hotspot/cpu/ppc/continuation_ppc.inline.hpp#L113
[5] Allocating a stack frame:
    https://github.com/reinrich/loom/blob/91d5cf041b89748b6647f539720979b6c147b804/src/hotspot/cpu/ppc/continuation_ppc.inline.hpp#L229


More information about the loom-dev mailing list