aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorNickolas Lloyd2016-12-22 20:05:16 -0500
committerNickolas Lloyd2016-12-22 20:05:16 -0500
commitca2e32dcc4ed8bba25a700cd7c8fa8aba6c94ae5 (patch)
treebfb09bc34f6de7c34a930d9bbeaddb6f82048cc5 /src/bytecode.c
parent52a3e81487641cd81cef777540fa5791fdd93ddb (diff)
downloademacs-ca2e32dcc4ed8bba25a700cd7c8fa8aba6c94ae5.tar.gz
emacs-ca2e32dcc4ed8bba25a700cd7c8fa8aba6c94ae5.zip
; Minor reorg of bytecode interpreter/JIT compiler
; * src/bytecode.c (exec_byte_code, exec_byte_code__): Use exec_byte_code as the single entrypoint for both the interpreter and JIT compiler. ; * src/bytecode-jit.c (jit_byte_code): Remove jit_byte_code to be replaced by exec_byte_code. ; * src/bytecode.h: Add function prototypes. ; * src/eval.c (funcall_lambda): Use exec_byte_code instead of jit_byte_code. ; * src/lisp.h: Update function prototypes.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index c88ca509119..76ec066c637 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -137,7 +137,7 @@ the third, MAXDEPTH, the maximum stack depth used in this function.
137If the third argument is incorrect, Emacs may crash. */) 137If the third argument is incorrect, Emacs may crash. */)
138 (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth) 138 (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth)
139{ 139{
140 return exec_byte_code (bytestr, vector, maxdepth, Qnil, 0, NULL); 140 return exec_byte_code__ (bytestr, vector, maxdepth, Qnil, 0, NULL);
141} 141}
142 142
143void 143void
@@ -155,8 +155,8 @@ bcall0 (Lisp_Object f)
155 executing BYTESTR. */ 155 executing BYTESTR. */
156 156
157Lisp_Object 157Lisp_Object
158exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, 158exec_byte_code__ (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
159 Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args) 159 Lisp_Object args_template, ptrdiff_t nargs, Lisp_Object *args)
160{ 160{
161#ifdef BYTE_CODE_METER 161#ifdef BYTE_CODE_METER
162 int volatile this_op = 0; 162 int volatile this_op = 0;
@@ -1283,6 +1283,24 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1283 return result; 1283 return result;
1284} 1284}
1285 1285
1286Lisp_Object
1287exec_byte_code (Lisp_Object byte_code, Lisp_Object args_template,
1288 ptrdiff_t nargs, Lisp_Object *args)
1289{
1290 if (AREF (byte_code, COMPILED_JIT_ID))
1291 return jit_exec (byte_code, args_template, nargs, args);
1292 else if (!byte_code_jit_on)
1293 return exec_byte_code__ (AREF (byte_code, COMPILED_BYTECODE),
1294 AREF (byte_code, COMPILED_CONSTANTS),
1295 AREF (byte_code, COMPILED_STACK_DEPTH),
1296 args_template, nargs, args);
1297 else
1298 {
1299 jit_byte_code__ (byte_code);
1300 return jit_exec (byte_code, args_template, nargs, args);
1301 }
1302}
1303
1286/* `args_template' has the same meaning as in exec_byte_code() above. */ 1304/* `args_template' has the same meaning as in exec_byte_code() above. */
1287Lisp_Object 1305Lisp_Object
1288get_byte_code_arity (Lisp_Object args_template) 1306get_byte_code_arity (Lisp_Object args_template)