1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00
Commit graph

172687 commits

Author SHA1 Message Date
Gerd Möllmann
7aea2a3d0c Alloc all handlers from MPS, don't xfree them 2024-06-21 20:28:20 +02:00
Gerd Möllmann
50481083ee Add roots for current_thread and all_threads 2024-06-21 20:28:20 +02:00
Helmut Eller
18c5bb6415 Be careful while profiling
SIGPROF can be delived while the SIGSEGV handler is running.  In this
situation we shouldn't access MPS-managed memory.  E.g. the profiler
should not look inside closures when recording backtraces.

* src/igc.h (igc_busy_p): New.
* src/profiler.c (add_sample): When igc_busy_p, do the same as the old
GC does when it is called during GC, i.e. only increace a counter and
don't record a backtrace.
* src/igc.c (igc_busy_p): Implement it.
2024-06-21 14:40:30 +02:00
Gerd Möllmann
5dfba4a943 Conditionalize weak_vector_p on IGC_DEBUG 2024-06-20 17:26:15 +02:00
Helmut Eller
287e2aae72 Use igc_assert instead of eassert
* src/igc.c. (igc_on_pdump_loaded):
2024-06-20 17:08:29 +02:00
Helmut Eller
d1db05b84f When creating roots, allow to record a debug-name
* src/igc.c (register_root): Create a telemetry label for the
debug_name.
(root_create, root_create_ambig, root_create_exact)
(igc_root_create_ambig): New debug_name argument.
(root_create_staticvec, root_create_lispsym, root_create_buffer)
(root_create_terminal_list, root_create_main_thread)
(igc_root_create_exact, igc_root_create_exact_ptr, root_create_specpdl)
(root_create_bc, root_create_charset_table, root_create_pure)
(root_create_thread, igc_grow_rdstack, root_create_exact_n)
(igc_xalloc_lisp_objs_exact, igc_xzalloc_ambig, igc_realloc_ambig)
(igc_xpalloc_ambig, igc_xpalloc_exact, igc_xnrealloc_ambig)
(igc_on_pdump_loaded): Set debug_name.
* src/igc.c (igc_root_create_ambig): New debug_name argument.
* src/keyboard.c (init_keyboard): Set debug_name.
2024-06-20 17:08:29 +02:00
Helmut Eller
2363023a3f When resurrecting buffers, copy markers to a weak vector
* src/igc.h (igc_resurrect_markers): New.
* src/igc.c (igc_resurrect_markers): Implementation.
(weak_vector_p): New helper.
* src/pdumper.c (dump_do_dump_relocation): Use igc_resurrect_markers.
2024-06-20 17:08:28 +02:00
Helmut Eller
c0983a93dd Minor changes
* src/igc.c (igc_alloc_dump): Let nbytes be the size without header.
(dump_mmap_contiguous_mps): Update accordingly.
(dump_field_fwd): Use &in_field->fwdptr instead of in_field.
2024-06-20 17:08:28 +02:00
Helmut Eller
8bff68ca3f Shrink dump_public after the dump is initialized
* src/pdumper.c (pdumper_load): Set dump_public to the pinned region
from cold_user_data_start to heap_end.  This should reduce the
probability that pdumper_object_p is misused.
2024-06-20 17:08:28 +02:00
Helmut Eller
b4d96d51aa Introduce RELOC_BUFFER
Use the dump_relocs mechanism instead of relying on Vbuffer_alist to
find all existing buffers.

* src/pdumper.c (dump_buffer, dump_do_dump_relocation): Create a
RELOC_BUFFER.
* src/igc.c (igc_on_pdump_loaded): Remove the buffer related code.
2024-06-20 17:08:28 +02:00
Gerd Möllmann
429cfa62b7 First try to handle buffer compaction and undo list 2024-06-19 08:17:46 +02:00
Gerd Möllmann
a312bbf13d Add hashes we have from dmpstruct.h for CHECK_STRUCTS 2024-06-19 06:02:34 +02:00
Gerd Möllmann
c45329db08 Remove a remnant from IGC_OBJ_DUMPED_FWD 2024-06-19 05:21:24 +02:00
Helmut Eller
44e96b3967 More strict error checking in pdump_mmap_discard
* src/dumper.c (dump_discard_mem): Abort on error.
(dump_mmap_discard_contents): Call dump_mmap_release instead
of dump_discard_mem, which invokes the map specific callback.
2024-06-18 21:29:14 +02:00
Helmut Eller
4641f51601 Support dumping bignums
* src/igc.h (enum igc_obj_type): Add IGC_OBJ_DUMPED_BIGNUM_DATA.
* src/igc.h: Allow IGC_OBJ_DUMPED_BIGNUM_DATA in the usual places.
* src/pdumper.c (dump_cold_bignum): Emit IGC_OBJ_DUMPED_BIGNUM_DATA
headers.
2024-06-18 18:41:58 +02:00
Gerd Möllmann
ccfec569bb Fix build with --enable-checking=igc_debug 2024-06-18 13:00:00 +02:00
Gerd Möllmann
f16ff28fdf Remove IGC_OBJ_DUMPED_FWD 2024-06-18 12:49:37 +02:00
Gerd Möllmann
450036294e Remove unused code from pdumper.c, conditionalize code on HAVE_MPS 2024-06-18 12:42:29 +02:00
Gerd Möllmann
d1dc5684eb Check use of pdumper_object_p in igc.c 2024-06-18 12:42:29 +02:00
Gerd Möllmann
fa22956002 Remove unused code, including the mirroring code 2024-06-18 12:42:29 +02:00
Gerd Möllmann
86ff6b62d7 Set IGC_DEBUG with --enable-checking=igc_debug 2024-06-18 08:18:03 +02:00
Gerd Möllmann
41e822c2b5 Fix warnings 2024-06-17 22:20:54 +02:00
Gerd Möllmann
61b12df426 Some comments and refactoring 2024-06-17 22:18:25 +02:00
Gerd Möllmann
fdbf2fbf41 Tentative fix for igc_dump_finish_obj 2024-06-17 22:07:40 +02:00
Helmut Eller
7b0f381993 Don't dump lispfwd objects
The forwarding structs already exist in the data or bss section.
They are all created with DEFVAR_INT and similar macros.  Instead
of creating new structs in the dump, create relocs to the data section.

* src/pdumper.c (dump_field_fwd): New.
(dump_blv, dump_symbol): Use it.
(dump_pre_dump_symbol): Don't dump fwd objects.
2024-06-17 20:22:29 +02:00
Helmut Eller
2343d55dff WIP Remove uses of pdumper_object_p
* src/igc.c (is_mps, igc_xfree, igc_hash): After the first collection,
pdumper_object_p doesn't make much sense any more.
2024-06-17 05:26:32 +02:00
Helmut Eller
4bfd242848 WIP Trace the FWD objects in the dump.
* src/igc.c (fix_symbol):
2024-06-17 05:26:32 +02:00
Helmut Eller
98f3ca9a1e WIP Allocate the dump as a single MPS block
* src/igc.c (dump_mmap_contiguous_mps): New variant of
dump_mmap_contiguous.
(dump_mmap_release_mps): New.
(pdumper_load): Call igc_on_pdump_loaded with more details.
(dump_header): Record some important positions.
(dump_fwd_int, dump_fwd_bool, dump_fwd_obj, dump_fwd_buffer_obj)
(dump_fwd_kboard_obj): Add IGC_OBJ_DUMPED_FWD header.
(dump_charset_table): Add IGC_OBJ_DUMPED_CHARSET_TABLE header.
(dump_cold_charsets): New. Add IGC_OBJ_DUMPED_CODE_SPACE_MASKS header.
(dump_cold_buffer): Add IGC_OBJ_DUMPED_BUFFER_TEXT header.
(Fdump_emacs_portable): Record positions for cold_user_data_start and
heap_end.

* src/igc.h (igc_obj_type): Add some tags to mark object in the dump.
(igc_on_pdump_loaded): Add some arguments for various regions.
(igc_alloc_dump): New.

* src/igc.c (igc_alloc_dump): Implement it.
(igc_on_pdump_loaded): Insert some IGC_OBJ_PAD headers, pin some stuff,
and prepare the text of the buffers.
(builtin_obj_type_and_hash): Allow some of the new object types.
2024-06-17 05:26:32 +02:00
Gerd Möllmann
047110cea5 Remove discard_dump 2024-06-15 16:40:22 +02:00
Gerd Möllmann
4fc39d8ebe Remove unused DEFSYMs 2024-06-15 16:40:22 +02:00
Gerd Möllmann
8b589b2877 Alloc PVEC_THREAD immovable to simplify code 2024-06-15 06:01:24 +02:00
Gerd Möllmann
c19fa49ca4 Fix build on savannah 2024-06-14 10:26:40 +02:00
Gerd Möllmann
b44c954a3c More refactoring 2024-06-14 10:15:30 +02:00
Gerd Möllmann
61f4183d52 Refactoring 2024-06-14 10:15:30 +02:00
Gerd Möllmann
fe06cb9e6a Add comment in igc_replace_char 2024-06-14 10:15:30 +02:00
Gerd Möllmann
f73ba920d7 Fix igc_replace_char and its use 2024-06-14 10:15:30 +02:00
Gerd Möllmann
fe9caf7cd4 Some cleansing 2024-06-14 10:15:30 +02:00
Gerd Möllmann
fb0b7154ee Use set_header to set fields of igc_header 2024-06-14 10:15:30 +02:00
Gerd Möllmann
c10a050a19 IGC_OBJ_HASH_VEC 2024-06-14 10:15:29 +02:00
Gerd Möllmann
68ddda2b1f Add some assertions 2024-06-14 10:15:29 +02:00
Gerd Möllmann
4da6d38d70 Fix build 2024-06-14 10:15:29 +02:00
Gerd Möllmann
52bb2fc94e --enable-checking=igc_check_fwd (not included in checking=all) 2024-06-14 10:15:29 +02:00
Gerd Möllmann
5705333105 Set marker buffer to NULL in igc_remove_marker 2024-06-14 10:15:29 +02:00
Gerd Möllmann
b7f84acc21 Make markers vector smaller initially 2024-06-14 10:15:29 +02:00
Gerd Möllmann
74f1cb73f6 NOT_IMPLEMENTED -> IGC_NOT_IMPLEMENTED 2024-06-14 10:15:29 +02:00
Gerd Möllmann
86180e74cd Fix build 2024-06-14 10:15:29 +02:00
Helmut Eller
2124f8135b Fix some compiler warnings
* src/igc.h (igc_alloc_lisp_obj_vec): Remove redundant declaration.
* src/igc.c: Remove warning about HAVE_TEXT_CONVERSION.  It's not helpful.
2024-06-14 10:15:28 +02:00
Helmut Eller
5dab269243 Dump IGC_OBJ_STRING_DATA with headers
This makes the mirroring code more uniform.

* src/pdumper.c (dump_cold_string): Emit headers.
* src/igc.c (igc_dump_finish_obj): Handle objects in pure space.
(builtin_obj_type_and_hash): Renamed from builtin_obj_type.
(pure_obj_type_and_hash): New helper.
(is_builtin_obj_type): Abort for unrecognized cases.
(mirror_string): Don't copy strings in the cold dump.
2024-06-14 10:15:28 +02:00
Helmut Eller
7aceb9287f WIP some fixes for pure space and obarrays
* src/igc.c (mirror_string): Don't change references to rodata.
(mirror_obarray): Mirror the buckets array.
(mirror_vector): Fix typo.
2024-06-14 10:15:28 +02:00
Gerd Möllmann
89a51ae5c7 Don'r mps_arena_step by default 2024-06-14 10:15:28 +02:00