aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2016-04-07 05:56:01 +0200
committerBjörn Gustavsson <bjorn@erlang.org>2016-04-11 13:57:26 +0200
commit93c476e258a20899cf6c20fb75e3ebe6f37d5d80 (patch)
treef18ac47fff2a3db8169b7b998becfdbe1ca8b82d /lib/compiler
parent8a659704161705fb838447cb6aa54627e12a8910 (diff)
downloadotp-93c476e258a20899cf6c20fb75e3ebe6f37d5d80.tar.gz
otp-93c476e258a20899cf6c20fb75e3ebe6f37d5d80.tar.bz2
otp-93c476e258a20899cf6c20fb75e3ebe6f37d5d80.zip
Teach beam_utils to check liveness for put_map instructions
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/beam_utils.erl11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index 68d6105cfa..eed4caf93f 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -484,6 +484,17 @@ check_liveness(R, [{get_map_elements,{f,Fail},S,{list,L}}|Is], St0) ->
Other
end
end;
+check_liveness(R, [{put_map,{f,_},_,Src,_D,Live,{list,_}}|_], St0) ->
+ case R of
+ Src ->
+ {used,St0};
+ {x,X} when X < Live ->
+ {used,St0};
+ {x,_} ->
+ {killed,St0};
+ {y,_} ->
+ {unknown,St0}
+ end;
check_liveness(R, [{test_heap,N,Live}|Is], St) ->
I = {block,[{set,[],[],{alloc,Live,{nozero,nostack,N,[]}}}]},
check_liveness(R, [I|Is], St);