1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 08:11:05 -08:00
Commit graph

43 commits

Author SHA1 Message Date
Gareth Rees
e5b175a961 Catch-up merge from master sources at changelevel 194484 to branch/2014-10-26/sc.
Copied from Perforce
 Change: 194487
2018-07-06 21:42:35 +01:00
Gareth Rees
052e5fbd18 Consistent order to prologue: include "mpm.h"; platform check; include other mps headers; include system headers; srcid.
Copied from Perforce
 Change: 194107
2018-06-23 11:31:57 +01:00
Gareth Rees
00da8664cd Mach_thread_self() can in theory "return mach_port_null if a resource shortage prevented the reception of the send right" so add a check in each case. (there's nothing we can do about it but at least we can notice.)
Copied from Perforce
 Change: 193831
2018-06-15 12:54:28 +01:00
Gareth Rees
c4a840d676 Rename "mac os x" and "os x" to "macos", except for a few cases where for historical accuracy we want to continue to refer to the former name.
Copied from Perforce
 Change: 193821
2018-06-15 12:15:36 +01:00
Gareth Rees
0662e96899 Refactor atfork code to improve separation of concerns.
Copied from Perforce
 Change: 193806
2018-06-15 10:58:33 +01:00
Gareth Rees
61e24c399a Take locks before fork(), release them in the parent and reinitialize them in the child.
Add forktest target to the Xcode project.
Write design for fork safety and cross-reference from the code.
Update release notes.

Copied from Perforce
 Change: 193760
2018-06-14 16:25:08 +01:00
Gareth Rees
2ccdd80953 Extend forktest so that it does allocation before the fork and collection afterwards; this ensures that we hit the read barrier and thus exercise the exception handling.
After forking in the child, re-create exception port and exception thread, and re-register the (only) thread with that port.

Copied from Perforce
 Change: 193755
2018-06-14 12:54:35 +01:00
Gareth Rees
47fc093662 Add fork test case (fails on os x if pthread_atfork is not called).
pthread_atfork handlers on OS X: in the child, update the mach port for the forking thread and move all other threads to the dead ring.

Copied from Perforce
 Change: 193746
2018-06-13 17:09:07 +01:00
Gareth Rees
0e3d8e373d Add discriminator to mutatorcontextstruct and implement mutatorcontextinitfault and mutatorcontextinitthread on os x.
Copied from Perforce
 Change: 192572
 ServerID: perforce.ravenbrook.com
2016-10-14 12:04:01 +01:00
Gareth Rees
4457a77a07 Initialization and checking of mutatorcontext data structures.
New files prmcix.c and prmcxc.c avoid duplicated code.

Copied from Perforce
 Change: 192562
 ServerID: perforce.ravenbrook.com
2016-10-13 23:13:40 +01:00
Gareth Rees
b4a3d0824b Rename the "protection mutator context" module to "mutator context" (this module handles mutator context decoding for both the protection module and the thread module).
Rename functions Prot{Can,}StepInstruction to MutatorContext{Can,}StepInstruction so that they follow the naming convention in guide.implc.naming.prefix.program.
Move mutator context declarations out of prot.h into new header prmc.h.
Correct .assume.null in a couple of places -- it's not safe for MutatorContextStepInstruction to return ResUNIMPL, instead MutatorContextCanStepInstruction should return FALSE.

Copied from Perforce
 Change: 192528
 ServerID: perforce.ravenbrook.com
2016-10-13 15:06:14 +01:00
Gareth Rees
437bf9c6a4 Rename mutatorfaultcontext to mutatorcontext because this data structure is not only used to store the context of a fault, but also to store the context of a thread that has been suspended.
Copied from Perforce
 Change: 192523
 ServerID: perforce.ravenbrook.com
2016-10-13 14:23:39 +01:00
Richard Brooksby
3de3827d47 Catch-up merge from master sources to branch/2014-10-26/sc.
Copied from Perforce
 Change: 190118
 ServerID: perforce.ravenbrook.com
2016-03-16 17:36:35 +00:00
Richard Brooksby
07987ab579 Eliminating withreservoirpermit and all its variants.
Copied from Perforce
 Change: 190005
 ServerID: perforce.ravenbrook.com
2016-03-13 21:04:01 +00:00
Richard Brooksby
275adfe651 Storing the pointer to the stack frame where setjmp was invoked, rather than the address of the jump buffer, as the hot end of the mutator state, because callee-save registered might be stored on either side of the jump buffer by the compiler.
Removing the unnecessary assumption that the stack ends are word-aligned.

Copied from Perforce
 Change: 189582
 ServerID: perforce.ravenbrook.com
2016-03-03 17:12:43 +00:00
Richard Brooksby
07a1290f3e Eliminating closure_size from area scanners and root registration functions, as it isn't all that useful.
Copied from Perforce
 Change: 189491
 ServerID: perforce.ravenbrook.com
2016-03-01 15:59:06 +00:00
Richard Brooksby
266228be7c Renaming "bottom" and "top" of stack to "cold" and "hot" end, to prevent confusion about descending stacks.
Correcting design documentation relating to stacks.
Referencing hot and cold end concepts from glossary entry for control stacks.

Copied from Perforce
 Change: 189320
 ServerID: perforce.ravenbrook.com
2016-02-18 23:49:58 +00:00
Richard Brooksby
f84e1d8f7e Fixing leftover sizeof(addr) that should've been changed to sizeof(word).
Copied from Perforce
 Change: 189319
 ServerID: perforce.ravenbrook.com
2016-02-18 21:22:05 +00:00
Richard Brooksby
0f8bee3762 Detabifying code and restructuredtext files.
Copied from Perforce
 Change: 189309
 ServerID: perforce.ravenbrook.com
2016-02-18 19:58:13 +00:00
Richard Brooksby
7e04c0f137 Fixing build for os x.
Copied from Perforce
 Change: 189210
 ServerID: perforce.ravenbrook.com
2016-02-16 00:55:23 +00:00
Richard Brooksby
16bde84a68 Generalising tracescanarea to be a checking wrapper for all area scanners.
Copied from Perforce
 Change: 189190
 ServerID: perforce.ravenbrook.com
2016-02-15 15:44:57 +00:00
Richard Brooksby
a3fdda4678 Lifting and generalising area scanners to allow flexible tagging schemes.
Copied from Perforce
 Change: 189189
 ServerID: perforce.ravenbrook.com
2016-02-15 15:30:08 +00:00
Richard Brooksby
c8fed5bb8d Renaming tracescanareamasked to tracescanareatagged
Copied from Perforce
 Change: 189133
 ServerID: perforce.ravenbrook.com
2016-02-11 20:39:57 +00:00
Richard Brooksby
a0e001c000 Catch up merge from master sources.
Copied from Perforce
 Change: 189130
 ServerID: perforce.ravenbrook.com
2016-02-10 21:10:25 +00:00
Richard Brooksby
0141cc951a Resolving review issues in <https://info.ravenbrook.com/mail/2016/01/19/11-51-10/0/>.
Improving documentation.
Fixing minor type misuse.

Copied from Perforce
 Change: 188922
 ServerID: perforce.ravenbrook.com
2016-01-19 16:23:39 +00:00
Gareth Rees
edf30c06b4 New function mps_root_create_reg_masked applies a mask and pattern test to all words in registers and on the stack when scanning them. this supports tagged references in these locations.
Consistently use the type "Word *" for pointers into the stack or into saved registers.
Remove TraceScanAreaTagged.

Copied from Perforce
 Change: 188231
 ServerID: perforce.ravenbrook.com
2015-09-04 12:22:03 +01:00
Gareth Rees
abbdcfc59f Assert if a thread dies while registered, but make a best effort to continue working after the assertion, by marking the thread as dead and moving it to a ring of dead threads.
Copied from Perforce
 Change: 187393
 ServerID: perforce.ravenbrook.com
2014-10-25 17:41:42 +01:00
Gareth Rees
7de068c21b Use aver(testt) when the arena lock is not held.
Copied from Perforce
 Change: 187351
 ServerID: perforce.ravenbrook.com
2014-10-22 20:14:01 +01:00
Gareth Rees
c968255f1e Ensure that code of the form if (condition) statement; is split over two lines, so that it is possible to set a breakpoint on the statement in a debugger.
This change was agreed in 1997 (see <https://info.ravenbrook.com/project/mps/mail/1997/08/19/13-44/0.txt>), so it's about time it was implemented.

Copied from Perforce
 Change: 187071
 ServerID: perforce.ravenbrook.com
2014-09-27 22:57:02 +01:00
Gareth Rees
c77c91056d Consistent order stream, depth.
Copied from Perforce
 Change: 186001
 ServerID: perforce.ravenbrook.com
2014-05-11 18:30:23 +01:00
Gareth Rees
2493f121dc Correct indentation of describe output by passing depth parameter to describe functions and to writef.
Call Describe functions from test cases so that we get coverage.

Copied from Perforce
 Change: 186000
 ServerID: perforce.ravenbrook.com
2014-05-11 18:20:38 +01:00
Gareth Rees
d1b44a4f05 Back out change 185626 (violates the design.mps.writef.snazzy).
Copied from Perforce
 Change: 185941
 ServerID: perforce.ravenbrook.com
2014-05-02 12:44:31 +01:00
Gareth Rees
6721c2b913 Correct indentation of describe output.
Copied from Perforce
 Change: 185626
 ServerID: perforce.ravenbrook.com
2014-04-17 13:36:42 +01:00
Gareth Rees
d3d2795fce Improve control over checking:
1. Where Type is a pointer type with a signature, replace CHECKL(TypeCheck(val)) with CHECKD(Type, val).
2. Where Type is a pointer type with no signature, replace CHECKL(TypeCheck(val)) with CHECKD_NOSIG(Type, val).
3. Where Type is a pointer type with a signature, but the structure is not visible at point of checking, replace CHECKL(TypeCheck(val)) with CHECKD_NOSIG(Type, val). Reference <design/check/#.hidden-type>
4. Make BTCheck extern and use it where possible.
5. Replace AVER(TypeCheck(val)) with AVERT(Type, val).

Copied from Perforce
 Change: 185263
 ServerID: perforce.ravenbrook.com
2014-04-06 22:51:05 +01:00
Richard Brooksby
1772a17e72 Documentation and commentary clarifications in response to code review <https://info.ravenbrook.com/mail/2013/07/11/13-17-56/0/>.
Copied from Perforce
 Change: 182999
 ServerID: perforce.ravenbrook.com
2013-07-11 15:44:19 +01:00
Gareth Rees
f8c90b565e Changes from review <https://info.ravenbrook.com/mail/2013/07/10/14-38-35/0/>.
Copied from Perforce
 Change: 182986
 ServerID: perforce.ravenbrook.com
2013-07-10 15:37:27 +01:00
Richard Brooksby
905c983569 Improving references to documentation and source code.
Copied from Perforce
 Change: 182983
 ServerID: perforce.ravenbrook.com
2013-07-10 14:12:46 +01:00
Richard Brooksby
01d17882e6 Reducing unnecessary copying of thread states by passing a pointer to the state in the mutator fault context.
Copied from Perforce
 Change: 182980
 ServerID: perforce.ravenbrook.com
2013-07-05 17:43:14 +01:00
Richard Brooksby
a4b67cf92a Lots of tidying up, deleting unnecessary code, and adding documentation.
Copied from Perforce
 Change: 182926
 ServerID: perforce.ravenbrook.com
2013-07-05 00:36:13 +01:00
Richard Brooksby
30e439b2c5 Registering exception handler for each thread, rather than the whole task.
This avoids the need to forward exception messages to the debugger, since we can reasonably insist that we're the first handler in the chain for each thread.

Copied from Perforce
 Change: 182925
 ServerID: perforce.ravenbrook.com
2013-07-04 22:58:34 +01:00
Richard Brooksby
96448d34a9 Initial implementation of mac os x protection exception handling using mach.
Some threading tests get quite a long way.

Copied from Perforce
 Change: 182872
 ServerID: perforce.ravenbrook.com
2013-06-29 01:22:42 +01:00
Richard Brooksby
512dca47e2 Thread scanning for mac os x / mach, and the start of thread exception handling.
Copied from Perforce
 Change: 182834
 ServerID: perforce.ravenbrook.com
2013-06-22 09:02:35 +01:00
Richard Brooksby
c1e5ec8f38 Implementing os x (mach) threading module.
Copied from Perforce
 Change: 182830
 ServerID: perforce.ravenbrook.com
2013-06-21 23:57:07 +01:00