Sebastian McKenzie
edc8bee38e
test for falsy nodes in tail call transformer subtransform
2015-02-10 22:39:46 +11:00
Sebastian McKenzie
329b4e9d21
append Transformer to the end of transformer classes
2015-02-10 22:12:36 +11:00
Sebastian McKenzie
f1bca0013e
refactor tail call transformer into a class - @RReverser
2015-02-10 22:11:22 +11:00
Ingvar Stepanyan
0d542b61d3
Performance improvements for TCO.
...
http://jsperf.com/tco/17
2015-02-09 19:00:31 +02:00
Sebastian McKenzie
ee5cb8d9ed
clean up tail call transformer
2015-02-08 22:47:50 +11:00
Sebastian McKenzie
45c507056a
add back old tail call implementation
2015-02-08 22:09:41 +11:00
Sebastian McKenzie
97784c8cca
comment out tailCall transformer
2015-02-08 21:19:01 +11:00
Sebastian McKenzie
812d93553a
temporairly disable tailCall transformer
2015-02-08 21:17:21 +11:00
Ingvar Stepanyan
0a1724fc3f
Remove no more needed returnBlock helper.
2015-02-08 11:31:19 +02:00
Ingvar Stepanyan
9e3c67a8a2
Clean up functionChildrenVisitor a bit.
2015-02-08 10:53:09 +02:00
Ingvar Stepanyan
91362f80b1
Clean up transformations after #714 .
...
Since now we have runtime helper, we don't need
expression -> statement conversions anymore.
2015-02-08 10:40:03 +02:00
Ingvar Stepanyan
4c318166e1
Added complete TCO (tail call optimization).
...
Works across functions and generates simpler and faster code than #701 .
Works even across files when used in conjunction with `runtime` option.
Closes #256 .
2015-02-07 22:22:38 +02:00
Sebastian McKenzie
8a143bf957
use a template in tail call transformer - @RReverser
2015-02-07 23:52:35 +11:00
Ingvar Stepanyan
b53b41cef3
Provide placeholders for proper function length.
2015-02-07 14:26:03 +02:00
Ingvar Stepanyan
5b2216b348
Add tail recursion optimization.
...
As per ES6, VMs should perform tail call optimization and prevent growth of call stack.
This adds tail call optimization for recursion case (when function has explicit name and calls itself in `return`).
Cross-function optimization is not currently performed as it's more complicated and requires value tracking.
2015-02-06 16:34:35 +02:00