Skip to content

Refactor main compiler logic#1962

Merged
fubuloubu merged 13 commits into
vyperlang:masterfrom
iamdefinitelyahuman:refactor-compiler2
May 11, 2020
Merged

Refactor main compiler logic#1962
fubuloubu merged 13 commits into
vyperlang:masterfrom
iamdefinitelyahuman:refactor-compiler2

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
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

codecov-io commented May 11, 2020

Copy link
Copy Markdown

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.

Comment thread vyper/compiler/README.md Outdated
Comment thread vyper/compiler/README.md
Comment thread vyper/compiler/README.md
Comment thread vyper/compiler/README.md Outdated
@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.

3 participants