diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2012-09-04 14:27:31 +0200 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2012-10-10 15:37:12 +0200 |
commit | 531aa719de264c81876da2db1ca9882f8f5db663 (patch) | |
tree | 4a88ea169f09aeaae36fbc12d9dbae151d277339 /lib/compiler/src/beam_jump.erl | |
parent | 0772d1063c3e03cfb575fb5e948c120cfee14605 (diff) | |
download | otp-531aa719de264c81876da2db1ca9882f8f5db663.tar.gz otp-531aa719de264c81876da2db1ca9882f8f5db663.tar.bz2 otp-531aa719de264c81876da2db1ca9882f8f5db663.zip |
Rewrite select_val and select_tuple_arity to a select instruction
Eliminate some code bloat.
Diffstat (limited to 'lib/compiler/src/beam_jump.erl')
-rw-r--r-- | lib/compiler/src/beam_jump.erl | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/compiler/src/beam_jump.erl b/lib/compiler/src/beam_jump.erl index d4a8d9e8a5..578baf184e 100644 --- a/lib/compiler/src/beam_jump.erl +++ b/lib/compiler/src/beam_jump.erl @@ -291,9 +291,7 @@ opt([{test,_,{f,_}=Lbl,_}=I|Is], Acc, St) -> opt(Is, [I|Acc], label_used(Lbl, St)); opt([{test,_,{f,_}=Lbl,_,_,_}=I|Is], Acc, St) -> opt(Is, [I|Acc], label_used(Lbl, St)); -opt([{select_val,_R,Fail,{list,Vls}}=I|Is], Acc, St) -> - skip_unreachable(Is, [I|Acc], label_used([Fail|Vls], St)); -opt([{select_tuple_arity,_R,Fail,{list,Vls}}=I|Is], Acc, St) -> +opt([{select,_,_R,Fail,Vls}=I|Is], Acc, St) -> skip_unreachable(Is, [I|Acc], label_used([Fail|Vls], St)); opt([{label,L}=I|Is], Acc, #st{entry=L}=St) -> %% NEVER move the entry label. @@ -415,8 +413,7 @@ is_unreachable_after({call_last,_Ar,_Lbl,_D}) -> true; is_unreachable_after({call_only,_Ar,_Lbl}) -> true; is_unreachable_after({apply_last,_Ar,_N}) -> true; is_unreachable_after({jump,_Lbl}) -> true; -is_unreachable_after({select_val,_R,_Lbl,_Cases}) -> true; -is_unreachable_after({select_tuple_arity,_R,_Lbl,_Cases}) -> true; +is_unreachable_after({select,_What,_R,_Lbl,_Cases}) -> true; is_unreachable_after({loop_rec_end,_}) -> true; is_unreachable_after({wait,_}) -> true; is_unreachable_after(I) -> is_exit_instruction(I). @@ -513,9 +510,7 @@ ulbl({test,_,Fail,_}, Used) -> mark_used(Fail, Used); ulbl({test,_,Fail,_,_,_}, Used) -> mark_used(Fail, Used); -ulbl({select_val,_,Fail,{list,Vls}}, Used) -> - mark_used_list(Vls, mark_used(Fail, Used)); -ulbl({select_tuple_arity,_,Fail,{list,Vls}}, Used) -> +ulbl({select,_,_,Fail,Vls}, Used) -> mark_used_list(Vls, mark_used(Fail, Used)); ulbl({'try',_,Lbl}, Used) -> mark_used(Lbl, Used); |