Skip to content
Henrik Lievonen edited this page May 31, 2014 · 6 revisions

This is a list of stuff that needs to be worked on.

  • Expression optimisation One could add an optimizer before compiler which goes through ast and optimizes constant expression out at the compile time.

  • Expression optimisation One could add support for variables in compiled code. Now everything is first pushed to the stack and then popped out. Temporary values should not go through stack but use variables.

    Another possible optimisation would be adding new CompilerExpressionReference-type, which wouldn't save the computed value anywhere but instead return the whole expression when value is to be taken.

    These both optimisation should be added via some kind of Compiler*References.

Better casting via Compiler*Reference

Compiler*References know their types, so they should be able to properly cast types to each others. The main problem is with casting doubles to integers. Currently compiler casts them with ((double)|0) which is not accepted by asm.js. It should be done with (~~(double)) syntax.
Clone this wiki locally