[Git][ghc/ghc][wip/ghc-debug] 87 commits: Add missing primop documentation (#18454)

Sven Tennie gitlab at gitlab.haskell.org
Fri Sep 11 06:20:52 UTC 2020



Sven Tennie pushed to branch wip/ghc-debug at Glasgow Haskell Compiler / GHC


Commits:
c6f50cea by Krzysztof Gogolewski at 2020-08-28T02:22:36-04:00
Add missing primop documentation (#18454)

- Add three pseudoops to primops.txt.pp, so that Haddock renders
  the documentation
- Update comments
- Remove special case for "->" - it's no longer exported from GHC.Prim
- Remove reference to Note [Compiling GHC.Prim] - the ad-hoc fix is no
  longer there after updates to levity polymorphism.
- Document GHC.Prim
- Remove the comment that lazy is levity-polymorphic.
  As far as I can tell, it never was: in 80e399639,
  only the unfolding was given an open type variable.
- Remove haddock hack in GHC.Magic - no longer neccessary after
  adding realWorld# to primops.txt.pp.

- - - - -
f065b6b0 by Tamar Christina at 2020-08-28T02:23:13-04:00
Fix use distro toolchian

- - - - -
4517a382 by Tamar Christina at 2020-08-28T02:23:13-04:00
document how build system find toolchains on Windows

- - - - -
329f7cb9 by Ben Gamari at 2020-08-31T22:59:14-04:00
base: Better error message on invalid getSystemTimerManager call

Previously we would produce a rather unhelpful pattern match failure
error in the case where the user called `getSystemTimerManager` in a
program which isn't built with `-threaded`. This understandably confused
the user in #15616.

Fixes #15616.

- - - - -
f6d70a8f by Roland Senn at 2020-08-31T22:59:50-04:00
Add tests for #15617.

Avoid a similar regression in the future.

- - - - -
e5969fd0 by Roland Senn at 2020-08-31T23:00:27-04:00
Add additional tests for #18172 (Followup MR 3543)

There was still one active discussion [thread](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3543#note_284325) when MR !3543 got merged.

This MR adds the requested tests exercising the changes in
`compiler/GHC/HsToCore/Match/Literal.hs:warnAboutEmptyEnumerations` and its sub-functions.

- - - - -
fe18b482 by Ben Gamari at 2020-08-31T23:01:02-04:00
Bump Win32 and process submodules

- - - - -
2da93308 by Sylvain Henry at 2020-08-31T23:01:39-04:00
Hadrian: fix slow-validate flavour (#18586)

- - - - -
85e13008 by Andreas Klebinger at 2020-08-31T23:02:15-04:00
Update dominator code with fixes from the dom-lt package.

Two bugs turned out in the package that have been fixed since.
This MR includes this fixes in the GHC port of the code.

- - - - -
dffb38fa by Andreas Klebinger at 2020-08-31T23:02:15-04:00
Dominators.hs: Use unix line endings

- - - - -
6189cc04 by Moritz Angermann at 2020-08-31T23:02:50-04:00
[fixup 3433] move debugBelch into IF_DEBUG(linker)

The commit in dff1cb3d9c111808fec60190747272b973547c52 incorrectly left
the `debugBelch` function without a comment or IF_DEBUG(linker,)
decoration. This rectifies it.

Needs at least a 8.10 backport, as it was backported in 6471cc6aff80d5deebbdb1bf7b677b31ed2af3d5

- - - - -
bcb68a3f by Sylvain Henry at 2020-08-31T23:03:27-04:00
Don't store HomeUnit in UnitConfig

Allow the creation of a UnitConfig (hence of a UnitState) without having
a HomeUnit. It's required for #14335.

- - - - -
0a372387 by Sylvain Henry at 2020-08-31T23:04:04-04:00
Fix documentation and fix "check" bignum backend (#18604)

- - - - -
eb85f125 by Moritz Angermann at 2020-08-31T23:04:39-04:00
Set the dynamic-system-linker flag to Manual

This flag should be user controllable, hence Manual: True.

- - - - -
380ef845 by Sven Tennie at 2020-08-31T23:05:14-04:00
Ignore more files

Ignore files from "new style" cabal builds (dist-newstyle folders) and
from clangd (C language server).

- - - - -
74a7fbff by Takenobu Tani at 2020-08-31T23:05:51-04:00
Limit upper version of Happy for ghc-9.0 and earlier (#18620)

This patch adds the upper bound of a happy version for ghc-9.0
and earlier.

Currently, we can't use happy-1.20.0 for ghc-9.0.

See #18620.

- - - - -
a4473f02 by Takenobu Tani at 2020-08-31T23:05:51-04:00
Limit upper version of Happy for ghc-9.2 (#18620)

This patch adds the upper bound of a happy version for ghc-9.2.

Currently, We can use happy-1.19 or happy-1.20 for ghc-9.2.

See #18620.

- - - - -
a8a2568b by Sylvain Henry at 2020-08-31T23:06:28-04:00
Bignum: add BigNat compat functions (#18613)

- - - - -
884245dd by Sylvain Henry at 2020-09-01T12:39:36-04:00
Fix FastString lexicographic ordering (fix #18562)

- - - - -
4b4fbc58 by Sylvain Henry at 2020-09-01T12:39:36-04:00
Remove "Ord FastString" instance

FastStrings can be compared in 2 ways: by Unique or lexically. We don't
want to bless one particular way with an "Ord" instance because it leads
to bugs (#18562) or to suboptimal code (e.g. using lexical comparison
while a Unique comparison would suffice).

UTF-8 encoding has the advantage that sorting strings by their encoded
bytes also sorts them by their Unicode code points, without having to
decode the actual code points. BUT GHC uses Modified UTF-8 which
diverges from UTF-8 by encoding \0 as 0xC080 instead of 0x00 (to avoid
null bytes in the middle of a String so that the string can still be
null-terminated). This patch adds a new `utf8CompareShortByteString`
function that performs sorting by bytes but that also takes Modified
UTF-8 into account. It is much more performant than decoding the strings
into [Char] to perform comparisons (which we did in the previous patch).

Bump haddock submodule

- - - - -
b4edcde7 by Ben Gamari at 2020-09-01T14:53:42-04:00
testsuite: Add broken test for #18302

- - - - -
bfab2a30 by Sebastian Graf at 2020-09-02T15:54:55-04:00
Turn on -XMonoLocalBinds by default (#18430)

And fix the resulting type errors.

Co-authored-by: Krzysztof Gogolewski <krz.gogolewski at gmail.com>

Metric Decrease:
    parsing001

- - - - -
c30cc0e9 by David Feuer at 2020-09-02T15:55:31-04:00
Remove potential space leak from Data.List.transpose

Previously, `transpose` produced a list of heads
and a list of tails independently. This meant that
a function using only some heads, and only some tails,
could potentially leak space. Use `unzip` to work
around the problem by producing pairs and selector
thunks instead. Time and allocation behavior will
be worse, but there should be no more leak potential.
- - - - -
ffc3da47 by Sylvain Henry at 2020-09-02T15:56:11-04:00
Remove outdated note

- - - - -
85e62123 by Sylvain Henry at 2020-09-02T15:56:48-04:00
Bignum: add missing compat import/export functions

- - - - -
397c2b03 by Ben Gamari at 2020-09-03T17:31:47-04:00
configure: Work around Raspbian's silly packaging decisions

See #17856.

- - - - -
4891c18a by Kathryn Spiers at 2020-09-03T17:32:24-04:00
expected-undocumented-flags remove kill flags

It looks like the flags were removed in https://gitlab.haskell.org/ghc/ghc/-/commit/3e27205a66b06a4501d87eb31e285eadbc693eb7
and can safely be removed here
- - - - -
1d6d6488 by Sylvain Henry at 2020-09-04T16:24:20-04:00
Don't rely on CLabel's Outputable instance in CmmToC

This is in preparation of the removal of sdocWithDynFlags (#10143),
hence of the refactoring of CLabel's Outputable instance.

- - - - -
89ce7cdf by Sylvain Henry at 2020-09-04T16:24:59-04:00
DynFlags: use Platform in foldRegs*

- - - - -
220ad8d6 by Sylvain Henry at 2020-09-04T16:24:59-04:00
DynFlags: don't pass DynFlags to cmmImplementSwitchPlans

- - - - -
c1e54439 by Ryan Scott at 2020-09-04T16:25:35-04:00
Introduce isBoxedTupleDataCon and use it to fix #18644

The code that converts promoted tuple data constructors to
`IfaceType`s in `GHC.CoreToIface` was using `isTupleDataCon`, which
conflates boxed and unboxed tuple data constructors. To avoid this,
this patch introduces `isBoxedTupleDataCon`, which is like
`isTupleDataCon` but only works for _boxed_ tuple data constructors.

While I was in town, I was horribly confused by the fact that there
were separate functions named `isUnboxedTupleCon` and
`isUnboxedTupleTyCon` (similarly, `isUnboxedSumCon` and
`isUnboxedSumTyCon`). It turns out that the former only works for
data constructors, despite its very general name! I opted to rename
`isUnboxedTupleCon` to `isUnboxedTupleDataCon` (similarly, I renamed
`isUnboxedSumCon` to `isUnboxedSumDataCon`) to avoid this potential
confusion, as well as to be more consistent with
the naming convention I used for `isBoxedTupleDataCon`.

Fixes #18644.

- - - - -
07bdcac3 by GHC GitLab CI at 2020-09-04T22:26:25-04:00
configure: Avoid hard-coded ld path on Windows

The fix to #17962 ended up regressing on Windows as it failed to
replicate the logic responsible for overriding the toolchain paths on
Windows. This resulted in a hard-coded path to a directory that likely
doesn't exist on the user's system (#18550).

- - - - -
0be8e746 by Benjamin Maurer at 2020-09-04T22:27:01-04:00
Documented the as of yet undocumented '--print-*'  GHC flags,
as well as `-split-objs`, since that is related to
`--print-object-splitting-supported`.
See #18641

- - - - -
4813486f by Sylvain Henry at 2020-09-04T22:27:44-04:00
Move Hadrian's wiki pages in tree (fix #16165)

Only the debugging page contains interesting stuff. Some of this stuff
looks old (e.g. recommending "cabal install")...

- - - - -
7980ae23 by GHC GitLab CI at 2020-09-05T14:50:52-04:00
rts: Consistently use stgMallocBytes instead of malloc

This can help in debugging RTS memory leaks since all allocations go
through the same interface.

- - - - -
67059893 by Ben Gamari at 2020-09-05T14:51:27-04:00
configure: Fix whitespace

- - - - -
be2cc0ad by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: More intelligent detection of locale availability

Previously ci.sh would unconditionally use C.UTF-8. However, this fails
on Centos 7, which appears not to provide this locale. Now we first try
C.UTF-8, then try en_US.UTF-8, then fail.

Works around #18607.

- - - - -
15dca847 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Rename RELEASE variable to RELEASE_JOB

This interfered with the autoconf variable of the same name, breaking
pre-release builds.

- - - - -
bec0d170 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Bump Windows toolchain version

This should have been done when we bumped the bootstrap compiler to
8.8.4.

- - - - -
9fbaee21 by Ben Gamari at 2020-09-05T14:51:27-04:00
gitlab-ci: Drop Windows make job

These are a significant burden on our CI resources and end up failing
quite often due to #18274. Here I drop the make jobs during
validaion; it is now run only during the nightly builds.

- - - - -
869f6e19 by Ben Gamari at 2020-09-05T14:51:27-04:00
testsuite: Drop Windows-specific output for parseTree

The normalise_slashes normaliser should handle this.

- - - - -
2c9f743c by Ben Gamari at 2020-09-05T14:51:28-04:00
testsuite: Mark T5975[ab] as broken on Windows

Due to #7305.

- - - - -
643785e3 by Ben Gamari at 2020-09-05T14:51:28-04:00
gitlab-ci: Fix typo

A small typo in a rule regular expression.

- - - - -
c5413fc6 by Wander Hillen at 2020-09-07T09:33:54-04:00
Add clarification regarding poll/kqueue flags

- - - - -
10434d60 by Ben Gamari at 2020-09-07T09:34:32-04:00
gitlab-ci: Configure bignum backend in Hadrian builds

- - - - -
d4bc9f0d by Ben Gamari at 2020-09-07T09:34:32-04:00
gitlab-ci: Use hadrian builds for Windows release artifacts

- - - - -
4ff93292 by Moritz Angermann at 2020-09-07T21:18:39-04:00
[macOS] improved runpath handling

In b592bd98ff25730bbe3c13d6f62a427df8c78e28 we started using
-dead_strip_dylib on macOS when lining dynamic libraries and binaries.
The underlying reason being the Load Command Size Limit in macOS
Sierra (10.14) and later.

GHC will produce @rpath/libHS... dependency entries together with a
corresponding RPATH entry pointing to the location of the libHS...
library. Thus for every library we produce two Load Commands.  One to
specify the dependent library, and one with the path where to find it.
This makes relocating libraries and binaries easier, as we just need to
update the RPATH entry with the install_name_tool. The dynamic linker
will then subsitute each @rpath with the RPATH entries it finds in the
libraries load commands or the environement, when looking up @rpath
relative libraries.

-dead_strip_dylibs intructs the linker to drop unused libraries. This in
turn help us reduce the number of referenced libraries, and subsequently
the size of the load commands.  This however does not remove the RPATH
entries.  Subsequently we can end up (in extreme cases) with only a
single @rpath/libHS... entry, but 100s or more RPATH entries in the Load
Commands.

This patch rectifies this (slighly unorthodox) by passing *no* -rpath
arguments to the linker at link time, but -headerpad 8000.  The
headerpad argument is in hexadecimal and the maxium 32k of the load
command size.  This tells the linker to pad the load command section
enough for us to inject the RPATHs later.  We then proceed to link the
library or binary with -dead_strip_dylibs, and *after* the linking
inspect the library to find the left over (non-dead-stripped)
dependencies (using otool).  We find the corresponding RPATHs for each
@rpath relative dependency, and inject them into the library or binary
using the install_name_tool.  Thus achieving a deadstripped dylib (and
rpaths) build product.

We can not do this in GHC, without starting to reimplement a dynamic
linker as we do not know which symbols and subsequently libraries are
necessary.

Commissioned-by: Mercury Technologies, Inc. (mercury.com)

- - - - -
df04b81e by Sylvain Henry at 2020-09-07T21:19:20-04:00
Move DynFlags test into updateModDetailsIdInfos's caller (#17957)

- - - - -
ea1cbb8f by Ben Gamari at 2020-09-08T15:42:02-04:00
rts: Add stg_copyArray_barrier to RtsSymbols list

It's incredible that this wasn't noticed until now.

- - - - -
d7b2f799 by Daishi Nakajima at 2020-09-08T15:42:41-04:00
testsuite: Output performance test results in tabular format
this was suggested in #18417.

Change the print format of the values.
* Shorten commit hash
* Reduce precision of the "Value" field
* Shorten metrics name
  * e.g. runtime/bytes allocated -> run/alloc
* Shorten "MetricsChange"
  * e.g. unchanged -> unch, increased -> incr

And, print the baseline environment if there are baselines that were
measured in a different environment than the current environment.

If all "Baseline commit" are the same, print it once.

- - - - -
44472daf by Ryan Scott at 2020-09-08T15:43:16-04:00
Make the forall-or-nothing rule only apply to invisible foralls (#18660)

This fixes #18660 by changing `isLHsForAllTy` to
`isLHsInvisForAllTy`, which is sufficient to make the
`forall`-or-nothing rule only apply to invisible `forall`s. I also
updated some related documentation and Notes while I was in the
neighborhood.

- - - - -
0c61cbff by Ben Gamari at 2020-09-08T15:43:54-04:00
gitlab-ci: Handle distributions without locales

Previously we would assume that the `locale` utility exists. However,
this is not so on Alpine as musl's locale support is essentially
non-existent.

(cherry picked from commit 17cdb7ac3b557a245fee1686e066f9f770ddc21e)

- - - - -
d989c842 by Ben Gamari at 2020-09-08T15:43:55-04:00
gitlab-ci: Accept Centos 7 C.utf8 locale

Centos apparently has C.utf8 rather than C.UTF-8.

(cherry picked from commit d9f85dd25a26a04d3485470afb3395ee2dec6464)

- - - - -
e5a2899c by John Ericson at 2020-09-09T00:46:05-04:00
Use "to" instead of "2" in internal names of conversion ops

Change the constructors for the primop union, and also names of the
literal conversion functions.

"2" runs into trouble when we need to do conversions from fixed-width
types, and end up with thing like "Int642Word".

Only the names internal to GHC are changed, as I don't want to worry
about breaking changes ATM.

- - - - -
822f1057 by Ryan Scott at 2020-09-09T00:46:41-04:00
Postpone associated tyfam default checks until after typechecking

Previously, associated type family defaults were validity-checked
during typechecking. Unfortunately, the error messages that these
checks produce run the risk of printing knot-tied type constructors,
which will cause GHC to diverge. In order to preserve the current
error message's descriptiveness, this patch postpones these validity
checks until after typechecking, which are now located in the new
function `GHC.Tc.Validity.checkValidAssocTyFamDeflt`.

Fixes #18648.

- - - - -
8c892689 by Sylvain Henry at 2020-09-09T11:19:24-04:00
DynFlags: add OptCoercionOpts

Use OptCoercionOpts to avoid threading DynFlags all the way down to
GHC.Core.Coercion.Opt

- - - - -
3f32a9c0 by Sylvain Henry at 2020-09-09T11:19:24-04:00
DynFlags: add UnfoldingOpts and SimpleOpts

Milestone: after this patch, we only use 'unsafeGlobalDynFlags' for the
state hack and for debug in Outputable.

- - - - -
b3df72a6 by Sylvain Henry at 2020-09-09T11:19:24-04:00
DynFlags: add sm_pre_inline field into SimplMode (#17957)

It avoids passing and querying DynFlags down in the simplifier.

- - - - -
ffae5792 by Sylvain Henry at 2020-09-09T11:19:24-04:00
Add comments about sm_dflags and simpleOptExpr

- - - - -
7911d0d9 by Alan Zimmerman at 2020-09-09T11:20:03-04:00
Remove GENERATED pragma, as it is not being used

@alanz pointed out on ghc-devs that the payload of this pragma does
not appear to be used anywhere.

I (@bgamari) did some digging and traced the pragma's addition back to
d386e0d2 (way back in 2006!).

It appears that it was intended to be used by code generators for use
in informing the code coveraging checker about generated code
provenance. When it was added it used the pragma's "payload" fields as
source location information to build an "ExternalBox". However, it
looks like this was dropped a year later in 55a5d8d9.  At this point
it seems like the pragma serves no useful purpose.

Given that it also is not documented, I think we should remove it.

Updates haddock submodule

Closes #18639

- - - - -
5aae5b32 by Ben Gamari at 2020-09-09T18:31:40-04:00
gitlab-ci: Bump Docker images

We now generate our Docker images via Dhall definitions, as described in
ghc/ci-images!52. Additionally, we are far more careful about where tools
come from, using the ALEX, HAPPY, HSCOLOR, and GHC environment variables
(set in the Dockerfiles) to find bootstrapping tools.

- - - - -
4ce9fe88 by Ben Gamari at 2020-09-09T18:31:40-04:00
hadrian: Fix leakage of GHC in PATH into build

Previously hadrian would use GHC on PATH when configuring packages (or
fail if there is no such GHC). Fix this. Unfortunately this runs into
another bug in Cabal which we workaround.

- - - - -
291a15dd by Ben Gamari at 2020-09-09T18:31:40-04:00
utils: Bump cabal-version of hp2ps and unlit

- - - - -
4798caa0 by David Himmelstrup at 2020-09-09T18:32:16-04:00
rts comment: RTS_TICKY_SYMBOLS moved from rts/Linker.c to rts/RtsSymbols.c

- - - - -
67ce72da by Sebastian Graf at 2020-09-10T10:35:33-04:00
Add long-distance info for pattern bindings (#18572)

We didn't consider the RHS of a pattern-binding before, which led to
surprising warnings listed in #18572.

As can be seen from the regression test T18572, we get the expected
output now.

- - - - -
1207576a by Sebastian Graf at 2020-09-10T10:35:33-04:00
PmCheck: Big refactor using guard tree variants more closely following source syntax (#18565)

Previously, we desugared and coverage checked plain guard trees as
described in Lower Your Guards. That caused (in !3849) quite a bit of
pain when we need to partially recover tree structure of the input
syntax to return covered sets for long-distance information, for
example.

In this refactor, I introduced a guard tree variant for each relevant
source syntax component of a pattern-match (mainly match groups, match,
GRHS, empty case, pattern binding). I made sure to share as much
coverage checking code as possible, so that the syntax-specific checking
functions are just wrappers around the more substantial checking
functions for the LYG primitives (`checkSequence`, `checkGrds`).

The refactoring payed off in clearer code and elimination of all panics
related to assumed guard tree structure and thus fixes #18565.

I also took the liberty to rename and re-arrange the order of functions
and comments in the module, deleted some dead and irrelevant Notes,
wrote some new ones and gave an overview module haddock.

- - - - -
95455982 by GHC GitLab CI at 2020-09-10T10:36:09-04:00
hadrian: Don't include -fdiagnostics-color in argument hash

Otherwise the input hash will vary with whether colors are requested,
which changed with `isatty`.

Fixes #18672.

- - - - -
8a857027 by Matthew Pickering at 2020-09-11T08:17:15+02:00
rts: Implement ghc-debug API (#18405)

There are four components to this patch which make it possible to
implement `ghc-debug`.

1. Add four new functions to the RtsAPI.
  * rts_pause and rts_unpause allow an external process to completely
  pause and unpause the RTS.
  * rts_listThreads and rts_listMiscRoots are used to find the current
  roots of the garbage collector.

These changes also mean that `Task.h` is exposed to the user.

2. Generalise the `ghc-heap` API so that raw `Word`s can be returned
rather than actual objects. This is necessary when trying to decode
closures on an external process because the pointers in such closures
are correct for the internal rather than external process. If you used
the previous API then you would get a segfault as the garbage collector
would try to traverse into these nonsensical branches.

```
-- before
getClosureData :: a -> IO Closure
-- after
getClosureDataX :: (forall c . c -> IO (Ptr StgInfoTable, [Word], [b]))
	                      -> a -> IO (GenClosure b)
```

For the normal case `b` is instantiated to `Box`, which contains a
pointer to a heap object.

```
data Box = Box a

-- GenClosure Box
```

For `ghc-debug` we instead just take the word of the address as we have
to explicitly interpret it on the external process.

```
GenClosure Word
```

3. Support for decoding `TSO` and `STACK` closures is partially
implemented. There is still quite a bit of work to do to finish both but
these at least allow us to make some more progress.

4. findPtr is generalised to take a callback argument. This means that
its result can be communicated to the debugger rather than just printing
out the result. The debugger has a function which invokes `findPtr` and
passes a callback which sends the result over a socket.

Co-authored-by: Ben Gamari <ben at smart-cactus.org>

- - - - -
91b9a5b2 by Sven Tennie at 2020-09-11T08:17:15+02:00
Decode more StgTSO and StgStack fields (#18405)

Use hsc2hs to get an understandable and stable mapping from the C
structs to Haskell.

It's important to keep StgTSO and StgStack decoding downwards
compatible. This is especially needed for hadrian/ghci.

- - - - -
aa1e5b37 by Sven Tennie at 2020-09-11T08:17:16+02:00
Add test for StgTSO decoding (#18405)

This makes sure ghc-heap decodes StgTSO and StgStack correctly.

To assert - otherwise dynamic - properties, a new, non-running TSO is
created in create_tso() (create_tso.c).

size is renamed to stack_size to use a dedicated type.

size was already defined as a HalfWord in GenClosure, which is
only equivalent to Word32 on 64bit architectures.

- - - - -
6e6a3207 by Sven Tennie at 2020-09-11T08:17:16+02:00
Add documentation to ghc-debug functions (#18405)

- - - - -
56b1eb08 by Sven Tennie at 2020-09-11T08:17:16+02:00
Adjust type of getClosureX to type of getClosureDataX (#18405)

After a rebase the compiler complained:

libraries/ghc-heap/GHC/Exts/Heap.hs:89:23: error:
    • Couldn't match type: a -> IO (Ptr StgInfoTable, [Word], [b])
                     with: forall c. c -> IO (Ptr StgInfoTable, [Word], [b])
      Expected: (forall c. c -> IO (Ptr StgInfoTable, [Word], [b]))
                -> a -> IO (GenClosure b)
        Actual: (a -> IO (Ptr StgInfoTable, [Word], [b]))
                -> a -> IO (GenClosure b)
    • In the expression: getClosureX
      In an equation for ‘getClosureDataX’: getClosureDataX = getClosureX
      In the instance declaration for ‘HasHeapRep a’
    • Relevant bindings include
        getClosureDataX :: (forall c.
                            c -> IO (Ptr StgInfoTable, [Word], [b]))
                           -> a -> IO (GenClosure b)
          (bound at libraries/ghc-heap/GHC/Exts/Heap.hs:89:5)
   |
89 |     getClosureDataX = getClosureX
   |                       ^^^^^^^^^^^
)

- - - - -
84708c1d by Sven Tennie at 2020-09-11T08:17:16+02:00
Add test for rts_pause and rts_unpause (#18405)

- - - - -
b33e3f6f by Sven Tennie at 2020-09-11T08:17:16+02:00
Add test list_threads_and_misc_roots (#18405)

It uses rts_listThreads() and rts_listMiscRoots().

- - - - -
1efdfa6c by Sven Tennie at 2020-09-11T08:17:16+02:00
Introduce rts_isPaused() (#18405)

Some operations are only save when the RTS is paused. This predicate
helps to make such checks.

- - - - -
647e137a by Sven Tennie at 2020-09-11T08:17:16+02:00
Decode CostCentreStacks, CostCentres and InfoTables (#18405)

These are the data structures used by profiling, i.e. they are only
available when the RTS is used with `-prof`. Otherwise fetching them
results into `Nothing`.

To reduce unnecessary decoding, a state monad transformer is used to
provide caching for CostCentres.

Because the three types form a circular data structure, loop-breakers
are applied to prevent endless decoding loops.

- - - - -
e46201da by Sven Tennie at 2020-09-11T08:17:16+02:00
Use more precise types in tests (#18405)

Use `Ptr ()` instead of `Word` to communicate that addresses/pointers
are meant.

- - - - -
f2c6bbd5 by Sven Tennie at 2020-09-11T08:17:16+02:00
Introduce LiftedClosure (#18405)

This is a representation for closures that do not have a representation
in the Haskell language. I.e. things like StgTSOs.

- - - - -
23ac6c62 by Sven Tennie at 2020-09-11T08:17:16+02:00
Expect stack_marking starting from GHC 8.10 (#18405)

This field was introduced with GHC 8.10.

- - - - -
8a887a08 by Sven Tennie at 2020-09-11T08:17:16+02:00
Add WhatNext, WhyBlocked and TsoFlags to TSO closure (#18405)

These constants can easily be decoded to sum types.

Additionally extract TestUtils with common test functions.

- - - - -
2c975c12 by Sven Tennie at 2020-09-11T08:17:16+02:00
END_TSO_QUEUE is not a closure type on it's own (#18405)

Indeed it's a CONSTR_NOCAF.

- - - - -
ab2179b1 by Sven Tennie at 2020-09-11T08:17:16+02:00
Rename boundTaskExiting and getTask (#18405)

Both are directly related to myTask, which the new names now reflect.

- - - - -
c9c4df53 by Sven Tennie at 2020-09-11T08:17:16+02:00
Mark unsafe accesses (#18405)

StgTSO and StgStack are very dynamic by nature. Accesses to outdated
pointers lead to segmentation faults or absolutely wrong results.

So, make sure (by naming) that the users nows about these facts.

The safe way to access these fields it to stop the RTS via RTS API.

- - - - -
90322ac3 by Sven Tennie at 2020-09-11T08:17:16+02:00
Check pointers with pattern matching (#18405)

This is nicer than to check the length of the pointer's list and index
on it.

- - - - -
b113405d by Sven Tennie at 2020-09-11T08:17:16+02:00
Remove unsave function (#18405)

heap_view_closurePtrsAsWords is currently only used by ghc-debug, so
it can be defined there.

- - - - -
0905d06a by Sven Tennie at 2020-09-11T08:17:16+02:00
Define a public API for Printer.c (#18405)

The RtsAPI contains functions to inspect the heap. The published
Printer.c functions help to print the found closures.

- - - - -
e7f21df8 by Sven Tennie at 2020-09-11T08:17:16+02:00
Do not require ClosureTypes to be Bounded (#18405)

A small change to list_threads_and_misc_roots.hs and being Bounded
isn't necessary anymore.

- - - - -


30 changed files:

- .gitignore
- .gitlab-ci.yml
- .gitlab/ci.sh
- aclocal.m4
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types/Literals.hs
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/Cmm/Sink.hs
- compiler/GHC/Cmm/Switch/Implement.hs
- compiler/GHC/CmmToAsm/CFG/Dominators.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/Core/Class.hs
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/DataCon.hs-boot
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Map.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7a89b21e6ebbf4b92d81e6675bc43ee07d5f9e44...e7f21df8dd7c442ebb5874006cc465d4ca2f5bfe

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7a89b21e6ebbf4b92d81e6675bc43ee07d5f9e44...e7f21df8dd7c442ebb5874006cc465d4ca2f5bfe
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200911/233c7ce6/attachment-0001.html>


More information about the ghc-commits mailing list