1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-23 07:12:12 -07:00
Commit graph

2916 commits

Author SHA1 Message Date
Helmut Eller
a600803f9d Fix for segment splitting
* mps/code/seg.c (segTrivSplit): Initialize the the ephemeron related
bits.
(segTrivMerge): Assert that the ephemeron related bits match.
2026-02-28 18:36:40 +01:00
Helmut Eller
5b5fef97ca Minor simplification
* mps/code/trace.c (tracePropagateToLowerRanks): Move the hack from
traceFindGrey to here and simplify it a bit.
* (traceScanSegRes): Remove a debugging assertion that can't fail.
2026-02-22 17:08:20 +01:00
Helmut Eller
0b9f87aa5c * mps/code/poolawl.c (aephFixKey): Add the fixed key to the summary. 2026-02-22 17:06:17 +01:00
Helmut Eller
43b493ffce Add another workaround for the ephemeron pool
Disabling write barrier deferral in config.h, uncovered a second
problem: mps/test/function/eph1.c fails because segments aren't scanned
if the segment's summary doesn't intersect with the white set.

* mps/code/trace.c (traceFindGrey): Force rescanning by adding the white
set to the segments summary.
2026-02-11 09:53:40 +01:00
Helmut Eller
b17532a1d7 Add a workaround for a failing assertion
In traceScanSegRes, the assertion

  AVER(RefSetSub(ScanStateUnfixedSummary(ss), SegSummary(seg)));

can fail if we call MPS_FIX1 on a reference but not MPS_FIX2.  In a
normal Emacs session that tends to happen after ~10 minutes.  If "write
barrier deferral" is disabled in config.h, then the tests in
mps/test/function/eph1.c will also run into this assertion.

I failed to create a reproducible test with write barrier deferral
enabled.  Obvioulsy, I don't understand this issue fully.

* mps/code/poolawl.c (aephFixKey): Include the key in the SegSummary.
(aephIsWhite): Return the new reference, so that we can avoid calling
MPS_FIX2 twice.
2026-02-11 09:53:40 +01:00
Helmut Eller
c067ff171e Handle accesses to protected AMC segments while in ephemeron band
* mps/code/trace.c (TraceRankForAccess): While in the ephemeron band,
use RankFINAL for final segments and RankEXACT for the others.
* mps/test/function/eph5.c: New Test.
* mps/test/testsets/passing: Include eph5.c.
* mps/test/test/testlib/ephfmt.h (union header): Use a one-word header.
* mps/test/test/testlib/ephfmt.c: Update accordingly.
* mps/test/function/eph1.c: Update accordingly.
2026-02-02 17:27:23 +01:00
Helmut Eller
a06d8bd6b9 Add a pool for ephemerons
Ephemerons solve the key-in-value problem for weak key/value pairs.  It
seems that it's not possible to solve that problem with weak pointers or
finalizers.  Basically we want a weak key/value pair that implements the
rule:

  The value is reachable, if the key is reachable.

The key-in-value problem occurs if all paths to the key go through the
value.  In this situation, the key is considered reachable only if the
value is "externally reachable", i.e. the value is reachable through a
path other than through the weak pair.

Such weak pairs seem to need an extra phase in the GC algorithm.  See
[1] for some variants of the algorithm.

https://www.haible.de/bruno/papers/cs/weak/WeakDatastructures-writeup.html

* mps/code/mpmst.h (SegStruct): Add fields propagationNeeded,
marksChanged, and propagationFinished.
* mps/code/mpmtypes.h (RANK_LIST): Add EPHEMERON rank.
* mps/code/mps.s (mps_rank_ephemeron): New prototype.
* mps/code/mpscawl.h (mps_class_aeph, mps_fix_weak_pair)
(mps_fix_weak_or_pair, mps_fix_weak_and_pair): New prototypes.
* mps/code/mpsi.c (mps_rank_ephemeron): New function.
* mps/code/poolawl.c (AEPHSegStruct, AEPHPoolStruct): New. The
implementation the ephemeron pool.
* mps/code/seg.c (segAbsInit): Initialize propagationNeeded,
marksChanged, and propagationFinished.
* mps/code/trace.c (traceBandRetreat, tracePropagateToLowerRanks)
(moveSegToEndOfGreyRing): New helpers.
(TraceRankForAccess): Handle the RankEPHEMERON.
(traceFindGrey, traceScanSegRes): Add special handling for ephemeron
segments.
* mps/test/function/eph1.c: New test file.
* mps/test/function/eph2.c: New test file.
* mps/test/function/eph3.c: New test file.
* mps/test/function/eph4.c: New test file.
* mps/test/test/testlib/ephfmt.c: New file.
* mps/test/test/testlib/ephfmt.h: New file.
* mps/test/test/testlib/manifest: Add ephfmt.c.
* mps/test/testsets/passing: Include eph{1,2,3,4}.c.
2026-01-23 08:48:40 +01:00
Helmut Eller
891938de73 * mps/code/global.c (GlobalsDescribe): Include tracedTime. 2025-11-26 10:41:34 +01:00
Helmut Eller
0d79158b3b * mps/code/poolamc.c (AMCBufInit): Accept optional MPS_KEY_GEN arg. 2025-11-17 20:57:18 +01:00
Helmut Eller
0028b33d23 Recognize some Amd64 instruction patterns
* mps/code/prmci6.c (IsSimpleMov): Actually do something.
(IsRexPrefix, DecodeSimpleMov, RexR, RexB, RexX, DecodeDisp32)
(SignedInsElt, RegValue, DecodeModRM, DecodeSIB, DecodeCB): New helpers.
* mps/code/prmctest.c: New file.
* mps/code/comm.gmk: Add prmctest.
* mps/tool/testcases.txt: Here too.
2025-10-11 20:33:40 +02:00
Helmut Eller
58a9768528 Ignore dangling-pointer warning
* mps/code/ss.c (StackHot): [MPS_BUILD_GC]: On more platforms, not only
__MINGW32__.
2025-10-11 20:18:34 +02:00
Helmut Eller
f0eaa4ff78 * mps/code/poolawl.c (AWL0Init): Stick to C89. 2025-10-11 20:15:09 +02:00
Eli Zaretskii
d8e1669b3f ; * mps/code/arenacv.c (TEST_ARENA_SIZE): Fix a typo. 2025-10-10 10:01:44 +03:00
Helmut Eller
9d81d966a6 Implement an experimental AWL0 pool
Mostly boilerplate code to override the SegAccess method of AWLSeg.

* mps/code/poolawl.c (AWL0Pool, AWL0Seg): New classes.
(awl0SegAccess, awl0BufferFill): New methods.
2025-10-09 18:32:21 +02:00
Ken Brown
b57067e8a0 Support the Cygwin build of MPS
* mps/code/prmccyi6.c:
* mps/code/cyi6gc.gmk: New files, for the Cygwin build.

* mps/code/config.h:
* mps/code/lockix.c:
* mps/code/prmcix.c:
* mps/code/protix.c:
* mps/code/protsgix.c:
* mps/code/pthrdext.c:
* mps/code/testthr.h:
* mps/code/thix.c:
* mps/code/vmix.c: Port to Cygwin.

* mps/configure.ac (x86_64-*-cygwin*/no): Add definitions for
Cygwin.

* mps/code/mps.c [MPS_PF_CYI6GC]:
* mps/code/mpstd.h: Define 64-bit Cygwin stuff.

* mps/code/gcbench.c: [MPS_OS_CY]:
* mps/code/djbench.c [MPS_OS_CY]: Include alloca.h.

* mps/code/arenacv.c (TEST_ARENA_SIZE) [MPS_OS_CY]: Increase to
make test pass.  (Bug#74805)

* mps/code/arenavm.c (VMArenaCreate): Avoid compiler warning.
2025-10-08 10:33:45 -04:00
Eli Zaretskii
d17571dfb9 Fix MinGW build of mps/code/eventsql.c
* mps/code/eventsql.c (PRINTF_ARCHETYPE) [__MINGW32__]: Define as
__gnu_printf__ for MinGW builds, to support ANSI- and GNU-compatible
format specs.
(vlog, evlog, error): Use PRINTF_ARCHETYPE.
2025-09-27 10:07:26 +03:00
Helmut Eller
be1fb95983 Don't compile forktest on the anangc platform
* mps/code/comm.gmk (TEST_TARGETS): Exclude forktest.
2025-09-25 18:38:13 +02:00
Helmut Eller
4de8c79615 * mps/code/comm.gmk (testratio): Add EXEEXT. 2025-09-25 18:27:44 +02:00
Eli Zaretskii
0cc5f338c4 ; * mps/code/mps.h (mps_word_t): Fix condition for MinGW64. 2025-09-25 11:39:05 +03:00
Eli Zaretskii
265981c232 Support the MinGW build of MPS and tests, part 2
* mps/code/mingw.gmk (CFLAGSCOMPILERSTRICT): Use gnu99, not gnu89.

* mps/configure.ac (EXEEXT): Define and use for program names.
(i*86-*-mingw*/no, x86_64-*-mingw*/no): Add definitions for MinGW.
2025-09-24 16:28:33 +03:00
Eli Zaretskii
e722ec9cfe Support the MinGW build of MPS and tests, part 1
* mps/code/w3i6gc.gmk:
* mps/code/w3i3gc.gmk:
* mps/code/mingw.gmk: New files, for the MinGW build.

* mps/code/ss.c (StackHot) [__MINGW32__ && __GNUC__ >= 12]: Ignore
dangling-pointer warnings.

* mps/code/global.c (ArenaFinalize): Avoid compiler warnings.

* mps/code/thw3.c (ThreadScan): Avoid compilation errors due to
prototype mismatch.

* mps/code/testlib.h (alloca): Don't redefine for MinGW.
(setenv): Don't redefine for mingw.org's MinGW.
(ulongest_t, longest_t): Separate definitions for MinGW64.

* mps/code/testlib.c (sizelog2) [__MINGW32__]: Fix comparison.
(rnd_align): Avoid name clashes with 'min' and 'max'.

* mps/code/spw3i3.c (StackProbe) [__GNUC__]: Implementation for
MinGW.

* mps/code/protw3.c: Avoid compiler warning.

* mps/code/mpstd.h: Define MinGW (_X86_) and MinGW64 (__X86_64)
configurations.

* mps/code/mpsiw3.c (mps_SEH_filter, mps_SEH_handler): Add
prototypes.

* mps/code/mps.c [MPS_PF_W3I3GC]: Define 32-bit MinGW stuff.
[MPS_PF_W3I6GC]: Define 64-bit MinGW64 stuff.

* mps/code/lockw3.c (RTL_RUN_ONCE, PRTL_RUN_ONCE_INIT_FN)
(RTL_RUN_ONCE_INIT, INIT_ONCE_STATIC_INIT, RTL_RUN_ONCE INIT_ONCE)
(PRTL_RUN_ONCE PINIT_ONCE, PINIT_ONCE_FN, InitOnceExecuteOnce):
Define for mingw.org's MinGW.

* mps/code/comm.gmk (EVENT_TARGETS, EXTRA_TARGETS, TEST_TARGETS)
(UNBUILDABLE_TARGETS): Add $(EXEEXT) to program names.
(TESTTHR): Define correct test for MS-Windows.
Don't fail the build if the *.d dependency files don't exist.
2025-09-24 13:02:30 +03:00
Helmut Eller
7c2bdaa548 Support out-of-tree builds
* mps/example/scheme/Makefile.in (VPATH): Set VPATH.
* mps/Makefile.in (COMMON_OPTS): New.  Pass SRCDIR down to sub-make.
* mps/code/comm.gmk (VPATH): Set VPATH from SRCDIR parameter
* mps/configure.ac (AC_CONFIG_COMMANDS): Copy .gmk makefiles and some
other things to the biuld directory.
2025-09-22 16:56:02 +02:00
Helmut Eller
7f3726d9a0 Better support for parallel make
* mps/code/comm.gmk (LIB_TARGETS, TEST_TARGETS, EVENT_TARGETS)
(TEST_SUITES, testmmqa): If VARIETY is not defined, then disable
parallism with .NOTPARALLEL.  Otherwise, avoid the recursive make with
a static pattern rule.
(clean-testansi, clean-testpollnone): New.
* mps/Makefile.in (build-via-make): Invoke submake explicit
VARIETY argument to allow more parallelism.
(test-make-build): Use clean-testansi and clean-testpollnone.
2025-09-15 08:23:25 +02:00
Gerd Möllmann
b736f9e6a4 * mps/code/mps.h (MPS_RM_PROT_INNER): Fix MPS issue #285. 2025-09-13 13:26:07 +02:00
Helmut Eller
771092f9e6 * mps/code/global.c (ArenaStep): Fix calculation of available time. 2025-09-13 13:23:52 +02:00
Helmut Eller
5eb8f34dbb Un-rename .gitignore 2025-09-13 10:03:13 +02:00
Richard Brooksby
3ce08c972f Clarifying that two avers are implementing .assume.parked in response to review comment <https://github.com/ravenbrook/mps/pull/298#issuecomment-2503792676>. 2024-11-27 13:25:08 +00:00
Richard Brooksby
a95e4aedc0 Removing unused variable that triggered the unused-but-set-variable warning when building on macos 14.7.1 with clang 15.0. 2024-11-27 13:25:08 +00:00
Bruce Mitchener
2e417719d4 Fix typos. 2024-11-26 22:10:23 +07:00
Richard Brooksby
013db39485 Catch-up merge from 'master into branch/2023-04-13/transforms 2023-06-17 11:35:18 +01:00
Richard Brooksby
5288a6b846 Adding references and clarifications in response to review <https://github.com/ravenbrook/mps/pull/214#discussion_r1230995545> and <https://github.com/ravenbrook/mps/pull/214#discussion_r1230997932>. 2023-06-17 11:33:25 +01:00
Richard Brooksby
1ea596e4f7 Cross-referencing rank assumptions in response to review <https://github.com/ravenbrook/mps/pull/214#discussion_r1230993565>. 2023-06-17 11:33:25 +01:00
Richard Brooksby
91d47dfb7d Catch-up merge from master into branch/2023-05-31/hash-arrays 2023-06-17 11:30:34 +01:00
Richard Brooksby
3e57b5a0ce Removing bogus test block introduced in 1a5ac67e7 that does not work when transforms are empty or trivial. raising this for later in github issue.
GitHub-reference: https://github.com/Ravenbrook/mps/issues/242
2023-06-16 13:02:43 +01:00
Richard Brooksby
d86a09e66f Enforcing parking restrictions when adding references to transforms in response to review <https://github.com/ravenbrook/mps/pull/214#discussion_r1230987289>. 2023-06-16 12:48:42 +01:00
Richard Brooksby
8ced8925b9 Clarifying why and documenting that transformed references must be in automatic pools, in response to review <https://github.com/ravenbrook/mps/pull/214#issuecomment-1590952221>. 2023-06-16 12:29:06 +01:00
Richard Brooksby
1a5ac67e71 Transforms are no longer implicitly destroyed by applying them, making the interface more consistent with the rest of the mps and simplifying the documentation. in response to review <https://github.com/ravenbrook/mps/pull/214#discussion_r1231004625>. 2023-06-16 11:58:34 +01:00
Richard Brooksby
d76c584d31 Adding spaces to conform to rule.code.style.control. 2023-06-16 09:43:52 +01:00
Richard Brooksby
597422484c Removing mpsitr.c, a relic of custom/cet, and merging its contents into mpsi.c. reponse to review <https://github.com/ravenbrook/mps/pull/214#issuecomment-1590952221>. 2023-06-16 09:33:58 +01:00
Richard Brooksby
021fff8643 Clarifying comments on tablecreate in response to review <https://github.com/ravenbrook/mps/pull/214#issuecomment-1590952221> 2023-06-16 09:19:52 +01:00
Richard Brooksby
40e6c06da3 Moving transforms design statements out of leader comment of trans.c, updating, clarifying, and cross-referencing, in response to review <https://github.com/ravenbrook/mps/pull/214#issuecomment-1590952221>. 2023-06-16 09:14:14 +01:00
Richard Brooksby
6e268e53ff Converting fixmes to comments containing what we have deduced about the test, and converting some to todos. linking issues to be resolved. 2023-06-16 07:43:57 +01:00
Jonathan Holburn
6bbf8a76bf Performing proc.review.edit 2023-06-15 18:19:53 +01:00
Jonathan Holburn
7511d24547 Make addrobj.c more verbose 2023-06-15 12:06:18 +01:00
Jonathan Holburn
e407bbc0d2 Reintroduce comments that went missing during the original work to port this functionality from configura's mps-preview 2023-06-15 11:51:17 +01:00
Jonathan Holburn
27cf30e15f Add fixmes to ztfm.c testbench after walkthrough with rb 2023-06-15 11:14:22 +01:00
Richard Brooksby
b6f049a4ac Catch up merge from master into branch/2023-05-16/interior-pointers 2023-06-15 09:28:49 +01:00
Richard Brooksby
1bb9a04b62 Improving comments on amcaddrobject in response to review <https://github.com/ravenbrook/mps/pull/223#pullrequestreview-1432893665>. 2023-06-15 09:21:55 +01:00
Richard Brooksby
e4d20ac7d4 Removing redundant user documentation in response to review <https://github.com/ravenbrook/mps/pull/223/files#r1197946092> 2023-06-15 09:01:16 +01:00
Richard Brooksby
351e34a2b4 Suppressing "may be used uninitialized" warning in rash build with gcc 11.3.0. 2023-06-14 09:13:09 +01:00