[Git][ghc/ghc][wip/js-staging] 243 commits: Pmc: consider any 2 dicts of the same type equal

doyougnu (@doyougnu) gitlab at gitlab.haskell.org
Tue Sep 6 16:12:15 UTC 2022



doyougnu pushed to branch wip/js-staging at Glasgow Haskell Compiler / GHC


Commits:
4786acf7 by sheaf at 2022-08-26T15:05:23-04:00
Pmc: consider any 2 dicts of the same type equal

This patch massages the keys used in the `TmOracle` `CoreMap` to ensure
that dictionaries of coherent classes give the same key.
That is, whenever we have an expression we want to insert or lookup in
the `TmOracle` `CoreMap`, we first replace any dictionary
`$dict_abcd :: ct` with a value of the form `error @ct`.

This allows us to common-up view pattern functions with required
constraints whose arguments differed only in the uniques of the
dictionaries they were provided, thus fixing #21662.

This is a rather ad-hoc change to the keys used in the
`TmOracle` `CoreMap`. In the long run, we would probably want to use
a different representation for the keys instead of simply using
`CoreExpr` as-is. This more ambitious plan is outlined in #19272.

Fixes #21662
Updates unix submodule

- - - - -
f5e0f086 by Krzysztof Gogolewski at 2022-08-26T15:06:01-04:00
Remove label style from printing context

Previously, the SDocContext used for code generation contained
information whether the labels should use Asm or C style.
However, at every individual call site, this is known statically.
This removes the parameter to 'PprCode' and replaces every 'pdoc'
used to print a label in code style with 'pprCLabel' or 'pprAsmLabel'.
The OutputableP instance is now used only for dumps.

The output of T15155 changes, it now uses the Asm style
(which is faithful to what actually happens).

- - - - -
1007829b by Cheng Shao at 2022-08-26T15:06:40-04:00
boot: cleanup legacy args

Cleanup legacy boot script args, following removal of the legacy make
build system.

- - - - -
95fe09da by Simon Peyton Jones at 2022-08-27T00:29:02-04:00
Improve SpecConstr for evals

As #21763 showed, we were over-specialising in some cases, when
the function involved was doing a simple 'eval', but not taking
the value apart, or branching on it.

This MR fixes the problem.  See Note [Do not specialise evals].

Nofib barely budges, except that spectral/cichelli allocates about
3% less.

Compiler bytes-allocated improves a bit
   geo. mean                                          -0.1%
   minimum                                            -0.5%
   maximum                                            +0.0%

The -0.5% is on T11303b, for what it's worth.

- - - - -
565a8ec8 by Matthew Pickering at 2022-08-27T00:29:39-04:00
Revert "Revert "Refactor SpecConstr to use treat bindings uniformly""

This reverts commit 851d8dd89a7955864b66a3da8b25f1dd88a503f8.

This commit was originally reverted due to an increase in space usage.
This was diagnosed as because the SCE increased in size and that was
being retained by another leak. See #22102

- - - - -
82ce1654 by Matthew Pickering at 2022-08-27T00:29:39-04:00
Avoid retaining bindings via ModGuts held on the stack

It's better to overwrite the bindings fields of the ModGuts before
starting an iteration as then all the old bindings can be collected as
soon as the simplifier has processed them. Otherwise we end up with the
old bindings being alive until right at the end of the simplifier pass
as the mg_binds field is only modified right at the end.

- - - - -
64779dcd by Matthew Pickering at 2022-08-27T00:29:39-04:00
Force imposs_deflt_cons in filterAlts

This fixes a pretty serious space leak as the forced thunk would retain
`Alt b` values which would then contain reference to a lot of old
bindings and other simplifier gunk.

The OtherCon unfolding was not forced on subsequent simplifier runs so
more and more old stuff would be retained until the end of
simplification.

Fixing this has a drastic effect on maximum residency for the mmark
package which goes from

```
  45,005,401,056 bytes allocated in the heap
  17,227,721,856 bytes copied during GC
     818,281,720 bytes maximum residency (33 sample(s))
       9,659,144 bytes maximum slop
            2245 MiB total memory in use (0 MB lost due to fragmentation)
```

to

```
  45,039,453,304 bytes allocated in the heap
  13,128,181,400 bytes copied during GC
     331,546,608 bytes maximum residency (40 sample(s))
       7,471,120 bytes maximum slop
             916 MiB total memory in use (0 MB lost due to fragmentation)
```

See #21993 for some more discussion.

- - - - -
a3b23a33 by Matthew Pickering at 2022-08-27T00:29:39-04:00
Use Solo to avoid retaining the SCE but to avoid performing the substitution

The use of Solo here allows us to force the selection into the SCE to obtain
the Subst but without forcing the substitution to be applied. The resulting thunk
is placed into a lazy field which is rarely forced, so forcing it regresses
peformance.

- - - - -
161a6f1f by Simon Peyton Jones at 2022-08-27T00:30:14-04:00
Fix a nasty loop in Tidy

As the remarkably-simple #22112 showed, we were making a black hole
in the unfolding of a self-recursive binding.  Boo!

It's a bit tricky.  Documented in GHC.Iface.Tidy,
   Note [tidyTopUnfolding: avoiding black holes]

- - - - -
68e6786f by Giles Anderson at 2022-08-29T00:01:35+02:00
Use TcRnDiagnostic in GHC.Tc.TyCl.Class (#20117)

The following `TcRnDiagnostic` messages have been introduced:

TcRnIllegalHsigDefaultMethods
TcRnBadGenericMethod
TcRnWarningMinimalDefIncomplete
TcRnDefaultMethodForPragmaLacksBinding
TcRnIgnoreSpecialisePragmaOnDefMethod
TcRnBadMethodErr
TcRnNoExplicitAssocTypeOrDefaultDeclaration

- - - - -
cbe51ac5 by Simon Peyton Jones at 2022-08-29T04:18:57-04:00
Fix a bug in anyInRnEnvR

This bug was a subtle error in anyInRnEnvR, introduced by

    commit d4d3fe6e02c0eb2117dbbc9df72ae394edf50f06
    Author: Andreas Klebinger <klebinger.andreas at gmx.at>
    Date:   Sat Jul 9 01:19:52 2022 +0200

    Rule matching: Don't compute the FVs if we don't look at them.

The net result was #22028, where a rewrite rule would wrongly
match on a lambda.

The fix to that function is easy.

- - - - -
0154bc80 by sheaf at 2022-08-30T06:05:41-04:00
Various Hadrian bootstrapping fixes

  - Don't always produce a distribution archive (#21629)
  - Use correct executable names for ghc-pkg and hsc2hs on windows
    (we were missing the .exe file extension)
  - Fix a bug where we weren't using the right archive format on Windows
    when unpacking the bootstrap sources.

Fixes #21629

- - - - -
451b1d90 by Matthew Pickering at 2022-08-30T06:06:16-04:00
ci: Attempt using normal submodule cloning strategy

We do not use any recursively cloned submodules, and this protects us
from flaky upstream remotes.

Fixes #22121

- - - - -
9d5ad7c4 by Pi Delport at 2022-08-30T22:40:46+00:00
Fix typo in Any docs: stray "--"

- - - - -
3a002632 by Pi Delport at 2022-08-30T22:40:46+00:00
Fix typo in Any docs: syntatic -> syntactic

- - - - -
7f490b13 by Simon Peyton Jones at 2022-08-31T03:53:54-04:00
Add a missing trimArityType

This buglet was exposed by #22114, a consequence of my earlier
refactoring of arity for join points.

- - - - -
e6fc820f by Ben Gamari at 2022-08-31T13:16:01+01:00
Bump binary submodule to 0.8.9.1

- - - - -
4c1e7b22 by Ben Gamari at 2022-08-31T13:16:01+01:00
Bump stm submodule to 2.5.1.0

- - - - -
837472b4 by Ben Gamari at 2022-08-31T13:16:01+01:00
users-guide: Document system-cxx-std-lib

- - - - -
f7a9947a by Douglas Wilson at 2022-08-31T13:16:01+01:00
Update submodule containers to 0.6.6

- - - - -
4ab1c2ca by Douglas Wilson at 2022-08-31T13:16:02+01:00
Update submodule process to 1.6.15.0

- - - - -
1309ea1e by Ben Gamari at 2022-08-31T13:16:02+01:00
Bump directory submodule to 1.3.7.1

- - - - -
7962a33a by Douglas Wilson at 2022-08-31T13:16:02+01:00
Bump text submodule to 2.0.1

- - - - -
fd8d80c3 by Ben Gamari at 2022-08-31T13:26:52+01:00
Bump deepseq submodule to 1.4.8.0

- - - - -
a9baafac by Ben Gamari at 2022-08-31T13:26:52+01:00
Add dates to base, ghc-prim changelogs

- - - - -
2cee323c by Ben Gamari at 2022-08-31T13:26:52+01:00
Update autoconf scripts

Scripts taken from autoconf 02ba26b218d3d3db6c56e014655faf463cefa983

- - - - -
e62705ff by Ben Gamari at 2022-08-31T13:26:53+01:00
Bump bytestring submodule to 0.11.3.1

- - - - -
f7b4dcbd by Douglas Wilson at 2022-08-31T13:26:53+01:00
Update submodule Cabal to tag Cabal-v3.8.1.0

closes #21931

- - - - -
e8eaf807 by Matthew Pickering at 2022-08-31T18:27:57-04:00
Refine in-tree compiler args for --test-compiler=stage1

Some of the logic to calculate in-tree arguments was not correct for the
stage1 compiler. Namely we were not correctly reporting whether we were
building static or dynamic executables and whether debug assertions were
enabled.

Fixes #22096

- - - - -
6b2f7ffe by Matthew Pickering at 2022-08-31T18:27:57-04:00
Make ghcDebugAssertions into a Stage predicate (Stage -> Bool)

We also care whether we have debug assertions enabled for a stage one
compiler, but the way which we turned on the assertions was quite
different from the stage2 compiler. This makes the logic for turning on
consistent across both and has the advantage of being able to correct
determine in in-tree args whether a flavour enables assertions or not.

Ticket #22096

- - - - -
15111af6 by Zubin Duggal at 2022-09-01T01:18:50-04:00
Add regression test for #21550

This was fixed by ca90ffa321a31842a32be1b5b6e26743cd677ec5
"Use local instances with least superclass depth"

- - - - -
7d3a055d by Krzysztof Gogolewski at 2022-09-01T01:19:26-04:00
Minor cleanup

- Remove mkHeteroCoercionType, sdocImpredicativeTypes, isStateType (unused),
  isCoVar_maybe (duplicated by getCoVar_maybe)
- Replace a few occurrences of voidPrimId with (# #).
  void# is a deprecated synonym for the unboxed tuple.
- Use showSDoc in :show linker.
  This makes it consistent with the other :show commands

- - - - -
31a8989a by Tommy Bidne at 2022-09-01T12:01:20-04:00
Change Ord defaults per CLC proposal

Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/24#issuecomment-1233331267

- - - - -
7f527f01 by Matthew Pickering at 2022-09-01T12:01:56-04:00
Fix bootstrap with ghc-9.0

It turns out Solo is a very recent addition to base, so for older GHC
versions we just defined it inline here the one place we use it in the
compiler.

- - - - -
065fd535 by Josh Meredith at 2022-09-02T13:54:25-04:00
Add ghcjs changes to deriveConstants:

- change String targetOS option in deriveConstants to an enum
- separate out getWantedGHSJS, removing generated c file in this path

- - - - -
9762485d by doyougnu at 2022-09-02T13:54:25-04:00
Add JavaScript code generator

Adapt code generator of GHCJS to GHC head. Currently it is only enabled
with the hidden -fjavascript flag. It produces .o files that can't be
used yet except by GHCJS's linker.

Codegen: doc

Codegen: correctly return linkable object

Now we can build a static library (-staticlib)

Codegen: doc genLit

Codegen: use assignAll

Codegen: introduce TypedExpr

Refactor assignAll et al, add documentation

Codegen: minor changes

Doc

- - - - -
3c99540c by doyougnu at 2022-09-02T13:54:26-04:00
Add JS.Rts

JS.Rts: compiles

reword: progress on RtsTypes

StgToJS.Config: add SDoc Context

JSRts: move ppr, workaround def type

JSRts.Types: compiles

JS.Rts: closer to compiling

JS.Rts: move jsIdIdent' to StgToJS.Monad

JS.Rts: remove unused predicates

JS: cleanup, comment sections, math funcs to Make

JS.Rts.Types: compiles

StgToJS.Expr: fix compilation errors

StgToJS.DataCon: move initClosure

JS.Rts: remove Alloc module

JS.Rts: initalize Rts module, remove redundant fs

JS: init Rts.Alloc move initClosure

JS.Apply: unwinding combinators in progress

JS: add helpers and fixmes

JS.Rts.Apply: no more e's, add closure, reg helper

StgToJS: add ToStat instance ClosureInfo

JS.Rts.Apply: closer to compiling

JS.Rts.Apply: more removal of #

JS.Rts.Apply: (#) removed

JS.Rts.Apply: compiles

JS.Rts.Rts: just pretty printing left

JS.Rts: Add Notes

JS.Rts: add file headers and notes

JS.Rts.Rts: fixing stringy issues

JS.Rts.Rts: compiles

JS.Rts.Rts: fix non-exhaustive patterns warnings

- - - - -
586ba4fe by Sylvain Henry at 2022-09-02T13:54:26-04:00
Doc has been moved into GHC.StgToJs top-level module

- - - - -
75a7c97b by Sylvain Henry at 2022-09-02T13:54:26-04:00
JS.Rts; refactoring and move to StgToJS

* add closure manipulation helpers and use them in Apply
* add cache (Array) for pre-generated PAP names
* reduce line length:
  * use BlockArguments instead of parens
  * remove implicit mconcat in jVar's body

Rts: more refactorings

Rts: move into StgToJS hierarchy

- - - - -
7010dd86 by Sylvain Henry at 2022-09-02T13:54:26-04:00
JS: cleanup, renaming, better module layout

Various degrees of cleanup adapting GHCJS to GHC. We move several
functions to CoreUtils, remove duplication between the JS.Rts.Apply and
Apply module and factor out closure related code into a Closure module
for cohesion.

Deduplicate code between Rts.Apply and Apply

Move might_be_a_function into CoreUtils

Factorize closure stuff into Closure module

Rename closureExtra into closureField

Minor renamings, comments...

- - - - -
540998e9 by Sylvain Henry at 2022-09-02T13:54:26-04:00
JS.Backend: add FFI code but don't implement yet

FFI: don't crash on JavaScript foreign imports

Note that they are still not desugared properly!!

But the following cmd doesn't crash anymore:

  ghc -fjavascript Test.hs -fforce-recomp -ddump-tc -fno-code -ddump-ds

FFI: adapt GHCJS desugarer

FFI: support direct application

The following example:

  foo :: Int# -> Int#
  foo = add 50000#

  foreign import javascript
    "(function(x,y) { return (x + y) })"
    add :: Int# -> Int# -> Int#

is compiled into an application like this:

  var h$mainZCMzifoozur2_e;
  h$mainZCMzifoozur2_e = (function()
                            {
                            var h$mainZCMziaddzur1;
                            h$mainZCMziaddzur1 = h$r1.d1;
                            var h$$mainZCMzietazuB0_8KXnScrCjF5;
                            h$$mainZCMzietazuB0_8KXnScrCjF5 = h$r2;
                            h$r3 = h$$mainZCMzietazuB0_8KXnScrCjF5;
                            h$r2 = 50000;
                            h$r1 = h$mainZCMziaddzur1;
                            return h$ap_2_2_fast();
                            return h$rs();
                          });
  var h$mainZCMziaddzur1_e;
  h$mainZCMziaddzur1_e = (function()
                            {
                            var h$$mainZCMzidszusAk_236l8r0P8S9;
                            h$$mainZCMzidszusAk_236l8r0P8S9 = h$r2;
                            var h$$mainZCMzids1zusAl_336l8r0P8S9;
                            h$$mainZCMzids1zusAl_336l8r0P8S9 = h$r3;
                            var h$$mainZCM_2;
                            var h$$mainZCMziwildzusAn_536l8r0P8S9;
                            try
                              {
                              h$$mainZCMziwildzusAn_536l8r0P8S9 = (function(x,y) { return (x + y) })(h$$mainZCMzidszusAk_236l8r0P8S9, h$$mainZCMzids1zusAl_336l8r0P8S9)
                            }
                            catch(except)
                              {
                              return h$throwJSException(except)
                            };
                            var h$$mainZCMzids3zusAp_736l8r0P8S9;
                            h$$mainZCMzids3zusAp_736l8r0P8S9 = h$$mainZCMziwildzusAn_536l8r0P8S9;
                            h$r1 = h$$mainZCMzids3zusAp_736l8r0P8S9;
                            return h$rs();
                          });

FFI: correctly dispatch for foreign exports too

FFI: move C FFI desugaring into its own module

FFI: avoid DynFlags in toJsName (copy of toCName)

- - - - -
cb200177 by Sylvain Henry at 2022-09-02T13:56:01-04:00
Configure: preliminary support for triple js-unknown-ghcjs

- - - - -
66034a4d by Sylvain Henry at 2022-09-02T13:56:05-04:00
Driver: enable JS backend by default for JS arch

- - - - -
2e80872b by doyougnu at 2022-09-02T13:56:05-04:00
JS.Backend: Add JS specific Linker

JS: initialize Linker, DynamicLinking

JS.Printer: adapted to GHC Head

JS.Printer: some cleanup and init Printer

StgToJS.Printer: Compiles

JS.Linker: Add types, expose JS keywords

JS.Syntax: add Binary instance on Ident's

JS.Linker: Migrate more Types to Data.Binary

JS.Linker.Types: compiles and adapted to GHC Head

JS.Linker.Types: compiles

JS.Linker.Types: add UseBase type

JS.Linker: Comments and Cleanup

JS.Linker.Types: add TH types, Env type, DepsLoc

JS.Linker: more FIXMEs numerous Linker fixes

JS.Linker: removed Text references

JS.UnitUtils: add package related helper functions

JS.Linker: more DynFlags removal

JS.Linker: Time for semantic errors

JS.Linker: DynFlags finally removed

JS.Linker: 107 compile errors to go

JS.Linker.Utils: initialized, adapted to GHC Head

JS.Linker.Utils: initialize Utils module

JS.Linker.Utils: more utils

JS.Rts: move rtsText to Rts

JS.Linker: linkerStats implemented

JS.Compactor: compiles, adapted to GHC Head

JS.Compactor: have to retrofit compact for linker

JS.Linker.Compactor: unwinding lenses

JS.Linker.Compactor: comments over addItem

JS.Linker.Compactor: Lenses removed

JS.Linker.Compactor: SHA256 removed

JS.Linker.Compactor: only missing instances left

JS.Linker.Compactor: compiles

JS.Linker: compiles, adapted to ghc Head

JS.Linker: More progress

JS.Linker: link in memory compiles

JS.Linker: just shims left

JS.Linker.DynamicLinking compiles: adapted to head

JS.Linker.DynamicLinking: initialization

JS.Linker.DynamicLinking: compiles up to Variants

JS.Variants: initialize

JS.Linker: numerous and various fixes

JS.Linker.DynamicLinking: only small errors left

JS.Linker.Archive: compiles, adapted to GHC Head

JS.Linker: initialize Archive compat module

JS.Linker.Archive: minor fixes

JS.Linker.DynamicLinking: compiles

JS.Linker: cleanup, remove Variants, add comments

fixup: more cleanup

JS.Linker: more cleanup and comments

- - - - -
4cb13e11 by Sylvain Henry at 2022-09-02T13:56:05-04:00
Minor panic fix

- - - - -
3952ebf6 by Sylvain Henry at 2022-09-02T13:56:05-04:00
Linker: fix stage2 build

- - - - -
5d2a2c9b by Sylvain Henry at 2022-09-02T13:56:05-04:00
Configure: Add support fo JS as unregistered ABI

Configure: detect emscripten tools

e.g. on ArchLinux:

  EMSDK=/usr/lib/emscripten EMSDK_LLVM=/opt/emscripten-llvm ./configure --target=js-unknown-ghcjs

Configure: detect nm tool too, required by Hadrian

Configure: make StgToJS use non-unregisterised ABI

It should probably be a third kind of ABI...

- - - - -
7ec5119d by doyougnu at 2022-09-02T13:56:05-04:00
JS.Linker: Hook up to GHC.Driver.Pipeline

JS.Linker.Types: Add newGhcjsEnv function

JS.UnitUtils: fix encodeModule api

JS.Linker: more removal of HscEnv

JS.Linker: hooked into GHC.Driver.Pipeline

- - - - -
5232f4f9 by Sylvain Henry at 2022-09-02T13:56:06-04:00
VERY WIP Hadrian/rts fixes

export EMSDK_LLVM=/opt/emscripten-llvm
export EMSDK=/usr/lib/emscripten
export PATH=./inplace/ghcjs_toolchain/bin:$PATH

./configure --target=js-unknown-ghcjs
./hadrian/build --flavour=quick-js -j --bignum=native --docs=none -V

- - - - -
0a6fb369 by Sylvain Henry at 2022-09-02T13:56:06-04:00
Force creation of rts library with dummy file

- - - - -
6908c5ba by Sylvain Henry at 2022-09-02T13:56:06-04:00
ghc-prim: avoid building C files

- - - - -
d04071fc by Sylvain Henry at 2022-09-02T13:56:06-04:00
Hadrian: disable -fllvm

- - - - -
2065d331 by Sylvain Henry at 2022-09-02T13:56:06-04:00
JS: fix caches

Note that the fact that we need index 0 may hide another issue...

- - - - -
d1e9cce0 by Sylvain Henry at 2022-09-02T13:56:06-04:00
codegen: enhance genCon debug message

- - - - -
747ee15f by Sylvain Henry at 2022-09-02T13:56:07-04:00
RTS: fix stupid comment

- - - - -
32e8edf3 by Sylvain Henry at 2022-09-02T13:56:07-04:00
RTS: embed headers

- - - - -
5fd02f46 by Sylvain Henry at 2022-09-02T13:56:07-04:00
JS.StgToJS: add documentation header for JS Types

- - - - -
28457e78 by Sylvain Henry at 2022-09-02T13:56:07-04:00
CodeGen: refactor ExprCtx code

- - - - -
e81fad7d by Sylvain Henry at 2022-09-02T13:56:07-04:00
CodeGen: cache LNE frame size

- - - - -
4d116eee by doyougnu at 2022-09-02T13:56:07-04:00
JS.Types: Add Outputable for TypedExpr

- - - - -
14653f81 by doyougnu at 2022-09-02T13:56:07-04:00
JS.CoreUtils: handle IOPort case

- - - - -
02e8d573 by doyougnu at 2022-09-02T13:56:08-04:00
JS.Expr: Fix unhandled datacon for RuntimeRep

- - - - -
ba1e9780 by doyougnu at 2022-09-02T13:56:08-04:00
JS.Literals: Adapt genLit to new Literal domain

- - - - -
9e95fd31 by Sylvain Henry at 2022-09-02T13:56:08-04:00
RTS: expose more headers (required to build base)

- - - - -
3e66ea50 by Sylvain Henry at 2022-09-02T13:56:08-04:00
Base: don't build C and Cmm sources with ghcjs

- - - - -
e63f5555 by Sylvain Henry at 2022-09-02T13:56:08-04:00
Tentatively set NO_REGS for JS platforms

- - - - -
e784966d by Sylvain Henry at 2022-09-02T13:56:08-04:00
CodeGen: output LitRubbish as null JS values

- - - - -
bbadd7ee by Sylvain Henry at 2022-09-02T13:56:09-04:00
base: disable forkOS and bound thread machinery

- - - - -
1aeb2547 by Sylvain Henry at 2022-09-02T13:56:09-04:00
CodeGen: support StackSnapshot# in primTypeVt

- - - - -
53a5de26 by Sylvain Henry at 2022-09-02T13:56:09-04:00
CodeGen: better debug message for assignCoerce1

- - - - -
996a61b2 by Sylvain Henry at 2022-09-02T13:56:09-04:00
Misc: enable HasDebugCallStack for zipWithEqual*

- - - - -
68526023 by Sylvain Henry at 2022-09-02T13:56:09-04:00
CodeGen: remove useless imports

- - - - -
e3f1ea73 by Sylvain Henry at 2022-09-02T13:56:09-04:00
Stg: expose pprStgAlt

- - - - -
23974fe0 by Sylvain Henry at 2022-09-02T13:56:09-04:00
CodeGen: restore assignAll (instead of assignAllEqual)

- - - - -
1a7a5534 by Sylvain Henry at 2022-09-02T13:56:10-04:00
CodeGen: handle proxy#

- - - - -
47b4962c by doyougnu at 2022-09-02T13:56:10-04:00
ghc-heap: Don't compile Cmm file for JS-Backend

- - - - -
0d45ac9f by doyougnu at 2022-09-02T13:56:10-04:00
Driver.Main: minor refactor do_code_gen

To clearly separate the JS-Backend from any other backend

- - - - -
67435f6c by Sylvain Henry at 2022-09-02T13:56:10-04:00
Configure: fix echo on Mac, add ghcjs target OS

- - - - -
1a582ea1 by Sylvain Henry at 2022-09-02T13:56:10-04:00
Configure: fix previous commit

- - - - -
b0e19b6f by Luite Stegeman at 2022-09-02T13:56:10-04:00
fix package name in module name field of system dependencies

- - - - -
e3e44e40 by Luite Stegeman at 2022-09-02T13:56:11-04:00
fix duplicate module name in symbols

- - - - -
539ce494 by doyougnu at 2022-09-02T13:56:11-04:00
GHCi.FFI: ignore ffi.h and friends for js-backend

- - - - -
0dc4e2b0 by Sylvain Henry at 2022-09-02T13:56:11-04:00
RTS: fix build of native rts

- - - - -
76c525e3 by Sylvain Henry at 2022-09-02T13:56:11-04:00
Remove temporary -fjavascript flag

- - - - -
dc83f226 by Sylvain Henry at 2022-09-02T13:56:11-04:00
Codegen: fix symbol names ppr

- - - - -
a7041cf3 by Sylvain Henry at 2022-09-02T13:56:11-04:00
Outputable: add ShortText instance

- - - - -
a18946f4 by Sylvain Henry at 2022-09-02T13:56:12-04:00
Linker: enhance debugging message

- - - - -
17a5dfe4 by Sylvain Henry at 2022-09-02T13:56:12-04:00
Remove unused ghcjs unit related code

- - - - -
f7dab371 by Sylvain Henry at 2022-09-02T13:56:12-04:00
ghci: Avoid unused-xyz warnings

- - - - -
e43e75c0 by Sylvain Henry at 2022-09-02T13:56:12-04:00
Linker: remove wiring of ghcjs-prim and ghcjs-th

They will be replaced by ghc-prim, base, template-haskell, etc.

- - - - -
649f249a by Sylvain Henry at 2022-09-02T13:56:12-04:00
Add outputable instance for Deps

- - - - -
f476af90 by doyougnu at 2022-09-02T13:56:12-04:00
Docs: JS.Syntax, JS.Make docs done

JS-backend: Add documentation headers

Docs: JS.Syntax done

Docs: JS.Make done

Docs: JS.Make JS.Syntax refined a bit

- - - - -
c62745d0 by Sylvain Henry at 2022-09-02T13:56:12-04:00
Rename u_env into unit_env (more common)

- - - - -
ba7f9ac6 by Sylvain Henry at 2022-09-02T13:56:13-04:00
Linker: deduplication + fixes

- deduplicate code that was copied from old GHC
- explicitly add preloadUnits to the link
- avoid calling getShims

- - - - -
7fe6118f by Sylvain Henry at 2022-09-02T13:56:13-04:00
Linker: reenable packStrings (not yet implemented though)

- - - - -
e16f4035 by Sylvain Henry at 2022-09-02T13:56:13-04:00
ShortText: add singleton

- - - - -
6f4c21a8 by Sylvain Henry at 2022-09-02T13:56:13-04:00
Linker: force less efficient (but working) static encoding

- - - - -
679ee90a by Luite Stegeman at 2022-09-02T13:56:13-04:00
add GHCJS modules to base package

- - - - -
5747dd6a by Sylvain Henry at 2022-09-02T13:56:13-04:00
Linker: remove JS Shims,tiny GHC.Linker refactor

- - - - -
ee77e1bd by doyougnu at 2022-09-02T13:56:14-04:00
Hadrian: QuickJS ways [] --> Set

- - - - -
5a0ec856 by doyougnu at 2022-09-02T13:56:14-04:00
JS-Backend: rebased to master 468f919b

First rebase of the JS-Backend. This rebase includes the JS backend
combined with !7442 (new backend design). Unfortunately we have to short
circuit the new backend design because the JS backend takes over after
STG and not after StgToCmm.

What's working:
  - hadrian builds JS backend
  - JS backend outputs .js files and "links" them

What still has to be done:
   - JS backend is missing core js libraries as we add these we
   discover bugs in the linker and js rts.

- - - - -
6e4593b5 by doyougnu at 2022-09-02T13:56:14-04:00
JS: silence haddock warnings

JS Backend: remove misc. warnings

- - - - -
f3ba1a3b by doyougnu at 2022-09-02T13:56:14-04:00
JS Backend: ghcjs_HOST_OS --> js_HOST_ARCH

- - - - -
b75abfe4 by Sylvain Henry at 2022-09-02T13:56:14-04:00
JS.Linker: add shims

GHCJS uses JS files for primitive things like the GC and RTS. We call
these JS files "shims". This sequence of commits adds shims from JS and
includes them for linking. In addition the shim directory is controlled
via an evironment variable JS_RTS_PATH...at least for now.

Linker: implement tryReadShimFile

Linker: link with shims provided via an env variable

Use JS_RTS_PATH to provide a directory into which .js and .js.pp files
will be linked into rts.js

JS.Linker: add js dir at root, fix js cpp includes

JS.gc.pp: remove variadic macro

JS.RTS: add rts JS shims files, remove shim CPP

RTS: remove the need for rts.h and add rts JS files

rts.h only contained a few constants duplicated in the codegen. Let's
use the Haskell version as the single source of truth and pass defined
values explicitly to cpp command line ("-DXYZ=abc" arguments).

Also switch from "raw" (use_cpp_and_not_cc_dash_E = True) to the
opposite: in both case we call "cc -E" (meh), but with False the
preprocessor doesn't choke one varargs in macros.

RTS: remove integer.js.pp

We use the native ghc-bignum backend, so we don't need the GMP
compatible JS code.

In addition, this code was failing to run as it requires the JSBN
(https://www.npmjs.com/package/jsbn) "Javascript big number" library,
which we don't necessarily have installed.

RTS: fix typo in field name

RTS: generate CPP macros in Haskell

RTS: share common CPP def into CAFs

- - - - -
d7968ae0 by Sylvain Henry at 2022-09-02T13:56:14-04:00
CPP: disable line markers

CPP: move option before input filename (to be squashed)

- - - - -
3d9a8372 by Sylvain Henry at 2022-09-02T13:56:15-04:00
Linker: add more types

Some cleanup

Enhance and fix LinkerStats

Document and refactor renderLinker

Split collectDeps

Fix collectDeps

Fix linker stats rendering

Remove unused seqListSpine

It isn't used in ghcjs either

- - - - -
b33084f5 by Sylvain Henry at 2022-09-02T13:56:15-04:00
Add some missing primops (Word32,Int32)

Also fix the rendering of missing primops (they must be z-encoded to
avoid having a "#" in their JS name)

- - - - -
e208a734 by Sylvain Henry at 2022-09-02T13:56:15-04:00
FFI: desugar every foreign import/export in JS with JS backend

It means we also desugar CApi calls into JS.

It's probably wrong but instead of generating invalid JS we will only
get the failure at runtime when we will use the function.

fixup

- - - - -
996dbb71 by doyougnu at 2022-09-02T13:56:15-04:00
JS.Linker: remove dflags includePath workaround.

We implemented a workaround for shims that modified the dynflags
includePaths so that the JS backend would find the rts.h file during CPP
of shims. Since aebcca98 this is no longer required because we've
removed the need for rts.h completely. Thus, this commit reverts that
modification.

- - - - -
27edc6d3 by Sylvain Henry at 2022-09-02T13:56:15-04:00
Temporarily wire-in base's shim

Use JS_BASE_PATH env var to set base's shim directory (js_base for now)

Also minor other changes

base: fix encoding for JS arch

- - - - -
8aff4bfa by Sylvain Henry at 2022-09-02T13:56:15-04:00
Add primops

Add primop

- - - - -
475a9161 by doyougnu at 2022-09-02T13:56:15-04:00
Make Shims type, refactor JS Linker

This commit:
 - Adds a proper Shim type and associated utilities. These utitlies are
 purposefully limited to ensure the ShimLbl tag is preserved thus
 guarenteeing shim ordering at link time.
 - Refactors the JS backend linker to use this ordering and Shim API.
 The ordering is not correct (yet!) but with this API its much easier to
 triage, experiment and diagnose link time issues.

Refactor linker to compile time shim ordering

- - - - -
e689c385 by doyougnu at 2022-09-02T13:56:16-04:00
Base: Adapt primitives to JS backend, add base.js

- - - - -
6ddcd5cc by doyougnu at 2022-09-02T13:56:16-04:00
Base: Remove binding forms in JS ffi

- - - - -
cec7567b by Josh Meredith at 2022-09-02T13:56:16-04:00
Replace GHCJS Objectable with GHC Binary

- - - - -
992527fb by Sylvain Henry at 2022-09-02T13:56:16-04:00
Binary: remove unused Map instance

- - - - -
852b3d3a by Sylvain Henry at 2022-09-02T13:56:16-04:00
CodeGen: Add export list

- - - - -
6d6171b1 by Sylvain Henry at 2022-09-02T13:56:16-04:00
Primops: add some Int64/Word64 primops

- - - - -
ae37661a by Sylvain Henry at 2022-09-02T13:56:16-04:00
base: fix one ffi import

- - - - -
49ea149d by doyougnu at 2022-09-02T13:56:17-04:00
base: CPP for JS-backend, adapt write in base shim

This commit ports over each CPP directive from GHCJS to base. In
addition, it adds struct.js.pp to Base shim directory and modifies
h$base_write to always take 6 arguments. Thereby avoiding errors such as
"c(bytesWritten) is not a function". The missing parameter was the file
descriptor object, fdo, which was looked up in the function itself and
is now passed through to comport with the FFI expectations.

- - - - -
bf66fef8 by doyougnu at 2022-09-02T13:56:17-04:00
fixup: remove redundant struct.js.pp in js_base

- - - - -
8164eb37 by doyougnu at 2022-09-02T13:56:17-04:00
JS.Linker: enable linker RTS symbols

- - - - -
d32519b7 by doyougnu at 2022-09-02T13:56:17-04:00
base.GHCJS: adapt Prim to direct call FFI format

- - - - -
9816a788 by doyougnu at 2022-09-02T13:56:17-04:00
Linker: Load JSVal from base not ghc-prim

- - - - -
610b63d4 by doyougnu at 2022-09-02T13:56:17-04:00
fixup: caught one more reference to JSVal in prim

- - - - -
6d4d8950 by Sylvain Henry at 2022-09-02T13:56:18-04:00
base: match on js arch , not ghcjs os

- - - - -
2201126c by Sylvain Henry at 2022-09-02T13:56:18-04:00
Fix MK_JSVAL

- - - - -
5232b6d7 by doyougnu at 2022-09-02T13:56:18-04:00
Prim: cleanup comments

- - - - -
ffe433a4 by doyougnu at 2022-09-02T13:56:18-04:00
JS.Prim: add Int64 PrimOps

- - - - -
1cfe04d1 by Sylvain Henry at 2022-09-02T13:56:18-04:00
Vendor MD5 lib

- - - - -
10e0b643 by Sylvain Henry at 2022-09-02T13:56:18-04:00
More 64-bit primops

- - - - -
61e7cd9f by Sylvain Henry at 2022-09-02T13:56:18-04:00
CodeGen: use if10 helper

- - - - -
e6d50b36 by Sylvain Henry at 2022-09-02T13:56:19-04:00
Ppr: fix selector to avoid adding a newline

- - - - -
d80d27cb by doyougnu at 2022-09-02T13:56:19-04:00
base: GHCJS.Prim make ffi imports use anon funcs

- - - - -
1233ee96 by Sylvain Henry at 2022-09-02T13:56:19-04:00
Linker: disable invalid constructors again

- - - - -
287073ca by Sylvain Henry at 2022-09-02T13:56:19-04:00
More 64-bits primops

- - - - -
b69ccb7b by Sylvain Henry at 2022-09-02T13:56:19-04:00
Fix base_write function

- - - - -
4c0703d1 by Sylvain Henry at 2022-09-02T13:56:19-04:00
Fix base_write for 32-bit size_t

- - - - -
1e5d590e by Sylvain Henry at 2022-09-02T13:56:19-04:00
Configure: fix detection of the target toolchain

- - - - -
2fe91a4c by Sylvain Henry at 2022-09-02T13:56:20-04:00
Remove js_base directory

- - - - -
ab173ffa by Sylvain Henry at 2022-09-02T13:56:20-04:00
Kill Node when the main loop reports an unhandled exception

- - - - -
c7d3540e by Sylvain Henry at 2022-09-02T13:56:20-04:00
CodeGen: preparation to make match on primops complete

- - - - -
81657fcf by Sylvain Henry at 2022-09-02T13:56:20-04:00
Primops: fix Compact primops

- - - - -
a7008c5a by Sylvain Henry at 2022-09-02T13:56:20-04:00
Ignore result arity for some exception primops

- - - - -
d2e5e21b by Sylvain Henry at 2022-09-02T13:56:20-04:00
Fix more primops. Bump array submodule!

- - - - -
01d998db by Sylvain Henry at 2022-09-02T13:56:21-04:00
Compact: fix return of 3 values

- - - - -
754c04a7 by Sylvain Henry at 2022-09-02T13:56:21-04:00
Configure: switch to absolute path

- - - - -
ced9b3d3 by Sylvain Henry at 2022-09-02T13:56:21-04:00
Add a few primops

- - - - -
f735343f by Sylvain Henry at 2022-09-02T13:56:21-04:00
Primop: implement WordAdd2

- - - - -
8cefca27 by Luite Stegeman at 2022-09-02T13:56:22-04:00
quick fix for uTypeVt and typePrimRep panics

this may cause other panics, a full fix will require a bit
more rework and probably removal of VarType

- - - - -
cf910c3e by Josh Meredith at 2022-09-02T13:56:22-04:00
Replace ShortText with (Lexical)FastString in GHCJS backend

- - - - -
11309b1b by Sylvain Henry at 2022-09-02T13:56:22-04:00
Primops: add arithmetic ops

Primops: add decodeDoubleInt64 back

Primop: added timesInt2#

Primop: add mulWord32 and mul2Word32

- - - - -
da2ce640 by Sylvain Henry at 2022-09-02T13:56:22-04:00
Reduce dependency on goog

- - - - -
a5133296 by Sylvain Henry at 2022-09-02T13:56:22-04:00
Primop: implement quotWord32, remWord32, and quotRemWord32

- - - - -
7f886dbb by Sylvain Henry at 2022-09-02T13:56:22-04:00
Primop: Implement quotRem2Word32, misc fixes

Primop: implement quotRem2Word32

Primop: fix timesInt2#

Primop: fix some shifting primops

- - - - -
e4b92460 by Sylvain Henry at 2022-09-02T13:56:23-04:00
Fix bug in upd_frame

I've introduced this bug when I've refactored the code to use helpers to
assign closures.

- - - - -
0a39963a by Sylvain Henry at 2022-09-02T13:56:23-04:00
Primop: throw an exception for unimplemented primops

- - - - -
60842d1a by Sylvain Henry at 2022-09-02T13:56:23-04:00
Primop: fix remWord32

- - - - -
ad19322a by Josh Meredith at 2022-09-02T13:56:23-04:00
Configure: add EMSDK_BIN, match emsdk expectations

Change EMSDK vars to match emscripten/emsdk_env.sh definitions

Add EMSDK_BIN environment variable to configure

- - - - -
9b28fb46 by Sylvain Henry at 2022-09-02T13:56:23-04:00
resultSize: correctly handle Void#

- - - - -
8dc2cf22 by Sylvain Henry at 2022-09-02T13:56:23-04:00
Primop: fix Sized test, more shifting fixes

Primop: ensure that we return u32 values for word primops

Also a refactoring from i3 to i32 for clarity.

Primop: add/fix more shifting primops

Primops: fix Sized test!

- - - - -
7d4c0769 by Sylvain Henry at 2022-09-02T13:56:23-04:00
StgToJS.Apply: Docs

Doc

Doc

- - - - -
7ef32c4c by Josh Meredith at 2022-09-02T13:56:24-04:00
Fix EMSDK configure condition

- - - - -
5f8e4009 by doyougnu at 2022-09-02T13:56:24-04:00
StgToJS.Arg: Unboxable Literal Optimization note

- - - - -
47050654 by Sylvain Henry at 2022-09-02T13:56:24-04:00
Fix Outputable instances for JExpr/JVal

- Put orphan instances in JS.Ppr
- Also fix some redundant imports

- - - - -
9a6b0e26 by doyougnu at 2022-09-02T13:56:24-04:00
configure: avoid CXX stdlib check for js backend

and some cleanup for a previously mis-applied commit during rebasing

- - - - -
79c6e1c3 by doyougnu at 2022-09-02T13:56:24-04:00
fixup: misc. fixes post rebase

- - - - -
de3764cf by Sylvain Henry at 2022-09-02T13:56:24-04:00
PrimOps: add more 64-bit primops

PrimOp: implement more 64-bit primops + PM fix

Ensure that we cover every primop explicitly

- - - - -
121c1320 by Sylvain Henry at 2022-09-02T13:56:25-04:00
PrimOp: correclty (un)handle new thread related primops

- - - - -
d3e7e350 by Sylvain Henry at 2022-09-02T13:56:25-04:00
PrimOp: disable LabelThreadOp for now

- - - - -
7b4dd4be by Sylvain Henry at 2022-09-02T13:56:25-04:00
Minor doc/cleanup

Fix more redundant imports

- - - - -
c3ac5ad6 by doyougnu at 2022-09-02T13:56:25-04:00
base: GHCJS.Prim directory --> GHC.JS.Prim

- - - - -
fc001c05 by Luite Stegeman at 2022-09-02T13:56:25-04:00
implement KeepAlive primop

- - - - -
e682fd45 by Sylvain Henry at 2022-09-02T13:56:25-04:00
Remove orphan instance for StaticArg

- - - - -
a93bebde by Sylvain Henry at 2022-09-02T13:56:25-04:00
Remove redundant jsIdIdent' function

- - - - -
a1abcd8f by Sylvain Henry at 2022-09-02T13:56:26-04:00
Split StgToJS.Monad into StgToJS.{Monad,Ids,Stack}

- - - - -
1277324e by Sylvain Henry at 2022-09-02T13:56:26-04:00
Apply: remove commented case (wasn't optimized either in latest ghcjs)

- - - - -
fd3df88b by Sylvain Henry at 2022-09-02T13:56:26-04:00
Doc: Apply

Apply: doc and refactoring

- use new types instead of Bool/Int
- factorize some code

- - - - -
f25a234c by Sylvain Henry at 2022-09-02T13:56:26-04:00
Primop: arith fixes

Primop: fix 64-bit shifting primops + add some traces

Primop: fix quotRem2Word32

Primop: fix timesInt2. Progress towards passing arith003

PrimOp: fix timesInt32

PrimOp: use mulWord32 when appropriate

- - - - -
144503cf by doyougnu at 2022-09-02T13:56:26-04:00
Configure: remove EMSDK hacks and wrapper scripts

configure JS: remove wrapper scripts

Configure: remove EMSDK hacks. Use emconfigure instead

emconfigure ./configure --target=js-unknown-ghcjs

- - - - -
591fbc7d by Sylvain Henry at 2022-09-02T13:56:26-04:00
GHCJS.Prim leftovers

- - - - -
bbab94fd by Sylvain Henry at 2022-09-02T13:56:27-04:00
Linker: fix linking issue for tuples

- - - - -
61d0c8d4 by Sylvain Henry at 2022-09-02T13:56:27-04:00
FFI: remove narrowing

Fix tests such as cgrun015 (Core lint error)

- - - - -
9e3a01af by Sylvain Henry at 2022-09-02T13:56:27-04:00
Linker: disable logs with default verbosity

- - - - -
78a8c813 by Sylvain Henry at 2022-09-02T13:56:27-04:00
Append program name in top-level exception handler

- - - - -
b5ac1005 by doyougnu at 2022-09-02T13:56:27-04:00
GHC.JS: Remove FIXMEs

JS.Syntax: Remove FIXMEs

JS.Make: remove FIXMEs

JS.Ppr/Transform: Remove FIXMEs

- - - - -
3c5b0b0f by Sylvain Henry at 2022-09-02T13:56:27-04:00
Primop: fix timesInt2#

Pass arith003 test

- - - - -
51195227 by doyougnu at 2022-09-02T13:56:27-04:00
JS.Linker.Linker: remove FIXMEs, clean dead code

- - - - -
d5879132 by Sylvain Henry at 2022-09-02T13:56:28-04:00
Linker: link platform shim before the others

- - - - -
9ea976d6 by Sylvain Henry at 2022-09-02T13:56:28-04:00
Primops: rework 64-bit and Word32 primops

- Use BigInt instead of complex and buggy bit twiddling. We'll assess
  performance later. Let's use a correct and simple implementation for
  now.

- Implement previously missing 64-bit quot and rem

- Refactor logical operators and Prim module more generally

- - - - -
941d3d05 by Sylvain Henry at 2022-09-02T13:56:28-04:00
PrimOp: fixup previous commit...

- - - - -
fe39292b by Sylvain Henry at 2022-09-02T13:56:28-04:00
Primop: fixup previous commit

- - - - -
eda39542 by Sylvain Henry at 2022-09-02T13:56:28-04:00
Doc: minor changes

- - - - -
184fcc03 by Sylvain Henry at 2022-09-02T13:56:28-04:00
Add debug option to watch for insertion of undefined/null in the stack

- - - - -
14c59412 by Sylvain Henry at 2022-09-02T13:56:28-04:00
Apply: fix tag generation

- - - - -
d61dd4fd by Sylvain Henry at 2022-09-02T13:56:29-04:00
Remove redundant import

- - - - -
b162293c by Sylvain Henry at 2022-09-02T13:56:29-04:00
Testsuite: disable Cmm tests with the JS backend

- - - - -
dee5667b by Sylvain Henry at 2022-09-02T13:56:29-04:00
Base: fix c_interruptible_open

- - - - -
54f187bb by Sylvain Henry at 2022-09-02T13:56:29-04:00
Base: fix typo in long_from_number

- - - - -
ff32742c by Sylvain Henry at 2022-09-02T13:56:29-04:00
Env: only add program name to errors, not to traces

- - - - -
62836536 by Sylvain Henry at 2022-09-02T13:56:29-04:00
Testsuite: disable more Cmm tests

- - - - -
8c0db5cf by doyougnu at 2022-09-02T13:56:30-04:00
JS.Linker: removes FIXMEs

JS.Linker.Linker: remove FIXMEs, clean dead code

StgToJS.Linker.Utils: remove FIXMEs

Compactor: Remove FIXMEs

StgToJS.Linker.Types: Remove FIXMEs

JS.Linker.Archive/Dynamic: remove FIXMEs

StgToJS.Linker.Shims: remove FIXMEs

- - - - -
66c61c66 by doyougnu at 2022-09-02T13:56:30-04:00
JS RTS: remove FIXMEs

StgToJS.Rts.Types: Remove FIXMEs

- - - - -
ca9784d5 by Sylvain Henry at 2022-09-02T13:56:30-04:00
Primop: fix bswap32/64 (cf cgrun072)

- - - - -
58fbd2de by Sylvain Henry at 2022-09-02T13:56:30-04:00
Testsuite: normalise ghc program name

- - - - -
c50c19dd by doyougnu at 2022-09-02T13:56:30-04:00
JS Backend: Remove FIXMEs

StgToJS.Apply: Remove FIXMEs

StgToJS.FFI: remove FIXMEs

StgToJS.Expr: remove FIXMEs

StgToJS: Remove FIXMEs

- - - - -
bb53e0b3 by Sylvain Henry at 2022-09-02T13:56:30-04:00
Enable RTS args filtering (cf cgrun025)

- - - - -
a89bc41a by Sylvain Henry at 2022-09-02T13:56:30-04:00
Remove trailing whitespaces (whitespace test)

- - - - -
4d8445e9 by Sylvain Henry at 2022-09-02T13:56:31-04:00
Testsuite: remove platform prefix for unlit tool

- - - - -
6b633fbe by Sylvain Henry at 2022-09-02T13:56:31-04:00
Primop: fix Int64 conversion/negate (integerConversions test)

- - - - -
5de80523 by Sylvain Henry at 2022-09-02T13:56:31-04:00
Linker: remove message with default verbosity

- - - - -
eccaea2b by Sylvain Henry at 2022-09-02T13:56:31-04:00
Testsuite: normalise .jsexe suffix

- - - - -
2903d22b by Sylvain Henry at 2022-09-02T13:56:31-04:00
Remove warning about orphan instance

- - - - -
dd4a9d18 by Sylvain Henry at 2022-09-02T13:56:31-04:00
Compactor: disable dead code

- - - - -
246a2027 by Sylvain Henry at 2022-09-02T13:56:32-04:00
Exception: implement raiseUnderflow etc. as primops

- - - - -
3d923e71 by Sylvain Henry at 2022-09-02T13:56:32-04:00
Primop: fix Int8/18 quot/rem

- - - - -
a808202b by Sylvain Henry at 2022-09-02T13:56:32-04:00
Linker: refactor wired-in deps

- - - - -
d8cf02f9 by Sylvain Henry at 2022-09-02T13:56:32-04:00
Ppr: remove useless left padding for functions in JS dumps

- - - - -
841ad3fd by Josh Meredith at 2022-09-02T13:56:32-04:00
Disable llvm ways and ghci for JS backend testsuite

- - - - -
ab3e10e6 by Sylvain Henry at 2022-09-02T13:56:32-04:00
StaticPtr: don't generate CStubs for the JS backend

- - - - -
18ea6b48 by Sylvain Henry at 2022-09-02T13:56:32-04:00
StaticPtr: fix hs_spt_lookup after upstream change

- - - - -
4a84ce49 by Sylvain Henry at 2022-09-02T13:56:33-04:00
Testsuite: fix normalisation for unlit

T8430 shows:
  `js-unknown-ghcjs-unlit' failed in phase `Literate pre-processor'. (Exit code: 1)

Notice the quote around the program name. So I've made the regex match
more cases (i.e. not only lines starting with the program name).

- - - - -
bfbddebe by Sylvain Henry at 2022-09-02T13:56:33-04:00
Codegen: fix codegen of string literals

Due to FastString change:
 Before: Text.pack . BSC.unpack
 After:  mkFastString . BSC.unpack

It seems that Text handles buggy multi-byte codepoints split into
several String Chars.

- - - - -
619f3ad5 by Sylvain Henry at 2022-09-02T13:56:33-04:00
CPP: fix LINE markers. Only disable them for JS

- - - - -
de7ba6af by Luite Stegeman at 2022-09-02T13:56:33-04:00
add JavaScript files listed in js-sources to package archives

- - - - -
349e2fe3 by Luite Stegeman at 2022-09-02T13:56:33-04:00
update rts js files to include recent fixes

- - - - -
b9d89233 by Luite Stegeman at 2022-09-02T13:56:33-04:00
fix definitions in js/rts.h

- - - - -
3d2e122f by Josh Meredith at 2022-09-02T13:56:34-04:00
stopgap fix for missing ghc-pkg in cross-compiler tests

- - - - -
c2b269ac by Sylvain Henry at 2022-09-02T13:56:34-04:00
Testsuite: better fix for finding prefixed tools

- - - - -
562249f9 by Sylvain Henry at 2022-09-02T13:56:34-04:00
Ppr: add hangBrace helper

- - - - -
d7af64ac by Sylvain Henry at 2022-09-02T13:56:34-04:00
Only declare ccs var in profiling mode

- - - - -
d878b3b7 by Sylvain Henry at 2022-09-02T13:56:34-04:00
Don't consider recursive bindings as inline nor as evaluated

Fix mdo001

- - - - -
13505746 by Sylvain Henry at 2022-09-02T13:56:34-04:00
Hadrian: disable shared libs for JS target

- - - - -
72166909 by Sylvain Henry at 2022-09-02T13:56:34-04:00
Support -ddump-stg-final with the JS backend

- - - - -
b281d6b9 by Sylvain Henry at 2022-09-02T13:56:35-04:00
Add ticky_ghc0 flavour transformer to ticky stage1

- - - - -
b6ffebf5 by Sylvain Henry at 2022-09-02T13:56:35-04:00
Don't read object file when -ddump-js isn't passed

- - - - -
1464f304 by Sylvain Henry at 2022-09-02T13:56:35-04:00
Object: remove dead code + renaming

- - - - -
8df7f336 by Sylvain Henry at 2022-09-02T13:56:35-04:00
Object: replace SymbolTableR with Dictionary

- - - - -
66d01077 by Sylvain Henry at 2022-09-02T13:56:35-04:00
Object: refactoring

- - - - -
7655423f by Sylvain Henry at 2022-09-02T13:56:35-04:00
RTS: link platform.js before the others!

- - - - -
e0316e24 by Sylvain Henry at 2022-09-02T13:56:35-04:00
Hadrian: treat JS objects similarly to other objects

- - - - -
fb0662a0 by Luite Stegeman at 2022-09-02T13:56:36-04:00
fix javascript FFI calls for read and write

- - - - -
a606f872 by doyougnu at 2022-09-02T14:34:23-04:00
propagate ppr code changes to JS backend

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- boot
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Dwarf.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/PIC.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/Tidy.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/add3cfd9bf129cfd8eeddafc17116c3b99beb91d...a606f87203a1c249437b1f182df091743e6c3194

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/add3cfd9bf129cfd8eeddafc17116c3b99beb91d...a606f87203a1c249437b1f182df091743e6c3194
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/20220906/e9f23e33/attachment-0001.html>


More information about the ghc-commits mailing list