aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.h
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-09-23 15:20:20 +0200
committerSverker Eriksson <[email protected]>2011-10-26 11:35:59 +0200
commit4fd9e3321e4de8b59b9874e9fcd9d428dd9f863b (patch)
tree47822f86d58b814e67589184c4b46a1324f30e09 /erts/emulator/beam/bif.h
parenta86f516df7931b813bd2524e811e06ad73a2d821 (diff)
downloadotp-4fd9e3321e4de8b59b9874e9fcd9d428dd9f863b.tar.gz
otp-4fd9e3321e4de8b59b9874e9fcd9d428dd9f863b.tar.bz2
otp-4fd9e3321e4de8b59b9874e9fcd9d428dd9f863b.zip
Change the calling convention for BIFs
The current calling convention for BIFs makes it necessary to handle each arity specially, since each argument for the BIF also becomes an argument for the C function implementing the BIF, which makes it hard to allow BIFs with any number of arguments. Change the calling convention for BIFs, so that BIF arguments are passed in an array to the C function implementing the BIF.
Diffstat (limited to 'erts/emulator/beam/bif.h')
-rw-r--r--erts/emulator/beam/bif.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/erts/emulator/beam/bif.h b/erts/emulator/beam/bif.h
index 8faa09feb8..cb5d266660 100644
--- a/erts/emulator/beam/bif.h
+++ b/erts/emulator/beam/bif.h
@@ -26,14 +26,14 @@ extern Export* erts_format_cpu_topology_trap;
#define BIF_P A__p
-#define BIF_ALIST_0 Process* A__p
-#define BIF_ALIST_1 Process* A__p, Eterm A_1
-#define BIF_ALIST_2 Process* A__p, Eterm A_1, Eterm A_2
-#define BIF_ALIST_3 Process* A__p, Eterm A_1, Eterm A_2, Eterm A_3
-
-#define BIF_ARG_1 A_1
-#define BIF_ARG_2 A_2
-#define BIF_ARG_3 A_3
+#define BIF_ALIST_0 Process* A__p, Eterm* BIF__ARGS
+#define BIF_ALIST_1 Process* A__p, Eterm* BIF__ARGS
+#define BIF_ALIST_2 Process* A__p, Eterm* BIF__ARGS
+#define BIF_ALIST_3 Process* A__p, Eterm* BIF__ARGS
+
+#define BIF_ARG_1 (BIF__ARGS[0])
+#define BIF_ARG_2 (BIF__ARGS[1])
+#define BIF_ARG_3 (BIF__ARGS[2])
#define BUMP_ALL_REDS(p) do { \
if (!ERTS_PROC_GET_SAVED_CALLS_BUF((p))) \