aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/ops.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-09-05 13:25:28 +0200
committerGitHub <[email protected]>2018-09-05 13:25:28 +0200
commit66b797b4aeca486f515d96c1677cc633ce12a5d3 (patch)
tree1d5d55a26a42a97b1f052fa87cfe772e212b6775 /erts/emulator/beam/ops.tab
parent092f4847f489cba0381676a6a389ddbfc2af4f1e (diff)
parent47a2ff39ac75c69b41f90f05a63fd9a2e6c0b36a (diff)
downloadotp-66b797b4aeca486f515d96c1677cc633ce12a5d3.tar.gz
otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.tar.bz2
otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.zip
Merge pull request #1947 from bjorng/bjorn/opt-put-tuple
Introduce a put_tuple2 instruction
Diffstat (limited to 'erts/emulator/beam/ops.tab')
-rw-r--r--erts/emulator/beam/ops.tab15
1 files changed, 12 insertions, 3 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index d71594235e..d859c4bb24 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -483,9 +483,16 @@ is_eq f? s s
is_ne f? s s
#
-# Putting things.
+# Putting tuples.
+#
+# Code compiled with OTP 22 and later uses put_tuple2 to
+# to construct a tuple.
+#
+# Code compiled before OTP 22 uses put_tuple + one put instruction
+# per element. Translate to put_tuple2.
#
+i_put_tuple/2
put_tuple Arity Dst => i_put_tuple Dst u
i_put_tuple Dst Arity Puts=* | put S1 | put S2 | \
@@ -495,11 +502,13 @@ i_put_tuple Dst Arity Puts=* | put S1 | put S2 | \
i_put_tuple Dst Arity Puts=* | put S => \
tuple_append_put(Arity, Dst, Puts, S)
-i_put_tuple/2
+i_put_tuple Dst Arity Puts=* => put_tuple2 Dst Arity Puts
-i_put_tuple xy I
+put_tuple2 xy I
#
+# Putting lists.
+#
# The instruction "put_list Const [] Dst" were generated in rare
# circumstances up to and including OTP 18. Starting with OTP 19,
# AFAIK, it should never be generated.