Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Sep 9, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.3)

Can you help keep this open source service alive? 💖 Please sponsor : )

composerinteralia and others added 6 commits September 9, 2025 08:55
[ZJIT] Avoid mutating string in zjit stats

GitHub runs with a Symbol patch that causes a frozen string error when
running `--zjit-stats`

```rb
Class Symbol
  alias_method :to_s, :name
end
```

I remember hearing that Shopify runs a similar patch, and that we might
try to make this the default behavior in Ruby some day.

Any chance we can avoid mutating the string here in case it's frozen?
That does mean we'll end up making some extra strings when it's not
frozen, but I think that's OK for printing stats.
* failing test for ObjToString optimization with GuardType

* profile ObjToString receiver and rewrite with guard

* adjust integration tests for objtostring type guard optimization

* Implement new GuardTypeNot HIR; objtostring sends to_s directly on profiled nonstrings

* codegen for GuardTypeNot

* typo fixes

* better name for tests; fix side exit reason for GuardTypeNot

* revert accidental change

* make bindgen

* Fix is_string to identify subclasses of String; fix codegen for identifying if val is String
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
@pull pull bot locked and limited conversation to collaborators Sep 9, 2025
@pull pull bot added the ⤵️ pull label Sep 9, 2025
@pull pull bot merged commit 72c7d9f into turkdevops:master Sep 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants