| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Note that the fact that we need index 0 may hide another issue...
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
JS.Linker.Types: Add newGhcjsEnv function
JS.UnitUtils: fix encodeModule api
JS.Linker: more removal of HscEnv
JS.Linker: hooked into GHC.Driver.Pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
- change String targetOS option in deriveConstants to an enum
- separate out getWantedGHSJS, removing generated c file in this path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clock_gettime reports the combined total or user AND system time so in
order to replicate it with getrusage we need to add both system and user
time together.
See https://stackoverflow.com/questions/7622371/getrusage-vs-clock-gettime
Some sample measurements when building Cabal with this patch
t1: rusage
t2: clock_gettime
t1: 62347518000; t2: 62347520873
t1: 62395687000; t2: 62395690171
t1: 62432435000; t2: 62432437313
t1: 62478489000; t2: 62478492465
t1: 62514990000; t2: 62514992534
t1: 62515479000; t2: 62515480327
t1: 62515485000; t2: 62515486344
Fixes #21656
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #21682
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch refactors hasFixedRuntimeRep_remainingValArgs, renaming it
to tcRemainingValArgs. The logic is moved to rebuildHsApps, which
ensures consistent behaviour across tcApp and quickLookArg1/tcEValArg.
This patch also refactors the treatment of stupid theta for data
constructors, changing the place we drop stupid theta arguments
from dsConLike to mkDataConRep (now the datacon wrapper drops these
arguments).
We decided not to implement PHASE 2 of the FixedRuntimeRep plan for
these remaining ValArgs. Future directions are outlined on the wiki:
https://gitlab.haskell.org/ghc/ghc/-/wikis/Remaining-ValArgs
Fixes #21544 and #21650
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to process the rhs of non-recursive bindings and their body
using the same env. If we had something like
let x = ... x ...
this caused trouble because the two xs refer to different binders
but we would substitute both for a new binder x2 causing out of scope
errors.
We now simply use two different envs for the rhs and body in cse_bind.
It's all explained in the Note [Separate envs for let rhs and body]
Fixes #21685
|
|
|
|
| |
Co-Authored-By: Andre Marianiello <andremarianiello@users.noreply.github.com>
|
|
|
|
|
|
|
| |
It is redundant information and a source of needless version control
conflicts when multiple MRs are changing the deps list.
Just printing the list and not also its length is fine.
|
|
|
|
|
|
|
|
|
|
|
| |
In the Specialiser, we missed one more call to
bringFloatedDictsIntoScope (see #21391).
This omission led to #21689. The problem is that the call
to `rewriteClassOps` needs to have in scope any dictionaries
floated out of the arguments we have just specialised.
Easy fix.
|
|
|
|
|
|
| |
Replaces uses of `TcRnUnknownMessage` with proper diagnostics
constructors in `GHC.Tc.Gen.Match`, `GHC.Tc.Gen.Pat`, and
`GHC.Tc.Gen.Sig`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes #20312
It deprecates "TypeInType" extension
according to the following proposal:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0083-no-type-in-type.rst
It has been already implemented.
The migration strategy:
1. Disable TypeInType
2. Enable both DataKinds and PolyKinds extensions
Metric Decrease:
T16875
|
|
|
|
|
|
| |
Finishes what !7467 (closed) started.
Progress towards #17957
|
|
|
|
|
| |
We have the length already, so we might as well use that rather than
O(n) recomputing it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As proposed in
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7508#note_432877 and
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7508#note_434676,
`GHC.HsToCore.Ticks` is about ticks, breakpoints are separate and
backend-specific (only for the bytecode interpreter), and mix entry
writing is just for HPC.
With this split we separate out those interpreter- and HPC-specific
its, and keep the main `GHC.HsToCore.Ticks` agnostic.
Also, instead of passing the reversed list and count around, we use
`SizedSeq` which abstracts over the algorithm. This is much nicer to
avoid noise and prevents bugs.
(The bugs are not just hypothetical! I missed up the reverses on an
earlier draft of this commit.)
|
|
|
|
|
|
| |
The old name made it confusing why disabling HPC didn't disable the
entire pass. The name makes it clear --- there are other reasons to add
ticks in addition.
|
|
|
|
|
|
| |
No need to inline traversing a maybe for `mkModBreaks`. And better to
make each function do one thing and let the caller deside when than
scatter the decision making and make the caller seem more imperative.
|