aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_z.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-08-31 19:14:10 +0200
committerBjörn Gustavsson <[email protected]>2012-10-09 15:24:41 +0200
commited7ab81375d599c73cbe0d2195102187957c25d6 (patch)
treef2e4114919a1e79be55f6171997febf33c0b9f27 /lib/compiler/src/beam_z.erl
parentb44f86b779f0b8579e4df2a98930ac3150c6c07c (diff)
downloadotp-ed7ab81375d599c73cbe0d2195102187957c25d6.tar.gz
otp-ed7ab81375d599c73cbe0d2195102187957c25d6.tar.bz2
otp-ed7ab81375d599c73cbe0d2195102187957c25d6.zip
Rewrite bs_add, bs_utf*_size to BIF instructions in optimizations
We can remove some code bloat by handling the special instructions as BIF instructions in the optimization passes. Also note that bs_utf*_size was not handled by beam_utils:check_liveness/3 (meaning the conservative answer instead of the correct answer would be returned).
Diffstat (limited to 'lib/compiler/src/beam_z.erl')
-rw-r--r--lib/compiler/src/beam_z.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_z.erl b/lib/compiler/src/beam_z.erl
index 7da6391f1f..7af6f1a74c 100644
--- a/lib/compiler/src/beam_z.erl
+++ b/lib/compiler/src/beam_z.erl
@@ -44,4 +44,10 @@ undo_rename({bs_put,F,{I,Fl},[Src]}) ->
{I,F,Fl,Src};
undo_rename({bs_put,{f,0},{bs_put_string,_,_}=I,[]}) ->
I;
+undo_rename({bif,bs_add=I,F,[Src1,Src2,{integer,U}],Dst}) ->
+ {I,F,[Src1,Src2,U],Dst};
+undo_rename({bif,bs_utf8_size=I,F,[Src],Dst}) ->
+ {I,F,Src,Dst};
+undo_rename({bif,bs_utf16_size=I,F,[Src],Dst}) ->
+ {I,F,Src,Dst};
undo_rename(I) -> I.