jon.recoil.org

Module Jkind.Sort

include Ocaml_typing.Jkind_intf.Sort with type t = Ocaml_typing.Jkind_types.Sort.t and type base = Ocaml_typing.Jkind_types.Sort.base and type Const.t = Ocaml_typing.Jkind_types.Sort.Const.t

A sort classifies how a type is represented at runtime. Every concrete jkind has a sort, and knowing the sort is sufficient for knowing the calling convention of values of a given type.

type base = Ocaml_typing.Jkind_types.Sort.base =
  1. | Void
    (*

    No run time representation at all

    *)
  2. | Value
    (*

    Standard ocaml value representation

    *)
  3. | Untagged_immediate
    (*

    Untagged 31- or 63-bit immediates, but without the tag bit, so they must never be visible to the GC

    *)
  4. | Float64
    (*

    Unboxed 64-bit floats

    *)
  5. | Float32
    (*

    Unboxed 32-bit floats

    *)
  6. | Word
    (*

    Unboxed native-size integers

    *)
  7. | Bits8
    (*

    Unboxed 8-bit integers

    *)
  8. | Bits16
    (*

    Unboxed 16-bit integers

    *)
  9. | Bits32
    (*

    Unboxed 32-bit integers

    *)
  10. | Bits64
    (*

    Unboxed 64-bit integers

    *)
  11. | Vec128
    (*

    Unboxed 128-bit simd vectors

    *)
  12. | Vec256
    (*

    Unboxed 256-bit simd vectors

    *)
  13. | Vec512
    (*

    Unboxed 512-bit simd vectors

    *)

These are the constant sorts -- fully determined and without variables

type var

A sort variable that can be unified during type-checking.

module Const : sig ... end
module Var : sig ... end
val new_var : level:int -> Ocaml_typing.Jkind.Sort.t

Create a new sort variable that can be unified.

This checks for equality, and sets any variables to make two sorts equal, if possible

val is_void_defaulting : Ocaml_typing.Jkind.Sort.t -> bool

Checks whether this sort is void, defaulting to value if a sort variable is unfilled.

default_to_value_and_get extracts the sort as a `const`. If it's a variable, it is set to value first.

default_for_transl_and_get extracts the sort as a `const`. If it's a variable, it is set to value first. After we have support for void, this will default to void instead.

type change

To record changes to sorts, for use with `Types.snapshot, backtrack`

val undo_change : Ocaml_typing.Jkind.Sort.change -> unit
module Debug_printers : sig ... end
module Flat : sig ... end