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

Optimizer #63

Open
3 tasks
ballercat opened this issue Jan 6, 2018 · 1 comment
Open
3 tasks

Optimizer #63

ballercat opened this issue Jan 6, 2018 · 1 comment

Comments

@ballercat
Copy link
Owner

Goal

Create an optimizing pass.

Overview

Go nuts? There is zero static optimization currently, everything written is emitted.

Dead code elimination sounds great. AssemblyScript does it, which is dope.

Acceptance Criteria

  • It works
  • It's tested
  • It's opt-in and configurable
@xtuc
Copy link

xtuc commented Jan 16, 2018

If the goal is to reduce the size of the final binary I guess you could just replace the func with an empty one (with no code).

Otherwise you'll need to shift every index because the func is not in the module instance anymore.

I don't know which AST format you're using exactly, but I think it's worth looking at some transformations we do in @babel/minify https://github.com/babel/minify/tree/master/packages.

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

No branches or pull requests

2 participants