summaryrefslogtreecommitdiff
path: root/src/comp.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Sanity check on lambdas fixupsAndrea Corallo2020-05-151-0/+1
| | | | | | | | | | * src/pdumper.c (dump_do_dump_relocation): While fixing up lambda relocation verify placeholder coherency. * src/comp.c (syms_of_comp): Define symbol 'lambda-fixup'. * lisp/emacs-lisp/comp.el (comp-finalize-container): Leave a lambda-fixup as placeholder in the relocation as a sanity check.
* * Better Vcomp_sym_subr_c_name_h test function + docAndrea Corallo2020-05-151-2/+2
| | | | | * src/comp.c (syms_of_comp): 'Vcomp_sym_subr_c_name_h' need only 'eq' as test + fix doc for 'comp-sym-subr-c-name-h'.
* Add anonymous lambdas reload mechanismAndrea Corallo2020-05-151-19/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/pdumper.c (dump_do_dump_relocation): Initialize 'lambda_gc_guard' while resurrecting. (dump_do_dump_relocation): Revive lambdas and fixup them. * src/comp.h (struct Lisp_Native_Comp_Unit): Define new 'lambda_gc_guard' 'lambda_c_name_idx_h' 'data_imp_relocs' 'loaded_once' fields. * src/comp.c (load_comp_unit): Use compilaiton unit 'loaded_once' field. (make_subr, Fcomp__register_lambda): New functions. (Fcomp__register_subr): Make use of 'make_subr'. (Fnative_elisp_load): Indent. (Fnative_elisp_load): Initialize 'lambda_gc_guard' 'lambda_c_name_idx_h' fields. (syms_of_comp): Add Scomp__register_lambda. * lisp/emacs-lisp/comp.el (comp-ctxt): Change 'byte-func-to-func-h' hash key test. (comp-ctxt): Add 'lambda-fixups-h' slot. (comp-emit-lambda-for-top-level): New function. (comp-finalize-relocs): Never emit lambdas in pure space. (comp-finalize-relocs): Fixup relocation indexes.
* * Render all immediates as comments at comp-debug > 2Andrea Corallo2020-05-141-1/+13
| | | | * src/comp.c (emit_mvar_rval): No reason to emit only fixnums.
* * Dump log and intemediate GCC IRs only at comp-debug 3Andrea Corallo2020-05-141-1/+1
| | | | | * src/comp.c (Fcomp__init_ctxt): Increase threshold for dumping really everything to 'comp-debug' 3.
* * Split emit_const_lisp_obj logicAndrea Corallo2020-05-141-17/+24
| | | | | | | | | * src/comp.c (emit_lisp_obj_reloc_lval): New function. (emit_const_lisp_obj): Rename into 'emit_lisp_obj_rval' and strip logic for 'emit_lisp_obj_reloc_lval'. (emit_NILP, emit_CHECK_CONS, emit_mvar_rval, emit_set_internal) (define_CAR_CDR, define_bool_to_lisp_obj): Update for 'emit_const_lisp_obj' being renamed.
* * Rename emit_mvar_access -> emit_mvar_lvalAndrea Corallo2020-05-141-3/+3
| | | | | | * src/comp.c (emit_mvar_access): Rename into 'emit_mvar_lval'. (emit_mvar_rval, emit_frame_assignment): Update for 'emit_mvar_access' rename.
* * Rename emit_mvar_val -> emit_mvar_rvalAndrea Corallo2020-05-141-14/+14
| | | | | | | | * src/comp.c (emit_mvar_val): Rename into 'emit_mvar_rval'. (emit_set_internal, emit_simple_limple_call, emit_limple_insn) (emit_call_with_type_hint, emit_call2_with_type_hint) (emit_consp, emit_numperp, emit_integerp): Update for 'emit_mvar_val' rename.
* * Indentation fixAndrea Corallo2020-05-141-9/+9
| | | | | | * src/comp.c (Fcomp__init_ctxt, Fcomp__release_ctxt) (Fcomp__compile_ctxt_to_file, Fcomp__register_subr): Indentation fix.
* * src/comp.c (load_comp_unit): Style fix.Andrea Corallo2020-05-101-1/+1
|
* * Fix --enable-check-lisp-object-type GNU/Linux X86_64 buildAndrea Corallo2020-05-091-2/+2
| | | | | * src/comp.c (emit_mvar_val): Fix missing use of XLP macro. (load_comp_unit): Fix missing use of NILP macro.
* Convert before final function doc hash into a vector.Andrea Corallo2020-04-261-9/+7
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-finalize-relocs): Convert doc hash table into vector befor final. (comp-emit-for-top-level): Rename `comp-ctxt-doc-index-h' -> `comp-ctxt-function-docs'. (comp-ctxt): Likewise. * src/comp.c (native_function_doc): Update logic for documentation being a vector. (emit_ctxt_code): Update for 'comp-ctxt-doc-index-h' slot rename. * src/comp.h (struct Lisp_Native_Comp_Unit): Rename 'data_fdoc_h' into data_fdoc_v. * src/pdumper.c (dump_native_comp_unit): Likewise.
* Lazy load function documentation.Andrea Corallo2020-04-251-1/+16
| | | | | | | | | | | | | * src/comp.c (native_function_doc): New function. (load_comp_unit): Do not load function doc during load. * src/comp.h: Extern 'native_function_doc'. * src/doc.c (Fdocumentation): Call 'native_function_doc' to retrive function doc. * src/pdumper.c (dump_native_comp_unit): Zero 'data_fdoc_h' before dumping.
* * Rename TEXT_OPTIM_QLY into TEXT_OPTIM_QLY_SYM.Andrea Corallo2020-04-251-3/+4
| | | | | | * src/comp.c (TEXT_OPTIM_QLY): Rename into TEXT_OPTIM_QLY_SYM. (emit_ctxt_code): Update TEXT_OPTIM_QLY naming. (load_comp_unit): Likewise.
* * src/comp.c (declare_function): fix missing NILP.Andrea Corallo2020-04-251-1/+1
|
* Store function documentations in a hash table.Andrea Corallo2020-04-251-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/pdumper.c (dump_subr): Update Lisp_Subr hash. (dump_subr): Update for new compilation unit layout. (dump_vectorlike): Update pvec_type hash. * src/lisp.h (struct Lisp_Subr): Remove 'native_doc' index. (DEFUN): Update macro for new compilation unit layout. * src/doc.c (Fdocumentation): Update for new compilation unit layout. * src/comp.h (struct Lisp_Native_Comp_Unit): Add 'data_fdoc_h' field. * src/comp.c (TEXT_FDOC_SYM): New macro. (emit_ctxt_code): Emit function documentations. (load_comp_unit): Load function documentation. (Fcomp__register_subr): Rename parameter. (Fcomp__register_subr): Update for new compilation unit layout. * src/alloc.c (mark_object): Update for new compilation unit layout. (syms_of_alloc): Likewise. * lisp/emacs-lisp/comp.el (comp-ctxt): Add doc-index-h slot. (comp-emit-for-top-level): Emit doc index as 'comp--register-subr' doc parameter.
* Introduce load-true-file-nameAndrea Corallo2020-04-131-5/+5
| | | | | | | | | * src/comp.c (maybe_defer_native_compilation): Use `load-true-file-name' instead of `load-file-name'. * src/lread.c (Fload, end_of_file_error, read1, read_list) (init_lread, syms_of_lread): Add new `load-true-file-name' and fake `load-file-name' value when loading .eln files.
* * src/comp.c (emit_FIXNUMP): Don't emit a shift when unnecessary.Andrea Corallo2020-04-061-7/+8
|
* * src/comp.c (emit_XFIXNUM): Fix for LSB_TAG plus annotate a FIXME.Andrea Corallo2020-04-051-8/+11
|
* * src/comp.c (emit_const_lisp_obj, emit_mvar_val): Fix.Andrea Corallo2020-04-051-10/+22
|
* * src/comp.c (hash_native_abi): Fix assertion.Andrea Corallo2020-04-051-1/+1
|
* * src/comp.c (emit_binary_op): New function.Andrea Corallo2020-04-051-229/+166
| | | | | Wrap gcc_jit_context_new_binary_op within emit_binary_op to make sure input type are coherent and save a slew of code.
* * src/comp.c: Emit cast only when necessary.Andrea Corallo2020-04-051-42/+47
| | | | | Coerce only when the destination type is different from the current one.
* * src/comp.c: Add MSB TAG and wide int support.Andrea Corallo2020-04-051-32/+194
|
* * src/comp.c: Clean-up unnecessary field declaration.Andrea Corallo2020-04-051-5/+0
|
* src/comp.c: Fix i386Andrea Corallo2020-04-031-30/+5
| | | | | | In i386 ABI parameter passing of structs (and unions) is done as pointer + size. Surprisingly this is done *always* even if the structure is known to be word size.
* Prevent collisions in C namespace and function shadowingAndrea Corallo2020-03-291-7/+16
| | | | | This rework make functions being indexed by their unique C symbol name preventing multiple lisp function with the same name colliding.
* * comp.c (maybe_defer_native_compilation): Compile comp dependecies.Andrea Corallo2020-03-291-7/+33
| | | | | Make maybe_defer_native_compilation able to compile comp dependecies breaking circularity.
* src/comp.c (Fcomp__init_ctxt): AestheticAndrea Corallo2020-03-291-8/+0
|
* * comp.c (emit_mvar_access): Fix speed 1 compilationAndrea Corallo2020-03-241-1/+1
| | | | | At speed 1 propagate does not run and all mvars are allocated in array 0.
* Guard against function redefinition during deferred loadAndrea Corallo2020-03-231-8/+31
|
* * comp.c (maybe_defer_native_compilation): FixAndrea Corallo2020-03-221-2/+7
| | | | Prevent recursive compilation while deferring compilation.
* * comp.c (maybe_defer_native_compilation): Add some debug codeAndrea Corallo2020-03-221-0/+21
|
* * comp.c (native-elisp-load): Guard against misisng file.Andrea Corallo2020-03-181-1/+3
|
* Command late load when deferring compilationAndrea Corallo2020-03-191-1/+3
|
* Extend low level code for late loadAndrea Corallo2020-03-191-20/+16
|
* Trigger native compilation when loading bytecodeAndrea Corallo2020-03-161-1/+37
| | | | | Introduce a first mechanism to trigger compilation when lex elc files are loaded. This is off by default and has to be better tested.
* Prefix native compilation folders with "eln-"Andrea Corallo2020-03-131-5/+6
|
* * Improve load_comp_unitAndreaCorallo2020-03-101-21/+26
| | | | | | | Fix uninitialized ephemeral data relocation for the case when a dumped compilation unit is manually reloaded. Guard also data_ephemeral_vec against compiler optimizations.
* Hash eln ABI once and add it to the output compilation pathAndreaCorallo2020-03-031-6/+23
|
* ; Nit fix in commentAndreaCorallo2020-02-261-1/+1
|
* Change parameter name into comp--compile-ctxt-to-fileAndreaCorallo2020-02-061-5/+5
|
* Remove relocation index form LIMPLE setimmAndreaCorallo2020-03-011-3/+3
| | | | Given that every object identify a relocation class simplify setimm too.
* Optimize relocation classes for object duplicationAndrea Corallo2020-03-011-51/+70
| | | | | | | | | | Merge duplicated objects during final. Precendece is: 1 d-default 2 d-impure 3 d-ephemeral Now every object identify uniquely a relocation class. Because of this there's no need to keep the reloc class into m-var.
* Store optimize qualities into .eln filesAndreaCorallo2020-02-261-0/+10
| | | | For now just comp-speed and comp-debug are stored.
* Rename d-base allocation classe into d-defaultAndreaCorallo2020-02-261-11/+11
|
* Add ephemeral relocation data classAndreaCorallo2020-02-261-16/+62
| | | | | | Add a new class of relocated objects that is in use just during load process. This in order to avoid having to maintain them in the heap and traverse them at every GC.
* Update copyright years plus two style nitsAndrea Corallo2020-02-161-1/+1
|
* Rework frame layoutAndrea Corallo2020-02-151-44/+73
| | | | | Every function call by reference gets use one unique array of arguments.
* Clean-up unused variable into load_comp_unitAndrea Corallo2020-02-061-1/+0
|