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

YJIT: add support for calling bmethods #6489

Merged
merged 2 commits into from Oct 5, 2022
Merged

Commits on Oct 4, 2022

  1. YJIT: fix a parameter name

    XrXr committed Oct 4, 2022
    Copy the full SHA
    89cf13b View commit details
    Browse the repository at this point in the history
  2. YJIT: add support for calling bmethods

    This commit adds support for the VM_METHOD_TYPE_BMETHOD method type in
    YJIT. You can get these type of methods from facilities like
    Kernel#define_singleton_method and Module#define_method.
    
    Even though the body of these methods are blocks, the parameter setup
    for them is exactly the same as VM_METHOD_TYPE_ISEQ, so we can reuse
    the same logic in gen_send_iseq(). You can see this from how
    vm_call_bmethod() eventually calls setup_parameters_complex() with
    arg_setup_method.
    
    Bmethods do need their frame environment to be setup differently. We
    handle this by allowing callers of gen_send_iseq() to control the iseq,
    the frame flag, and the prev_ep. The `prev_ep` goes into the same
    location as the block handler would go into in an iseq method frame.
    
    Co-authored-by: John Hawthorn <john@hawthorn.email>
    XrXr and jhawthorn committed Oct 4, 2022
    Copy the full SHA
    5944f4c View commit details
    Browse the repository at this point in the history