aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_type.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-02-27 15:17:01 +0100
committerBjörn Gustavsson <[email protected]>2015-03-09 09:41:12 +0100
commit1f0ae04d3745bf316f620ef35b24f87c0da7c05b (patch)
tree9774006cb02d81c0129a59785d05ceac15ed5d05 /lib/compiler/src/beam_type.erl
parentea46a223e34eefbc765facb0ec0fd90fb891c53d (diff)
downloadotp-1f0ae04d3745bf316f620ef35b24f87c0da7c05b.tar.gz
otp-1f0ae04d3745bf316f620ef35b24f87c0da7c05b.tar.bz2
otp-1f0ae04d3745bf316f620ef35b24f87c0da7c05b.zip
Introduce '%live' annotations with a complete register map
As a preparation for fixing a bug, introduce a complete register map in the '%live' annotations.
Diffstat (limited to 'lib/compiler/src/beam_type.erl')
-rw-r--r--lib/compiler/src/beam_type.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl
index d9713cef0d..8dd6e5f1c6 100644
--- a/lib/compiler/src/beam_type.erl
+++ b/lib/compiler/src/beam_type.erl
@@ -244,7 +244,7 @@ clearerror([], OrigIs) -> [{set,[],[],fclearerror}|OrigIs].
%% Combine two blocks and eliminate any move instructions that assign
%% to registers that are killed later in the block.
%%
-merge_blocks(B1, [{'%live',_}|B2]) ->
+merge_blocks(B1, [{'%live',_,_}|B2]) ->
merge_blocks_1(B1++[{set,[],[],stop_here}|B2]).
merge_blocks_1([{set,[],_,stop_here}|Is]) -> Is;
@@ -336,7 +336,7 @@ build_alloc(Words, Floats) -> {alloc,[{words,Words},{floats,Floats}]}.
%% is not continous at an allocation function (e.g. if {x,0} and {x,2}
%% are live, but not {x,1}).
-flt_liveness([{'%live',Live}=LiveInstr|Is]) ->
+flt_liveness([{'%live',Live,_}=LiveInstr|Is]) ->
flt_liveness_1(Is, init_regs(Live), [LiveInstr]).
flt_liveness_1([{set,Ds,Ss,{alloc,_,Alloc}}|Is], Regs0, Acc) ->
@@ -347,7 +347,7 @@ flt_liveness_1([{set,Ds,Ss,{alloc,_,Alloc}}|Is], Regs0, Acc) ->
flt_liveness_1([{set,Ds,_,_}=I|Is], Regs0, Acc) ->
Regs = foldl(fun(R, A) -> set_live(R, A) end, Regs0, Ds),
flt_liveness_1(Is, Regs, [I|Acc]);
-flt_liveness_1([{'%live',_}=I|Is], Regs, Acc) ->
+flt_liveness_1([{'%live',_,_}=I|Is], Regs, Acc) ->
flt_liveness_1(Is, Regs, [I|Acc]);
flt_liveness_1([], _Regs, Acc) -> reverse(Acc).
@@ -371,7 +371,7 @@ set_live(_, Regs) -> Regs.
%% Update the type database to account for executing an instruction.
%%
%% First the cases for instructions inside basic blocks.
-update({'%live',_}, Ts) -> Ts;
+update({'%live',_,_}, Ts) -> Ts;
update({set,[D],[S],move}, Ts) ->
tdb_copy(S, D, Ts);
update({set,[D],[{integer,I},Reg],{bif,element,_}}, Ts0) ->