diff options
| author | Alan Wu <XrXr@users.noreply.github.com> | 2021-08-30 15:42:04 -0400 |
|---|---|---|
| committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:39 -0400 |
| commit | d098c5560b7ae43f6f6798bedd9561f80604986f (patch) | |
| tree | 3d01f73f5276ff879034f2ea0002f35f0837e207 /include/ruby/internal/iterator.h | |
| parent | ed85e8a33ac13c75967f8a893bb5de22b729c1ef (diff) | |
Shave a few instructions off of leave
The code path for leave that returns to the interpreter
(gen_leave() -> yjit_gen_leave_exit()) used to have the logic:
```
cfp->sp++;
cfp->sp[-1] = return_val;
cfp->sp--;
return return_val;
```
The SP changes it made was unnecessary and this change removes it.
After this change, `leave` doesn't adjust the `cfp->sp` of the caller
and only writes `cfp->sp[0]`. To accomodate this in the JIT-to-JIT
return case, return stubs have an `sp_offset` of 1.
The change removes sp adjustment from the JIT-to-JIT return case, too,
making it more efficient. Also, since the C method case of `send`
has an `sp_offset` of 1 after the call, this change enables block
version sharing.
Diffstat (limited to 'include/ruby/internal/iterator.h')
0 files changed, 0 insertions, 0 deletions
