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

[Merged by Bors] - Divide byte compiler #2425

Closed
wants to merge 45 commits into from

Conversation

e-codes-stuff
Copy link
Contributor

This Pull Request is currently unfinished but will fix/close #1808 after some review and more work

It changes the following:

  • Divides byte compiler logic into separate files

I would like some review on the current code I have to know if the patterns I'm using are acceptable for the codebase, if everything looks good I will try to separate more code into different small modules to finish the work here.

@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #2425 (8cd2888) into main (c79b902) will increase coverage by 0.30%.
The diff coverage is 47.53%.

@@            Coverage Diff             @@
##             main    #2425      +/-   ##
==========================================
+ Coverage   52.44%   52.74%   +0.30%     
==========================================
  Files         332      343      +11     
  Lines       34948    34940       -8     
==========================================
+ Hits        18327    18430     +103     
+ Misses      16621    16510     -111     
Impacted Files Coverage Δ
boa_engine/src/bytecompiler/class.rs 0.00% <0.00%> (ø)
boa_engine/src/bytecompiler/mod.rs 63.79% <ø> (+11.47%) ⬆️
...rc/bytecompiler/declaration/declaration_pattern.rs 26.71% <26.71%> (ø)
...gine/src/bytecompiler/expression/object_literal.rs 42.24% <42.24%> (ø)
boa_engine/src/bytecompiler/expression/mod.rs 51.63% <51.63%> (ø)
boa_engine/src/bytecompiler/expression/assign.rs 64.81% <64.81%> (ø)
boa_engine/src/bytecompiler/statement/continue.rs 70.17% <70.17%> (ø)
boa_engine/src/bytecompiler/statement/loop.rs 74.19% <74.19%> (ø)
boa_engine/src/bytecompiler/statement/mod.rs 78.12% <78.12%> (ø)
boa_engine/src/bytecompiler/expression/binary.rs 81.03% <81.03%> (ø)
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@raskad raskad added this to the v0.17.0 milestone Nov 9, 2022
@raskad raskad added execution Issues or PRs related to code execution Internal Category for changelog labels Nov 9, 2022
@raskad
Copy link
Member

raskad commented Nov 9, 2022

Thanks for starting to work on this!

The current changes look very much the way I would expect.

Copy link
Contributor

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@e-codes-stuff
Copy link
Contributor Author

I went through git rebase --interactive and tried to resolve everything so it can be merged into main, does this seem fine? I'm still not amazing with git so I'm unsure what it should look like in this case.

@nekevss
Copy link
Member

nekevss commented Dec 3, 2022

The test that's failing is related to Rustfmt. You just need to run cargo fmt 😄

@e-codes-stuff
Copy link
Contributor Author

Whoops, forgot to run that. Fixed it, anything else?

Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for woking on this. I have some suggestions for the new code in general, but I'd be happy to merge this as is and do the changes later.

Instead of the compile* functions being free functions that take byte_compiler: &mut ByteCompiler<'_>, as an argument, I would suggest implementing them on the ByteCompiler.

All of the compile* functions probably could use some minimal documentation, but we do not have any for that right now, so that may wait.

@e-codes-stuff
Copy link
Contributor Author

e-codes-stuff commented Dec 11, 2022 via email

@Razican
Copy link
Member

Razican commented Dec 13, 2022

Is it possible to implement methods on ByteCompiler within submodules? I was under the impression that wasn't allowed which is why I made them free functions, I could pretty easily correct that if theres something I'm missing though

It is definitely possible, you just need to create another impl ByteCompiler block. You can have as many of them as you need.

Copy link
Member

@jasonwilliams jasonwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @raskad about implementing byteCompiler but apart from that LGTM

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

@jedel1043
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Dec 19, 2022
This Pull Request is currently unfinished but will fix/close #1808 after some review and more work

It changes the following:

- Divides byte compiler logic into separate files

I would like some review on the current code I have to know if the patterns I'm using are acceptable for the codebase, if everything looks good I will try to separate more code into different small modules to finish the work here.
@bors
Copy link

bors bot commented Dec 19, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Divide byte compiler [Merged by Bors] - Divide byte compiler Dec 19, 2022
@bors bors bot closed this Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution Issues or PRs related to code execution Internal Category for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Divide the byte compiler
7 participants