aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_z.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-09-03 12:08:40 +0200
committerBjörn Gustavsson <[email protected]>2012-10-09 15:24:42 +0200
commit0772d1063c3e03cfb575fb5e948c120cfee14605 (patch)
tree90b735d1ef71dea89c935b2b5507bab584f58b9f /lib/compiler/src/beam_z.erl
parented7ab81375d599c73cbe0d2195102187957c25d6 (diff)
downloadotp-0772d1063c3e03cfb575fb5e948c120cfee14605.tar.gz
otp-0772d1063c3e03cfb575fb5e948c120cfee14605.tar.bz2
otp-0772d1063c3e03cfb575fb5e948c120cfee14605.zip
Rewrite binary creation instructions to bs_init instructions
Rewrite the five binary creation instructions to a bs_init instruction, in order to somewhat reduce code bloat.
Diffstat (limited to 'lib/compiler/src/beam_z.erl')
-rw-r--r--lib/compiler/src/beam_z.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_z.erl b/lib/compiler/src/beam_z.erl
index 7af6f1a74c..37087fc306 100644
--- a/lib/compiler/src/beam_z.erl
+++ b/lib/compiler/src/beam_z.erl
@@ -50,4 +50,12 @@ 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({bs_init,F,{I,U,Flags},none,[Sz,Src],Dst}) ->
+ {I,F,Sz,U,Src,Flags,Dst};
+undo_rename({bs_init,F,{I,Extra,Flags},Live,[Sz],Dst}) ->
+ {I,F,Sz,Extra,Live,Flags,Dst};
+undo_rename({bs_init,F,{I,Extra,U,Flags},Live,[Sz,Src],Dst}) ->
+ {I,F,Sz,Extra,Live,U,Src,Flags,Dst};
+undo_rename({bs_init,_,bs_init_writable=I,_,_,_}) ->
+ I;
undo_rename(I) -> I.