aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/cerl_trees.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-02-24 14:28:22 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-02-24 14:28:22 +0100
commit4acee7b02b53d785c444e886c39ed82ab76b52fe (patch)
tree2d5110c59ad0022d43f97e76681b13e5dec58ea7 /lib/compiler/src/cerl_trees.erl
parentce614726e9fb19b462ed41a2f020b68ef98cd532 (diff)
parent771fa6d1f96684b61ed5f6033db51f5b0a55ec19 (diff)
downloadotp-4acee7b02b53d785c444e886c39ed82ab76b52fe.tar.gz
otp-4acee7b02b53d785c444e886c39ed82ab76b52fe.tar.bz2
otp-4acee7b02b53d785c444e886c39ed82ab76b52fe.zip
Merge branch 'egil/maps/fix-cerl-inlining'
* egil/maps/fix-cerl-inlining: compiler: Update map_SUITE to handle inlining erts: Maps src instructions can't be literals compiler: Fix map inlining compiler: Add variable coverage of map in cerl
Diffstat (limited to 'lib/compiler/src/cerl_trees.erl')
-rw-r--r--lib/compiler/src/cerl_trees.erl20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/compiler/src/cerl_trees.erl b/lib/compiler/src/cerl_trees.erl
index 2542841eef..2ebeab243f 100644
--- a/lib/compiler/src/cerl_trees.erl
+++ b/lib/compiler/src/cerl_trees.erl
@@ -57,9 +57,9 @@
update_c_try/6, update_c_tuple/2, update_c_tuple_skel/2,
update_c_values/2, values_es/1, var_name/1,
- map_es/1,
- ann_c_map/2,
- update_c_map/2,
+ map_val/1, map_es/1,
+ ann_c_map/3,
+ update_c_map/3,
map_pair_key/1,map_pair_val/1,map_pair_op/1,
ann_c_map_pair/4,
update_c_map_pair/4
@@ -138,7 +138,7 @@ map_1(F, T) ->
tuple ->
update_c_tuple_skel(T, map_list(F, tuple_es(T)));
map ->
- update_c_map(T, map_list(F, map_es(T)));
+ update_c_map(T, map(F,map_val(T)), map_list(F, map_es(T)));
map_pair ->
update_c_map_pair(T, map(F, map_pair_op(T)),
map(F, map_pair_key(T)),
@@ -372,8 +372,9 @@ mapfold(F, S0, T) ->
{Ts, S1} = mapfold_list(F, S0, tuple_es(T)),
F(update_c_tuple_skel(T, Ts), S1);
map ->
- {Ts, S1} = mapfold_list(F, S0, map_es(T)),
- F(update_c_map(T, Ts), S1);
+ {M , S1} = mapfold(F, S0, map_val(T)),
+ {Ts, S2} = mapfold_list(F, S1, map_es(T)),
+ F(update_c_map(T, M, Ts), S2);
map_pair ->
{Op, S1} = mapfold(F, S0, map_pair_op(T)),
{Key, S2} = mapfold(F, S1, map_pair_key(T)),
@@ -723,9 +724,10 @@ label(T, N, Env) ->
{As, N2} = label_ann(T, N1),
{ann_c_tuple_skel(As, Ts), N2};
map ->
- {Ts, N1} = label_list(map_es(T), N, Env),
- {As, N2} = label_ann(T, N1),
- {ann_c_map(As, Ts), N2};
+ {M, N1} = label(map_val(T), N, Env),
+ {Ts, N2} = label_list(map_es(T), N1, Env),
+ {As, N3} = label_ann(T, N2),
+ {ann_c_map(As, M, Ts), N3};
map_pair ->
{Op, N1} = label(map_pair_op(T), N, Env),
{Val, N2} = label(map_pair_key(T), N1, Env),