jon.recoil.org

Module Emitaux

val output_channel : Stdlib.out_channel Stdlib.ref
val emit_string : string -> unit
val emit_buffer : Stdlib.Buffer.t -> unit
val reset : unit -> unit
val reset_debug_info : unit -> unit
val emit_debug_info_gen : ?discriminator:int -> Debuginfo.t -> (file_num:int -> file_name:string -> unit) -> (file_num:int -> line:int -> col:int -> ?discriminator:int -> unit -> unit) -> unit
type frame_debuginfo =
  1. | Dbg_alloc of Cmm.alloc_dbginfo
  2. | Dbg_raise of Debuginfo.t
  3. | Dbg_other of Debuginfo.t
val record_frame_descr : label:Label.t -> frame_size:int -> live_offset:int list -> Emitaux.frame_debuginfo -> unit
type emit_frame_actions = {
  1. efa_code_label : Label.t -> unit;
  2. efa_data_label : Label.t -> unit;
  3. efa_i8 : Numbers.Int8.t -> unit;
  4. efa_i16 : Numbers.Int16.t -> unit;
  5. efa_i32 : Stdlib.Int32.t -> unit;
  6. efa_u8 : Numbers.Uint8.t -> unit;
  7. efa_u16 : Numbers.Uint16.t -> unit;
  8. efa_u32 : Numbers.Uint32.t -> unit;
  9. efa_word : int -> unit;
  10. efa_align : int -> unit;
  11. efa_label_rel : Label.t -> int32 -> unit;
  12. efa_def_label : Label.t -> unit;
  13. efa_string : string -> unit;
}
val emit_frames : Emitaux.emit_frame_actions -> unit
val is_generic_function : string -> bool
val binary_backend_available : bool Stdlib.ref

Is a binary backend available. If yes, we don't need to generate the textual assembly file (unless the user request it with -S).

val reduce_heap_size : reset:(unit -> unit) -> unit

Clear global state and compact the heap, so that an external program (such as the assembler or linker) may have more memory available to it.

When this frees up around 1.1GB of memory, it takes around 0.6s. We only take this time when the job is large enough that we're worried that we'll either run out of memory or constrain the number of parallel jobs. We heuristically measure how big the job is by how much heap we're using ourselves.

The reset parameter will be called before Gc.compact if we go ahead with the compaction. It should clear as much as possible from the global state, since the fewer live words there are after GC, the smaller the new heap can be.

type error =
  1. | Stack_frame_too_large of int
  2. | Stack_frame_way_too_large of int
  3. | Inconsistent_probe_init of string * Debuginfo.t
module Dwarf_helpers : sig ... end
exception Error of Emitaux.error
val report_error : Stdlib.Format.formatter -> Emitaux.error -> unit
type preproc_stack_check_result = {
  1. max_frame_size : int;
  2. contains_nontail_calls : bool;
}
val preproc_stack_check : fun_body:Linear.instruction -> frame_size:int -> trap_size:int -> Emitaux.preproc_stack_check_result
val add_stack_checks_if_needed : Linear.fundecl -> stack_offset:int -> stack_threshold_size:int -> trap_size:int -> Linear.fundecl
val emit_stapsdt_base_section : unit -> unit
val emit_elf_note : section:Asm_targets.Asm_section.t -> owner:string -> typ:int32 -> emit_desc:(unit -> unit) -> unit