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_a.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/compiler/src/beam_a.erl') diff --git a/lib/compiler/src/beam_a.erl b/lib/compiler/src/beam_a.erl index 3709b94c3c..fd76154b78 100644 --- a/lib/compiler/src/beam_a.erl +++ b/lib/compiler/src/beam_a.erl @@ -64,4 +64,14 @@ rename_instr({bs_utf8_size=I,F,Src,Dst}) -> {bif,I,F,[Src],Dst}; rename_instr({bs_utf16_size=I,F,Src,Dst}) -> {bif,I,F,[Src],Dst}; +rename_instr({bs_init2=I,F,Sz,Extra,Live,Flags,Dst}) -> + {bs_init,F,{I,Extra,Flags},Live,[Sz],Dst}; +rename_instr({bs_init_bits=I,F,Sz,Extra,Live,Flags,Dst}) -> + {bs_init,F,{I,Extra,Flags},Live,[Sz],Dst}; +rename_instr({bs_append=I,F,Sz,Extra,Live,U,Src,Flags,Dst}) -> + {bs_init,F,{I,Extra,U,Flags},Live,[Sz,Src],Dst}; +rename_instr({bs_private_append=I,F,Sz,U,Src,Flags,Dst}) -> + {bs_init,F,{I,U,Flags},none,[Sz,Src],Dst}; +rename_instr(bs_init_writable=I) -> + {bs_init,{f,0},I,1,[{x,0}],{x,0}}; rename_instr(I) -> I. -- cgit v1.2.3