Allow generating reified Ruby classes with actual name.#5813
Merged
headius merged 1 commit intojruby:masterfrom Aug 2, 2019
Merged
Allow generating reified Ruby classes with actual name.#5813headius merged 1 commit intojruby:masterfrom
headius merged 1 commit intojruby:masterfrom
Conversation
This partially addresses jruby#4643. One of the main features of the old "reify.classes" feature was that all Object subclasses would reify as their actual names. This is needed for JVM tooling to separate different types of Ruby object since normally they'll all appear to be RubyObject or one of the specialized subclasses like RubyObject1. However the other features of reify.classes are difficult to reconcile with reified variables from reify.variables, due to the complexity of mapping a Ruby class hierarchy into a Java class hierarchy at the same time we are reifying variables into fields. This patch goes partway to restore the actual names by forcing reify.variables to use the actual Ruby class name without attempting to match the class hierarchy or generate the other Java methods from reify.classes. Pass -Xreify.variables.name to get this new behavior (off by default).
enebo
approved these changes
Aug 2, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This partially addresses #4643.
One of the main features of the old "reify.classes" feature was that all Object subclasses would reify as their actual names. This is needed for JVM tooling to separate different types of Ruby object since normally they'll all appear to be RubyObject or one of the specialized subclasses like RubyObject1.
However the other features of reify.classes are difficult to reconcile with reified variables from reify.variables, due to the complexity of mapping a Ruby class hierarchy into a Java class hierarchy at the same time we are reifying variables into fields.
This patch goes partway to restore the actual names by forcing reify.variables to use the actual Ruby class name without attempting to match the class hierarchy or generate the other Java methods from reify.classes.
Pass -Xreify.variables.name to get this new behavior (off by default).