aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_trim.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-21 17:47:01 +0200
committerBjörn Gustavsson <[email protected]>2015-04-29 12:23:41 +0200
commit5440c67570b9d436301cdb2f8234730a1fa8287f (patch)
tree09556bbe258fc5ae1bd7fb46c056dbabe8e1f857 /lib/compiler/src/beam_trim.erl
parent61eaa7570811d81e2a91d0126461a2dac22786dc (diff)
downloadotp-5440c67570b9d436301cdb2f8234730a1fa8287f.tar.gz
otp-5440c67570b9d436301cdb2f8234730a1fa8287f.tar.bz2
otp-5440c67570b9d436301cdb2f8234730a1fa8287f.zip
Teach beam_trim to handle map instructions
Diffstat (limited to 'lib/compiler/src/beam_trim.erl')
-rw-r--r--lib/compiler/src/beam_trim.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_trim.erl b/lib/compiler/src/beam_trim.erl
index fad9c42584..8181e555a1 100644
--- a/lib/compiler/src/beam_trim.erl
+++ b/lib/compiler/src/beam_trim.erl
@@ -172,6 +172,10 @@ remap([{bif,Name,Fail,Ss,D}|Is], Map, Acc) ->
remap([{gc_bif,Name,Fail,Live,Ss,D}|Is], Map, Acc) ->
I = {gc_bif,Name,Fail,Live,[Map(S) || S <- Ss],Map(D)},
remap(Is, Map, [I|Acc]);
+remap([{get_map_elements,Fail,M,{list,L0}}|Is], Map, Acc) ->
+ L = [Map(E) || E <- L0],
+ I = {get_map_elements,Fail,Map(M),{list,L}},
+ remap(Is, Map, [I|Acc]);
remap([{bs_init,Fail,Info,Live,Ss0,Dst0}|Is], Map, Acc) ->
Ss = [Map(Src) || Src <- Ss0],
Dst = Map(Dst0),
@@ -275,6 +279,8 @@ frame_size([{kill,_}|Is], Safe) ->
frame_size(Is, Safe);
frame_size([{make_fun2,_,_,_,_}|Is], Safe) ->
frame_size(Is, Safe);
+frame_size([{get_map_elements,{f,L},_,_}|Is], Safe) ->
+ frame_size_branch(L, Is, Safe);
frame_size([{deallocate,N}|_], _) -> N;
frame_size([{line,_}|Is], Safe) ->
frame_size(Is, Safe);