Cheng Shao pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC
Commits:
-
1a86d8c2
by Cheng Shao at 2026-07-15T15:14:32+00:00
7 changed files:
- libraries/base/src/GHC/Essentials.hs
- libraries/base/src/System/CPUTime/Posix/Times.hsc
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Conc.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Conc/Internal.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Exports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Imports.hs
- libraries/ghc-internal/src/GHC/Internal/Wasm/Prim/Types.hs
Changes:
| ... | ... | @@ -353,7 +353,13 @@ import GHC.Internal.Ptr |
| 353 | 353 | import GHC.Internal.Foreign.C.ConstPtr
|
| 354 | 354 | #if defined(javascript_HOST_ARCH)
|
| 355 | 355 | import GHC.Internal.JS.Prim (unsafeUnpackJSStringUtf8##, JSVal)
|
| 356 | +#elif defined(wasm32_HOST_ARCH)
|
|
| 357 | +import GHC.Internal.Wasm.Prim (JSVal)
|
|
| 356 | 358 | #else
|
| 359 | +data JSVal
|
|
| 360 | +#endif
|
|
| 361 | + |
|
| 362 | +#if !defined(javascript_HOST_ARCH)
|
|
| 357 | 363 | {-
|
| 358 | 364 | Note [JS primitives known-keys for non-js target]
|
| 359 | 365 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| ... | ... | @@ -373,7 +379,6 @@ be used unless compiling to JS) and toggle -fdefines-known-key-names for these s |
| 373 | 379 | -}
|
| 374 | 380 | |
| 375 | 381 | -- See Note [JS primitives known-keys for non-js target]
|
| 376 | -data JSVal
|
|
| 377 | 382 | unsafeUnpackJSStringUtf8## :: a
|
| 378 | 383 | unsafeUnpackJSStringUtf8## = error "unsafeUnpackJSStringUtf8## known-key was used when the compilation target wasn't javascript_HOST_ARCH"
|
| 379 | 384 | #endif |
| ... | ... | @@ -14,6 +14,10 @@ import Data.Ratio |
| 14 | 14 | import GHC.Internal.Foreign.C.Types
|
| 15 | 15 | import System.CPUTime.Utils
|
| 16 | 16 | |
| 17 | +#if !HAVE_TIMES
|
|
| 18 | +import GHC.Essentials
|
|
| 19 | +#endif
|
|
| 20 | + |
|
| 17 | 21 | -- for struct tms
|
| 18 | 22 | #if HAVE_SYS_TIMES_H
|
| 19 | 23 | #include <sys/times.h>
|
| ... | ... | @@ -7,7 +7,6 @@ module GHC.Internal.Wasm.Prim.Conc ( |
| 7 | 7 | import GHC.Internal.Base
|
| 8 | 8 | import GHC.Internal.IO.Unsafe
|
| 9 | 9 | import GHC.Internal.Stable
|
| 10 | -import GHC.Internal.Types (Int, IO)
|
|
| 11 | 10 | |
| 12 | 11 | {-
|
| 13 | 12 |
| ... | ... | @@ -6,7 +6,6 @@ module GHC.Internal.Wasm.Prim.Conc.Internal ( |
| 6 | 6 | |
| 7 | 7 | import GHC.Internal.Base
|
| 8 | 8 | import GHC.Internal.IO
|
| 9 | -import GHC.Internal.Types
|
|
| 10 | 9 | |
| 11 | 10 | -- See W6 of Note [Tracking dependencies on primitives] in GHC.Internal.Base
|
| 12 | 11 | import GHC.Internal.Wasm.Prim.Imports ()
|
| ... | ... | @@ -30,7 +30,7 @@ module GHC.Internal.Wasm.Prim.Exports ( |
| 30 | 30 | js_promiseReject
|
| 31 | 31 | ) where
|
| 32 | 32 | |
| 33 | -import GHC.Internal.Base (join, pure, ($), (*>), (=<<))
|
|
| 33 | +import GHC.Internal.Base
|
|
| 34 | 34 | import GHC.Internal.Exception.Type
|
| 35 | 35 | import GHC.Internal.IO
|
| 36 | 36 | import GHC.Internal.IORef
|
| ... | ... | @@ -40,7 +40,6 @@ import GHC.Internal.Prim ( |
| 40 | 40 | )
|
| 41 | 41 | import GHC.Internal.Stable
|
| 42 | 42 | import GHC.Internal.TopHandler (flushStdHandles)
|
| 43 | -import GHC.Internal.Types (Any, Bool, Char, Double, Float)
|
|
| 44 | 43 | import GHC.Internal.Wasm.Prim.Types
|
| 45 | 44 | import GHC.Internal.Word
|
| 46 | 45 | import GHC.Internal.Unsafe.Coerce ( unsafeCoerce# )
|
| ... | ... | @@ -35,7 +35,6 @@ import GHC.Internal.Stable |
| 35 | 35 | import GHC.Internal.Prim (
|
| 36 | 36 | RealWorld, State#, makeStablePtr#, newMVar#, readMVar#,
|
| 37 | 37 | )
|
| 38 | -import GHC.Internal.Types (Any, IO(..))
|
|
| 39 | 38 | import GHC.Internal.Wasm.Prim.Types
|
| 40 | 39 | import GHC.Internal.Unsafe.Coerce ( unsafeCoerce# )
|
| 41 | 40 | import qualified GHC.Internal.Stack.Types as Rebindable
|
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | {-# LANGUAGE NoImplicitPrelude #-}
|
| 6 | 6 | {-# LANGUAGE UnliftedFFITypes #-}
|
| 7 | 7 | {-# LANGUAGE UnliftedNewtypes #-}
|
| 8 | +{-# OPTIONS_GHC -fdefines-known-key-names #-}
|
|
| 8 | 9 | |
| 9 | 10 | module GHC.Internal.Wasm.Prim.Types (
|
| 10 | 11 | JSVal# (..),
|
| ... | ... | @@ -20,13 +21,11 @@ module GHC.Internal.Wasm.Prim.Types ( |
| 20 | 21 | |
| 21 | 22 | import qualified GHC.Internal.Data.Typeable.Internal as Rebindable
|
| 22 | 23 | import GHC.Internal.Base
|
| 23 | -import GHC.Internal.Classes (Ord(..))
|
|
| 24 | 24 | import GHC.Internal.Exception.Type
|
| 25 | 25 | import GHC.Internal.Foreign.C.String.Encoding
|
| 26 | 26 | import GHC.Internal.ForeignPtr
|
| 27 | 27 | import GHC.Internal.Prim (Int#, RealWorld, State#, mkWeak#, mkWeakNoFinalizer#)
|
| 28 | 28 | import GHC.Internal.Ptr
|
| 29 | -import GHC.Internal.Types (Any, Int, UnliftedType)
|
|
| 30 | 29 | import GHC.Internal.IO
|
| 31 | 30 | import GHC.Internal.IO.Encoding
|
| 32 | 31 | import GHC.Internal.Maybe (Maybe(..))
|