Skip to content

Revisit chilled strings and pass all specs#8375

Merged
headius merged 7 commits intojruby:9.5-devfrom
headius:chilled_revisited
Oct 14, 2024
Merged

Revisit chilled strings and pass all specs#8375
headius merged 7 commits intojruby:9.5-devfrom
headius:chilled_revisited

Conversation

@headius
Copy link
Member

@headius headius commented Oct 14, 2024

Fixing the one failure (chilled strings should not be frozen?) led to some refactoring elsewhere in order to keep specs passing. All are green now.

We have too many ways to check for frozen status and error etc,
and they all need to be chilled-aware, so for now just override
them in RubyString. In the future we'll want to sort this out to
one master method that subclasses can override for specialized
frozen checks.
@headius headius added this to the JRuby 10.0.0.0 milestone Oct 14, 2024
@headius headius changed the base branch from master to 9.5-dev October 14, 2024 20:09
ObjectSpace for string is already problematic, but in this case we
have two specialized types of strings that are born frozen before
they are fully initialized. Adding these into ObjectSpace requires
installing a hidden variable, which triggers frozen checks, which
fire causing a FrozenError to try to inspect an incompletely-
initialized object. It's simpler to just say that FString (and
the Debug version) never go into ObjectSpace.
ObjectSpace wants to be able to assign a hidden variable, but
calling checkFrozen here leads to child class implementations
being called that may have other side effects. This is another
place where the frozen checks need to be unified and cleaned up,
but for now I restore the !isFrozen short circuit and revert the
checkFrozen call to avoid this unintended behavior.
@headius headius merged commit 9d4d157 into jruby:9.5-dev Oct 14, 2024
@headius headius deleted the chilled_revisited branch October 14, 2024 21:11
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

Successfully merging this pull request may close these issues.

1 participant