aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-04-27 11:07:29 +0200
committerRaimo Niskanen <[email protected]>2010-05-20 12:20:49 +0200
commit2bbfb378e90ac6569c950571c26a207ed8e559db (patch)
tree324c59d1eb9ec27f78146f70cdb2af5e587c68df /erts
parent55a79d5ebacd51ba11f4bbdb29b8844382a78113 (diff)
downloadotp-2bbfb378e90ac6569c950571c26a207ed8e559db.tar.gz
otp-2bbfb378e90ac6569c950571c26a207ed8e559db.tar.bz2
otp-2bbfb378e90ac6569c950571c26a207ed8e559db.zip
erts: Stop supporting non-literal empty tuples
Since R12B, empty tuples are literals. Thus the compiler will no longer generate the instruction: put_tuple 0 Destination for creating an empty tuple. It is now time to stop supporting that instruction in the run-time system. While we are at it, correct a typo.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/beam_emu.c6
-rw-r--r--erts/emulator/beam/ops.tab11
2 files changed, 7 insertions, 10 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index f0b04535dd..eb95999e55 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -3217,12 +3217,6 @@ apply_bif_or_nif_epilogue:
StoreBifResult(1, result);
}
- OpCase(i_put_tuple_only_Ad): {
- tmp_arg1 = make_tuple(HTOP);
- *HTOP++ = Arg(0);
- StoreBifResult(1, tmp_arg1);
- }
-
OpCase(case_end_s):
GetArg1(0, tmp_arg1);
c_p->fvalue = tmp_arg1;
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index d6feef3fb9..802c6fd1eb 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -60,12 +60,18 @@ func_info M=a a==am_module_info A=u==0 | label L | move n r => too_old_compiler
func_info M=a a==am_module_info A=u==1 | label L | move n r => too_old_compiler
# The undocumented and unsupported guard BIF is_constant/1 was removed
-# in R13. The is_constant/2 operation is marked as obosolete in genop.tab,
+# in R13. The is_constant/2 operation is marked as obsolete in genop.tab,
# so the loader will automatically generate a too_old_compiler message
# it is used, but we need to handle the is_constant/1 BIF specially here.
bif1 Fail u$func:erlang:is_constant/1 Src Dst => too_old_compiler
+# Since the constant pool was introduced in R12B, empty tuples ({})
+# are literals. Therefore we no longer need to allow put_tuple/2
+# with a tuple size of zero.
+
+put_tuple u==0 d => too_old_compiler
+
#
# All the other instructions.
#
@@ -328,11 +334,8 @@ i_is_eq_immed f y c
# Putting things.
#
-put_tuple u==0 Dst => i_put_tuple_only u Dst
put_tuple Arity Dst | put V => i_put_tuple Arity V Dst
-i_put_tuple_only A d
-
%macro: i_put_tuple PutTuple -pack
i_put_tuple A x x
i_put_tuple A y x