From: Nickolas Lloyd Date: Fri, 23 Dec 2016 05:44:45 +0000 (-0500) Subject: Make JIT support entirely optional. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b84c200793be61115c956237ca435462ef0ae230;p=emacs.git Make JIT support entirely optional. ; * src/bytecode-jit.c: ; * src/bytecode.c: ; * src/bytecode.h: ; * src/emacs.c: ; * src/lisp.h: Add guards around all JIT-related code. --- diff --git a/src/bytecode-jit.c b/src/bytecode-jit.c index 734371dc772..2274935fbda 100644 --- a/src/bytecode-jit.c +++ b/src/bytecode-jit.c @@ -18,6 +18,7 @@ along with GNU Emacs. If not, see . */ #include +#ifdef HAVE_LIBJIT #include "bytecode.h" #include "lisp.h" #include "blockinput.h" @@ -2112,3 +2113,4 @@ syms_of_bytecode_jit (void) before execution. */); byte_code_jit_on = 0; } +#endif /* HAVE_LIBJIT */ diff --git a/src/bytecode.c b/src/bytecode.c index 76ec066c637..6567039765d 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -1287,20 +1287,23 @@ Lisp_Object exec_byte_code (Lisp_Object byte_code, Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args) { +#ifdef HAVE_LIBJIT if (AREF (byte_code, COMPILED_JIT_ID)) return jit_exec (byte_code, args_template, nargs, args); - else if (!byte_code_jit_on) - return exec_byte_code__ (AREF (byte_code, COMPILED_BYTECODE), - AREF (byte_code, COMPILED_CONSTANTS), - AREF (byte_code, COMPILED_STACK_DEPTH), - args_template, nargs, args); - else + else if (byte_code_jit_on) { jit_byte_code__ (byte_code); return jit_exec (byte_code, args_template, nargs, args); } + else +#endif + return exec_byte_code__ (AREF (byte_code, COMPILED_BYTECODE), + AREF (byte_code, COMPILED_CONSTANTS), + AREF (byte_code, COMPILED_STACK_DEPTH), + args_template, nargs, args); } + /* `args_template' has the same meaning as in exec_byte_code() above. */ Lisp_Object get_byte_code_arity (Lisp_Object args_template) diff --git a/src/bytecode.h b/src/bytecode.h index 25f11f1ce1f..4882ca50db6 100644 --- a/src/bytecode.h +++ b/src/bytecode.h @@ -16,6 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ +#include + #include "lisp.h" /* Define BYTE_CODE_SAFE true to enable some minor sanity checking, @@ -302,12 +304,14 @@ struct byte_stack extern void bcall0 (Lisp_Object f); +extern Lisp_Object +exec_byte_code__ (Lisp_Object, Lisp_Object, Lisp_Object, + Lisp_Object, ptrdiff_t, Lisp_Object *); + +#ifdef HAVE_LIBJIT extern void jit_byte_code__ (Lisp_Object); extern Lisp_Object jit_exec (Lisp_Object, Lisp_Object, ptrdiff_t, Lisp_Object *); - -extern Lisp_Object -exec_byte_code__ (Lisp_Object, Lisp_Object, Lisp_Object, - Lisp_Object, ptrdiff_t, Lisp_Object *); +#endif diff --git a/src/emacs.c b/src/emacs.c index e670e6e0756..89d1bbd252d 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1460,7 +1460,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem syms_of_buffer (); syms_of_bytecode (); +#ifdef HAVE_LIBJIT syms_of_bytecode_jit (); +#endif syms_of_callint (); syms_of_casefiddle (); syms_of_casetab (); diff --git a/src/lisp.h b/src/lisp.h index fc600a50cab..63b336a106d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4344,7 +4344,9 @@ extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, ptrdiff_t, Lisp_Obj extern Lisp_Object get_byte_code_arity (Lisp_Object); /* Defined in bytecode-jit.c */ +#ifdef HAVE_LIBJIT extern void syms_of_bytecode_jit (void); +#endif /* Defined in macros.c. */ extern void init_macros (void);