]> git.eshelyaron.com Git - emacs.git/commitdiff
Make JIT support entirely optional.
authorNickolas Lloyd <ultrageek.lloyd@gmail.com>
Fri, 23 Dec 2016 05:44:45 +0000 (00:44 -0500)
committerNickolas Lloyd <ultrageek.lloyd@gmail.com>
Fri, 23 Dec 2016 15:54:54 +0000 (10:54 -0500)
; * src/bytecode-jit.c:
; * src/bytecode.c:
; * src/bytecode.h:
; * src/emacs.c:
; * src/lisp.h: Add guards around all JIT-related code.

src/bytecode-jit.c
src/bytecode.c
src/bytecode.h
src/emacs.c
src/lisp.h

index 734371dc7724281efa597b497125e3b7916a66fa..2274935fbdae4dd02b6968bf60c1689f68bbdbcc 100644 (file)
@@ -18,6 +18,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
+#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 */
index 76ec066c6371add751fb862e2daebbf5615a86c0..6567039765dd21375a0055ba40b6ded467c7eccf 100644 (file)
@@ -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)
index 25f11f1ce1fc91e68b8a7e597416c9445948e9df..4882ca50db616d85b40d7025b75da2dea792e7c4 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.  */
 
+#include <config.h>
+
 #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
index e670e6e0756bb543a8e949ee4a9b854a2f64b61a..89d1bbd252d28f3c21e59b8aed98a9f8054d7da8 100644 (file)
@@ -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 ();
index fc600a50cab2a43ad648f4f48282541c1a8fe8b1..63b336a106d906eea15d463d23eb259b3034234f 100644 (file)
@@ -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);