aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorPip Cet2021-05-16 15:44:26 +0200
committerStefan Monnier2022-07-01 18:59:35 -0400
commitb6a526361b57f8d9f6d5078ccd97832d0a1fb036 (patch)
tree0c752a1c74920a2b731bb2e3c2ff6623be240a72 /src/comp.c
parent3daf833ff3f3e99b44731808cb197c0912649997 (diff)
downloademacs-scratch/no-purespace-old.tar.gz
emacs-scratch/no-purespace-old.zip
Remove purespace and ancillary codescratch/no-purespace-old
Now that purespace is not used any more, remove it, along with the functions used to allocate into it. Use equivalent functions allocating into the normal heap. Remove calls to PURE_P since they always return false. * src/puresize.h: Delete file. * src/alloc.c: Don't include `puresize.h` any more. (pure, purebeg, pure_size, pure_bytes_used_before_overflow) (pure_bytes_used_lisp, pure_bytes_used_non_lisp, symbol_block_pinned) (pinned_objects): Delete vars. (PUREBEG): Delete macro. (pointer_align): Move after definition of USE_ALIGNED_ALLOC and only define it if USE_ALIGNED_ALLOC is not used. (cons_listn): Remove `cons` arg, hardcode `Fcons` instead. (pure_listn, pure_alloc, check_pure_size, make_pure_string) (make_pure_c_string, pure_cons): Delete functions. (init_symbol): Don't set `pinned` any more. (mark_pinned_objects, mark_pinned_symbols): Delete functions. (garbage_collect): Don't call them any more. (init_alloc_once_for_pdumper): Don't initialize purebeg and pure_size. * src/print.c (print_object) <PVEC_HASH_TABLE>: Don't print `purecopy`. * src/pdumper.c (dump_symbol, dump_hash_table): Update sig hash. (dump_symbol): Don't dump `pinned`. (dump_hash_table): Don't dump `purecopy`. * src/lread.c (readevalloop, read_internal_start): Adjust call to `make_hash_table`. (read0, intern_c_string_1, define_symbol, Fintern): Don't purify symbol names. (string): Avoid `pure_cons` and `build_pure_c_string`. * src/lisp.h (struct Lisp_Symbol): Remove `pinned` field. (struct Lisp_Hash_Table): Remove `purecopy` field. (check_pure_size, pure_listn, pure_list, make_pure_string) (make_pure_c_string, pure_cons): Remove prototypes. (build_pure_c_string): Delete function. * src/keymap.c: Don't include `puresize.h` any more. (Fmake_sparse_keymap): Don't purecopy the menu name. (Fset_keymap_parent, store_in_keymap): Don't `CHECK_IMPURE` any more. (syms_of_keymap): Avoid `pure_cons` and `build_pure_c_string`. * src/intervals.c: Don't include `puresize.h` any more. (create_root_interval): Don't `CHECK_IMPURE` any more. * src/fns.c: Don't include `puresize.h` any more. (Ffillarray, Fclear_string): Don't `CHECK_IMPURE` any more. (make_hash_table): Remove `purecopy` arg. (Fmake_hash_table): Remove `:purecopy` keyword argument. * src/eval.c (Finternal__define_uninitialized_variable): Don't purecopy the doc any more. (Fdefconst_1): Don't purecopy the initvalue any more. (Fautoload): Get rid of hack needed when we used hash-consing. (syms_of_eval): Avoid `build_pure_c_string`. * src/emacs.c: Don't include `puresize.h` any more. (Fdump_emacs): Don't `check_pure_size`. * src/doc.c (Fsnarf_documentation): Don't purecopy the build files. * src/deps.mk: Remove puresize.h. * src/data.c: Don't include `puresize.h` any more. (pure_write_error): Delete function. (Fsetcar, Fsetcdr): Don't `CHECK_IMPURE` any more. (Fdefalias): Don't purecopy the definition any more. (Faset): Don't `CHECK_IMPURE` any more. (syms_of_data): Avoid `pure_cons` and `build_pure_c_string`. * src/conf_post.h (SYSTEM_PURESIZE_EXTRA): Delete macro. * src/comp.c: Don't include `puresize.h` any more. (helper_link_table): Remove `pure_write_error`. (define_CHECK_IMPURE): Delete function. (maybe_defer_native_compilation, syms_of_comp): Avoid `build_pure_c_string`. * src/category.c (hash_get_category_set): Update call to `make_hash_table`. (Fdefine_category): Don't purecopy the docstring any more. * src/bytecode.c: Don't include `puresize.h` any more. (Bsetcar, Bsetcdr): Don't `CHECK_IMPURE` any more. * doc/lispref/internals.texi (Pure Storage): Delete section. (Garbage Collection): Remove note about purespace overflow. * src/xfaces.c (syms_of_xfaces): * src/emacs-module.c (syms_of_module): * src/frame.c (make_frame, make_initial_frame): * src/fileio.c (syms_of_fileio): * src/image.c (xpm_make_color_table_h): * src/process.c (ADD_SUBFEATURE, syms_of_process): * src/profiler.c (make_log): * src/json.c (define_error): * src/xterm.c (syms_of_xterm): * src/xfns.c (syms_of_xfns): * src/xdisp.c (syms_of_xdisp): * src/w32fns.c (syms_of_w32fns): * src/syntax.c (syms_of_syntax): * src/sqlite.c (syms_of_sqlite): * src/search.c (syms_of_search): * src/keyboard.c (syms_of_keyboard): * src/fontset.c (syms_of_fontset): * src/dbusbind.c (syms_of_dbusbind): * src/coding.c (syms_of_coding): * src/callint.c (syms_of_callint): * src/buffer.c (init_buffer_once, syms_of_buffer): Avoid `build_pure_c_string`, `Fpurecopy`, `pure_cons`, and `pure_list`, and adjust calls to `make_hash_table`.
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c72
1 files changed, 10 insertions, 62 deletions
diff --git a/src/comp.c b/src/comp.c
index 0c78e60fc43..520b846a090 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -31,7 +31,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
31#include <libgccjit.h> 31#include <libgccjit.h>
32#include <epaths.h> 32#include <epaths.h>
33 33
34#include "puresize.h"
35#include "window.h" 34#include "window.h"
36#include "dynlib.h" 35#include "dynlib.h"
37#include "buffer.h" 36#include "buffer.h"
@@ -676,7 +675,6 @@ helper_GET_SYMBOL_WITH_POSITION (Lisp_Object);
676static void *helper_link_table[] = 675static void *helper_link_table[] =
677 { wrong_type_argument, 676 { wrong_type_argument,
678 helper_PSEUDOVECTOR_TYPEP_XUNTAG, 677 helper_PSEUDOVECTOR_TYPEP_XUNTAG,
679 pure_write_error,
680 push_handler, 678 push_handler,
681 record_unwind_protect_excursion, 679 record_unwind_protect_excursion,
682 helper_unbind_n, 680 helper_unbind_n,
@@ -3946,52 +3944,6 @@ static void define_SYMBOL_WITH_POS_SYM (void)
3946} 3944}
3947 3945
3948static void 3946static void
3949define_CHECK_IMPURE (void)
3950{
3951 gcc_jit_param *param[] =
3952 { gcc_jit_context_new_param (comp.ctxt,
3953 NULL,
3954 comp.lisp_obj_type,
3955 "obj"),
3956 gcc_jit_context_new_param (comp.ctxt,
3957 NULL,
3958 comp.void_ptr_type,
3959 "ptr") };
3960 comp.check_impure =
3961 gcc_jit_context_new_function (comp.ctxt, NULL,
3962 GCC_JIT_FUNCTION_INTERNAL,
3963 comp.void_type,
3964 "CHECK_IMPURE",
3965 2,
3966 param,
3967 0);
3968
3969 DECL_BLOCK (entry_block, comp.check_impure);
3970 DECL_BLOCK (err_block, comp.check_impure);
3971 DECL_BLOCK (ok_block, comp.check_impure);
3972
3973 comp.block = entry_block;
3974 comp.func = comp.check_impure;
3975
3976 emit_cond_jump (emit_PURE_P (gcc_jit_param_as_rvalue (param[0])), /* FIXME */
3977 err_block,
3978 ok_block);
3979 gcc_jit_block_end_with_void_return (ok_block, NULL);
3980
3981 gcc_jit_rvalue *pure_write_error_arg =
3982 gcc_jit_param_as_rvalue (param[0]);
3983
3984 comp.block = err_block;
3985 gcc_jit_block_add_eval (comp.block,
3986 NULL,
3987 emit_call (intern_c_string ("pure_write_error"),
3988 comp.void_type, 1,&pure_write_error_arg,
3989 false));
3990
3991 gcc_jit_block_end_with_void_return (err_block, NULL);
3992}
3993
3994static void
3995define_maybe_gc_or_quit (void) 3947define_maybe_gc_or_quit (void)
3996{ 3948{
3997 3949
@@ -5114,10 +5066,10 @@ maybe_defer_native_compilation (Lisp_Object function_name,
5114 5066
5115 Lisp_Object src = 5067 Lisp_Object src =
5116 concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name), 5068 concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name),
5117 build_pure_c_string (".el")); 5069 build_string (".el"));
5118 if (NILP (Ffile_exists_p (src))) 5070 if (NILP (Ffile_exists_p (src)))
5119 { 5071 {
5120 src = concat2 (src, build_pure_c_string (".gz")); 5072 src = concat2 (src, build_string (".gz"));
5121 if (NILP (Ffile_exists_p (src))) 5073 if (NILP (Ffile_exists_p (src)))
5122 return; 5074 return;
5123 } 5075 }
@@ -5317,10 +5269,6 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump,
5317 comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM); 5269 comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM);
5318 comp_u->data_impure_vec = 5270 comp_u->data_impure_vec =
5319 load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM); 5271 load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM);
5320
5321 if (!NILP (Vpurify_flag))
5322 /* Non impure can be copied into pure space. */
5323 comp_u->data_vec = Fpurecopy (comp_u->data_vec);
5324 } 5272 }
5325 5273
5326 EMACS_INT d_vec_len = XFIXNUM (Flength (comp_u->data_vec)); 5274 EMACS_INT d_vec_len = XFIXNUM (Flength (comp_u->data_vec));
@@ -5690,40 +5638,40 @@ compiled one. */);
5690 Fput (Qnative_compiler_error, Qerror_conditions, 5638 Fput (Qnative_compiler_error, Qerror_conditions,
5691 pure_list (Qnative_compiler_error, Qerror)); 5639 pure_list (Qnative_compiler_error, Qerror));
5692 Fput (Qnative_compiler_error, Qerror_message, 5640 Fput (Qnative_compiler_error, Qerror_message,
5693 build_pure_c_string ("Native compiler error")); 5641 build_string ("Native compiler error"));
5694 5642
5695 DEFSYM (Qnative_ice, "native-ice"); 5643 DEFSYM (Qnative_ice, "native-ice");
5696 Fput (Qnative_ice, Qerror_conditions, 5644 Fput (Qnative_ice, Qerror_conditions,
5697 pure_list (Qnative_ice, Qnative_compiler_error, Qerror)); 5645 pure_list (Qnative_ice, Qnative_compiler_error, Qerror));
5698 Fput (Qnative_ice, Qerror_message, 5646 Fput (Qnative_ice, Qerror_message,
5699 build_pure_c_string ("Internal native compiler error")); 5647 build_string ("Internal native compiler error"));
5700 5648
5701 /* By the load machinery. */ 5649 /* By the load machinery. */
5702 DEFSYM (Qnative_lisp_load_failed, "native-lisp-load-failed"); 5650 DEFSYM (Qnative_lisp_load_failed, "native-lisp-load-failed");
5703 Fput (Qnative_lisp_load_failed, Qerror_conditions, 5651 Fput (Qnative_lisp_load_failed, Qerror_conditions,
5704 pure_list (Qnative_lisp_load_failed, Qerror)); 5652 pure_list (Qnative_lisp_load_failed, Qerror));
5705 Fput (Qnative_lisp_load_failed, Qerror_message, 5653 Fput (Qnative_lisp_load_failed, Qerror_message,
5706 build_pure_c_string ("Native elisp load failed")); 5654 build_string ("Native elisp load failed"));
5707 5655
5708 DEFSYM (Qnative_lisp_wrong_reloc, "native-lisp-wrong-reloc"); 5656 DEFSYM (Qnative_lisp_wrong_reloc, "native-lisp-wrong-reloc");
5709 Fput (Qnative_lisp_wrong_reloc, Qerror_conditions, 5657 Fput (Qnative_lisp_wrong_reloc, Qerror_conditions,
5710 pure_list (Qnative_lisp_wrong_reloc, Qnative_lisp_load_failed, Qerror)); 5658 pure_list (Qnative_lisp_wrong_reloc, Qnative_lisp_load_failed, Qerror));
5711 Fput (Qnative_lisp_wrong_reloc, Qerror_message, 5659 Fput (Qnative_lisp_wrong_reloc, Qerror_message,
5712 build_pure_c_string ("Primitive redefined or wrong relocation")); 5660 build_string ("Primitive redefined or wrong relocation"));
5713 5661
5714 DEFSYM (Qwrong_register_subr_call, "wrong-register-subr-call"); 5662 DEFSYM (Qwrong_register_subr_call, "wrong-register-subr-call");
5715 Fput (Qwrong_register_subr_call, Qerror_conditions, 5663 Fput (Qwrong_register_subr_call, Qerror_conditions,
5716 pure_list (Qwrong_register_subr_call, Qnative_lisp_load_failed, Qerror)); 5664 pure_list (Qwrong_register_subr_call, Qnative_lisp_load_failed, Qerror));
5717 Fput (Qwrong_register_subr_call, Qerror_message, 5665 Fput (Qwrong_register_subr_call, Qerror_message,
5718 build_pure_c_string ("comp--register-subr can only be called during " 5666 build_string ("comp--register-subr can only be called during "
5719 "native lisp load phase.")); 5667 "native lisp load phase."));
5720 5668
5721 DEFSYM (Qnative_lisp_file_inconsistent, "native-lisp-file-inconsistent"); 5669 DEFSYM (Qnative_lisp_file_inconsistent, "native-lisp-file-inconsistent");
5722 Fput (Qnative_lisp_file_inconsistent, Qerror_conditions, 5670 Fput (Qnative_lisp_file_inconsistent, Qerror_conditions,
5723 pure_list (Qnative_lisp_file_inconsistent, Qnative_lisp_load_failed, Qerror)); 5671 pure_list (Qnative_lisp_file_inconsistent, Qnative_lisp_load_failed, Qerror));
5724 Fput (Qnative_lisp_file_inconsistent, Qerror_message, 5672 Fput (Qnative_lisp_file_inconsistent, Qerror_message,
5725 build_pure_c_string ("eln file inconsistent with current runtime " 5673 build_string ("eln file inconsistent with current runtime "
5726 "configuration, please recompile")); 5674 "configuration, please recompile"));
5727 5675
5728 defsubr (&Scomp__subr_signature); 5676 defsubr (&Scomp__subr_signature);
5729 defsubr (&Scomp_el_to_eln_rel_filename); 5677 defsubr (&Scomp_el_to_eln_rel_filename);