1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-26 21:20:30 +02:00
Commit graph

21803 commits

Author SHA1 Message Date
Ekaitz Zarraga
746660bf08 riscv: movi: use addiw in RV64 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
019cd02410 riscv: movi: sign extend hi 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
741af987a3 riscv: fix load size for ldxi instructions 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
33eddc7b62 riscv: simplify load from pool 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
8c7990d4a1 riscv: fix literal pool guard jump address calc 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
fb527804f9 riscv: add get_callr_temp 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
c6008fd0ab riscv: fix the B and J type size check 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
93380fc377 riscv: clean patch jumps 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
f6f2a757c3 riscv: don't pack veneers, use padding 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
76549a674a riscv: Pack the veneer struct 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
775d11b21e riscv: Add fence 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
3edd48b046 Fix CI 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
797fe5067c Add RISCV to CI and makefile 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
cbd72e71a7 RISC-V Support 2025-01-29 14:01:52 +01:00
Ekaitz Zarraga
23c4e36dca Makefile: RISCV support and optional vars
Optional variables are needed because the structure of the makefile
is prepared to run on Guix but Guix doesn't support RISCV yet, so it's
better to set them as optional and let the user decide how do they want
to compile this thing.
2025-01-29 14:01:52 +01:00
Andy Wingo
41a2a60fa1 Merge branch 'reinterpret' into 'main'
Add movr_f_i, movr_i_f, movr_d_l, movr_l_d

See merge request wingo/lightening!27
2025-01-29 11:17:25 +00:00
Andy Wingo
11918685e1 Add movr_f_i, movr_i_f, movr_d_l, movr_l_d
These move values verbatim between FPRs and GPRs.
2025-01-29 12:14:59 +01:00
Andy Wingo
624d78625b Avoid accidentally-quadratic use of intmap-keys
* module/language/cps/utils.scm (compute-reachable-functions): Rework to
not call intmap-keys on a data structure that we are building up in a
loop.
2025-01-27 10:24:01 +01:00
Andy Wingo
b517464d7f copy-space: refactor to copy_space_can_allocate 2025-01-24 16:11:11 +01:00
Maxim Cournoyer
f109baebc0 doc/srfi-64: Fix typos and add examples.
* doc/ref/srfi-modules.texi (SRFI-64 Writing Basic Test Suites): Fix
  typo.  Add default test runner example.  Add test-approximate and
  test-error examples.  Document valid error types in Guile for test-error.

  (SRFI-64 Conditonal Test Suites and Other Advanced Features): Fix typo.

Fixes <https://bugs.gnu.org/75041>.

Suggested-by: Arne Babenhauserheide <arne_bab@web.de>
2025-01-24 10:54:01 +01:00
Rob Browning
48b1c4eff4 fport_print: handle ttyname ENODEV
In some situations, ttyname may return ENODEV even though isatty is
true.  From ttyname(3):

  A process that keeps a file descriptor that refers to a pts(4) device
  open when switching to another mount namespace that uses a different
  /dev/ptmx instance may still accidentally find that a device path of
  the same name for that file descriptor exists.  However, this device
  path refers to a different device and thus can't be used to access the
  device that the file descriptor refers to.  Calling ttyname() or
  ttyname_r() on the file descriptor in the new mount namespace will
  cause these functions to return NULL and set errno to ENODEV.

Observed in a Debian riscv64 porterbox schroot.

When ttyname fails with ENODEV, just include the file descriptor integer
value instead.  Call ttyname() directly to avoid having to catch the
ENODEV.

* libguile/fports.c (fport_print): fall back to the integer fd when
ttyname() fails with ENODEV.
2025-01-23 12:49:33 -06:00
Andy Wingo
68e3a692f5 Fix bug with lospace in generational configurations 2025-01-23 19:24:57 +01:00
Andy Wingo
7049871484 lospace: Fix bug when splitting freelist entries 2025-01-23 17:22:29 +01:00
Andy Wingo
7a5c994613 lospace: Add missing lock in allocation path 2025-01-23 17:12:34 +01:00
Andy Wingo
2c72034a1c Fix bug in mmc for new lospace locking discipline 2025-01-23 15:19:09 +01:00
Andy Wingo
7a9de35aaa lospace: Rely on object_map to be immutable during collection
This avoids having multiple threads serialize through a mutex.  We still
have to allow for mutation on object_tree and remembered_edges, though.
2025-01-23 15:06:44 +01:00
Rob Browning
63756efbc5 Don't hold lock during scm_async_tick in readdir and ttyname
Only hold scm_i_misc_mutex while making the C calls.  This also avoids
the need for a dynamic-wind.  Add SCM_I_LOCKED_SYSCALL (similar to
SCM_SYSCALL) to handle the locking and EINTR loop.

libguile/filesys.c (scm_readdir): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/filesys.c (scm_ttyname): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/syscalls.h: add SCM_I_LOCKED_SYSCALL.
2025-01-22 19:24:07 -06:00
Andy Wingo
4a6347c371 Optimize ordering edges in fix-letrec
* module/language/tree-il/fix-letrec.scm (compute-sccs): Instead of
depending on all previous complex bindings, we can just depend on the
most recent one.  Decreases the graph size.
2025-01-22 16:51:28 +01:00
Andy Wingo
47dce42edb Use transient intset/intmap optimizations when computing SCCs
* module/language/cps/graphs.scm (compute-sorted-strongly-connected-components):
Use more transient data structures.
2025-01-22 16:50:52 +01:00
Andy Wingo
60c1e5cc42 Fix bad algorithmic growth in fix-letrec
We were using list sets, which when you end up with thousands of
bindings in an SCC reaches the point where we are off the quadratic end
of the curve.  Fix to use intsets and intmaps instead.

* module/language/tree-il/fix-letrec.scm (compute-ids): New function.
(compute-referenced-and-assigned): Rename from analyze-lexicals, and
compute intsets.
(make-compute-free-variables): Rename from free-variables, return a
procedure instead of a hash table, and use intsets.  Use a global cache
to avoid quadratic behavior with regard to binding depth.
(compute-complex): Compute a global set of "complex" variables, as an
intset.
(compute-sccs): Use intsets and intmaps to compute the free-variable and
ordering edges.
(fix-scc, fix-term): Refactorings.
(reorder-bindings): Avoid a linear search.
(fix-letrec): Refactor.
2025-01-22 14:56:32 +01:00
Andy Wingo
787e49f137 Fix a check in the Tree-IL verifier
* module/language/tree-il/debug.scm (verify-tree-il): Fix
pattern-matching.
2025-01-22 12:14:30 +01:00
Andy Wingo
7885ea1037 nofl: Prevent needless expansion
Releasing memory proceeds until there is (-NOFL_BLOCK_SIZE,0] bytes to
release; we should only expand when the number of bytes to reacquire is
large enough.
2025-01-21 21:12:45 +01:00
Andy Wingo
2a51399896 nofl: Disable some consistency checks when tracing conservatively 2025-01-21 21:09:03 +01:00
Yuval Langer
0b501477f9 Fix faulty SRFI-31 example. 2025-01-20 10:52:49 +01:00
Daniel Llorens
bf3c632b82 Fix bug in srfi-111 box printer
* module/srfi/srfi-111.scm: Add missing port.
* test-suite/tests/srfi-111.test: Test.
2025-01-16 15:47:03 +01:00
Andy Wingo
f93777c133 generational-pcc: Make a smaller pending-ephemeron nursery table
Otherwise we end up visiting a pending-ephemeron set that is
proportional in size to the whole heap.
2025-01-15 22:32:31 +01:00
Andy Wingo
685c63ab3a Trim remembered-set during minor GC
When visiting remembered-set roots, if the target is no longer in
newspace, forget the edge.
2025-01-15 22:31:48 +01:00
Mikael Djurfeldt
8ac25f3fae README: Add dependency on autopoint 2025-01-13 22:51:35 +01:00
Andy Wingo
cc68a9a610 Update docs 2025-01-13 21:42:18 +01:00
Andy Wingo
f9c2ce04d4 Add generational-pcc to embed.mk 2025-01-13 21:08:13 +01:00
Andy Wingo
ba65e32b00 pcc / copy-space: Allow allocations to fail
This fixes an issue in which minor collection of a nursery full of live
data can fail because of fragmentation, whereas really it should just
fall back to promotion.
2025-01-13 17:22:43 +01:00
Andy Wingo
5fdb14cc5e Remove "ABORTED" atomic forwarding state
It was not distinguishable from "NOT_FORWARDED".
2025-01-13 16:44:12 +01:00
Andy Wingo
b23b77218c nofl space: Fix a bug for parallel optimistic evacuation
If two tracer threads visit edges to the same object on an evacuation
candidate block, and they first see that the object is unmarked, then
they both try to evacuate it at the same time.  Thread A might try and
fail before thread B manages to acquire the forwarding word.  B needs to
see that A marked it in place, and to do that it needs to re-load the
mark byte after acquiring the forwarding word.  Otherwise perhaps B
could succeed and you would end up with two copies of an object, one of
them garbled!
2025-01-13 16:28:40 +01:00
Andy Wingo
e41000094d Add missing write barriers to finalizers.c 2025-01-13 10:23:47 +01:00
Andy Wingo
b37a7f3862 copy-space: Fix bug computing field logging byte location
Also re-enable survivors in generational-pcc :)
2025-01-13 09:12:34 +01:00
Andy Wingo
27f9a1f01e gpcc: Temporarily always promote survivors
Generational PCC is still a bit buggy.
2025-01-10 16:40:19 +01:00
Andy Wingo
4ab72e92b0 gpcc: Don't mix survivors and new objects in same block 2025-01-10 16:40:19 +01:00
Andy Wingo
c95b7ef046 New collector configuration: generational-pcc 2025-01-10 16:40:19 +01:00
Andy Wingo
65b74b5abb Add generational support to pcc 2025-01-10 16:40:14 +01:00
Andy Wingo
0b8630145a Copy space clears log bits when obtaining fresh blocks 2025-01-10 16:05:34 +01:00