summaryrefslogtreecommitdiff
path: root/m4/labels-as-values.m4
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2008-08-05 01:03:17 +0200
committerAndy Wingo <wingo@pobox.com>2008-08-05 01:03:17 +0200
commit659b4611b6a138fa252a42d1e1a0f4862242454c (patch)
tree81ea597791e89aac0e4f850d500acafd7f54820a /m4/labels-as-values.m4
parentfbde2b915bfe4139b75e71c4ad5fd701b2558d8f (diff)
downloadguile-659b4611b6a138fa252a42d1e1a0f4862242454c.tar.gz
re-enable computed goto; fix ,help in the repl; subr dispatch optimizations
* m4/labels-as-values.m4: New file, checks for computed goto. * configure.in: Use AC_C_LABELS_AS_VALUES. * module/system/repl/command.scm (procedure-documentation): Extend the core's procedure-documentation in an ad-hoc way, so that ,help works. * module/system/vm/core.scm (program-properties): New function. (program-documentation): New function. * src/vm_engine.h (DROP, DROPN): Decrement sp before checking for underflow. * src/vm_system.c (call, tail-call): Add some optimized dispatch for some C functions, so that we can avoid consing and the interpreter if possible. However currently it seems that I'm always getting the scm_call_* trampolines back.
Diffstat (limited to 'm4/labels-as-values.m4')
-rw-r--r--m4/labels-as-values.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/m4/labels-as-values.m4 b/m4/labels-as-values.m4
new file mode 100644
index 000000000..eedfb553a
--- /dev/null
+++ b/m4/labels-as-values.m4
@@ -0,0 +1,22 @@
+dnl check for gcc's "labels as values" feature
+AC_DEFUN(AC_C_LABELS_AS_VALUES,
+[AC_CACHE_CHECK([labels as values], ac_cv_labels_as_values,
+[AC_TRY_COMPILE([
+int foo(int);
+int foo(i)
+int i; {
+static void *label[] = { &&l1, &&l2 };
+goto *label[i];
+l1: return 1;
+l2: return 2;
+}
+],
+[int i;],
+ac_cv_labels_as_values=yes,
+ac_cv_labels_as_values=no)])
+if test "$ac_cv_labels_as_values" = yes; then
+AC_DEFINE(HAVE_LABELS_AS_VALUES, [],
+ [Define if compiler supports gcc's "labels as values" (aka computed goto)
+ feature, used to speed up instruction dispatch in the interpreter.])
+fi
+])