jon.recoil.org

Module Flambda2_simplify_shared.Slot_offsets

Computing offsets

type t

The type of state used to accumulate constraints on offsets.

type used_slots = {
  1. function_slots_in_normal_projections : Flambda2_identifiers.Function_slot.Set.t;
    (*

    Function slots that appear in projections with normal name mode

    *)
  2. all_function_slots : Flambda2_identifiers.Function_slot.Set.t;
    (*

    All function slots, both in projections and declarations, irrespective of name mode

    *)
  3. value_slots_in_normal_projections : Flambda2_identifiers.Value_slot.Set.t;
    (*

    Closure vars that appear in projections with normal name mode

    *)
  4. all_value_slots : Flambda2_identifiers.Value_slot.Set.t;
    (*

    All value slots, both in projections and declarations, irrespective of name mode

    *)
}

The slot information required from the caller of this module.

type result = {
  1. exported_offsets : Flambda2_simplify_shared.Exported_offsets.t;
    (*

    This includes all offsets for function/value slots that occur in the current compilation unit. This includes offsets for slots from other compilation units that appear in the current compilation unit.

    Some slots can be marked as dead, because they are unused but simplify could not remove them. For instance, this occurs for unused value slots of non-liftable functions (.e.g in functors).

    *)
  2. used_value_slots : Flambda2_identifiers.Value_slot.Set.t;
    (*

    This is the set of values slots that appears after simplify, minus the slots that are marked as dead in exported_offsets.

    *)
}

The result of the slot offset computation

Printing function.

Create an empty set of constraints.

Add a set of closure to the set of constraints.

Aggregate sets of closures from two contexts

Compute offsets for all function and value slots that occur in the current compilation unit, taking into account the constraints introduced by the potential sharing of slots across multiple sets of closures (see .ml file for more details).

type words = int
module Layout : sig ... end