Stream: git-wasmtime

Topic: wasmtime / issue #2960 Cranelift AArch64: Simplify leaf f...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 02 2021 at 12:35):

uweigand commented on issue #2960:

@akirilov-arm I haven't looked into your patch in detail yet, but the s390x back-end already doesn't allocate any stack frame if it is not needed. The gen_prologue_frame_setup routine always does nothing because I'm handling all frame setup in gen_clobber_save, and there I detect the case by simply noting that the required stack size is zero - computed as

        let stack_size =
            outgoing_args_size as i32 + clobber_size as i32 + fixed_frame_storage_size as i32;

(outgoing_args_size will be zero in a leaf function, clobber_size is zero if no call-saved register needs to be saved, and fixed_frame_storage_size is zero if there's no local stack variables or spill slots.)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 23 2021 at 14:11):

akirilov-arm commented on issue #2960:

I have enabled a couple of additional tests and made some minor changes, but I haven't checked how much work the x64 backend is going to require, which I am going to do next, so, please, do not merge yet.

@cfallin It turns out that there are already tests that use the unwinding information in a suitable way - in particular, traps::test_trap_trace mixes both functions to which the optimization applies and to which it doesn't in the call stack.

As for whether the defaults are sufficient in the AArch64 case - I checked the code that generated the DWARF Common Information Entry (CIE), and it sets the both the Canonical Frame Address (CFA) and the return address correctly (among other things), so an empty Frame Description Entry (FDE) should be fine. In fact, I compiled a simple C function and checked the unwinding information with readelf -wf - it was identical. Concerning Windows, AArch64 is currently unsupported on that platform anyway.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 23 2021 at 14:15):

akirilov-arm edited a comment on issue #2960:

I have enabled a couple of additional tests and made some minor changes, but I haven't checked how much work the x64 backend is going to require, which I am going to do next, so, please, do not merge yet.

@cfallin It turns out that there are already tests that use the unwinding information in a suitable way - in particular, traps::test_trap_trace mixes both functions to which the optimization applies and to which it doesn't in the call stack.

As for whether the defaults are sufficient in the AArch64 case - I checked the code that generated the DWARF Common Information Entry (CIE), and it sets both the Canonical Frame Address (CFA) and the return address correctly (among other things), so an empty Frame Description Entry (FDE) should be fine. In fact, I compiled a simple C function and looked at the unwinding information with readelf -wf - it was identical. Concerning Windows, I believe AArch64 is currently unsupported by Cranelift on that platform anyway.


Last updated: Dec 23 2024 at 12:05 UTC