[Git][ghc/ghc][wip/js-staging] 547 commits: rts: ensure we are below maxHeapSize after returning megablocks

Sylvain Henry (@hsyl20) gitlab at gitlab.haskell.org
Thu Oct 27 16:19:39 UTC 2022



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


Commits:
54e41b16 by Teo Camarasu at 2022-10-15T18:09:24+01:00
rts: ensure we are below maxHeapSize after returning megablocks

When the heap is heavily block fragmented the live byte size might be
low while the memory usage is high. We want to ensure that heap overflow
triggers in these cases.

We do so by checking that we can return enough megablocks to
under maxHeapSize at the end of GC.

- - - - -
29bb90db by Teo Camarasu at 2022-10-15T18:09:24+01:00
rts: trigger a major collection if megablock usage exceeds maxHeapSize

When the heap is suffering from block fragmentation, live bytes might be
low while megablock usage is high.

If megablock usage exceeds maxHeapSize, we want to trigger a major GC to
try to recover some memory otherwise we will die from a heapOverflow at
the end of the GC.

Fixes #21927

- - - - -
4a4641ca by Teo Camarasu at 2022-10-15T18:11:29+01:00
Add realease note for #21927

- - - - -
c1e5719a by Sebastian Graf at 2022-10-17T11:58:46-04:00
DmdAnal: Look through unfoldings of DataCon wrappers (#22241)

Previously, the demand signature we computed upfront for a DataCon wrapper

lacked boxity information and was much less precise than the demand transformer

for the DataCon worker.

In this patch we adopt the solution to look through unfoldings of DataCon

wrappers during Demand Analysis, but still attach a demand signature for other

passes such as the Simplifier.

See `Note [DmdAnal for DataCon wrappers]` for more details.

Fixes #22241.

- - - - -
8c72411d by Gergo ERDI at 2022-10-17T19:20:04-04:00
Add `Enum (Down a)` instance that swaps `succ` and `pred`

See https://github.com/haskell/core-libraries-committee/issues/51 for
discussion. The key points driving the implementation are the following
two ideas:

* For the `Int` type, `comparing (complement @Int)` behaves exactly as
  an order-swapping `compare @Int`.
* `enumFrom @(Down a)` can be implemented in terms of `enumFromThen @a`,
  if only the corner case of starting at the very end is handled specially

- - - - -
d80ad2f4 by Alan Zimmerman at 2022-10-17T19:20:40-04:00
Update the check-exact infrastructure to match ghc-exactprint

GHC tests the exact print annotations using the contents of
utils/check-exact.

The same functionality is provided via
https://github.com/alanz/ghc-exactprint

The latter was updated to ensure it works with all of the files on
hackage when 9.2 was released, as well as updated to ensure users of
the library could work properly (apply-refact, retrie, etc).

This commit brings the changes from ghc-exactprint into
GHC/utils/check-exact, adapting for the changes to master.

Once it lands, it will form the basis for the 9.4 version of
ghc-exactprint.

See also discussion around this process at #21355

- - - - -
08ab5419 by Andreas Klebinger at 2022-10-17T19:21:15-04:00
Avoid allocating intermediate lists for non recursive bindings.

We do so by having an explicit folding function that doesn't need to
allocate intermediate lists first.

Fixes #22196

- - - - -
ff6275ef by Andreas Klebinger at 2022-10-17T19:21:52-04:00
Testsuite: Add a new tables_next_to_code predicate.

And use it to avoid T21710a failing on non-tntc archs.

Fixes #22169

- - - - -
abb82f38 by Eric Lindblad at 2022-10-17T19:22:33-04:00
example rewrite
- - - - -
39beb801 by Eric Lindblad at 2022-10-17T19:22:33-04:00
remove redirect
- - - - -
0d9fb651 by Eric Lindblad at 2022-10-17T19:22:33-04:00
use heredoc
- - - - -
0fa2d185 by Matthew Pickering at 2022-10-17T19:23:10-04:00
testsuite: Fix typo when setting llvm_ways

Since 2014 llvm_ways has been set to [] so none of the tests which use
only_ways(llvm_ways) have worked as expected.

Hopefully the tests still pass with this typo fix!

- - - - -
ced664a2 by Krzysztof Gogolewski at 2022-10-17T19:23:10-04:00
Fix T15155l not getting -fllvm

- - - - -
0ac60423 by Andreas Klebinger at 2022-10-18T03:34:47-04:00
Fix GHCis interaction with tag inference.

I had assumed that wrappers were not inlined in interactive mode.
Meaning we would always execute the compiled wrapper which properly
takes care of upholding the strict field invariant.
This turned out to be wrong. So instead we now run tag inference even
when we generate bytecode. In that case only for correctness not
performance reasons although it will be still beneficial for runtime
in some cases.

I further fixed a bug where GHCi didn't tag nullary constructors
properly when used as arguments. Which caused segfaults when calling
into compiled functions which expect the strict field invariant to
be upheld.

Fixes #22042 and #21083

-------------------------
Metric Increase:
    T4801

Metric Decrease:
    T13035
-------------------------

- - - - -
9ecd1ac0 by M Farkas-Dyck at 2022-10-18T03:35:38-04:00
Make `Functor` a superclass of `TrieMap`, which lets us derive the `map` functions.

- - - - -
f60244d7 by Ben Gamari at 2022-10-18T03:36:15-04:00
configure: Bump minimum bootstrap GHC version

Fixes #22245

- - - - -
ba4bd4a4 by Matthew Pickering at 2022-10-18T03:36:55-04:00
Build System: Remove out-of-date comment about make build system

Both make and hadrian interleave compilation of modules of different
modules and don't respect the package boundaries. Therefore I just
remove this comment which points out this "difference".

Fixes #22253

- - - - -
e1bbd368 by Matthew Pickering at 2022-10-18T16:15:49+02:00
Allow configuration of error message printing

This MR implements the idea of #21731 that the printing of a diagnostic
method should be configurable at the printing time.

The interface of the `Diagnostic` class is modified from:

```
class Diagnostic a where
  diagnosticMessage :: a -> DecoratedSDoc
  diagnosticReason  :: a -> DiagnosticReason
  diagnosticHints   :: a -> [GhcHint]
```

to

```
class Diagnostic a where
  type DiagnosticOpts a
  defaultDiagnosticOpts :: DiagnosticOpts a
  diagnosticMessage :: DiagnosticOpts a -> a -> DecoratedSDoc
  diagnosticReason  :: a -> DiagnosticReason
  diagnosticHints   :: a -> [GhcHint]
```

and so each `Diagnostic` can implement their own configuration record
which can then be supplied by a client in order to dictate how to print
out the error message.

At the moment this only allows us to implement #21722 nicely but in
future it is more natural to separate the configuration of how much
information we put into an error message and how much we decide to print
out of it.

Updates Haddock submodule

- - - - -
99dc3e3d by Matthew Pickering at 2022-10-18T16:15:53+02:00
Add -fsuppress-error-contexts to disable printing error contexts in errors

In many development environments, the source span is the primary means
of seeing what an error message relates to, and the In the expression:
and In an equation for: clauses are not particularly relevant. However,
they can grow to be quite long, which can make the message itself both
feel overwhelming and interact badly with limited-space areas.

It's simple to implement this flag so we might as well do it and give
the user control about how they see their messages.

Fixes #21722

- - - - -
5b3a992f by Dai at 2022-10-19T10:45:45-04:00
Add VecSlot for unboxed sums of SIMD vectors

This patch adds the missing `VecRep` case to `primRepSlot` function and
all the necessary machinery to carry this new `VecSlot` through code
generation. This allows programs involving unboxed sums of SIMD vectors
to be written and compiled.

Fixes #22187

- - - - -
6d7d9181 by sheaf at 2022-10-19T10:45:45-04:00
Remove SIMD conversions

This patch makes it so that packing/unpacking SIMD
vectors always uses the right sized types, e.g.
unpacking a Word16X4# will give a tuple of Word16#s.

As a result, we can get rid of the conversion instructions
that were previously required.

Fixes #22296

- - - - -
3be48877 by sheaf at 2022-10-19T10:45:45-04:00
Cmm Lint: relax SIMD register assignment check

As noted in #22297, SIMD vector registers can be used
to store different kinds of values, e.g. xmm1 can be used
both to store integer and floating point values.
The Cmm type system doesn't properly account for this, so
we weaken the Cmm register assignment lint check to only
compare widths when comparing a vector type with its
allocated vector register.

- - - - -
f7b7a312 by sheaf at 2022-10-19T10:45:45-04:00
Disable some SIMD tests on non-X86 architectures

- - - - -
83638dce by M Farkas-Dyck at 2022-10-19T10:46:29-04:00
Scrub various partiality involving lists (again).

Lets us avoid some use of `head` and `tail`, and some panics.

- - - - -
c3732c62 by M Farkas-Dyck at 2022-10-19T10:47:13-04:00
Enforce invariant of `ListBag` constructor.

- - - - -
488d3631 by Bodigrim at 2022-10-19T10:47:52-04:00
More precise types for fields of OverlappingInstances and UnsafeOverlap in TcSolverReportMsg

It's clear from asserts in `GHC.Tc.Errors` that `overlappingInstances_matches`
and `unsafeOverlapped` are supposed to be non-empty, and `unsafeOverlap_matches`
contains a single instance, but these invariants are immediately lost afterwards
and not encoded in types. This patch enforces the invariants by pattern matching
and makes types more precise, avoiding asserts and partial functions such as `head`.

- - - - -
607ce263 by sheaf at 2022-10-19T10:47:52-04:00
Rename unsafeOverlap_matches -> unsafeOverlap_match in UnsafeOverlap
- - - - -
1fab9598 by Matthew Pickering at 2022-10-19T10:48:29-04:00
Add SpliceTypes test for hie files

This test checks that typed splices and quotes get the right type
information when used in hiefiles.

See #21619

- - - - -
a8b52786 by Jan Hrček at 2022-10-19T10:49:09-04:00
Small language fixes in 'Using GHC'

- - - - -
1dab1167 by Gergő Érdi at 2022-10-19T10:49:51-04:00
Fix typo in `Opt_WriteIfSimplifiedCore`'s name

- - - - -
b17cfc9c by sheaf at 2022-10-19T10:50:37-04:00
TyEq:N assertion: only for saturated applications

The assertion that checked TyEq:N in canEqCanLHSFinish incorrectly
triggered in the case of an unsaturated newtype TyCon heading the RHS,
even though we can't unwrap such an application. Now, we only trigger
an assertion failure in case of a saturated application of a newtype
TyCon.

Fixes #22310

- - - - -
ff6f2228 by M Farkas-Dyck at 2022-10-20T16:15:51-04:00
CoreToStg: purge `DynFlags`.

- - - - -
1ebd521f by Matthew Pickering at 2022-10-20T16:16:27-04:00
ci: Make fat014 test robust

For some reason I implemented this as a makefile test rather than a
ghci_script test. Hopefully making it a ghci_script test makes it more
robust.

Fixes #22313

- - - - -
8cd6f435 by Curran McConnell at 2022-10-21T02:58:01-04:00
remove a no-warn directive from GHC.Cmm.ContFlowOpt

This patch is motivated by the desire to remove the {-# OPTIONS_GHC
-fno-warn-incomplete-patterns #-} directive at the top of
GHC.Cmm.ContFlowOpt. (Based on the text in this coding standards doc, I
understand it's a goal of the project to remove such directives.) I
chose this task because I'm a new contributor to GHC, and it seemed like
a good way to get acquainted with the patching process.

In order to address the warning that arose when I removed the no-warn
directive, I added a case to removeUnreachableBlocksProc to handle the
CmmData constructor. Clearly, since this partial function has not been
erroring out in the wild, its inputs are always in practice wrapped by
the CmmProc constructor. Therefore the CmmData case is handled by a
precise panic (which is an improvement over the partial pattern match
from before).

- - - - -
a2af7c4c by Nicolas Trangez at 2022-10-21T02:58:39-04:00
build: get rid of `HAVE_TIME_H`

As advertized by `autoreconf`:

> All current systems provide time.h; it need not be checked for.

Hence, remove the check for it in `configure.ac` and remove conditional
inclusion of the header in `HAVE_TIME_H` blocks where applicable.

The `time.h` header was being included in various source files without a
`HAVE_TIME_H` guard already anyway.

- - - - -
25cdc630 by Nicolas Trangez at 2022-10-21T02:58:39-04:00
rts: remove use of `TIME_WITH_SYS_TIME`

`autoreconf` will insert an `m4_warning` when the obsolescent
`AC_HEADER_TIME` macro is used:

> Update your code to rely only on HAVE_SYS_TIME_H,
> then remove this warning and the obsolete code below it.
> All current systems provide time.h; it need not be checked for.
> Not all systems provide sys/time.h, but those that do, all allow
> you to include it and time.h simultaneously.

Presence of `sys/time.h` was already checked in an earlier
`AC_CHECK_HEADERS` invocation, so `AC_HEADER_TIME` can be dropped and
guards relying on `TIME_WITH_SYS_TIME` can be reworked to
(unconditionally) include `time.h` and include `sys/time.h` based on
`HAVE_SYS_TIME_H`.

Note the documentation of `AC_HEADER_TIME` in (at least) Autoconf 2.67
says

> This macro is obsolescent, as current systems can include both files
> when they exist. New programs need not use this macro.

- - - - -
1fe7921c by Eric Lindblad at 2022-10-21T02:59:21-04:00
runhaskell
- - - - -
e3b3986e by David Feuer at 2022-10-21T03:00:00-04:00
Document how to quote certain names with spaces

Quoting a name for Template Haskell is a bit tricky if the second
character of that name is a single quote. The User's Guide falsely
claimed that it was impossible. Document how to do it.

Fixes #22236
- - - - -
0eba81e8 by Krzysztof Gogolewski at 2022-10-21T03:00:00-04:00
Fix syntax
- - - - -
a4dbd102 by Ben Gamari at 2022-10-21T09:11:12-04:00
Fix manifest filename when writing Windows .rc files

As noted in #12971, we previously used `show` which resulted in
inappropriate escaping of non-ASCII characters.

- - - - -
30f0d9a9 by Ben Gamari at 2022-10-21T09:11:12-04:00
Write response files in UTF-8 on Windows

This reverts the workaround introduced in
f63c8ef33ec9666688163abe4ccf2d6c0428a7e7, which taught our response file
logic to write response files with the `latin1` encoding to workaround
`gcc`'s lacking Unicode support. This is now no longer necessary (and in
fact actively unhelpful) since we rather use Clang.

- - - - -
b8304648 by M Farkas-Dyck at 2022-10-21T09:11:56-04:00
Scrub some partiality in `GHC.Core.Opt.Simplify.Utils`.

- - - - -
09ec7de2 by Teo Camarasu at 2022-10-21T13:23:07-04:00
template-haskell: Improve documentation of strictness annotation types

Before it was undocumentated that DecidedLazy can be returned by
reifyConStrictness for strict fields. This can happen when a field has
an unlifted type or its the single field of a newtype constructor.

Fixes #21380

- - - - -
88172069 by M Farkas-Dyck at 2022-10-21T13:23:51-04:00
Delete `eqExpr`, since GHC 9.4 has been released.

- - - - -
86e6549e by Ömer Sinan Ağacan at 2022-10-22T07:41:30-04:00
Introduce a standard thunk for allocating strings

Currently for a top-level closure in the form

    hey = unpackCString# x

we generate code like this:

    Main.hey_entry() //  [R1]
             { info_tbls: [(c2T4,
                            label: Main.hey_info
                            rep: HeapRep static { Thunk }
                            srt: Nothing)]
               stack_info: arg_space: 8 updfr_space: Just 8
             }
         {offset
           c2T4: // global
               _rqm::P64 = R1;
               if ((Sp + 8) - 24 < SpLim) (likely: False) goto c2T5; else goto c2T6;
           c2T5: // global
               R1 = _rqm::P64;
               call (stg_gc_enter_1)(R1) args: 8, res: 0, upd: 8;
           c2T6: // global
               (_c2T1::I64) = call "ccall" arg hints:  [PtrHint,
                                                        PtrHint]  result hints:  [PtrHint] newCAF(BaseReg, _rqm::P64);
               if (_c2T1::I64 == 0) goto c2T3; else goto c2T2;
           c2T3: // global
               call (I64[_rqm::P64])() args: 8, res: 0, upd: 8;
           c2T2: // global
               I64[Sp - 16] = stg_bh_upd_frame_info;
               I64[Sp - 8] = _c2T1::I64;
               R2 = hey1_r2Gg_bytes;
               Sp = Sp - 16;
               call GHC.CString.unpackCString#_info(R2) args: 24, res: 0, upd: 24;
         }
     }

This code is generated for every string literal. Only difference between
top-level closures like this is the argument for the bytes of the string
(hey1_r2Gg_bytes in the code above).

With this patch we introduce a standard thunk in the RTS, called
stg_MK_STRING_info, that does what `unpackCString# x` does, except it
gets the bytes address from the payload. Using this, for the closure
above, we generate this:

    Main.hey_closure" {
        Main.hey_closure:
            const stg_MK_STRING_info;
            const 0; // padding for indirectee
            const 0; // static link
            const 0; // saved info
            const hey1_r1Gg_bytes; // the payload
    }

This is much smaller in code.

Metric Decrease:
    T10421
    T11195
    T12150
    T12425
    T16577
    T18282
    T18698a
    T18698b

Co-Authored By: Ben Gamari <ben at well-typed.com>

- - - - -
1937016b by Andreas Klebinger at 2022-10-22T07:42:06-04:00
hadrian: Improve error for wrong key/value errors.

- - - - -
11fe42d8 by Vladislav Zavialov at 2022-10-23T00:11:50+03:00
Class layout info (#19623)

Updates the haddock submodule.

- - - - -
f0a90c11 by Sven Tennie at 2022-10-24T00:12:51-04:00
Pin used way for test cloneMyStack (#21977)

cloneMyStack checks the order of closures on the cloned stack. This may
change for different ways. Thus we limit this test to one way (normal).

- - - - -
0614e74d by Aaron Allen at 2022-10-24T17:11:21+02:00
Convert Diagnostics in GHC.Tc.Gen.Splice (#20116)

Replaces uses of `TcRnUnknownMessage` in `GHC.Tc.Gen.Splice` with
structured diagnostics.

closes #20116

- - - - -
8d2dbe2d by Andreas Klebinger at 2022-10-24T15:59:41-04:00
Improve stg lint for unboxed sums.

It now properly lints cases where sums end up distributed
over multiple args after unarise.

Fixes #22026.

- - - - -
41406da5 by Simon Peyton Jones at 2022-10-25T18:07:03-04:00
Fix binder-swap bug

This patch fixes #21229 properly, by avoiding doing a
binder-swap on dictionary Ids.  This is pretty subtle, and explained
in Note [Care with binder-swap on dictionaries].

Test is already in simplCore/should_run/T21229

This allows us to restore a feature to the specialiser that we had
to revert: see Note [Specialising polymorphic dictionaries].
(This is done in a separate patch.)

I also modularised things, using a new function scrutBinderSwap_maybe
in all the places where we are (effectively) doing a binder-swap,
notably

* Simplify.Iteration.addAltUnfoldings
* SpecConstr.extendCaseBndrs

In Simplify.Iteration.addAltUnfoldings I also eliminated a guard
    Many <- idMult case_bndr
because we concluded, in #22123, that it was doing no good.

- - - - -
5a997e16 by Simon Peyton Jones at 2022-10-25T18:07:03-04:00
Make the specialiser handle polymorphic specialisation

Ticket #13873 unexpectedly showed that a SPECIALISE pragma made a
program run (a lot) slower, because less specialisation took place
overall. It turned out that the specialiser was missing opportunities
because of quantified type variables.

It was quite easy to fix. The story is given in
    Note [Specialising polymorphic dictionaries]

Two other minor fixes in the specialiser

* There is no benefit in specialising data constructor /wrappers/.
  (They can appear overloaded because they are given a dictionary
  to store in the constructor.)  Small guard in canSpecImport.

* There was a buglet in the UnspecArg case of specHeader, in the
  case where there is a dead binder. We need a LitRubbish filler
  for the specUnfolding stuff.  I expanded
  Note [Drop dead args from specialisations] to explain.

There is a 4% increase in compile time for T15164, because we generate
more specialised code.  This seems OK.

Metric Increase:
    T15164

- - - - -
7f203d00 by Sylvain Henry at 2022-10-25T18:07:43-04:00
Numeric exceptions: replace FFI calls with primops

ghc-bignum needs a way to raise numerical exceptions defined in base
package. At the time we used FFI calls into primops defined in the RTS.
These FFI calls had to be wrapped into hacky bottoming functions because
"foreign import prim" syntax doesn't support giving a bottoming demand
to the foreign call (cf #16929).

These hacky wrapper functions trip up the JavaScript backend (#21078)
because they are polymorphic in their return type. This commit
replaces them with primops very similar to raise# but raising predefined
exceptions.

- - - - -
0988a23d by Sylvain Henry at 2022-10-25T18:08:24-04:00
Enable popcount rewrite rule when cross-compiling

The comment applies only when host's word size < target's word size.
So we can relax the guard.

- - - - -
a2f53ac8 by Sylvain Henry at 2022-10-25T18:09:05-04:00
Add GHC.SysTools.Cpp module

Move doCpp out of the driver to be able to use it in the upcoming JS backend.

- - - - -
1fd7f201 by Ben Gamari at 2022-10-25T18:09:42-04:00
llvm-targets: Add datalayouts for big-endian AArch64 targets

Fixes #22311.

Thanks to @zeldin for the patch.

- - - - -
f5a486eb by Krzysztof Gogolewski at 2022-10-25T18:10:19-04:00
Cleanup String/FastString conversions

Remove unused mkPtrString and isUnderscoreFS.
We no longer use mkPtrString since 1d03d8bef96.

Remove unnecessary conversions between FastString and String and back.

- - - - -
f7bfb40c by Ryan Scott at 2022-10-26T00:01:24-04:00
Broaden the in-scope sets for liftEnvSubst and composeTCvSubst

This patch fixes two distinct (but closely related) buglets that were uncovered
in #22235:

* `liftEnvSubst` used an empty in-scope set, which was not wide enough to cover
  the variables in the range of the substitution. This patch fixes this by
  populating the in-scope set from the free variables in the range of the
  substitution.
* `composeTCvSubst` applied the first substitution argument to the range of the
  second substitution argument, but the first substitution's in-scope set was
  not wide enough to cover the range of the second substutition. We similarly
  fix this issue in this patch by widening the first substitution's in-scope set
  before applying it.

Fixes #22235.

- - - - -
0270cc54 by Vladislav Zavialov at 2022-10-26T00:02:01-04:00
Introduce TcRnWithHsDocContext (#22346)

Before this patch, GHC used withHsDocContext to attach an HsDocContext
to an error message:

	addErr $ mkTcRnUnknownMessage $ mkPlainError noHints (withHsDocContext ctxt msg)

The problem with this approach is that it only works with
TcRnUnknownMessage. But could we attach an HsDocContext to a
structured error message in a generic way? This patch solves
the problem by introducing a new constructor to TcRnMessage:

	data TcRnMessage where
	  ...
	  TcRnWithHsDocContext :: !HsDocContext -> !TcRnMessage -> TcRnMessage
	  ...

- - - - -
9ab31f42 by Sylvain Henry at 2022-10-26T09:32:20+02:00
Testsuite: more precise test options

Necessary for newer cross-compiling backends (JS, Wasm) that don't
support TH yet.

- - - - -
f60a1a62 by Vladislav Zavialov at 2022-10-26T12:17:14-04:00
Use TcRnVDQInTermType in noNestedForallsContextsErr (#20115)

When faced with VDQ in the type of a term, GHC generates the following
error message:

	Illegal visible, dependent quantification in the type of a term
	(GHC does not yet support this)

Prior to this patch, there were two ways this message could have been
generated and represented:

	1. with the dedicated constructor TcRnVDQInTermType
	    (see check_type in GHC.Tc.Validity)
	2. with the transitional constructor TcRnUnknownMessage
	    (see noNestedForallsContextsErr in GHC.Rename.Utils)

Not only this led to duplication of code generating the final SDoc,
it also made it tricky to track the origin of the error message.

This patch fixes the problem by using TcRnVDQInTermType exclusively.

- - - - -
aba14a5c by Josh Meredith at 2022-10-27T15:04:14+02: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

- - - - -
5ede5acf by doyougnu at 2022-10-27T15:04:14+02: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

- - - - -
577f685e by doyougnu at 2022-10-27T15:04:14+02: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

- - - - -
a9f67742 by Sylvain Henry at 2022-10-27T15:04:14+02:00
Doc has been moved into GHC.StgToJs top-level module

- - - - -
5105665c by Sylvain Henry at 2022-10-27T15:04:14+02: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

- - - - -
2a663cdf by Sylvain Henry at 2022-10-27T15:04:14+02: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...

- - - - -
04e37107 by Sylvain Henry at 2022-10-27T15:04:14+02: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)

- - - - -
64db65f7 by Sylvain Henry at 2022-10-27T15:04:14+02:00
Configure: preliminary support for triple js-unknown-ghcjs

- - - - -
a8c68a7a by Sylvain Henry at 2022-10-27T15:04:14+02:00
Driver: enable JS backend by default for JS arch

- - - - -
ae6a14c7 by doyougnu at 2022-10-27T15:04:14+02: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

- - - - -
4da42530 by Sylvain Henry at 2022-10-27T15:04:14+02:00
Minor panic fix

- - - - -
150e1949 by Sylvain Henry at 2022-10-27T15:04:14+02:00
Linker: fix stage2 build

- - - - -
93dc0acf by Sylvain Henry at 2022-10-27T15:04:15+02: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...

- - - - -
c7885c18 by doyougnu at 2022-10-27T15:04:15+02: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

- - - - -
5e597946 by Sylvain Henry at 2022-10-27T15:04:15+02: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

- - - - -
922ea5f4 by Sylvain Henry at 2022-10-27T15:04:15+02:00
Force creation of rts library with dummy file

- - - - -
cc1913d8 by Sylvain Henry at 2022-10-27T15:04:15+02:00
ghc-prim: avoid building C files

- - - - -
81e9056e by Sylvain Henry at 2022-10-27T15:04:15+02:00
Hadrian: disable -fllvm

- - - - -
3f35890c by Sylvain Henry at 2022-10-27T15:04:15+02:00
JS: fix caches

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

- - - - -
be2ff877 by Sylvain Henry at 2022-10-27T15:04:15+02:00
codegen: enhance genCon debug message

- - - - -
9484a115 by Sylvain Henry at 2022-10-27T15:04:15+02:00
RTS: fix stupid comment

- - - - -
e38f8715 by Sylvain Henry at 2022-10-27T15:04:15+02:00
RTS: embed headers

- - - - -
1f1faae0 by Sylvain Henry at 2022-10-27T15:04:15+02:00
JS.StgToJS: add documentation header for JS Types

- - - - -
686a8c8f by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: refactor ExprCtx code

- - - - -
0a79675a by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: cache LNE frame size

- - - - -
7c2386d1 by doyougnu at 2022-10-27T15:04:15+02:00
JS.Types: Add Outputable for TypedExpr

- - - - -
d831d0b8 by doyougnu at 2022-10-27T15:04:15+02:00
JS.CoreUtils: handle IOPort case

- - - - -
27124039 by doyougnu at 2022-10-27T15:04:15+02:00
JS.Expr: Fix unhandled datacon for RuntimeRep

- - - - -
0ad4d160 by doyougnu at 2022-10-27T15:04:15+02:00
JS.Literals: Adapt genLit to new Literal domain

- - - - -
3245d1d8 by Sylvain Henry at 2022-10-27T15:04:15+02:00
RTS: expose more headers (required to build base)

- - - - -
dcba7241 by Sylvain Henry at 2022-10-27T15:04:15+02:00
Base: don't build C and Cmm sources with ghcjs

- - - - -
cb5fb32c by Sylvain Henry at 2022-10-27T15:04:15+02:00
Tentatively set NO_REGS for JS platforms

- - - - -
76ae652f by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: output LitRubbish as null JS values

- - - - -
9c4bf605 by Sylvain Henry at 2022-10-27T15:04:15+02:00
base: disable forkOS and bound thread machinery

- - - - -
b04e3cb2 by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: support StackSnapshot# in primTypeVt

- - - - -
dd53bc6e by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: better debug message for assignCoerce1

- - - - -
60bcc35a by Sylvain Henry at 2022-10-27T15:04:15+02:00
Misc: enable HasDebugCallStack for zipWithEqual*

- - - - -
e7946162 by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: remove useless imports

- - - - -
48d4502d by Sylvain Henry at 2022-10-27T15:04:15+02:00
Stg: expose pprStgAlt

- - - - -
fef7293f by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: restore assignAll (instead of assignAllEqual)

- - - - -
e7836cd0 by Sylvain Henry at 2022-10-27T15:04:15+02:00
CodeGen: handle proxy#

- - - - -
c00e4c57 by doyougnu at 2022-10-27T15:04:15+02:00
ghc-heap: Don't compile Cmm file for JS-Backend

- - - - -
0cc01875 by doyougnu at 2022-10-27T15:09:00+02:00
Driver.Main: minor refactor do_code_gen

To clearly separate the JS-Backend from any other backend

- - - - -
3569514f by Sylvain Henry at 2022-10-27T15:09:05+02:00
Configure: fix echo on Mac, add ghcjs target OS

- - - - -
b5b81407 by Sylvain Henry at 2022-10-27T15:09:05+02:00
Configure: fix previous commit

- - - - -
818b3844 by Luite Stegeman at 2022-10-27T15:09:05+02:00
fix package name in module name field of system dependencies

- - - - -
29ae5f31 by Luite Stegeman at 2022-10-27T15:09:05+02:00
fix duplicate module name in symbols

- - - - -
724326e5 by doyougnu at 2022-10-27T15:09:05+02:00
GHCi.FFI: ignore ffi.h and friends for js-backend

- - - - -
f03353a0 by Sylvain Henry at 2022-10-27T15:09:05+02:00
RTS: fix build of native rts

- - - - -
f4df976c by Sylvain Henry at 2022-10-27T15:09:05+02:00
Remove temporary -fjavascript flag

- - - - -
a5eaea98 by Sylvain Henry at 2022-10-27T15:09:05+02:00
Codegen: fix symbol names ppr

- - - - -
653fbddf by Sylvain Henry at 2022-10-27T15:09:05+02:00
Outputable: add ShortText instance

- - - - -
f06923a9 by Sylvain Henry at 2022-10-27T15:09:05+02:00
Linker: enhance debugging message

- - - - -
7378af69 by Sylvain Henry at 2022-10-27T15:09:05+02:00
Remove unused ghcjs unit related code

- - - - -
c3e98b18 by Sylvain Henry at 2022-10-27T15:09:05+02:00
ghci: Avoid unused-xyz warnings

- - - - -
ff825665 by Sylvain Henry at 2022-10-27T15:09:05+02:00
Linker: remove wiring of ghcjs-prim and ghcjs-th

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

- - - - -
6c43bea8 by Sylvain Henry at 2022-10-27T15:09:05+02:00
Add outputable instance for Deps

- - - - -
e7fb6351 by doyougnu at 2022-10-27T15:09:05+02: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

- - - - -
57fff81e by Sylvain Henry at 2022-10-27T15:09:06+02:00
Rename u_env into unit_env (more common)

- - - - -
6e0d7bbe by Sylvain Henry at 2022-10-27T15:09:06+02:00
Linker: deduplication + fixes

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

- - - - -
26df04f5 by Sylvain Henry at 2022-10-27T15:09:06+02:00
Linker: reenable packStrings (not yet implemented though)

- - - - -
60697ce5 by Sylvain Henry at 2022-10-27T15:09:06+02:00
ShortText: add singleton

- - - - -
84875209 by Sylvain Henry at 2022-10-27T15:09:06+02:00
Linker: force less efficient (but working) static encoding

- - - - -
6cacaeda by Luite Stegeman at 2022-10-27T15:09:06+02:00
add GHCJS modules to base package

- - - - -
9ce584b6 by Sylvain Henry at 2022-10-27T15:09:06+02:00
Linker: remove JS Shims,tiny GHC.Linker refactor

- - - - -
975326e0 by doyougnu at 2022-10-27T15:09:06+02:00
Hadrian: QuickJS ways [] --> Set

- - - - -
7131a822 by doyougnu at 2022-10-27T15:12:56+02: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.

- - - - -
88e41cfe by doyougnu at 2022-10-27T15:13:00+02:00
JS: silence haddock warnings

JS Backend: remove misc. warnings

- - - - -
9a22d379 by doyougnu at 2022-10-27T15:13:00+02:00
JS Backend: ghcjs_HOST_OS --> js_HOST_ARCH

- - - - -
419134d8 by Sylvain Henry at 2022-10-27T15:14:07+02: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

- - - - -
490db3e2 by Sylvain Henry at 2022-10-27T15:14:33+02: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

- - - - -
76bd2c08 by Sylvain Henry at 2022-10-27T15:14:33+02: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)

- - - - -
5a2b3300 by Sylvain Henry at 2022-10-27T15:14:33+02: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

- - - - -
d69735d9 by doyougnu at 2022-10-27T15:14:33+02: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.

- - - - -
0a8ed2f1 by Sylvain Henry at 2022-10-27T15:14:33+02: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

- - - - -
7187e9a2 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Add primops

Add primop

- - - - -
f0d82d69 by doyougnu at 2022-10-27T15:14:33+02: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

- - - - -
ac31c2da by doyougnu at 2022-10-27T15:14:33+02:00
Base: Adapt primitives to JS backend, add base.js

- - - - -
a58fb155 by doyougnu at 2022-10-27T15:14:33+02:00
Base: Remove binding forms in JS ffi

- - - - -
b4e051e5 by Josh Meredith at 2022-10-27T15:14:33+02:00
Replace GHCJS Objectable with GHC Binary

- - - - -
beb72edd by Sylvain Henry at 2022-10-27T15:14:33+02:00
Binary: remove unused Map instance

- - - - -
418fa8df by Sylvain Henry at 2022-10-27T15:14:33+02:00
CodeGen: Add export list

- - - - -
4bea5bcf by Sylvain Henry at 2022-10-27T15:14:33+02:00
Primops: add some Int64/Word64 primops

- - - - -
06b6b2ca by Sylvain Henry at 2022-10-27T15:14:33+02:00
base: fix one ffi import

- - - - -
9c7b4bfc by doyougnu at 2022-10-27T15:14:33+02: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.

- - - - -
de7a1e7a by doyougnu at 2022-10-27T15:14:33+02:00
fixup: remove redundant struct.js.pp in js_base

- - - - -
f3b628b4 by doyougnu at 2022-10-27T15:14:33+02:00
JS.Linker: enable linker RTS symbols

- - - - -
8a1b83bb by doyougnu at 2022-10-27T15:14:33+02:00
base.GHCJS: adapt Prim to direct call FFI format

- - - - -
a772dbf4 by doyougnu at 2022-10-27T15:14:33+02:00
Linker: Load JSVal from base not ghc-prim

- - - - -
1c4ff2fd by doyougnu at 2022-10-27T15:14:33+02:00
fixup: caught one more reference to JSVal in prim

- - - - -
39e51040 by Sylvain Henry at 2022-10-27T15:14:33+02:00
base: match on js arch , not ghcjs os

- - - - -
387dfe15 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Fix MK_JSVAL

- - - - -
58f56f17 by doyougnu at 2022-10-27T15:14:33+02:00
Prim: cleanup comments

- - - - -
6c26baef by doyougnu at 2022-10-27T15:14:33+02:00
JS.Prim: add Int64 PrimOps

- - - - -
269f47f1 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Vendor MD5 lib

- - - - -
8109fd93 by Sylvain Henry at 2022-10-27T15:14:33+02:00
More 64-bit primops

- - - - -
3d6f52cd by Sylvain Henry at 2022-10-27T15:14:33+02:00
CodeGen: use if10 helper

- - - - -
00959e69 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Ppr: fix selector to avoid adding a newline

- - - - -
06abf4c3 by doyougnu at 2022-10-27T15:14:33+02:00
base: GHCJS.Prim make ffi imports use anon funcs

- - - - -
b413be8f by Sylvain Henry at 2022-10-27T15:14:33+02:00
Linker: disable invalid constructors again

- - - - -
2ea117db by Sylvain Henry at 2022-10-27T15:14:33+02:00
More 64-bits primops

- - - - -
d46bfe7b by Sylvain Henry at 2022-10-27T15:14:33+02:00
Fix base_write function

- - - - -
e8692dcc by Sylvain Henry at 2022-10-27T15:14:33+02:00
Fix base_write for 32-bit size_t

- - - - -
3de929ce by Sylvain Henry at 2022-10-27T15:14:33+02:00
Configure: fix detection of the target toolchain

- - - - -
d4b159be by Sylvain Henry at 2022-10-27T15:14:33+02:00
Remove js_base directory

- - - - -
ab0e82bd by Sylvain Henry at 2022-10-27T15:14:33+02:00
Kill Node when the main loop reports an unhandled exception

- - - - -
3a390a50 by Sylvain Henry at 2022-10-27T15:14:33+02:00
CodeGen: preparation to make match on primops complete

- - - - -
e45255fa by Sylvain Henry at 2022-10-27T15:14:33+02:00
Primops: fix Compact primops

- - - - -
9320f5e8 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Ignore result arity for some exception primops

- - - - -
f3622371 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Fix more primops. Bump array submodule!

- - - - -
a6e437e0 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Compact: fix return of 3 values

- - - - -
94abefbe by Sylvain Henry at 2022-10-27T15:14:33+02:00
Configure: switch to absolute path

- - - - -
22b072e6 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Add a few primops

- - - - -
ec508eb6 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Primop: implement WordAdd2

- - - - -
5924234d by Luite Stegeman at 2022-10-27T15:14:33+02: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

- - - - -
d66c3a39 by Josh Meredith at 2022-10-27T15:14:33+02:00
Replace ShortText with (Lexical)FastString in GHCJS backend

- - - - -
d2855932 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Primops: add arithmetic ops

Primops: add decodeDoubleInt64 back

Primop: added timesInt2#

Primop: add mulWord32 and mul2Word32

- - - - -
17e524f9 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Reduce dependency on goog

- - - - -
7f8bcb71 by Sylvain Henry at 2022-10-27T15:14:33+02:00
Primop: implement quotWord32, remWord32, and quotRemWord32

- - - - -
e916de44 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Primop: Implement quotRem2Word32, misc fixes

Primop: implement quotRem2Word32

Primop: fix timesInt2#

Primop: fix some shifting primops

- - - - -
cc17494f by Sylvain Henry at 2022-10-27T15:14:34+02:00
Fix bug in upd_frame

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

- - - - -
d4931c9f by Sylvain Henry at 2022-10-27T15:14:34+02:00
Primop: throw an exception for unimplemented primops

- - - - -
1e64cb46 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Primop: fix remWord32

- - - - -
86f55e6e by Josh Meredith at 2022-10-27T15:14:34+02: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

- - - - -
7f3205dd by Sylvain Henry at 2022-10-27T15:14:34+02:00
resultSize: correctly handle Void#

- - - - -
f5026823 by Sylvain Henry at 2022-10-27T15:14:34+02: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!

- - - - -
83c05289 by Sylvain Henry at 2022-10-27T15:14:34+02:00
StgToJS.Apply: Docs

Doc

Doc

- - - - -
1dff7690 by Josh Meredith at 2022-10-27T15:14:34+02:00
Fix EMSDK configure condition

- - - - -
c2e65b43 by doyougnu at 2022-10-27T15:14:34+02:00
StgToJS.Arg: Unboxable Literal Optimization note

- - - - -
cda37a8e by Sylvain Henry at 2022-10-27T15:14:34+02:00
Fix Outputable instances for JExpr/JVal

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

- - - - -
fc018e51 by doyougnu at 2022-10-27T15:14:34+02:00
configure: avoid CXX stdlib check for js backend

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

- - - - -
5e9259dc by doyougnu at 2022-10-27T15:14:34+02:00
fixup: misc. fixes post rebase

- - - - -
fba83bb5 by Sylvain Henry at 2022-10-27T15:14:34+02:00
PrimOps: add more 64-bit primops

PrimOp: implement more 64-bit primops + PM fix

Ensure that we cover every primop explicitly

- - - - -
4a4961f8 by Sylvain Henry at 2022-10-27T15:14:34+02:00
PrimOp: correclty (un)handle new thread related primops

- - - - -
304f6780 by Sylvain Henry at 2022-10-27T15:14:34+02:00
PrimOp: disable LabelThreadOp for now

- - - - -
46ac2613 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Minor doc/cleanup

Fix more redundant imports

- - - - -
63d33b12 by doyougnu at 2022-10-27T15:14:34+02:00
base: GHCJS.Prim directory --> GHC.JS.Prim

- - - - -
7ac91eaf by Luite Stegeman at 2022-10-27T15:14:34+02:00
implement KeepAlive primop

- - - - -
4d15298c by Sylvain Henry at 2022-10-27T15:14:34+02:00
Remove orphan instance for StaticArg

- - - - -
459fd770 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Remove redundant jsIdIdent' function

- - - - -
c4a62a33 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Split StgToJS.Monad into StgToJS.{Monad,Ids,Stack}

- - - - -
6e9f6f5b by Sylvain Henry at 2022-10-27T15:14:34+02:00
Apply: remove commented case (wasn't optimized either in latest ghcjs)

- - - - -
e2d8b7ae by Sylvain Henry at 2022-10-27T15:14:34+02:00
Doc: Apply

Apply: doc and refactoring

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

- - - - -
34821437 by Sylvain Henry at 2022-10-27T15:14:34+02: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

- - - - -
fbe591c5 by doyougnu at 2022-10-27T15:14:34+02: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

- - - - -
5313ebf3 by Sylvain Henry at 2022-10-27T15:14:34+02:00
GHCJS.Prim leftovers

- - - - -
3f48ace5 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Linker: fix linking issue for tuples

- - - - -
d4559a23 by Sylvain Henry at 2022-10-27T15:14:34+02:00
FFI: remove narrowing

Fix tests such as cgrun015 (Core lint error)

- - - - -
e406b7fa by Sylvain Henry at 2022-10-27T15:14:34+02:00
Linker: disable logs with default verbosity

- - - - -
9fc62119 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Append program name in top-level exception handler

- - - - -
026ce562 by doyougnu at 2022-10-27T15:14:34+02:00
GHC.JS: Remove FIXMEs

JS.Syntax: Remove FIXMEs

JS.Make: remove FIXMEs

JS.Ppr/Transform: Remove FIXMEs

- - - - -
afd65c8e by Sylvain Henry at 2022-10-27T15:14:34+02:00
Primop: fix timesInt2#

Pass arith003 test

- - - - -
3f08b2fe by doyougnu at 2022-10-27T15:14:34+02:00
JS.Linker.Linker: remove FIXMEs, clean dead code

- - - - -
4a09c065 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Linker: link platform shim before the others

- - - - -
52ddce1b by Sylvain Henry at 2022-10-27T15:14:34+02: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

- - - - -
2c91f255 by Sylvain Henry at 2022-10-27T15:14:34+02:00
PrimOp: fixup previous commit...

- - - - -
6ac581fc by Sylvain Henry at 2022-10-27T15:14:34+02:00
Primop: fixup previous commit

- - - - -
8fafb352 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Doc: minor changes

- - - - -
2534116f by Sylvain Henry at 2022-10-27T15:14:34+02:00
Add debug option to watch for insertion of undefined/null in the stack

- - - - -
36f5b437 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Apply: fix tag generation

- - - - -
c2f06cb7 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Remove redundant import

- - - - -
78b22add by Sylvain Henry at 2022-10-27T15:14:34+02:00
Testsuite: disable Cmm tests with the JS backend

- - - - -
93d57ca0 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Base: fix c_interruptible_open

- - - - -
a3e44cbd by Sylvain Henry at 2022-10-27T15:14:34+02:00
Base: fix typo in long_from_number

- - - - -
4075cfda by Sylvain Henry at 2022-10-27T15:14:34+02:00
Env: only add program name to errors, not to traces

- - - - -
6720dcef by Sylvain Henry at 2022-10-27T15:14:34+02:00
Testsuite: disable more Cmm tests

- - - - -
3c602b4b by doyougnu at 2022-10-27T15:14:34+02: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

- - - - -
8a7dbf9b by doyougnu at 2022-10-27T15:14:34+02:00
JS RTS: remove FIXMEs

StgToJS.Rts.Types: Remove FIXMEs

- - - - -
958f11ba by Sylvain Henry at 2022-10-27T15:14:34+02:00
Primop: fix bswap32/64 (cf cgrun072)

- - - - -
5a4a3034 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Testsuite: normalise ghc program name

- - - - -
f3030821 by doyougnu at 2022-10-27T15:14:34+02:00
JS Backend: Remove FIXMEs

StgToJS.Apply: Remove FIXMEs

StgToJS.FFI: remove FIXMEs

StgToJS.Expr: remove FIXMEs

StgToJS: Remove FIXMEs

- - - - -
9bc93b1b by Sylvain Henry at 2022-10-27T15:14:34+02:00
Enable RTS args filtering (cf cgrun025)

- - - - -
a2f9cdaa by Sylvain Henry at 2022-10-27T15:14:34+02:00
Remove trailing whitespaces (whitespace test)

- - - - -
762c8c64 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Testsuite: remove platform prefix for unlit tool

- - - - -
d3234b3e by Sylvain Henry at 2022-10-27T15:14:34+02:00
Primop: fix Int64 conversion/negate (integerConversions test)

- - - - -
52fac6ed by Sylvain Henry at 2022-10-27T15:14:34+02:00
Linker: remove message with default verbosity

- - - - -
e9754514 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Testsuite: normalise .jsexe suffix

- - - - -
d3baa9f7 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Remove warning about orphan instance

- - - - -
d5f1dcd4 by Sylvain Henry at 2022-10-27T15:14:34+02:00
Compactor: disable dead code

- - - - -
4ef9bbc9 by Sylvain Henry at 2022-10-27T15:15:32+02:00
Exception: implement raiseUnderflow etc. as primops

- - - - -
c03a17a1 by Sylvain Henry at 2022-10-27T15:15:35+02:00
Primop: fix Int8/18 quot/rem

- - - - -
67a7425b by Sylvain Henry at 2022-10-27T15:15:35+02:00
Linker: refactor wired-in deps

- - - - -
a080eea3 by Sylvain Henry at 2022-10-27T15:15:35+02:00
Ppr: remove useless left padding for functions in JS dumps

- - - - -
9876f4af by Josh Meredith at 2022-10-27T15:15:35+02:00
Disable llvm ways and ghci for JS backend testsuite

- - - - -
0d3e418d by Sylvain Henry at 2022-10-27T15:15:35+02:00
StaticPtr: don't generate CStubs for the JS backend

- - - - -
b8df5640 by Sylvain Henry at 2022-10-27T15:15:35+02:00
StaticPtr: fix hs_spt_lookup after upstream change

- - - - -
6ea4bc50 by Sylvain Henry at 2022-10-27T15:15:35+02: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).

- - - - -
b5272496 by Sylvain Henry at 2022-10-27T15:15:35+02: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.

- - - - -
89c73121 by Sylvain Henry at 2022-10-27T15:16:10+02:00
CPP: fix LINE markers. Only disable them for JS

- - - - -
fc34e591 by Luite Stegeman at 2022-10-27T15:16:13+02:00
add JavaScript files listed in js-sources to package archives

- - - - -
eb1989c3 by Luite Stegeman at 2022-10-27T15:16:13+02:00
update rts js files to include recent fixes

- - - - -
95dec287 by Luite Stegeman at 2022-10-27T15:16:13+02:00
fix definitions in js/rts.h

- - - - -
9c405232 by Josh Meredith at 2022-10-27T15:16:13+02:00
stopgap fix for missing ghc-pkg in cross-compiler tests

- - - - -
c4ae0c54 by Sylvain Henry at 2022-10-27T15:16:13+02:00
Testsuite: better fix for finding prefixed tools

- - - - -
976c66c6 by Sylvain Henry at 2022-10-27T15:16:13+02:00
Ppr: add hangBrace helper

- - - - -
d61446b4 by Sylvain Henry at 2022-10-27T15:16:13+02:00
Only declare ccs var in profiling mode

- - - - -
a3e1cfe8 by Sylvain Henry at 2022-10-27T15:16:13+02:00
Don't consider recursive bindings as inline nor as evaluated

Fix mdo001

- - - - -
16b2b6df by Sylvain Henry at 2022-10-27T15:16:13+02:00
Hadrian: disable shared libs for JS target

- - - - -
f44de6e8 by Sylvain Henry at 2022-10-27T15:17:09+02:00
Support -ddump-stg-final with the JS backend

- - - - -
7c89badb by Sylvain Henry at 2022-10-27T15:17:11+02:00
Add ticky_ghc0 flavour transformer to ticky stage1

- - - - -
64b1e0e7 by Sylvain Henry at 2022-10-27T15:17:11+02:00
Don't read object file when -ddump-js isn't passed

- - - - -
b3919dcc by Sylvain Henry at 2022-10-27T15:17:11+02:00
Object: remove dead code + renaming

- - - - -
5d5b4a8b by Sylvain Henry at 2022-10-27T15:17:11+02:00
Object: replace SymbolTableR with Dictionary

- - - - -
df9bfbc7 by Sylvain Henry at 2022-10-27T15:17:11+02:00
Object: refactoring

- - - - -
5f358ae5 by Sylvain Henry at 2022-10-27T15:17:11+02:00
RTS: link platform.js before the others!

- - - - -
9b0ceefa by Sylvain Henry at 2022-10-27T15:17:11+02:00
Hadrian: treat JS objects similarly to other objects

- - - - -
23a08194 by Luite Stegeman at 2022-10-27T15:17:11+02:00
fix javascript FFI calls for read and write

- - - - -
97c792a7 by doyougnu at 2022-10-27T15:17:11+02:00
propagate ppr code changes to JS backend

- - - - -
18019b5b by Sylvain Henry at 2022-10-27T15:17:11+02:00
Switch from Data.Binary and ByteString to BinHandle

- - - - -
8ffa05b7 by Sylvain Henry at 2022-10-27T15:17:11+02:00
Perf: use Ppr's LeftMode to output JS

- - - - -
6b5ab855 by doyougnu at 2022-10-27T15:17:11+02:00
Primops: Add {Index,Write,Read}ByteArrayAs ops

Still need to check for correctness based on T4442.

minor doc fixes

fixup: add some Index..As primops

fixup missed type signature

Primops: Add WriteByteArrayOp_Word8AsFoo ops

Primops: {Index,Read,Write}FooAsBar done except Addr's

Primops: add {Index,Read,Write}ByteArrayAsAddr ops

These will need to be tested for correctness with T4442.hs

- - - - -
f02d5a90 by Sylvain Henry at 2022-10-27T15:17:11+02:00
Move platform.js to base (it must be linked first)

- - - - -
51b88077 by Sylvain Henry at 2022-10-27T15:17:11+02:00
Remove old shim directory

- - - - -
6f1f7732 by doyougnu at 2022-10-27T15:17:11+02:00
JS.Prim: more PrimOps {IndexByteArrayAs, CAS}

Primop: WriteByteArrayOp_Word8AsChar use setInt8

Primops: remove dv_s_u8

This function is non-sensical. Due to the infelicities of JS as a
platform we must use Int8 and friends to write, then coerce to a word,
thus dv_s_iN are the only legal calls for a write, and dv_s_uN legal for
Index and Reads.

Primops: set dv_u8 to correct method call

should be getUint8, not getUInt8, of course the naming convention
changes ever so slightly for Words.

Primops: T4442 finishes ByteArrayAs still fails

JS.Prim: More IndexByteAAs primops

JS.Prim: Prefetch PrimOps are noOps

JS.Primops: Doc explaining lack of vector support

JS.Prim: add CAS and Fetch Ops

- - - - -
f467fe52 by doyougnu at 2022-10-27T15:17:11+02:00
GHC.Utils.Binary: BinDictionary -> FSTable

Rename to avoid naming conflict with haddock.

- - - - -
ff873689 by Josh Meredith at 2022-10-27T15:17:11+02:00
Adjust derefnull test exit code for ghcjs

- - - - -
ef538ebe by doyougnu at 2022-10-27T15:17:11+02:00
Fix Driver missing type signature warnings

- - - - -
d0fc8d49 by doyougnu at 2022-10-27T15:17:11+02:00
PipeLine.Execute: silence warnings on JS backend

- - - - -
f3b70e00 by doyougnu at 2022-10-27T15:17:12+02:00
JS.Primops: Add Bit reverse ops

- - - - -
b1569a1c by doyougnu at 2022-10-27T15:17:12+02:00
SysTools.Tasks: quiet non-totality warnings

- - - - -
299e87da by doyougnu at 2022-10-27T15:17:12+02:00
JS.Primops: Add InterlockedExchange Addr Word

- - - - -
8967bb0f by Sylvain Henry at 2022-10-27T15:17:12+02:00
base: conditional js-sources

- - - - -
84703a93 by Sylvain Henry at 2022-10-27T15:17:12+02:00
TH: add support for JS files

- - - - -
13d87d96 by Sylvain Henry at 2022-10-27T15:17:12+02:00
Linker: fix creation of directories in output paths

- - - - -
697d2cd8 by Sylvain Henry at 2022-10-27T15:17:38+02:00
Backpack: fix empty stubs

- - - - -
2bcbb877 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Add encodeDouble/Float RTS functions

- - - - -
4bc0f422 by Sylvain Henry at 2022-10-27T15:17:40+02:00
encodeDouble: correctly handle 0 base

- - - - -
af323448 by doyougnu at 2022-10-27T15:17:40+02:00
JS.Primops: Add listThreads op

- - - - -
fff4c531 by doyougnu at 2022-10-27T15:17:40+02:00
JS.Primops: Add Read/WriteAddrOp ops

- - - - -
07ff55b3 by doyougnu at 2022-10-27T15:17:40+02:00
JS: Linker and Compactor: cleanup and docs

Compactor: Cleanup: Remove dead comments

JS.Linker.Types: cleanup and document module

- - - - -
2e16c865 by doyougnu at 2022-10-27T15:17:40+02:00
StgToJS.Linker: Add docs to utility modules

StgToJS.Linker.Utils: more docs

StgToJS.Linker.Archive: more docs

- - - - -
2e9d8d6a by doyougnu at 2022-10-27T15:17:40+02:00
StgToJS.Object: Add documentation

- - - - -
4130c615 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Refactor Expr

- - - - -
072b5fd3 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Object: reduce pinned allocation. And don't forget to hClose invalid objects

- - - - -
ff919faf by Sylvain Henry at 2022-10-27T15:17:40+02:00
Fix pdep (cgrun075)

- - - - -
79b83cb1 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Fix error message (don't mention emscripten)

- - - - -
c71f8b99 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Add Float/Word casts

- - - - -
732c79fd by Sylvain Henry at 2022-10-27T15:17:40+02:00
Disable HPC tests with JS backend

- - - - -
0f337c73 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Fix encodeDouble/Float

- - - - -
0229865d by Sylvain Henry at 2022-10-27T15:17:40+02:00
Implement putchar (fix cgrun015)

- - - - -
158a710f by Sylvain Henry at 2022-10-27T15:17:40+02:00
Fix decoding of denormalized floats

- - - - -
d69102ab by Sylvain Henry at 2022-10-27T15:17:40+02:00
Fix isFloatDenormalized function

- - - - -
fac2a09e by Sylvain Henry at 2022-10-27T15:17:40+02:00
Reuse convert buffer

- - - - -
e3de14fe by Sylvain Henry at 2022-10-27T15:17:40+02:00
Reuse convert buffer bis

- - - - -
8b472ebb by Sylvain Henry at 2022-10-27T15:17:40+02:00
Skip some tests that require the dynamic linker

- - - - -
755d9f45 by Josh Meredith at 2022-10-27T15:17:40+02:00
JavaScript ShrinkSmallMutableArrayOp_Char & GetSizeofSmallMutableArrayOp

- - - - -
cbe12a6c by Sylvain Henry at 2022-10-27T15:17:40+02:00
Disable more linker tests

- - - - -
7c418542 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Testsuite: better normalisation for ghc and ghc-pkg

Allow normalisation for ghc and ghc-pkg anywhere in the output, not just
at the beginning of the line.

Fix T1750 and ghcpkg05 for example

- - - - -
e14e09c7 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Skip T14373 because it requires Cmm

- - - - -
57a7e7c3 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Disable cg010 with JS backend

- - - - -
4c57a1f8 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Testsuite: better normalisation of .jsexe extension

- - - - -
e44d1a6a by doyougnu at 2022-10-27T15:17:40+02:00
JS: Linker,Rts docs and cleanup

JS.Linker: Cleanup: remove unused functions/types

JS.Rts.Types: remove dead code, docs

StgToJS.RTS: cleanup and more docs

- - - - -
60935a86 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Disable recomp015

- - - - -
2ad2c591 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Minor refactoring

- - - - -
08a8c899 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Temporary fix the testsuite bug

- - - - -
0533e79e by doyougnu at 2022-10-27T15:17:40+02:00
JS.StgToJS.Types: Docs and cleanup

- - - - -
c0704b70 by Josh Meredith at 2022-10-27T15:17:40+02:00
change JS.Transform.Idents* to use UniqDSet from Set

- - - - -
4b91134c by Sylvain Henry at 2022-10-27T15:17:40+02:00
Minor Linker cleanup

Minor cleanup

- - - - -
3d06d8cd by Sylvain Henry at 2022-10-27T15:17:40+02:00
Linker: load all the dependent units transitively

- - - - -
5ff3d484 by doyougnu at 2022-10-27T15:17:40+02:00
JS: Add Docs and cleanup StgToJS.{Arg,Ids}

JS.Arg: docs and cleanup

StgToJS.Arg: add minimal docs

StgToJS.Ids: Add header

- - - - -
32bb8386 by Sylvain Henry at 2022-10-27T15:17:40+02:00
Implement h$sleep (T5611)

- - - - -
a765c53b by Sylvain Henry at 2022-10-27T15:17:41+02:00
Linker: don't link the same unit twice

- - - - -
355cb4f4 by doyougnu at 2022-10-27T15:17:41+02:00
JS:  docs, cleanup, StgToJS.{Expr,DataCon,Stack}

StgToJS.Deps/Expr: add docs

StgToJS.DataCon: add minor docs

StgToJS.Stack: Docs and cleanup

In particular:

-- Removing some single use functions
-- Some minor refactors related to these removals

StgToJS: comments on static args and optimizeFree

- - - - -
ff700b90 by Sylvain Henry at 2022-10-27T15:17:41+02:00
Disable compact tests

- - - - -
b6c6b9ae by Sylvain Henry at 2022-10-27T15:18:35+02:00
Add support for JS files passed on the command line

- - - - -
f4e26cc8 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Minor cleanup in compactor

- - - - -
ec5a1d27 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Fix encoding of unboxed strings (don't pass through FastString/h$str)

- - - - -
0f93f080 by doyougnu at 2022-10-27T15:18:38+02:00
JS: Misc fixes post Del-Cont rebase

- - - - -
1e86b0ba by Sylvain Henry at 2022-10-27T15:18:38+02:00
Minor cleanup

- - - - -
d26d59ab by Sylvain Henry at 2022-10-27T15:18:38+02:00
Add log1p and expm1 (fix cgrun078)

- - - - -
a352af0b by Sylvain Henry at 2022-10-27T15:18:38+02:00
Assume existence of Math.fround and use it in Float's primops

- - - - -
64b362df by Sylvain Henry at 2022-10-27T15:18:38+02:00
Disable "debug" test

- - - - -
5795eac3 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Implement copyMutableArray with overlap support

- - - - -
8103c69f by Sylvain Henry at 2022-10-27T15:18:38+02:00
Skip CmmSwitchTests

- - - - -
446c3dfd by Sylvain Henry at 2022-10-27T15:18:38+02:00
Fix WordToDouble/WordToFloat (Word2Float32 test)

- - - - -
0795e4ba by Sylvain Henry at 2022-10-27T15:18:38+02:00
Skip one more test

- - - - -
4556b769 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Fix after GHC.Tuple to GHC.Tuple.Prim

- - - - -
d2dee9cf by Sylvain Henry at 2022-10-27T15:18:38+02:00
Fix InterlockedExchange primops (cgrun080)

- - - - -
864ad15b by Sylvain Henry at 2022-10-27T15:18:38+02:00
Disable T12059

- - - - -
de2eb56e by Sylvain Henry at 2022-10-27T15:18:38+02:00
Implement sqrt/sqrtf (fix T14619)

- - - - -
cb4e8b38 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Skip more tests

- - - - -
6f529221 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Disable conc012

- - - - -
1f4b0dd8 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Disable more Cmm tests

- - - - -
c9705cc8 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Fix AtomicPrimops test. Some refactoring in Prim too

- - - - -
83471eb3 by Sylvain Henry at 2022-10-27T15:18:38+02:00
Use GHCJS's signExtend/narrow

- - - - -
3b342ec8 by Josh Meredith at 2022-10-27T15:18:38+02:00
Implement get/set thread label prims

- - - - -
ca6920e8 by doyougnu at 2022-10-27T15:18:38+02:00
JS: remove Linker.Archive module

- - - - -
55d7bf89 by Sylvain Henry at 2022-10-27T15:19:02+02:00
Start disabling tests that use TH/interpreter

- - - - -
1a1f761d by Josh Meredith at 2022-10-27T15:19:03+02:00
Add flagged bounds checking to JS primops

- - - - -
53d1fdb3 by Sylvain Henry at 2022-10-27T15:20:51+02:00
Disable more tests

- - - - -
232b328f by Sylvain Henry at 2022-10-27T15:20:53+02:00
Disable T1791

- - - - -
7f40c5ce by Sylvain Henry at 2022-10-27T15:20:53+02:00
Raise NonTermination as an async exception

- - - - -
c1463aa6 by Sylvain Henry at 2022-10-27T15:20:53+02:00
Expect IOPort test to be broken

- - - - -
71855c70 by Sylvain Henry at 2022-10-27T15:20:53+02:00
Implement rts_isThreaded (fix jules_xref2)

- - - - -
55a0a704 by Sylvain Henry at 2022-10-27T15:20:53+02:00
Disable outofmem2 test

- - - - -
63667c13 by Sylvain Henry at 2022-10-27T15:21:22+02:00
Disable delimited continuation tests

- - - - -
0007f830 by Sylvain Henry at 2022-10-27T15:21:22+02:00
Disable native RTS flag tests

- - - - -
90f36056 by Sylvain Henry at 2022-10-27T15:22:14+02:00
Disable more tests

- - - - -
6ae0869c by Sylvain Henry at 2022-10-27T15:22:16+02:00
Disable more tests

- - - - -
f48c7bec by Sylvain Henry at 2022-10-27T15:22:16+02:00
Skip more tests

- - - - -
ca7bcbaa by Sylvain Henry at 2022-10-27T15:22:16+02:00
Disable try_putmvar tests that use C files

- - - - -
c91bf2af by Sylvain Henry at 2022-10-27T15:22:16+02:00
Disable even more tests

- - - - -
b536ff83 by Sylvain Henry at 2022-10-27T15:22:16+02:00
Linker: remove dead code (base, compactor)

- - - - -
f82453b2 by Sylvain Henry at 2022-10-27T15:22:16+02:00
Better shims linking

- - - - -
7bf2c3a5 by Sylvain Henry at 2022-10-27T15:22:16+02:00
Make isJsFile a bit faster by only reading the header

- - - - -
5a751809 by Sylvain Henry at 2022-10-27T15:22:16+02:00
Linker: write directly into output file

- - - - -
cc782656 by Sylvain Henry at 2022-10-27T15:22:16+02:00
Linker: more refactoring

- - - - -
bd074398 by Sylvain Henry at 2022-10-27T15:22:16+02:00
Lazy loading of JStat in object code

- - - - -
f41580e2 by Sylvain Henry at 2022-10-27T15:22:16+02:00
Use Ppr hack to render directly into a file

- - - - -
d9c68eac by Sylvain Henry at 2022-10-27T15:22:16+02:00
Fix backpack dependencies

- - - - -
68ea1eaf by doyougnu at 2022-10-27T15:22:16+02:00
testsuite: add js_skip_csources function

Used to indicate a test that fails in the JS backend because the JS
Backend does not yet support c-sources in cabal files.

- - - - -
ada4cdfd by doyougnu at 2022-10-27T15:26:47+02:00
testsuite: JS: skip tests which use c-sources

Skip because these tests use c-sources and the JS backend does not yet
support including c-sources

testsuite: JS backend: skip backpack tests

testsuite: JS: skip c-sources ffi tests

testsuite: JS: skip multipleHomeUnits_odir

testsuite: JS: disable more backpack tests

testsuite: JS: disable c-sources rts tests

testsuite: JS: skip c-sources codeGen tests

testsuite: JS: skip c-sources generics test

- - - - -
3024f494 by Josh Meredith at 2022-10-27T15:26:49+02:00
use exit code 134 for JS prim bounds checks

- - - - -
24b48bce by Sylvain Henry at 2022-10-27T15:26:49+02:00
Remove panic in getObject

- - - - -
1d7d9c8b by Sylvain Henry at 2022-10-27T15:26:49+02:00
Add debug and Outputable instances

- - - - -
b770b1bd by Sylvain Henry at 2022-10-27T15:26:49+02:00
Remove backup file

- - - - -
db2326be by Sylvain Henry at 2022-10-27T15:26:49+02:00
Skip overflow tests

- - - - -
161faab7 by Sylvain Henry at 2022-10-27T15:26:49+02:00
Fix RTS includes for native build

- - - - -
1bd62b22 by Sylvain Henry at 2022-10-27T15:26:49+02:00
Doc

- - - - -
7bae6900 by Sylvain Henry at 2022-10-27T15:26:49+02:00
Add perf-js Hadrian flavour

- - - - -
a8766fe1 by doyougnu at 2022-10-27T15:26:49+02:00
JS.Syntax: fix doc wording

- - - - -
6631c5d7 by doyougnu at 2022-10-27T15:26:49+02:00
Driver: JS: tweak error message

- - - - -
381113b4 by Josh Meredith at 2022-10-27T15:26:49+02:00
Factor JS platform constants and h$programArgs/h$rtsArgs into functions with init

- - - - -
066cfe66 by Josh Meredith at 2022-10-27T15:26:49+02:00
Fix function name from h$shrinkMutableArray to h$shrinkMutableCharArray

- - - - -
e6b10f26 by Luite Stegeman at 2022-10-27T15:26:49+02:00
allow async exceptions to be thrown from outside a haskell thread

- - - - -
9d74f606 by Sylvain Henry at 2022-10-27T15:27:47+02:00
Remove shims and refactor Cpp

I've removed the use of js/rts.h and js/constants.h again. We generate
their contents at cpp time. Instead of wiring z-encoded strings into
these macros, we should derive them from wired-in Names so that they
stay correct in the future. Using wired-in Names as single source of
truth.

- - - - -
caac33d5 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Support RTS globals (used by GHC) and EISDIR

Did this while trying to fix CallArity1 (still failing)

- - - - -
80f85582 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Remove JS keywords

1. The list is incomplete
2. We prefix locals with "h$$" so there is no risk of conflict with JS
   keywords

- - - - -
3f792135 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Remove dead code

- - - - -
7b1b4e12 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Make ident supply strict (no need to make it lazy, list already is)

- - - - -
212f2c7b by Sylvain Henry at 2022-10-27T15:27:50+02:00
Add optional assign to DeclStat and remove dead code

- - - - -
a10e2cf7 by doyougnu at 2022-10-27T15:27:50+02:00
JS: Note on JS .o file order, fix .o files

To be specific:

1. add Note [JS Backend .o file procedure]
2. ensure that .o files are touch'd in JS backend postHsc phase. This
  fixes "missing object file" errors produced by
  'GHC.Driver.Main.checkObjects'.

- - - - -
c3359302 by Luite Stegeman at 2022-10-27T15:27:50+02:00
start a subtransaction in a catchStm block

- - - - -
0abd740e by Sylvain Henry at 2022-10-27T15:27:50+02:00
Use FastMutInt in G for uniques

- - - - -
03013825 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Compactor: remove dead code

- - - - -
c880088d by Sylvain Henry at 2022-10-27T15:27:50+02:00
Compactor: remove more dead code

- - - - -
10f4a1db by Sylvain Henry at 2022-10-27T15:27:50+02:00
Compactor: remove unused debug code

- - - - -
b7613ef0 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Compactor: remove unimplemented packStrings

- - - - -
c3788846 by Sylvain Henry at 2022-10-27T15:27:50+02:00
RTS: fix query/replace error

- - - - -
7f521f07 by Luite Stegeman at 2022-10-27T15:27:50+02:00
remove unused STM check invariants

- - - - -
425a3f4a by Josh Meredith at 2022-10-27T15:27:50+02:00
Refactor renaming functions from Compactor module into the Linker

- - - - -
cfa66dc6 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Linker: refactor and cleanup after compactor removal

- - - - -
87f0d6e2 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Filter empty exports to avoid printing a lot of useless newlines

- - - - -
5a84bd46 by Sylvain Henry at 2022-10-27T15:27:50+02:00
RTS: remove dangling semicolons

- - - - -
6db4918b by Sylvain Henry at 2022-10-27T15:27:50+02:00
RTS: remove more dangling semicolons

- - - - -
39af9bb0 by Sylvain Henry at 2022-10-27T15:27:50+02:00
RTS: less semicolons

- - - - -
a0388014 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Only initialize statics once!

- - - - -
e6187c42 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Minor refactoring: avoid unpacking ShortText too soon

- - - - -
14b31403 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Remove unused derived instances

- - - - -
568ba792 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Use Ident in ClosureInfo instead of FastString

- - - - -
24b123f3 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Add identFS helper

- - - - -
49cceaeb by Sylvain Henry at 2022-10-27T15:27:50+02:00
Fix liftToGlobal

identsS wasn't correctly ported: it has to return all the Ident
occurences, not only one. Fixed this and simplified liftToGlobal
implementation.

Used UniqFM instead of Map forn the global ident cache.

- - - - -
6f6da530 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Refactor symbol generation.

Avoid concatenating Strings or FastStrings. Concatenate ByteString
instead.

- - - - -
7735efde by Sylvain Henry at 2022-10-27T15:27:50+02:00
Enhance Label symbol generation

- - - - -
0dd5d845 by Sylvain Henry at 2022-10-27T15:27:50+02:00
Rename fresh idents with their FastString unique

Reduce by 2x the size of the generated file (on Cabal's Setup).

- - - - -
84968c30 by Sylvain Henry at 2022-10-27T15:28:47+02:00
Disable more tests

- - - - -
e6977b6e by Sylvain Henry at 2022-10-27T15:29:05+02:00
Disable more tests

- - - - -
487c58f5 by Sylvain Henry at 2022-10-27T15:29:07+02:00
Disable ghc-heap tests

- - - - -
881dbbb5 by Sylvain Henry at 2022-10-27T15:29:07+02:00
Mark flaky test as fragile

- - - - -
5dc06bc2 by Sylvain Henry at 2022-10-27T15:29:07+02:00
Fix bound checking

- - - - -
2d10b821 by Sylvain Henry at 2022-10-27T15:29:07+02:00
Fix note

- - - - -
70b1d941 by Sylvain Henry at 2022-10-27T15:29:07+02:00
Disable more tests

- - - - -
c55718f2 by Sylvain Henry at 2022-10-27T15:30:59+02:00
Disable more tests

- - - - -
3eb98a9d by Sylvain Henry at 2022-10-27T15:32:48+02:00
Disable more tests

- - - - -
a433ebd5 by doyougnu at 2022-10-27T15:32:50+02:00
testsuite: force ghc-pkg to use stage1

- - - - -
05d35841 by doyougnu at 2022-10-27T15:32:50+02:00
fix linker errors post rebase

Re-add InitFini.c to the rts, it was introduced in
78ab7afe244a7617d600a6180d81d9dec657114d but was somehow removed after a
rebase.

- - - - -
aa01f5d3 by doyougnu at 2022-10-27T15:32:50+02:00
testsuite: rts disable rtsflags001 for JS backend

- - - - -
d7d221f5 by Josh Meredith at 2022-10-27T15:32:50+02:00
Disable runInteractiveProcess tests for ghcjs

- - - - -
c8e61d47 by Josh Meredith at 2022-10-27T15:32:50+02:00
Disable fed001 test for javascript backend

- - - - -
fbe52d55 by Josh Meredith at 2022-10-27T15:32:50+02:00
Disable driver tests for JS backend that use foreign exports

- - - - -
1bfee15b by Josh Meredith at 2022-10-27T15:32:50+02:00
Disable ImpSafeOnly01..10 for JavaScript backend

- - - - -
afa48a77 by Sylvain Henry at 2022-10-27T15:32:50+02:00
Add missing GHC globals

- - - - -
c43abb0c by doyougnu at 2022-10-27T15:33:06+02:00
testsuite: disable ffi for JS backend

More Specically disable:

ffi006
ffi008
ffi011
ffi013
ffi018
ffi019
ffi020
ffi021
ffi023

- - - - -
309c5b1a by doyougnu at 2022-10-27T15:33:08+02:00
testsuite: disable ghci linking tests for JS

Specifically:

ghcilink001
ghcilink003
ghcilink005
ghcilink006

- - - - -
49e048ec by Sylvain Henry at 2022-10-27T15:33:25+02:00
Fix comment

- - - - -
3d364da7 by Sylvain Henry at 2022-10-27T15:33:25+02:00
More bound checking

- - - - -
b422150d by Sylvain Henry at 2022-10-27T15:33:25+02:00
Fix some Word reading in Prim

- - - - -
b8bfd0ec by Sylvain Henry at 2022-10-27T15:33:25+02:00
Implement openDir

Seems to work (with tracing) but tests still fail with getInt16 index
error :'(

- - - - -
05ed3ad4 by doyougnu at 2022-10-27T15:33:25+02:00
testsuite: disable cabal tests for JS backend

- - - - -
107b4f62 by doyougnu at 2022-10-27T15:33:25+02:00
testsuite: disable bkpcabal[01-07] for JS backend

- - - - -
cdef27e9 by doyougnu at 2022-10-27T15:33:25+02:00
testsuite: disable tests that cause OOM on JS

These tests require the JS Backend to implement GHCJS's compactor, until
that happens nodejs throws an exception that variable names are too
long, hence we disable them.

- - - - -
c34ec03c by Sylvain Henry at 2022-10-27T15:33:25+02:00
Disable HPC tests

Bump hpc submodule

- - - - -
2400836e by Sylvain Henry at 2022-10-27T15:33:25+02:00
Avoid useless space change

- - - - -
30014808 by Sylvain Henry at 2022-10-27T15:33:25+02:00
Remove duplicated comment

- - - - -
260b4f90 by Sylvain Henry at 2022-10-27T15:33:25+02:00
Readd useless space

- - - - -
c7dff24d by Sylvain Henry at 2022-10-27T15:33:25+02:00
Fix some rts.cabal.in rebase glitches

- - - - -
036942dd by doyougnu at 2022-10-27T15:33:25+02:00
testsuite: disable T12233 tests for JS backend

- - - - -
644fd7d7 by Sylvain Henry at 2022-10-27T15:33:25+02:00
Fix rts.cabal.in again

- - - - -
98405c69 by Luite Stegeman at 2022-10-27T15:33:25+02:00
fix typo in dumpStackTop function

- - - - -
e0de305d by doyougnu at 2022-10-27T15:41:19+02:00
testsuite: remove js_skip_csources, use c_src

- - - - -
bac2fff2 by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip recomp4,8 on JS backend

- - - - -
3fb6a91c by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip alloccounter1 and T19156 for JS

These tests fail due to missing primops

- - - - -
22f312d6 by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip T7773 and topHandler01 for JS

- - - - -
ca01237d by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip rdynamic and T2615 for JS Backend

- - - - -
5082d0cf by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip T4012 for JS backend

- - - - -
b3834d80 by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip T15427 for JS backend

- - - - -
7848009b by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip T19481, T19381, T3474 for JS

- - - - -
6ec362ca by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip stack004 for JS backend

- - - - -
e4e06fcd by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: JS skip ThreadDelay001 and encoding004

- - - - -
b1e7a369 by doyougnu at 2022-10-27T15:41:21+02:00
testsuite: skip openFile003 for JS backend

- - - - -
98dcc9d2 by doyougnu at 2022-10-27T15:41:34+02:00
testsuite: disable T1959 and capi tests for JS

- - - - -
c7dc80eb by Sylvain Henry at 2022-10-27T15:43:56+02:00
Replace c_src with req_c

- - - - -
07c5c95f by Sylvain Henry at 2022-10-27T15:44:13+02:00
Fix testsuite

- - - - -
3c528b25 by doyougnu at 2022-10-27T15:44:15+02:00
testsuite: disable CallArity, LintEtaExpand etc

These cause a illegal op on directory error. Disable for now:

CallArity1
LintEtaExpand
T9595
T10942
T18522-dbg-ppr

- - - - -
6938bae0 by Luite Stegeman at 2022-10-27T15:44:15+02:00
fix isJsCore predicates for base package

- - - - -
8fb89ca5 by Sylvain Henry at 2022-10-27T15:44:15+02:00
CI: add CI script for the JS backend

- - - - -
a7bf964c by Sylvain Henry at 2022-10-27T15:44:15+02:00
Fix rts.cabal again

- - - - -
7deaab9a by Sylvain Henry at 2022-10-27T15:44:15+02:00
Fix invalid use of predStage

- - - - -
b21d493d by Sylvain Henry at 2022-10-27T15:44:15+02:00
Fix hlint errors on CI

- - - - -
7ade7cf0 by doyougnu at 2022-10-27T15:44:15+02:00
testsuite: disable that throw out of bounds on JS

Specifically:

T12733
T1372
T15594
T16219
T18567
T20509
T3007
different-db
mhu-closure
package-imports-20779
t19518

- - - - -
e8a6afe4 by doyougnu at 2022-10-27T15:44:15+02:00
testsuite: skip EventlogOutput{1,2} for JS backend

- - - - -
dcd20a80 by doyougnu at 2022-10-27T15:44:15+02:00
testsuite: skip T1679, T2469, T4038 for JS

and also skip UnliftedTVar2

- - - - -
2f705d39 by doyougnu at 2022-10-27T15:44:15+02:00
testsuite: skip T4891 for JS backend

This one throws illegal op on directory similar to T10942 and CallArity1

- - - - -
6886fdb8 by doyougnu at 2022-10-27T15:44:15+02:00
testsuite: skip T8308 for JS

JS backend does not have any ticky capability yet, so skip for now

- - - - -
e1141cd5 by doyougnu at 2022-10-27T15:44:15+02:00
testsuite: skip T9405 for JS

JS backend does not yet support ticky

- - - - -
b08db5bd by doyougnu at 2022-10-27T15:44:39+02:00
testsuite: skip T14624, T20199 for JS backend

- - - - -
b9524118 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip T5594 and T5402 for JS

- - - - -
eba2ee0f by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip openFile00{5,7} readFile001 for JS

- - - - -
8740038f by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip T11004 and T12504 for JS

- - - - -
0155e32e by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip hGetBuf001, hReady00{1,2} for JS

- - - - -
dbdb572e by doyougnu at 2022-10-27T15:44:40+02:00
fixup: missed readwrite002

- - - - -
5dbe3da7 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip T18642 for JS

- - - - -
736bab19 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip TargetContents for JS

- - - - -
3286f7ef by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip T18481a T10678 and friends

- - - - -
1b255f35 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip RepPolyUnliftedDatatype2 for JS

- - - - -
6a5e4609 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip ghci some tests

these throw not built for interactive use errors

- - - - -
f815da84 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip DocsInHiFileTH for JS

- - - - -
7e240eb7 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip T7037, T7702, safePkg01 for JS

- - - - -
b905a11c by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip tests that throw gmake error

Specifically:

T15261a
T15261b
T16318
T17648
T20214
T21336c
rtsopts002
withRtsOpts

- - - - -
6372ce92 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip T3837, hsc2hs003 typecheck.testeq1

- - - - -
306786a2 by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip fat005 for JS

- - - - -
e73e9abb by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip topHandler02,03 for JS

- - - - -
53f63fbf by doyougnu at 2022-10-27T15:44:40+02:00
testsuite: skip tests that unexpected pass/fail

- - - - -
95fc176a by Sylvain Henry at 2022-10-27T15:44:40+02:00
Try to fix Hadrian for native

- - - - -
2f008430 by Luite Stegeman at 2022-10-27T15:44:40+02:00
fix index.html template newlines and use all.js for now (at least it works)

- - - - -
0cf000ce by Sylvain Henry at 2022-10-27T15:44:40+02:00
Fix testsuite typo

- - - - -
75ad5bed by doyougnu at 2022-10-27T15:44:58+02:00
testsuite: skip golden failure tests

Specifically:

GcStaticPointers
T13167
T14452
T16707
T17481
T7160
bkp32
fptr01

- - - - -
c65f5cd5 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip T13525 for JS

Fails for missing h$base_mkfifo

- - - - -
cdc1917b by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip tests which timeout on JS

Specifically:

Timeout001
listThreads
mask002

- - - - -
a37b2897 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip failing IO tests for JS

Specifically:

hClose002
hFileSize002
hSetBuffering003
sum_mod

- - - - -
23e88d76 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip countReaders001 for JS

- - - - -
abbc682e by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip T10414 for JS backend

- - - - -
13db7cd8 by Luite Stegeman at 2022-10-27T15:45:00+02:00
correct stack offset when restarting an STM transaction

- - - - -
11912077 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip T11155 T21336a T21869 for JS

- - - - -
23dfcb84 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip failing linker and hp2ps tests

- - - - -
3303ba93 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip out of memory tests for JS

- - - - -
83aaf9b2 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip remaining failing tests for JS

- - - - -
4813d19d by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: fix typo

- - - - -
9bedb3d7 by doyougnu at 2022-10-27T15:45:00+02:00
hadrian: fix js and native testing

- - - - -
3387a576 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Skip one test

- - - - -
94755c12 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Skip one more test

- - - - -
a1750365 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Add missing comma

- - - - -
9f07c124 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Only change the test environment for cross

- - - - -
3938ea47 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Force creation of hpc/haddock/runghc programs for cross

- - - - -
ee63b0a2 by doyougnu at 2022-10-27T15:45:00+02:00
process: skip process tests for JS backend

- - - - -
5cd2f92b by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip remaining failing tests for JS

- - - - -
0a943a28 by doyougnu at 2022-10-27T15:45:00+02:00
process: skip T1780, T8343, T4889 for JS

- - - - -
52c9b013 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: skip T12852 for JS backend

- - - - -
0a7339d8 by doyougnu at 2022-10-27T15:45:00+02:00
stm: skip failing tests for JS backend

- - - - -
67ff0a85 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Some changes to Binary after reviews

- - - - -
385c9312 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Rename back defaultUserData into noUserData

- - - - -
4a91efdb by Sylvain Henry at 2022-10-27T15:45:00+02:00
Revert backpack change

- - - - -
f4c8ce2e by Sylvain Henry at 2022-10-27T15:45:00+02:00
Don't create directory in copyWithHeader

- - - - -
2fd3d5c1 by Sylvain Henry at 2022-10-27T15:45:00+02:00
Remove now useless changes to Ppr

- - - - -
9c36c375 by Josh Meredith at 2022-10-27T15:45:00+02:00
Change js_skip to js_broken(22350) for ImpSafeOnly01..10 tests

- - - - -
b376335c by Josh Meredith at 2022-10-27T15:45:00+02:00
Change js_broken(22350) to js_skip for safePkg01 test

- - - - -
78e88a51 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: Cabal js_skip -> js_broken(22351)

Issue: https://gitlab.haskell.org/ghc/ghc/-/issues/22351

- - - - -
d37ecbe0 by doyougnu at 2022-10-27T15:45:00+02:00
add req_js_compactor, update impacted tests

Issue: https://gitlab.haskell.org/ghc/ghc/-/issues/22352

- - - - -
679f80b1 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: mark more tests with req_js_compactor

- - - - -
632a1f4e by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: js_skip -> js_broken(22355) more tests

Specifically:
T11004
T12504
T3837
hsc2hs003
T15758
exec_signals
hsc2hs001
hsc2hs002
typecheck.testeq1

See tracking ticket: https://gitlab.haskell.org/ghc/ghc/-/issues/22355

- - - - -
6ecd2735 by doyougnu at 2022-10-27T15:45:00+02:00
testsuite: mark #22356 tests as js_broken

Specifically:

T12733
T1372
T15594
T16219
T18567
T20509
T3007
different-db
mhu-closure
package-imports-20779
t19518

- - - - -
2a784ec0 by Josh Meredith at 2022-10-27T15:45:00+02:00
Use js_broken(22349) for releavant base tests

- - - - -
d7a9d7a0 by Josh Meredith at 2022-10-27T15:45:00+02:00
Use js_broken(22359) for relevant tests

- - - - -
a219e4d2 by Josh Meredith at 2022-10-27T15:45:00+02:00
Use js_broken(22360) for releavant tests

- - - - -
d47fabaf by Josh Meredith at 2022-10-27T15:45:00+02:00
Use req_ffi_exports for JS-skipped driver* tests

- - - - -
946e1409 by Josh Meredith at 2022-10-27T15:45:00+02:00
Use req_c for some JS-skipped tests

- - - - -
bdea64b7 by Josh Meredith at 2022-10-27T15:45:00+02:00
Use js_broken(22362) for package.conf.d errored tests

- - - - -
24d27b59 by Josh Meredith at 2022-10-27T15:45:00+02:00
Use req_interp for JS-skipped ghcilink001/3/5/6

- - - - -
3ed08eda by Josh Meredith at 2022-10-27T15:45:15+02:00
Use js_broken(22363) for affected ffi000 tests

- - - - -
e084f2d5 by Josh Meredith at 2022-10-27T15:45:17+02:00
Use js_broken(22364) for affected tests

- - - - -
acceb752 by doyougnu at 2022-10-27T15:45:17+02:00
testsuite: mark tests as js_broken(22370)

Specifically:

rtsopts002
T15261a
T15261b
T16318
T17648
T20214
T21336c
withRtsOpts

Tracking ticket: #22370

- - - - -
cee914ed by Josh Meredith at 2022-10-27T15:45:17+02:00
Use js_broken(22351) for T10955dyn

- - - - -
f1bf6e21 by Sylvain Henry at 2022-10-27T15:45:18+02:00
Remove trailing semicolons

- - - - -
6088c972 by Sylvain Henry at 2022-10-27T16:26:39+02:00
Minor fixes after rebase

- - - - -
e8ecf969 by doyougnu at 2022-10-27T16:53:18+02:00
test: T23674{w} recomp004 load_short_name -> req_c

- - - - -
7f2942c9 by Josh Meredith at 2022-10-27T18:22:43+02:00
Upgrade miscellaneous tests from js_skip to js_broken(22261)

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/BlockLayout.hs
- compiler/GHC/CmmToAsm/PPC/Instr.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Map/Expr.hs
- compiler/GHC/Core/Map/Type.hs
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/Opt/ConstantFold.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/71162e41807aaf7ddb43b2233979235570b0da11...7f2942c997808c1cb39e2adacaeb08d30542ba68

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/71162e41807aaf7ddb43b2233979235570b0da11...7f2942c997808c1cb39e2adacaeb08d30542ba68
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/20221027/ba1f0009/attachment-0001.html>


More information about the ghc-commits mailing list