| Copyright | (C) 2026 Edward Kmett |
|---|---|
| License | UPL-1.0 AND BSD-3-Clause |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | experimental |
| Portability | THC with the pinned Graal integration; native fallback statuses |
| Safe Haskell | Unsafe |
| Language | Haskell2010 |
THC.Internal.JIT
Description
Unstable, potentially hazardous Graal diagnostics. This module is
deliberately Unsafe for Safe Haskell and is not re-exported by THC.
Enabling callbacks affects compilation behavior and overhead; the Graal
integration is version-pinned. No Java handles or forced recompilation are
exposed. Counters are context-attributed, not JVM-wide.
Synopsis
- data Available a
- = Available a
- | Unsupported
- | Disabled
- | Denied
- | Unavailable
- data JitSnapshot = JitSnapshot {}
- jitTelemetryEnabled :: IO (Available Bool)
- setJitTelemetryEnabled :: Bool -> IO (Available ())
- jitSnapshot :: IO JitSnapshot
Documentation
An absent metric is not zero. Queries never enable JVM-wide monitoring.
fmap transforms a genuine value and preserves every non-value status:
>>>fmap (+ 1) (Available (41 :: Int))Available 42>>>fmap (+ 1) (Disabled :: Available Int)Disabled>>>map (fmap (+ 1)) [Unsupported, Disabled, Denied, Unavailable :: Available Int][Unsupported,Disabled,Denied,Unavailable]
Constructors
| Available a | A genuine value; its scope is specified by the query. |
| Unsupported | The runtime or provider does not implement this service. |
| Disabled | Supported, but its instrumentation or sink is switched off. |
| Denied | The current context or host security policy forbids access. |
| Unavailable | Normally supported, but no value is currently available. |
Instances
| Functor Available # | |
| Eq a => Eq (Available a) # | |
| Ord a => Ord (Available a) # | |
Defined in THC.Runtime.Types | |
| Show a => Show (Available a) # | |
data JitSnapshot Source #
Independently sampled cumulative event counts during enabled periods. Disabling does not reset counters. These are callbacks, not a count of currently installed call targets or proof that a particular entry compiled. All tiers/recompilations count. An enabled-period boundary can separate a start from its completion, so matching totals are not guaranteed. Counts saturate at 2^63-1.
Constructors
| JitSnapshot | |
Instances
| Eq JitSnapshot # | |
Defined in THC.Internal.JIT | |
| Show JitSnapshot # | |
Defined in THC.Internal.JIT Methods showsPrec :: Int -> JitSnapshot -> ShowS # show :: JitSnapshot -> String # showList :: [JitSnapshot] -> ShowS # | |
jitTelemetryEnabled :: IO (Available Bool) Source #
Query whether this context has opted into telemetry callbacks.
setJitTelemetryEnabled :: Bool -> IO (Available ()) Source #
Explicitly opt this context into or out of telemetry. Does not force compilation or enable process-wide monitoring; counters survive toggling.
jitSnapshot :: IO JitSnapshot Source #
Sample the context-attributed counters without enabling telemetry or requesting compilation. Each counter retains its own availability status.