thc:runtime
Copyright(C) 2026 Edward Kmett
LicenseUPL-1.0 AND BSD-3-Clause
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
PortabilityTHC with the pinned Graal integration; native fallback statuses
Safe HaskellUnsafe
LanguageHaskell2010

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

Documentation

data Available a Source #

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

Instances details
Functor Available # 
Instance details

Defined in THC.Runtime.Types

Methods

fmap :: (a -> b) -> Available a -> Available b #

(<$) :: a -> Available b -> Available a #

Eq a => Eq (Available a) # 
Instance details

Defined in THC.Runtime.Types

Methods

(==) :: Available a -> Available a -> Bool #

(/=) :: Available a -> Available a -> Bool #

Ord a => Ord (Available a) # 
Instance details

Defined in THC.Runtime.Types

Show a => Show (Available a) # 
Instance details

Defined in THC.Runtime.Types

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.

Instances

Instances details
Eq JitSnapshot # 
Instance details

Defined in THC.Internal.JIT

Show JitSnapshot # 
Instance details

Defined in THC.Internal.JIT

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.