Skip to content

refactor[codegen]: refactor assembly labels #4629

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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented May 5, 2025

What I did

How I did it

How to verify it

Commit message

this commit refactors label handling in assembly. previous, how symbols
were handled was context dependent -- `_sym_` items followed by a
`JUMPDEST` were added to the symbol map, and `_sym_` items not followed
by a `JUMPDEST` would compile to `PUSH <symbol>`. this commit refactors
the structure to be more explicit, so that there is a clear distinction
between `PUSHLABEL` and `LABEL`. a new `PUSH_OFST` directive has
been added. `_mem_` ("memory symbols") which require a different PUSH
length, have not been handled in this refactor.

this commit also removes explicit jumpdests from the assembly format,
since `LABEL`s will now compile to `JUMPDEST`.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@charles-cooper charles-cooper changed the title refactor symbol handling in assembly to have more structure refactor[codegen]: refactor assembly labels May 7, 2025
@charles-cooper charles-cooper marked this pull request as ready for review May 7, 2025 09:26
Copy link

codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 94.90446% with 8 lines in your changes missing coverage. Please review.

Project coverage is 92.50%. Comparing base (6b670e7) to head (42a4436).

Files with missing lines Patch % Lines
vyper/ir/compile_ir.py 95.65% 4 Missing and 2 partials ⚠️
vyper/venom/venom_to_assembly.py 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4629      +/-   ##
==========================================
- Coverage   92.51%   92.50%   -0.01%     
==========================================
  Files         130      130              
  Lines       18586    18637      +51     
  Branches     3225     3230       +5     
==========================================
+ Hits        17195    17241      +46     
- Misses        945      948       +3     
- Partials      446      448       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants