diff options
author | doyougnu <jeffrey.young@iohk.io> | 2023-03-15 11:01:03 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-03-30 01:40:08 -0400 |
commit | b159e0e94f8d049198947965046b6a5edbd89c36 (patch) | |
tree | 4edd4755aed0d7c4043f6fa008acff8692a69549 /compiler/GHC/StgToJS/DataCon.hs | |
parent | 41a572f656c04770366c29ef5554184cf685482f (diff) | |
download | haskell-b159e0e94f8d049198947965046b6a5edbd89c36.tar.gz |
js: split JMacro into JS eDSL and JS syntax
This commit:
Splits JExpr and JStat into two nearly identical DSLs:
- GHC.JS.Syntax is the JMacro based DSL without unsaturation, i.e., a
value cannot be unsaturated, or, a value of this DSL is a witness that a
value of GHC.JS.Unsat has been saturated
- GHC.JS.Unsat is the JMacro DSL from GHCJS with Unsaturation.
Then all binary and outputable instances are changed to use
GHC.JS.Syntax.
This moves us closer to closing out #22736 and #22352. See #22736 for
roadmap.
-------------------------
Metric Increase:
CoOpt_Read
LargeRecord
ManyAlternatives
PmSeriesS
PmSeriesT
PmSeriesV
T10421
T10858
T11195
T11374
T11822
T12227
T12707
T13035
T13253
T13253-spj
T13379
T14683
T15164
T15703
T16577
T17096
T17516
T17836
T18140
T18282
T18304
T18478
T18698a
T18698b
T18923
T1969
T19695
T20049
T21839c
T3064
T4801
T5321FD
T5321Fun
T5631
T5642
T783
T9198
T9233
T9630
TcPlugin_RewritePerf
WWRec
-------------------------
Diffstat (limited to 'compiler/GHC/StgToJS/DataCon.hs')
-rw-r--r-- | compiler/GHC/StgToJS/DataCon.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/GHC/StgToJS/DataCon.hs b/compiler/GHC/StgToJS/DataCon.hs index cf82c2f6ac..675fd6d583 100644 --- a/compiler/GHC/StgToJS/DataCon.hs +++ b/compiler/GHC/StgToJS/DataCon.hs @@ -27,7 +27,8 @@ where import GHC.Prelude -import GHC.JS.Syntax +import GHC.JS.Unsat.Syntax +import GHC.JS.Transform import GHC.JS.Make import GHC.StgToJS.Closure @@ -58,7 +59,10 @@ genCon ctx con args = allocCon ctxi con currentCCS args | xs <- concatMap typex_expr (ctxTarget ctx) - = pprPanic "genCon: unhandled DataCon" (ppr (con, args, xs)) + = pprPanic "genCon: unhandled DataCon" (ppr (con + , fmap satJExpr args + , fmap satJExpr xs + )) -- | Allocate a data constructor. Allocate in this context means bind the data -- constructor to 'to' @@ -86,7 +90,7 @@ allocUnboxedCon con = \case | isBoolDataCon con && dataConTag con == 2 -> true_ [x] | isUnboxableCon con -> x - xs -> pprPanic "allocUnboxedCon: not an unboxed constructor" (ppr (con,xs)) + xs -> pprPanic "allocUnboxedCon: not an unboxed constructor" (ppr (con, fmap satJExpr xs)) -- | Allocate an entry function. See 'GHC.StgToJS.hs' for the object layout. allocDynamicE :: Bool -- ^ csInlineAlloc from StgToJSConfig |