aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2013-07-08 18:04:14 +0200
committerRickard Green <[email protected]>2013-07-09 14:39:58 +0200
commitb3b0c44ca3f1b87c719f782f09dd0331dbb1a351 (patch)
tree7aac7a292128d2830389cb522ed5143645988af2 /erts
parentdbd97f2569af24ef395fa3d60bb2b00543296ce8 (diff)
downloadotp-b3b0c44ca3f1b87c719f782f09dd0331dbb1a351.tar.gz
otp-b3b0c44ca3f1b87c719f782f09dd0331dbb1a351.tar.bz2
otp-b3b0c44ca3f1b87c719f782f09dd0331dbb1a351.zip
Make information about use of jump table available via system_info BIF
erlang:system_info(beam_jump_table)
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/beam_emu.c9
-rwxr-xr-xerts/emulator/beam/erl_bif_info.c3
-rwxr-xr-xerts/emulator/beam/global.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 5781009f58..da36c4437e 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -6256,3 +6256,12 @@ erts_current_reductions(Process *current, Process *p)
}
}
+int
+erts_beam_jump_table(void)
+{
+#if defined(NO_JUMP_TABLE)
+ return 0;
+#else
+ return 1;
+#endif
+}
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index b1dc62b4fd..e4fbd21c0e 100755
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -2583,6 +2583,9 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
else if (ERTS_IS_ATOM_STR("emu_args", BIF_ARG_1)) {
BIF_RET(erts_get_emu_args(BIF_P));
}
+ else if (ERTS_IS_ATOM_STR("beam_jump_table", BIF_ARG_1)) {
+ BIF_RET(erts_beam_jump_table() ? am_true : am_false);
+ }
else if (ERTS_IS_ATOM_STR("dynamic_trace", BIF_ARG_1)) {
#if defined(USE_DTRACE)
DECL_AM(dtrace);
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 25aedc91c6..e5807b5ce6 100755
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1042,6 +1042,8 @@ extern erts_driver_t vanilla_driver;
extern erts_driver_t spawn_driver;
extern erts_driver_t fd_driver;
+int erts_beam_jump_table(void);
+
/* Should maybe be placed in erl_message.h, but then we get an include mess. */
ERTS_GLB_INLINE Eterm *
erts_alloc_message_heap_state(Uint size,