1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-19 04:10:18 -08:00
Commit graph

128 commits

Author SHA1 Message Date
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
Gareth Rees
9bb6b2f8be Tidy-up of attributes and pool classes:
* Bring design up to date.
* New function PoolHasAttr encapsulates attribute checking.
* Abstract classes are abstract and mustn't be checked.
* The dummy pool class in fotest needs a size.
* Abstract pool classes null out methods that they can't provide a generic implementation for, to force subclasses to provide one.
* New function PoolTrivFramePopPending provides a generic implementation of that method.
* Rename PoolNoFreeWalk to PoolTrivFreeWalk since it has NOOP rather than NOTREACHED.
* Check that AttrMOVINGGC implies AttrGC.
* Remove unimplemented attributes (BUF_RESERVE, BUF_ALLOC, INCR_RB, INCR_WB, PM)
* AMC now inherits from AMCZ instead of the other way round. This is simpler: AMC adds features to AMCZ rather than AMCZ taking features away (and not quite getting it right).
* Similarly, LO inherits from AbstractSegBufPoolClass + PoolClassMixInCollect so that it doesn't have to clear AttrSCAN and the scan methods.
* Fix bug in MFSCheck -- mustn't check unroundedUnitSize >= UNIT_MIN since small unit sizes are rounded up to UNIT_MIN.
* Don't see AttrFREE in MRG (since no free method is supplied).
* Check AttrSCAN systematically (in PoolScan and SegCheck) rather than opportunistically in TraceStart and TraceQuantum.

Copied from Perforce
 Change: 185231
 ServerID: perforce.ravenbrook.com
2014-04-04 17:05:08 +01:00
Gareth Rees
b2ec897e6b Support the clang address sanitizer.
Copied from Perforce
 Change: 185096
 ServerID: perforce.ravenbrook.com
2014-03-30 18:51:53 +01:00
Gareth Rees
f025b00534 Turn on -wunreachable-code for gcc and clang.
Remove unreachable code:
* No need to have different debug options or structured allocation classes for different platforms.
* Don't use STATISTIC_BEGIN, use STATISTIC_STAT.
* #ifdef away the unused code in zmess.c for testing ControlAlloc failure.
* Remove unused code from the example Scheme interpreter.

Copied from Perforce
 Change: 185089
 ServerID: perforce.ravenbrook.com
2014-03-30 14:26:02 +01:00
Richard Brooksby
d8cb7e9a01 Catch-up merge from master, mainly to pick up chain-zones merge.
Copied from Perforce
 Change: 184343
 ServerID: perforce.ravenbrook.com
2014-02-14 15:23:36 +00:00
Richard Brooksby
e6ff3a648f Merging branch //info.ravenbrook.com/project/mps/branch/2014-01-29/mps-chain-zones/... into master.
Copied from Perforce
 Change: 184342
 ServerID: perforce.ravenbrook.com
2014-02-14 15:15:07 +00:00
Richard Brooksby
8679bb210f Catch-up merge from master, mainly to pick up gcbench.
Copied from Perforce
 Change: 184335
 ServerID: perforce.ravenbrook.com
2014-02-12 17:39:31 +00:00
Richard Brooksby
f1d5750639 Adding a cache of free pages per zone to the arena, so that we recycle single pages fast, especially after each reclaim.
Copied from Perforce
 Change: 184324
 ServerID: perforce.ravenbrook.com
2014-02-11 15:23:32 +00:00
Richard Brooksby
8a3dc7c98a Fixing gcc warnings found in https://travis-ci.org/ravenbrook/mps-temporary/jobs/17977403
Copied from Perforce
 Change: 184271
 ServerID: perforce.ravenbrook.com
2014-01-31 15:49:14 +00:00
Richard Brooksby
f719851f50 Since the dynamic generation is shared between chains (for some reason) using its unified zone set, rather than keeping a special zone set per chain, which would’ve used up more zones.
Using arena->topGen->mortality for the dynamic generation’s mortality, rather than a global variable.

Copied from Perforce
 Change: 184216
 ServerID: perforce.ravenbrook.com
2014-01-29 13:49:42 +00:00
Richard Brooksby
56d48bbd1d iterating over segments using the pool and segment rings, rather than scanning the tract table, which may be full of irrelevant tracts, especially when non-gc pools are large. see <https://info.ravenbrook.com/mail/2014/01/25/12-16-09/0/>.
Copied from Perforce
 Change: 184120
 ServerID: perforce.ravenbrook.com
2014-01-25 15:33:10 +00:00
Gareth Rees
ea9df0b2b7 Merge custom cet mainline into the master sources. this includes fixes for job003519 (clock values in text telemetry logs on windows have top 32 bits zero), job003536 (cet office can't replicate 100k snowmen in reasonable time), job003651 (stack overflows are not reliably handled).
Copied from Perforce
 Change: 183926
 ServerID: perforce.ravenbrook.com
2014-01-10 14:16:08 +00:00
Gareth Rees
1c4ff669ac Remove diag facility.
Copied from Perforce
 Change: 182553
 ServerID: perforce.ravenbrook.com
2013-06-05 18:35:40 +01:00
Richard Brooksby
3b37d681c2 Linking tags to mmprevol requests (e.g. request.epcode.12345) to their location on info.ravenbrook.com.
Copied from Perforce
 Change: 182526
 ServerID: perforce.ravenbrook.com
2013-06-05 00:57:04 +01:00
Richard Brooksby
5c6785b815 Catch-up merge from custom/cet/main to master.
Includes installable assertion handler, events in circular memory buffers, LARGEADDRESSAWARE, etc.

Copied from Perforce
 Change: 182176
 ServerID: perforce.ravenbrook.com
2013-05-24 19:42:46 +01:00
Richard Brooksby
c4d6a2de1f Merging spelling corrections contributed by bruce mitchener.
See <1c80ccb634>.

Copied from Perforce
 Change: 180956
 ServerID: perforce.ravenbrook.com
2013-02-18 15:46:39 +00:00
Richard Brooksby
85f3d6bbb4 Short-circuit the cases where we set the greyness or summary of a segment to the same as it was before in all cases, rather than just in a few restricted cases in amc.
This was the result of noticing a large number of SetSetGrey events that set the segment to the same greyness when scanning ambiguous references.

Copied from Perforce
 Change: 179567
 ServerID: perforce.ravenbrook.com
2012-09-19 20:04:41 +01:00
David Lovemore
1ece8c4ccb Remove whiteminalign handling code which was used to calculate a mask for scanning in tracescanareatagged. for now we use sizeof(word)-1, which will work for dylan and configura.
Copied from Perforce
 Change: 179393
 ServerID: perforce.ravenbrook.com
2012-09-10 15:17:38 +01:00
Richard Brooksby
5a604a2f51 Fixing bugs introduced by type puns passed through scanning methods, discovered by offsetting mps_ss_s from the beginning of scanstatestruct.
Adding a pseudo-target "find-puns" which, on FreeBSD mostly, prints useful warnings about strict aliasing rule violations.
Fixing more strict aliasing rule violations found by the above.

Copied from Perforce
 Change: 179358
 ServerID: perforce.ravenbrook.com
2012-09-07 23:48:14 +01:00
Richard Brooksby
d6b37e23c5 Correcting use of parent in trace.c. oops.
Copied from Perforce
 Change: 179348
 ServerID: perforce.ravenbrook.com
2012-09-07 21:25:00 +01:00
Richard Brooksby
e8d345149f Adding references to critical path design.
Fixing cast from external scan state structure to a PARENT, now that we're not punning the pointer any more.

Copied from Perforce
 Change: 179347
 ServerID: perforce.ravenbrook.com
2012-09-07 20:49:05 +01:00
Richard Brooksby
78d5f049f0 Eliminating type puns on scan states, location dependencies, and allocation points through the mps interface.
Now that we're recommending inlining with client code and optimising with -O2 or -O3, we can't afford any bug introduced by the strict aliasing rule.

Copied from Perforce
 Change: 179322
 ServerID: perforce.ravenbrook.com
2012-09-07 12:58:57 +01:00
Richard Brooksby
858e4ac0ac Partial merge of branch/2012-07-23/cet-transform, excluding cet-specific parts.
Copied from Perforce
 Change: 179309
 ServerID: perforce.ravenbrook.com
2012-09-06 17:17:18 +01:00
Richard Brooksby
27c6706791 Merging branch/2012-08-21/diagnostic-telemetry.
Copied from Perforce
 Change: 179289
 ServerID: perforce.ravenbrook.com
2012-09-05 23:45:31 +01:00
David Lovemore
886e96ba8e Fix weak band assert. we now trace weak segments as weak on a fault if we are in the weak band.
Copied from Perforce
 Change: 179210
 ServerID: perforce.ravenbrook.com
2012-09-03 17:05:51 +01:00
Richard Brooksby
e00495829f Adding more events corresponding to diagnostics.
Copied from Perforce
 Change: 179141
 ServerID: perforce.ravenbrook.com
2012-08-31 19:33:45 +01:00
Richard Brooksby
455e3ee43c Adding an mps-style eventdescribe.
Removing deliberate assert and event debugging dump.  Oops.

Copied from Perforce
 Change: 179133
 ServerID: perforce.ravenbrook.com
2012-08-31 15:14:09 +01:00
Richard Brooksby
09dc2bca88 Writing event dumper to print recent events, and adding it to the default assertion handler.
NUL-terminating event strings to make them easier to print.

Copied from Perforce
 Change: 179132
 ServerID: perforce.ravenbrook.com
2012-08-31 14:12:23 +01:00
David Lovemore
ed8cd9432d In tracescanareatagged use the alignments of pools in the condemned set to determine mask.
Copied from Perforce
 Change: 179117
 ServerID: perforce.ravenbrook.com
2012-08-30 13:48:41 +01:00
Richard Brooksby
4009b8a559 Abolishing eventgen.pl. event structures are now expanded by the preprocessor.
Abolishing event formats.  Each event now has its own structure.
Event parameters are now written directly into the event buffer, rather than being copied twice.

Copied from Perforce
 Change: 179010
 ServerID: perforce.ravenbrook.com
2012-08-21 22:48:11 +01:00
Richard Brooksby
13ba70d2dd Fixing warnings revealed by xcode (clang).
Copied from Perforce
 Change: 178898
 ServerID: perforce.ravenbrook.com
2012-08-11 09:30:24 +01:00
David Lovemore
fa5ad6689b Merged from master/... to pick up longest changes to varargs and casts on shifts
Copied from Perforce
 Change: 178097
 ServerID: perforce.ravenbrook.com
2012-05-03 17:02:33 +01:00
David Lovemore
9bf482ea08 Fixed up long constants and shifts that needed to be cast to correct type.
Copied from Perforce
 Change: 178095
 ServerID: perforce.ravenbrook.com
2012-05-03 16:38:47 +01:00
David Lovemore
4ee202d5cf Adding casts to varargs in diagnostic output
Copied from Perforce
 Change: 178092
 ServerID: perforce.ravenbrook.com
2012-05-03 15:17:04 +01:00
Richard Brooksby
ecfd805f9a Fixing horrible type unsafe candy-machine interface to tracestartgendesc_diag, which broke on w3i6mv.
Copied from Perforce
 Change: 178077
 ServerID: perforce.ravenbrook.com
2012-05-01 17:05:27 +01:00
Richard Kistruck
d1e04a6dd5 mps br/vmem: simple-chunk-return:
arenavm.c, trace.c, mpmst.h -- trace->preTraceArenaReserved, to show pre- and peak-vmem during collection

Copied from Perforce
 Change: 170098
 ServerID: perforce.ravenbrook.com
2010-03-23 04:07:43 +00:00
Richard Kistruck
0e6aecdbb8 mps br/vmem: simple-chunk-return:
arenavm.c -- move chunk-return into new function "VMCompact".
 (also, in VMArenaFinish, null out arena->primary in VMArenaFinish, so it is not left dangling).

 arena.c, arenavm.c, mpm.h, mpmst.h, mpmtypes.h:
 arena->class->compact: ArenaCompact, ArenaTrivCompact, VMCompact

 trace.c -- traceReclaim calls ArenaCompact!

Copied from Perforce
 Change: 170095
 ServerID: perforce.ravenbrook.com
2010-03-23 01:49:17 +00:00
Richard Kistruck
1ff022cae1 mps br/vmem: simple-chunk-return:
zcoll.c:
 How to get rid of all the objects, so full collect really collects all automatic objects:
   - Rootdrop() helps, but we can still retain a 1.2MB object;
   - stackwipe() does not help much -- these unwanted ambig refs are being left on the stack by MPS code that runs between mps_arena_collect and the flip!
   - therefore StackScan(0/1) to destroy stack+reg root before full collect: it's the only way to be sure.

 Reproducibility:
   - give Make() a random? switch, acted on by df() = diversity function, to allow bypass of rnd();
   - ZRndStateSet, to set the seed for rnd()

 Output:
   - print_M: switchable Mebibytes or Megabytes (more useful, to be honest);
   - get(): don't report message times, it messes up diffs.

 testlib.c/h:
 Reproducibility:
   - fix rnd_state so a rnd_state getter is possible;
   - testlib.h += rnd_state_t, rnd_state(), rnd_state_set(), rnd_state_set_v2()

 trace.c: traceFindGrey diag: no newline please

Copied from Perforce
 Change: 170093
 ServerID: perforce.ravenbrook.com
2010-03-22 23:00:42 +00:00
Richard Kistruck
bf80a3a11d Mps br/padding: new pooltraceendmethod: do end-of-trace work
Tracer calls PoolTraceEnd() when the trace is TraceFINISHED.
 AbstractPoolClass uses PoolTrivTraceEnd -- a NOOP. [mpm.h, mpmst.h, mpmtypes.h, pool.c, poolabs.c]
 AMC overrides with AMCTraceEnd, to emit diagnostic on how well the trace went! [poolamc.c]

Copied from Perforce
 Change: 168478
 ServerID: perforce.ravenbrook.com
2009-08-20 17:44:16 +01:00
Richard Kistruck
ed1f97ac9f Mps br/padding: more diagnostic for how padding survives a collection.
More diag:
  - new traceSetSignalEmergency;
  - new AMCFix_amcSegCreateNailboard and AMCHeaderFix_amcSegCreateNailboard
    (note: the other, unreported, route to becoming boarded is because of a (mutator) buffer);
  - in traces: show SegBase and zone;
   - in TraceStart: show genZoneSets;
   - in amcReclaimNailed: show cbpip and cbpad.
 zcoll.c:
   - sizemethod 1 to Make command: occasionally makes >1MiB objects;
   - declare root_table all MPS_RANK_AMBIG.

Copied from Perforce
 Change: 167726
 ServerID: perforce.ravenbrook.com
2009-04-02 18:29:10 +01:00
Richard Kistruck
b27e4ff179 Mps br/timing (fix warnings "... may be used uninitialized"):
trace.c, tract.c: initialise variable to NULL

Copied from Perforce
 Change: 167191
 ServerID: perforce.ravenbrook.com
2009-01-21 14:17:56 +00:00
Richard Kistruck
bf3c873639 Mps br/timing (revert previous local-only change @166956)
Copied from Perforce
 Change: 166957
 ServerID: perforce.ravenbrook.com
2008-12-16 18:01:18 +00:00
Richard Kistruck
bace1c7bc1 Mps br/timing (local only - must revert) hack trace.c so it does not
pre-allocate GC messages after the first trace, and verify that 
everything still works, droppedMessages is incremented, and reported 
as non-zero (in diagnostic varieties only) by global.c on 
ArenaDestroy.  Test passes.

Copied from Perforce
 Change: 166956
 ServerID: perforce.ravenbrook.com
2008-12-16 17:59:50 +00:00
Richard Kistruck
ac7a39432c Mps br/timing traceidmessages: create them at mps_arena_create time,
re-create them immediately after a trace sends its last message.
Store them, one per TraceId, in ArenaStruct.  Cope correctly if they 
cannot be created (ControlAlloc fails).  Destroy them correctly on 
mps_arena_destroy.  See job001989 and design/message-gc#lifecycle
(not yet written).

Copied from Perforce
 Change: 166918
 ServerID: perforce.ravenbrook.com
2008-12-11 16:06:14 +00:00
Richard Kistruck
77ea63625a Mps br/timing: traceanc.c -- all this ancillary stuff was making
trace.c very cluttered.  Put it here instead.

Copied from Perforce
 Change: 166911
 ServerID: perforce.ravenbrook.com
2008-12-09 16:55:22 +00:00
Richard Kistruck
c7cc77b06b Mps br/timing: move field "messagetype type" out of messagestruct
and into MessageClassStruct.

Copied from Perforce
 Change: 166795
 ServerID: perforce.ravenbrook.com
2008-11-24 15:44:27 +00:00
Richard Kistruck
a563a76204 Mps br/timing: mps_alert_collection_set() -- client sets a callback
function; MPS calls it synchronously on collection start/stop 
(immediately after posting start/stop message).  The callback 
receives two ints: alertcode (start|stop; see mps.h), and whycode 
(trace->why).  Note: callback is also called for heap walk 
start/stop.
amcss.c: show start/stop alerts.

Copied from Perforce
 Change: 166703
 ServerID: perforce.ravenbrook.com
2008-11-12 15:07:04 +00:00
David Jones
d6d6a11ef7 Mps: adding uses of diag_decl so that variety=hi builds on os x.
Copied from Perforce
 Change: 163257
 ServerID: perforce.ravenbrook.com
2007-09-19 11:12:21 +01:00
Richard Kistruck
3cf7d5d66a Mps br/diagtag: whether a rule matches tag and para is constant for
the whole of a given diag, so memoize it (instead of repeating the 
match for every line of the diag).
locus.c: new diag from ChainCondemnAuto.
trace.c: tidy up TraceStart diag, give traceFindGrey diag a tag.

Copied from Perforce
 Change: 163077
 ServerID: perforce.ravenbrook.com
2007-08-09 16:41:59 +01:00
Richard Kistruck
c311f178cc Mps br/diagtag: oops! back out accidental checkin of trace.c with
test code in.

Copied from Perforce
 Change: 163071
 ServerID: perforce.ravenbrook.com
2007-08-09 13:45:26 +01:00