diff options
author | Björn Gustavsson <[email protected]> | 2012-09-04 14:27:31 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-10-10 15:37:12 +0200 |
commit | 531aa719de264c81876da2db1ca9882f8f5db663 (patch) | |
tree | 4a88ea169f09aeaae36fbc12d9dbae151d277339 /lib/compiler/src/beam_clean.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_clean.erl')
-rw-r--r-- | lib/compiler/src/beam_clean.erl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/compiler/src/beam_clean.erl b/lib/compiler/src/beam_clean.erl index 39710490df..009a799f54 100644 --- a/lib/compiler/src/beam_clean.erl +++ b/lib/compiler/src/beam_clean.erl @@ -200,7 +200,7 @@ replace([{test,Test,{f,Lbl},Ops}|Is], Acc, D) -> replace(Is, [{test,Test,{f,label(Lbl, D)},Ops}|Acc], D); replace([{test,Test,{f,Lbl},Live,Ops,Dst}|Is], Acc, D) -> replace(Is, [{test,Test,{f,label(Lbl, D)},Live,Ops,Dst}|Acc], D); -replace([{select_val,R,{f,Fail0},{list,Vls0}}|Is], Acc, D) -> +replace([{select,I,R,{f,Fail0},Vls0}|Is], Acc, D) -> Vls1 = map(fun ({f,L}) -> {f,label(L, D)}; (Other) -> Other end, Vls0), Fail = label(Fail0, D), @@ -210,12 +210,8 @@ replace([{select_val,R,{f,Fail0},{list,Vls0}}|Is], Acc, D) -> %% Convert to a plain jump. replace(Is, [{jump,{f,Fail}}|Acc], D); Vls -> - replace(Is, [{select_val,R,{f,Fail},{list,Vls}}|Acc], D) + replace(Is, [{select,I,R,{f,Fail},Vls}|Acc], D) end; -replace([{select_tuple_arity,R,{f,Fail},{list,Vls0}}|Is], Acc, D) -> - Vls = map(fun ({f,L}) -> {f,label(L, D)}; - (Other) -> Other end, Vls0), - replace(Is, [{select_tuple_arity,R,{f,label(Fail, D)},{list,Vls}}|Acc], D); replace([{'try',R,{f,Lbl}}|Is], Acc, D) -> replace(Is, [{'try',R,{f,label(Lbl, D)}}|Acc], D); replace([{'catch',R,{f,Lbl}}|Is], Acc, D) -> |