Skip to content

Generate right-shaped object subclasses #5171

@headius

Description

@headius

We have been running with the reified instance variable logic for some time, which picks from among a fixed set of "right-shaped" object subtypes that use Java fields instead of instance variables for the first N ivars. However we want to improve and expand this logic as follows:

  • The subtypes should be generated at runtime. Some set may be pre-generated for the jar to avoid having as much type churn.
  • For Decreased performance between JRuby 1.7 and 9.1 #3973 and others we found issues trying to do both reify.variables and reify.classes, the latter of which generates the native Java class name according to the Ruby name for better profiling. That logic should be rolled into the generation of reified variable classes, perhaps with the flag if we are concerned about the load of N generated classes for N Ruby classes instantiated in the system.

This work should proceed in tandem with explorations into Graal JIT's partial escape analysis, which will work better if we can avoid the extra indirection through the instance variable table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions