From 20c511d4a80c26a54004a9b44b3108669baa86c3 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 31 Aug 2020 14:10:21 +0200 Subject: Optimize Is_accu a bit. --- kernel/byterun/coq_interp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c index 67e6bed0d9..72f6e12b0f 100644 --- a/kernel/byterun/coq_interp.c +++ b/kernel/byterun/coq_interp.c @@ -193,7 +193,9 @@ if (sp - num_args < coq_stack_threshold) { \ #endif #endif -#define Is_accu(v) (Is_block(v) && Tag_val(v) == Closure_tag && Code_val(v) == accumulate) +/* We should also check "Code_val(v) == accumulate" to be sure, + but Is_accu is only used in places where closures cannot occur. */ +#define Is_accu(v) (Is_block(v) && Tag_val(v) == Closure_tag) #define CheckPrimArgs(cond, apply_lbl) do{ \ if (cond) pc++; \ -- cgit v1.2.3