walt icon indicating copy to clipboard operation
walt copied to clipboard

Optimizer

Open ballercat opened this issue 8 years ago • 1 comments

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

ballercat avatar Jan 06 '18 23:01 ballercat

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.

xtuc avatar Jan 16 '18 10:01 xtuc