diff options
author | Björn Gustavsson <[email protected]> | 2010-11-11 08:23:55 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-01-17 15:23:42 +0100 |
commit | 824a481d5f38c748cd6efcb83cba0b8d26b88768 (patch) | |
tree | b516c2028042df57c05bb66faf7d6b3202950bb7 /erts/emulator/beam/ops.tab | |
parent | e4a4632ed173f22642a2b67316b6decbc91b2a5b (diff) | |
download | otp-824a481d5f38c748cd6efcb83cba0b8d26b88768.tar.gz otp-824a481d5f38c748cd6efcb83cba0b8d26b88768.tar.bz2 otp-824a481d5f38c748cd6efcb83cba0b8d26b88768.zip |
Optimize creation of tuples
Combine the put_tuple/2 and all following put/1 instructions
to one i_put_tuple/2 instruction. In general, that will reduce
the number of instruction words by 50 percent.
Measurements seem to indicate that the speed is about the same.
Diffstat (limited to 'erts/emulator/beam/ops.tab')
-rw-r--r-- | erts/emulator/beam/ops.tab | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 4546f056a9..f629cc80b6 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -345,25 +345,21 @@ i_is_eq_immed f y c # Putting things. # -put_tuple Arity Dst | put V => i_put_tuple Arity V Dst - -%macro: i_put_tuple PutTuple -pack -i_put_tuple A x x -i_put_tuple A y x -i_put_tuple A r x -i_put_tuple A n x -i_put_tuple A c x -i_put_tuple A x y -i_put_tuple A x r -i_put_tuple A y r -i_put_tuple A n r -i_put_tuple A c r +put_tuple Arity Dst => i_put_tuple Dst u -%cold -i_put_tuple A r y -i_put_tuple A y y -i_put_tuple A c y -%hot +i_put_tuple Dst Arity Puts=* | put S1 | put S2 | \ + put S3 | put S4 | put S5 => \ + tuple_append_put5(Arity, Dst, Puts, S1, S2, S3, S4, S5) + +i_put_tuple Dst Arity Puts=* | put S => \ + tuple_append_put(Arity, Dst, Puts, S) + +i_put_tuple/2 + +%macro:i_put_tuple PutTuple -pack -goto:do_put_tuple +i_put_tuple r I +i_put_tuple x I +i_put_tuple y I %macro:put_list PutList -pack -gen_dest @@ -416,13 +412,6 @@ put_list x r r put_list s s d %hot -%macro: put Put -put x -put r -put y -put c -put n - %macro: i_fetch FetchArgs -pack i_fetch c c i_fetch c r |