Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition from interpreter to JIT reallocates frozen strings #7713

Open
headius opened this issue Mar 2, 2023 · 1 comment
Open

Transition from interpreter to JIT reallocates frozen strings #7713

headius opened this issue Mar 2, 2023 · 1 comment

Comments

@headius
Copy link
Member

headius commented Mar 2, 2023

When we run code with frozen strings in the interpreter and then later run the same code as JIT-compiled, those frozen strings objects will be allocated a second time.

This leads to failures in some tests and specs that expect exactly one construction of the frozen string, such as this one in CRuby:

  3) Failure:
TestHash::TestSubHash#test_NEWHASH_fstring_key [/home/runner/work/jruby/jruby/test/mri/ruby/test_hash.rb:352]:
Expected "ABC" (oid=12312) to be the same as "ABC" (oid=12316).

There's no simple fix for this currently, since it's not possible (or at least not easy) to pass already-allocated objects into the cache fields that jitted code uses.

@headius
Copy link
Member Author

headius commented Nov 29, 2023

Similar issue with literal ranges: #8019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant