This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [PATCH] Go closures for s390[x]
- From: Richard Henderson <rth at redhat dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: libffi-discuss at sourceware dot org, Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Fri, 19 Dec 2014 08:09:52 -0600
- Subject: Re: [PATCH] Go closures for s390[x]
- Authentication-results: sourceware.org; auth=none
- References: <201412191313 dot sBJDDb77031594 at d03av02 dot boulder dot ibm dot com>
On 12/19/2014 07:13 AM, Ulrich Weigand wrote:
> Actually, it sort-of is; the code does:
> la %r14,0(%r13,%r9) # Set return address
> br %r7 # ... and call function
>
> i.e. sets the return address register to point to one of the return stubs
> and then jumps to the target function instead of calling it; so from the
> point of view of an unwinder, it looks like the target function was called
> from the instruction immediately preceding the return stub.
Ah, good point. That's the sort of verbage that should be in the comment then.
Is that optimization really worth it? Is there no call/return prediction stack
to get confused? I know I replicated it in the code that I wrote, but really
only now do I start to question it.
r~