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

Refactor main compiler logic #1962

Merged
merged 13 commits into from
May 11, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

  • Refactor vyper/compiler.py into a subpackage
  • Make the compilation process more linear
  • Make the compilation process almost 5x faster! 😎

How I did it

  • Compilation is handled in five phases: ast generation, context, lll gen, assembly, bytecode
  • Compiler outputs trigger these phases as data is required - nothing is repeated, nothing is generated that isn't needed

Everything is well-documented in the docstrings and module README.md - see the diff for more details on how it all works.

How to verify it

Run tests.

Cute Animal Picture

image

@codecov-io
Copy link

codecov-io commented May 11, 2020

Codecov Report

Merging #1962 into master will increase coverage by 0.07%.
The diff coverage is 97.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1962      +/-   ##
==========================================
+ Coverage   86.05%   86.13%   +0.07%     
==========================================
  Files          56       58       +2     
  Lines        6628     6641      +13     
  Branches     1685     1684       -1     
==========================================
+ Hits         5704     5720      +16     
+ Misses        585      584       -1     
+ Partials      339      337       -2     
Impacted Files Coverage Δ
vyper/parser/parser.py 93.40% <83.33%> (-2.10%) ⬇️
vyper/compiler/phases.py 94.66% <94.66%> (ø)
vyper/compiler/utils.py 96.29% <96.29%> (ø)
vyper/ast/folding.py 80.24% <100.00%> (ø)
vyper/ast/natspec.py 98.75% <100.00%> (ø)
vyper/compiler/output.py 100.00% <100.00%> (ø)
vyper/parser/global_context.py 80.76% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c0855b...bed6a7b. Read the comment docs.

vyper/compiler/README.md Outdated Show resolved Hide resolved
vyper/compiler/README.md Show resolved Hide resolved
vyper/compiler/README.md Show resolved Hide resolved
vyper/compiler/README.md Outdated Show resolved Hide resolved
@fubuloubu fubuloubu merged commit cfea222 into vyperlang:master May 11, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the refactor-compiler2 branch May 11, 2020 16:27
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.

None yet

3 participants