From 0772d1063c3e03cfb575fb5e948c120cfee14605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 3 Sep 2012 12:08:40 +0200 Subject: 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. --- lib/compiler/src/beam_z.erl | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/compiler/src/beam_z.erl') 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. -- cgit v1.2.3