aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEduardo Julian2016-05-21 14:23:23 -0400
committerEduardo Julian2016-05-21 14:23:23 -0400
commitc93240c1392196c031b374e721b564f6c3743cd0 (patch)
tree07a9ebf6671811dcc1834bcc14efbb037ae48c91 /src
parent0f110f4b904f64a1c79928be2f62dbffcf699ff5 (diff)
- Improved the optimization of self-calls.
Diffstat (limited to '')
-rw-r--r--src/lux/optimizer.clj13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lux/optimizer.clj b/src/lux/optimizer.clj
index 6adfca501..e774f4216 100644
--- a/src/lux/optimizer.clj
+++ b/src/lux/optimizer.clj
@@ -67,10 +67,6 @@
($tuple elems)
(&/T [meta ($tuple (&/|map (partial shift-function-body own-body?) elems))])
- ($apply func args)
- (&/T [meta ($apply (shift-function-body own-body? func)
- (&/|map (partial shift-function-body own-body?) args))])
-
($case value branches)
(&/T [meta ($case (shift-function-body own-body? value)
(&/|map (fn [branch]
@@ -108,6 +104,15 @@
(&/$Global ?module ?name)
body)
body)
+
+ ($apply [meta-0 ($var (&/$Local 0))] args)
+ (&/T [meta ($apply (&/T [meta-0 ($var (&/$Local 0))])
+ (&/$Cons (&/T [meta-0 ($var (&/$Local 1))])
+ (&/|map (partial shift-function-body own-body?) args)))])
+
+ ($apply func args)
+ (&/T [meta ($apply (shift-function-body own-body? func)
+ (&/|map (partial shift-function-body own-body?) args))])
($captured scope idx source)
(if own-body?