summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* CodeGen: output LitRubbish as null JS valuesSylvain Henry2022-06-131-12/+13
|
* Tentatively set NO_REGS for JS platformsSylvain Henry2022-06-131-1/+4
|
* Base: don't build C and Cmm sources with ghcjsSylvain Henry2022-06-131-13/+15
|
* RTS: expose more headers (required to build base)Sylvain Henry2022-06-131-1/+4
|
* JS.Literals: Adapt genLit to new Literal domaindoyougnu2022-06-131-0/+12
|
* JS.Expr: Fix unhandled datacon for RuntimeRepdoyougnu2022-06-131-2/+8
|
* JS.CoreUtils: handle IOPort casedoyougnu2022-06-131-0/+1
|
* JS.Types: Add Outputable for TypedExprdoyougnu2022-06-131-2/+6
|
* CodeGen: cache LNE frame sizeSylvain Henry2022-06-131-5/+7
|
* CodeGen: refactor ExprCtx codeSylvain Henry2022-06-1310-92/+213
|
* JS.StgToJS: add documentation header for JS TypesSylvain Henry2022-06-131-4/+7
|
* RTS: embed headersSylvain Henry2022-06-131-4/+4
|
* RTS: fix stupid commentSylvain Henry2022-06-131-1/+3
|
* codegen: enhance genCon debug messageSylvain Henry2022-06-131-2/+2
|
* JS: fix cachesSylvain Henry2022-06-131-3/+3
| | | | Note that the fact that we need index 0 may hide another issue...
* Hadrian: disable -fllvmSylvain Henry2022-06-131-1/+13
|
* ghc-prim: avoid building C filesSylvain Henry2022-06-131-12/+13
|
* Force creation of rts library with dummy fileSylvain Henry2022-06-132-0/+1
|
* VERY WIP Hadrian/rts fixesSylvain Henry2022-06-139-658/+705
| | | | | | | | | 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: Hook up to GHC.Driver.Pipelinedoyougnu2022-06-135-115/+206
| | | | | | | | | | 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: Add support fo JS as unregistered ABISylvain Henry2022-06-131-1/+1
| | | | | | | | | | | | | | 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...
* Linker: fix stage2 buildSylvain Henry2022-06-131-22/+21
|
* Minor panic fixSylvain Henry2022-06-131-1/+1
|
* JS.Backend: Add JS specific Linkerdoyougnu2022-06-1316-81/+4256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Driver: enable JS backend by default for JS archSylvain Henry2022-06-131-0/+8
|
* Configure: preliminary support for triple js-unknown-ghcjsSylvain Henry2022-06-134-1/+17
|
* JS.Backend: add FFI code but don't implement yetSylvain Henry2022-06-138-12/+800
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* JS: cleanup, renaming, better module layoutSylvain Henry2022-06-1312-1052/+996
| | | | | | | | | | | | | | | | | 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...
* JS.Rts; refactoring and move to StgToJSSylvain Henry2022-06-139-855/+979
| | | | | | | | | | | | * 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
* Doc has been moved into GHC.StgToJs top-level moduleSylvain Henry2022-06-131-66/+0
|
* Add JS.Rtsdoyougnu2022-06-1317-76/+1936
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add JavaScript code generatordoyougnu2022-06-1345-189/+8449
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add ghcjs changes to deriveConstants:Josh Meredith2022-06-131-15/+61
| | | | | - change String targetOS option in deriveConstants to an enum - separate out getWantedGHSJS, removing generated c file in this path
* getProcessCPUTime: Fix the getrusage fallback to account for system CPU timeMatthew Pickering2022-06-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix TcRnPragmaWarning meaninguhbif192022-06-093-25/+25
|
* Remove TcRnUnknownMessage usage from GHC.Rename.Env #20115uhbif192022-06-096-49/+127
|
* Document dataToTag# primopAndreas Klebinger2022-06-091-0/+2
|
* Add test for T21682Matthew Pickering2022-06-092-0/+4
| | | | Fixes #21682
* Typecheck remaining ValArgs in rebuildHsAppssheaf2022-06-0932-522/+726
| | | | | | | | | | | | | | | | | 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
* Fix a CSE shadowing bug.Andreas Klebinger2022-06-091-30/+94
| | | | | | | | | | | | | | 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
* Core.Lint: Reduce `DynFlags` and `HscEnv`wip/no-state-core-lintJohn Ericson2022-06-0714-157/+300
| | | | Co-Authored-By: Andre Marianiello <andremarianiello@users.noreply.github.com>
* Don't print the number of deps in count-deps testswip/enumerate-deps-only-no-countJohn Ericson2022-06-073-4/+3
| | | | | | | 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.
* Ensure floated dictionaries are in scope (again)Simon Peyton Jones2022-06-064-2/+240
| | | | | | | | | | | 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.
* Diagnostics conversions, part 6 (#20116)Aaron Allen2022-06-067-72/+229
| | | | | | Replaces uses of `TcRnUnknownMessage` with proper diagnostics constructors in `GHC.Tc.Gen.Match`, `GHC.Tc.Gen.Pat`, and `GHC.Tc.Gen.Sig`.
* Deprecate TypeInType extensionHaskellMouse2022-06-06145-163/+240
| | | | | | | | | | | | | | | | 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
* HsToCore.Coverage: Purge DynFlagswip/coverage-configJohn Ericson2022-06-028-46/+78
| | | | | | Finishes what !7467 (closed) started. Progress towards #17957
* GHC.HsToCore.Breakpoints: Slightly improve perfSylvain Henry2022-06-021-1/+1
| | | | | We have the length already, so we might as well use that rather than O(n) recomputing it.
* Split out `GHC.HsToCore.{Breakpoints,Coverage}` and use `SizedSeq`John Ericson2022-06-026-189/+266
| | | | | | | | | | | | | | | | | | | 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.)
* Rename `HsToCore.{Coverage -> Ticks}`John Ericson2022-06-028-25/+25
| | | | | | 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.
* Hoist auto `mkModBreaks` and `writeMixEntries` conditions to callerJohn Ericson2022-06-021-13/+14
| | | | | | 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.