aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_peep.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-09-04 14:27:31 +0200
committerBjörn Gustavsson <[email protected]>2012-10-10 15:37:12 +0200
commit531aa719de264c81876da2db1ca9882f8f5db663 (patch)
tree4a88ea169f09aeaae36fbc12d9dbae151d277339 /lib/compiler/src/beam_peep.erl
parent0772d1063c3e03cfb575fb5e948c120cfee14605 (diff)
downloadotp-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_peep.erl')
-rw-r--r--lib/compiler/src/beam_peep.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_peep.erl b/lib/compiler/src/beam_peep.erl
index f39fc50b95..a199aa50ed 100644
--- a/lib/compiler/src/beam_peep.erl
+++ b/lib/compiler/src/beam_peep.erl
@@ -120,13 +120,13 @@ peep([{test,Op,_,Ops}=I|Is], SeenTests0, Acc) ->
peep(Is, SeenTests, [I|Acc])
end
end;
-peep([{select_val,Src,Fail,
- {list,[{atom,false},{f,L},{atom,true},{f,L}]}}|
+peep([{select,select_val,Src,Fail,
+ [{atom,false},{f,L},{atom,true},{f,L}]}|
[{label,L}|_]=Is], SeenTests, Acc) ->
I = {test,is_boolean,Fail,[Src]},
peep([I|Is], SeenTests, Acc);
-peep([{select_val,Src,Fail,
- {list,[{atom,true},{f,L},{atom,false},{f,L}]}}|
+peep([{select,select_val,Src,Fail,
+ [{atom,true},{f,L},{atom,false},{f,L}]}|
[{label,L}|_]=Is], SeenTests, Acc) ->
I = {test,is_boolean,Fail,[Src]},
peep([I|Is], SeenTests, Acc);