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

Rework framing for super and __callee__ #7098

Open
wants to merge 7 commits into
base: jruby-9.3
Choose a base branch
from

Commits on Feb 16, 2022

  1. Use static name for super in a module method

    Module methods have a dynamic hierarchy, but do not have a dynamic
    super target name. This eliminates part of the frame requirement
    for super within a module method, on the way to getting __callee__
    working.
    headius committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    a151aad View commit details
    Browse the repository at this point in the history
  2. Always use ModuleSuper and rewrite define_method

    The changes here attempt to get more super calls using a static
    name, so we can eliminate dependency on a call frame to get that
    name.
    
    * super in a block in any method will start out as a ModuleSuper
      using the name from the method.
    * define_method clones and rewrites the block to retarget any
      super calls to the newly defined name.
    * all super instructions get rewritten to the appropriate type for
      the target class, instance/class/module
    
    Remaining cases that use UnresolvedSuper may only be the ones
    where super is invalid, such as a block at top-level or within a
    class or module body.
    headius committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    cb27869 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2022

  1. Configuration menu
    Copy the full SHA
    34b33a2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fd50860 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    eed5a35 View commit details
    Browse the repository at this point in the history
  4. Use startup instead of full for super rewriting

    startup is simpler time to do this and also the
    define_method opto will not work if the AST is consumed
    which is what happens if you full compile.
    enebo committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    31465a3 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2022

  1. Additional tweaks for define_methods super

    * Alter scope class to be the target class, so it will be used as
      the base class when doing InstanceSuper. This fixes the last
      remaining failure in specs.
    * Also consider and rewrite super in nested closures. This fixes
      the last remaining failure in CRuby tests.
    headius committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    7e71845 View commit details
    Browse the repository at this point in the history