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

Add some static analysis in bytecode rewriting #519

Draft
wants to merge 71 commits into
base: trunk
Choose a base branch
from

Commits on Nov 28, 2023

  1. Initial scaffolding

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    b90d69c View commit details
    Browse the repository at this point in the history
  2. WIP: Run until fixpoint

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    183593e View commit details
    Browse the repository at this point in the history
  3. WIP: Fix jump offsets for jump instructions

    Some are absolute, some relative
    
    It boots now!
    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    c0ec58c View commit details
    Browse the repository at this point in the history
  4. Log reason for bailout

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    d7b8cb1 View commit details
    Browse the repository at this point in the history
  5. Remove commented code

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    724cba3 View commit details
    Browse the repository at this point in the history
  6. Remember to call meet

    I think this is in the wrong place though
    
    Also, add debugging
    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    759a30f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c70bf20 View commit details
    Browse the repository at this point in the history
  8. nit

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    fe0a261 View commit details
    Browse the repository at this point in the history
  9. WIP: everything is broken

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    71a2d36 View commit details
    Browse the repository at this point in the history
  10. wip what is going on

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    8c6fdae View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    66dc669 View commit details
    Browse the repository at this point in the history
  12. Seems to work...!!!

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    9842fd6 View commit details
    Browse the repository at this point in the history
  13. Add safeguard

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    96f0b8c View commit details
    Browse the repository at this point in the history
  14. Cleanup

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    ca9e16f View commit details
    Browse the repository at this point in the history
  15. Remove print for tests

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    1d94d88 View commit details
    Browse the repository at this point in the history
  16. Rewrite opcodes

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    c57b9e1 View commit details
    Browse the repository at this point in the history
  17. Bail out in some tests

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    3fd9209 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3866d67 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3501d88 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    4e153ea View commit details
    Browse the repository at this point in the history
  21. Support FOR_ITER

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    5d15d67 View commit details
    Browse the repository at this point in the history
  22. Support RAISE_VARARGS without try/except handlers

    This brings us up from ~2500/3500 to ~3000/3500 analyzed. Next pole in
    the tent is SETUP_FINALLY.
    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    4b9a778 View commit details
    Browse the repository at this point in the history
  23. Add RETURN_VALUE to test

    The bytecode needs to end with RETURN_VALUE otherwise the analysis does
    not work. This is normally guaranteed by the compiler.
    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    e4839be View commit details
    Browse the repository at this point in the history
  24. Add a DCHECK for the last op being RETURN_VALUE

    Unfortunately this makes a bunch of BytecodeTest tests fail but they
    were wrong to begin with. Will fix later...
    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    2100d00 View commit details
    Browse the repository at this point in the history
  25. Add runUntilFixpoint

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    1f3a350 View commit details
    Browse the repository at this point in the history
  26. clang-format

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    fa29ac1 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    88dc5c0 View commit details
    Browse the repository at this point in the history
  28. Add TODO

    tekknolagi committed Nov 28, 2023
    Configuration menu
    Copy the full SHA
    b3fd31e View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2023

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

Commits on Nov 30, 2023

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

    tekknolagi committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    bd14e0e View commit details
    Browse the repository at this point in the history
  3. Move meet to Locals

    tekknolagi committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    e2e5a34 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4ccce2c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    33bd90d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c7e08fe View commit details
    Browse the repository at this point in the history
  7. Add live variable analysis

    tekknolagi committed Nov 30, 2023
    Configuration menu
    Copy the full SHA
    eebb8dd View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2023

  1. Add TODO

    tekknolagi committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    4f600e0 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Consider more opcodes and use bitset instead

    I don't think it's the bitset--we should go back to the data
    structures.
    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    86e5934 View commit details
    Browse the repository at this point in the history
  2. Clang format

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    ea04194 View commit details
    Browse the repository at this point in the history
  3. Cleanup

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    04f7418 View commit details
    Browse the repository at this point in the history
  4. Mark unimplemented

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    0d04642 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9f718a8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    34c9b0e View commit details
    Browse the repository at this point in the history
  7. Cleanup

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    f3971b8 View commit details
    Browse the repository at this point in the history
  8. Cleanup

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    1979859 View commit details
    Browse the repository at this point in the history
  9. Cleanup

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    ab64701 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    8471beb View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5875813 View commit details
    Browse the repository at this point in the history
  12. Add TODO

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    54a8eca View commit details
    Browse the repository at this point in the history
  13. Add TODO

    tekknolagi committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    ce4b91c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    590bfea View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2023

  1. WIP

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    0618ab3 View commit details
    Browse the repository at this point in the history
  2. Cleanup

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    2c23236 View commit details
    Browse the repository at this point in the history
  3. Remove unused C++ code now...

    Sad. That was a lot of work.
    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    8a2727c View commit details
    Browse the repository at this point in the history
  4. Add num_iterations

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    a73c5fc View commit details
    Browse the repository at this point in the history
  5. Remove _analyze_bytecode

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    202c982 View commit details
    Browse the repository at this point in the history
  6. Do liveness first

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    b7a0120 View commit details
    Browse the repository at this point in the history
  7. Remove print

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    ecbc526 View commit details
    Browse the repository at this point in the history
  8. nit

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    aa3d987 View commit details
    Browse the repository at this point in the history
  9. nit

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    a6d234e View commit details
    Browse the repository at this point in the history
  10. nit

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    a453072 View commit details
    Browse the repository at this point in the history
  11. Fix DELETE_FAST handling

    It takes nothing off the stack, so use NOP instead of POP_TOP. Also it
    appears as though peephole gets rid of this completely in the test.
    Neat!
    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    09c0da1 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    099efe8 View commit details
    Browse the repository at this point in the history
  13. Add another test

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    0c57c01 View commit details
    Browse the repository at this point in the history
  14. Abort if calling locals()

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    12a9310 View commit details
    Browse the repository at this point in the history
  15. Fix C++ test

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    5c8097e View commit details
    Browse the repository at this point in the history
  16. Fix test

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    4bab890 View commit details
    Browse the repository at this point in the history
  17. Lint

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    90b2e9e View commit details
    Browse the repository at this point in the history
  18. Add a test

    tekknolagi committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    075dbe0 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    b0fa910 View commit details
    Browse the repository at this point in the history