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

feat: add parametrized labels to LLL #2598

Merged

Commits on Feb 16, 2022

  1. rename get_comb_opcodes to get_lll_opcodes

    get_comb_opcodes originally stood for "get combined [pseudo- and evm-]
    opcodes". what it really meant is get all LLL opcodes.
    charles-cooper committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    2fcbc25 View commit details
    Browse the repository at this point in the history
  2. change LLL labels to be parametrized

    this commit forces stack items passed to labels to be explicitly named.
    this will help liveness analysis of stack items. note that it changes
    the structure of labels - instead of allowing labels to occur
    arbitrarily in code, they turn into blocks, enforcing scope of the named
    stack items.
    charles-cooper committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    9b724aa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bab7dab View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    76b9e55 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c68dd6a View commit details
    Browse the repository at this point in the history
  6. fix lint

    charles-cooper committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    9ace6fb View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    eefac01 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bb0a8ad View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    25f4358 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    db24a0a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    b8d58a6 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    083b700 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    cdbb155 View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2022

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

Commits on Feb 18, 2022

  1. Revert "move fallback in a level of nesting"

    This reverts commit eca642f.
    charles-cooper committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    954753f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a73500a View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2022

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

Commits on Feb 22, 2022

  1. Configuration menu
    Copy the full SHA
    26e8441 View commit details
    Browse the repository at this point in the history
  2. remove dead code

    charles-cooper committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    f3a5f7c View commit details
    Browse the repository at this point in the history
  3. fix variable popping

    charles-cooper committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    ccb809c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0db966b View commit details
    Browse the repository at this point in the history
  5. remove bad assertion

    charles-cooper committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    e4a0270 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    33a8612 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9ab4777 View commit details
    Browse the repository at this point in the history
  8. fix lint

    charles-cooper committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    9d092ba View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    db39f2e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    503daa2 View commit details
    Browse the repository at this point in the history
  11. fix mypy complaint

    charles-cooper committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    9abf013 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2022

  1. fix return out of loop

    charles-cooper committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    af3ceb0 View commit details
    Browse the repository at this point in the history
  2. add extra tests for returning out of loop

    cases:
    - internal void
    - internal with return
    - external void
    - external with return
    charles-cooper committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    64bc1c5 View commit details
    Browse the repository at this point in the history
  3. feat: add parametrized labels to LLL

    Change labels in LLL to be parameterized. Previously, stack items were
    implicitly consumed from jumpdests using `pass`, which made liveness
    analysis for stack items impossible in general. Since labels now take
    parameters, they are very similar to subroutines so we could use that
    terminology interchangeably.
    
    This change also enables translation to other architectures such as LLVM
    backends since implicit stack items cannot be handled in translation to
    a register machine.
    
    Lastly, this commit also added an `exit_to` instruction for LLL. This
    compiles the same as `goto` -- to a JUMP instruction -- but has
    different scoping semantics. `exit_to` terminates a subroutine while
    `goto` expects control flow to be returned. This is an important hint
    for liveness analysis. If you hit an `exit_to`, all stack items in scope
    must be consumed, whereas if you hit a `goto` the same requirement does
    not hold.
    
    In order to accomodate the semantic change, this commit changes the
    codegen everywhere that stack items are consumed implicitly. In
    practice, this happens in private functions, and in function common
    cleanup blocks.
    
    Note: the assembly output for all contracts I looked at were
    byte-for-byte the same with the exception of those which returned
    straight out of a loop (using the LLL `cleanup_repeat` instruction), so
    this commit adds a couple more tests to test returns out of loops (in
    the void return and external cases)
    charles-cooper committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    2541c25 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1b1ec32 View commit details
    Browse the repository at this point in the history