On 7/5/23 14:45, Matheus Tavares Bernardino wrote:
Taylor <[email protected]> wrote:
Note that check_noshuf calls HELPER(probe_noshuf_load) and
HELPER(commit_store). Both of those call GETPC() from within. So, you'll
need to pull the contents into separate functions that take ra as an
argument.
Ah, good point. It was my understanding that, in case of a memory
exception in one of those nested helper calls, the GETPC() we would want
to use for unwinding was the one from the most recent helper. I'm still
trying to wrap my head around these concepts, though, so I might have
misunderstood it. Is this not the case?
No, it is not the case.
GETPC fetches the return address from the current function.
The unwinder which uses this value needs the return address *into* the
generated code.
Therefore the HELPER function that is directly called from generated code is the place at
which GETPC must be used, and nowhere else. The corollary is that one HELPER should avoid
calling another HELPER, Just In Case -- use separate intermediate functions instead, as
Taylor suggests above.
r~