aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-12-07 16:12:21 +0100
committerBjörn Gustavsson <[email protected]>2016-04-07 15:28:29 +0200
commite93a66110aa27a5b8228fb46a3459a6de0e626d0 (patch)
tree856ab34d2bcf08fdbb7a6360534c842f6b5a8f15 /erts/emulator/beam
parentc6cabe0b76dda183d209498e1e4e13e3407dcf9b (diff)
downloadotp-e93a66110aa27a5b8228fb46a3459a6de0e626d0.tar.gz
otp-e93a66110aa27a5b8228fb46a3459a6de0e626d0.tar.bz2
otp-e93a66110aa27a5b8228fb46a3459a6de0e626d0.zip
Introduce a 'rename' instruction
Introduce a 'rename' instruction that can be used to optimize simple renaming with unchanged operands such as: get_tuple_element Reg P Dst => i_get_tuple_element Reg P Dst By allowing it to lower the arity of instruction, transformations such as the following can be handled: trim N Remaining => i_trim N All in all, currently 67 transformations can be optimized in this way, including some commonly used ones.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/beam_load.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 5d03c98657..ad174664ae 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -5077,6 +5077,12 @@ transform_engine(LoaderState* st)
instr->arity = gen_opc[op].arity;
ap = 0;
break;
+#ifdef TOP_rename
+ case TOP_rename:
+ instr->op = op = *pc++;
+ instr->arity = gen_opc[op].arity;
+ return TE_OK;
+#endif
case TOP_store_type:
i = *pc++;
instr->a[ap].type = i;