Skip to content

ZJIT: Experiment with going through memory for all local variable access #981

@XrXr

Description

@XrXr

ZJIT currently tries to lift local variables at environment level 0 into FrameState using the NoEPEscape invariant and the from-memory reloads at strategic places. This setup has had a few bugs in the past and a few outstanding ones.1 2

We would like to know what performance looks like if all local variables went through EP to/from memory. It has the benefit of being close to interpreter semantics so easier to ensure correctness. With ZJIT: Optimize load store forwarding (ruby#16228) and ZJIT: Implement dead store elimination (ruby#16507) we may not be losing much speed by going through memory.

To give an estimate of speed impact, in YJIT, putting some local variables into registers gave about a 2% speedup (ruby#11157).

Footnotes

  1. https://github.com/Shopify/ruby/issues/970

  2. https://github.com/Shopify/ruby/issues/976

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions