aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode-jit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Fix errors introduced during merge.Nickolas Lloyd2017-02-011-12/+2
|
* Small speed improvement for JITed lisp function dispatchNickolas Lloyd2017-01-291-0/+1
| | | | | | | | | | * src/alloc.c (make-byte-code): * src/bytecode-jit.c (jit_byte_code__): * src/bytecode.c [HAVE_LIBJIT] (exec_byte_code): * src/eval.c (funcall_lambda): * src/lisp.h (funcall_lambda): Store pointer to bytecode execution function (either `exec_byte_code' or `jit_exec') in Lisp_Compiled objects to avoid the need for an extra function call in `exec_byte_code'.
* Avoid extra calls to `jit_function_to_closure'Nickolas Lloyd2017-01-231-3/+5
| | | | | | * src/bytecode-jit.c (jit_byte_code__, jit_exec): * src/alloc.c (cleanup_vector, mark_compiled): Add vector slot for holding the generated closure so that it only has to be generated once.
* ; Fix a performance regression in bytecode JIT compilerNickolas Lloyd2017-01-011-1/+1
| | | | | | | ; * src/bytecode-jit.c: Make `functions' array static const to allow the compiler to elide the array accesses. This brings `jit_byte_code__' performance back in line with the more explicit, repetitive pre-639dfad3ae2a478652a399986b03e5eec219eab1 version.
* ; Store jit_function_t value instead of closure.Nickolas Lloyd2016-12-311-2/+2
| | | | | | ; * src/bytecode-jit.c (jit_byte_code__, jit_exec): Use the COMPILED_JIT_ID field for storing the jit_function_t value so that we can retrive the jit_context_t later for destruction.
* ; Make JIT compilation loop more readable.Nickolas Lloyd2016-12-301-637/+140
| | | | | | | ; * src/bytecode-jit.c (jit_byte_code__): Condense cases using JIT_CALL_STACK_N and JIT_CALL_STACK_MANY. ; * src/bytecode.h: Define function called and number of stack items for each bytecode instruction.
* ; Change JIT_* macros to return a value.Nickolas Lloyd2016-12-271-51/+39
|
* ; Create a new context for each JIT compilation.Nickolas Lloyd2016-12-271-145/+145
| | | | | ; * src/bytecode-jit.c (jit_byte_code__, jit_exec): Add emacs_jit_context struct to hold common signatures and such.
* ; Fix compiler warnings in src/bytecode-jit.cNickolas Lloyd2016-12-251-16/+0
|
* Use inline functions instead of macros for JIT operations.Nickolas Lloyd2016-12-251-89/+118
| | | | | | * src/bytecode-jit.c (jit_inc, jit_push, jit_top, jit_pop, jit_call) (jit_call_vaarg, jit_call_with_stack_n, jit_call_with_stack_many) (jit_byte_code__): Create inline functions to clean up macro messiness.
* ; Fix a possible bug with JIT-compiled functions in the call stackNickolas Lloyd2016-12-231-21/+19
| | | | | | | | * src/bytecode-jit.c (jit_byte_code__, jit_exec): Insert entry into `byte_stack_list' from `jit_exec' instead of `jit_byte_code__'. It seems like this would be needed for proper stack unwinding in `unwind_to_catch'. * src/bytecode.c (relocate_byte_stack) [HAVE_LIBJIT]: Skip entries in `byte_stack_list' with no associated bytecode stack.
* ; * src/bytecode-jit.c: Remove #include of uneeded headers.Nickolas Lloyd2016-12-231-5/+0
|
* Make JIT support entirely optional.Nickolas Lloyd2016-12-231-0/+2
| | | | | | | | ; * src/bytecode-jit.c: ; * src/bytecode.c: ; * src/bytecode.h: ; * src/emacs.c: ; * src/lisp.h: Add guards around all JIT-related code.
* ; Minor reorg of bytecode interpreter/JIT compilerNickolas Lloyd2016-12-221-20/+2
| | | | | | | | | | ; * 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.
* ; * src/bytecode-jit.c: Fix copyright years.Nickolas Lloyd2016-12-221-2/+1
|
* ; Merge branch 'master' into nick.lloyd-bytecode-jitNickolas Lloyd2016-12-221-6/+6
|
* Enable optimization of JITed functions.Nickolas Lloyd2016-12-221-0/+2
| | | | | ; * src/bytecode-jit.c (jit_byte_code__): Set highest optimization level when compiling functions.
* Add bytecode JIT compilation capabilitiesNickolas Lloyd2016-12-221-0/+2131
This change adds several functions that utilize GNU libjit to compile byte-compiled lisp functions to machine code. The functionality is exposed in two ways: specific functions can be JIT compiled from lisp with the `jit-compile' function, or JIT compilation can be enabled globally by setting `byte-code-jit-on' to non-nil. Once the function has been JIT compiled, the machine-code version will be executed in place of the bytecode version. * src/bytecode-jit.c (native_varref, native_ifnil, native_ifnonnil) (native_car, native_eq, native_memq, native_cdr, native_varset) (native_unbind_to, byte_code_quit, native_save_excursion) (native_save_restriction, native_save_window_excursion, native_catch) (native_pophandler, native_pushhandler1, native_pushhandler2) (native_unwind_protect, native_temp_output_buffer_setup, native_nth) (native_symbolp, native_consp, native_stringp, native_listp, native_not) (native_add1, native_eqlsign, native_negate, native_point, native_point_max) (native_point_min, native_current_column, native_interactive_p) (native_char_syntax, native_elt, native_car_safe, native_cdr_safe) (native_number_p, native_integer_p, emacs_jit_init, jit_exec, jit_byte_code__) (jit_byte_code, Fjit_compile, syms_of_bytecode_jit): New file encapsulating JIT compilation functionality and execution functionality. * src/bytecode.c: * src/bytecode.h: Extract useful data structures and macro definitions into a separate header to allow sharing between src/bytecode{,-jit}.c. ; * src/Makefile.in: Add src/bytecode-jit.o to Makefile recipe. ; * src/lisp.h: Add function prototypes for new JIT functions. ; * src/emacs.c: Call syms_of_bytecode_jit to initialize JIT-related symbols.