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

Implementing Nesting #15

Merged
merged 15 commits into from Aug 9, 2019
Merged

Implementing Nesting #15

merged 15 commits into from Aug 9, 2019

Commits on May 22, 2018

  1. rework how nested values are accessed

    The current way on how importing values from ancestors works mainly aims at
    hiding how it works from the outside. The main problem was that it required
    a complex implementation in each backend which only one of the backends (x86)
    implemented.
    This commit changes accessing nested values, making it completely frontend
    based. Furthermore it allows the library users to retrieve the frame pointer
    of a parent and pass it in any way they like instead of forcing them to use
    jit_insn_call. This means the new way allows implementing things such as lambdas
    as function pointer (closure) together with a pointer to the parent frame and
    then call this lambda using jit_insn_call_indirect.
    M4GNV5 committed May 22, 2018
    Configuration menu
    Copy the full SHA
    a40e0bc View commit details
    Browse the repository at this point in the history
  2. Fix some issues with importing values

    The previous commit intrduced a couple of bugs.
    While importing values from the parent worked importing
    values from a higher ancestor or calling siblings was broken.
    This commit fixes these issues
    M4GNV5 committed May 22, 2018
    Configuration menu
    Copy the full SHA
    780b4b8 View commit details
    Browse the repository at this point in the history
  3. automatically find and pass parent frame pointers when calling nested…

    … functions
    
    when calling a nested function the function needs a pointer to the parent frame
    to import values. With the new nested importing system the work of importing
    values was taken away from the backends, so this commit takes away setting up
    calls to nested functions from the backend. Instead this is done in
    jit-rules.c (and architecture specific versions of jit-rule.c).
    M4GNV5 committed May 22, 2018
    Configuration menu
    Copy the full SHA
    25c88f5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    87735cf View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ba1ebf2 View commit details
    Browse the repository at this point in the history
  6. add an instruction for calling a nested function via a function and a…

    … frame pointer
    
    currently nested functions can only be called using jit_insn_call. This requires
    the caller to have the jit_function_t object available. The new function
    jit_insn_call_nested_indirect is similar to jit_insn_call_indirect - allowing
    to call a function using a jit_value_t - but it has an additional parameter for
    passing a pointer to the parent frame of the callee. Using
    jit_insn_get_parent_frame_pointer_of and jit_function_to_closure one can now
    create both the closure and the parent frame and pass it around together as
    jit values, calling them does not require the caller to know the actual
    jit_function_t he is calling. This makes it possible to implement what C#
    calls delegates.
    M4GNV5 committed May 22, 2018
    Configuration menu
    Copy the full SHA
    13eaac6 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2018

  1. Configuration menu
    Copy the full SHA
    cffe11a View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2018

  1. Configuration menu
    Copy the full SHA
    217a496 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2018

  1. Add a special OP for retrieving the frame pointer

    previousely this was handeled by incoming_reg however the register allocator
    doesn't allow to move registers from different reg classes.
    Nesting is tested on x86-86, x86 and the interpreter.
    M4GNV5 committed Aug 26, 2018
    Configuration menu
    Copy the full SHA
    00f8f12 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2018

  1. fix importing parameter in the interpreter as they reside in a custom…

    … memory location
    
    this commit also makes sure that the frame offset of parameters is available
    when the function is built, so they dont get assigned a different offset
    when being imported.
    M4GNV5 committed Aug 27, 2018
    Configuration menu
    Copy the full SHA
    ec02928 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1c5c925 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2018

  1. Configuration menu
    Copy the full SHA
    5281bae View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2018

  1. remove all calls to _jit_gen_fix_value from jit-insn.c, re-adding the…

    … import opcode, which is transformed into an add_relative in jit-compile.c
    M4GNV5 committed Dec 3, 2018
    Configuration menu
    Copy the full SHA
    e6dcb55 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2018

  1. make sure struct return pointer arguments are always before parent fr…

    …ame pointer arguments
    M4GNV5 committed Dec 29, 2018
    Configuration menu
    Copy the full SHA
    4740b27 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2018

  1. make sure values don't change their address

    the current implementations of incoming_frame_posn and outgoing_frame_posn
    tend to break addressable variables, as they simply change a values
    frame_offset.
    For incoming_frame_posn this is fine, as it is only used at the start
    of a function.
    This commit changes the implementation of outgoing_frame_posn to store
    the value at the target frame offset.
    M4GNV5 committed Dec 30, 2018
    Configuration menu
    Copy the full SHA
    d6c0eb9 View commit details
    Browse the repository at this point in the history