PreviousUpNext

15.3.128  src/lib/compiler/back/low/main/nextcode/per-codetemp-heapcleaner-info.api

# per-codetemp-heapcleaner-info.api
#
# Here we define info to be attached to codetemps
# for the benefit of the heapcleaner.
#
# This appears to be another project started but never finished;
# activation is controlled by the always-FALSE
#
#     lowhalf_track_heapcleaner_type_info
#
# flag in
#
#     src/lib/compiler/back/low/main/main/translate-nextcode-to-treecode-g.pkg
#
# The other relevant files are:
#
#     src/lib/compiler/back/low/heapcleaner-safety/per-codetemp-heapcleaner-info-template.api
#     src/lib/compiler/back/low/main/nextcode/per-codetemp-heapcleaner-info.pkg
#     src/lib/compiler/back/low/heapcleaner-safety/codetemps-with-heapcleaner-info.api
#     src/lib/compiler/back/low/heapcleaner-safety/codetemps-with-heapcleaner-info-g.pkg

# Compiled by:
#     src/lib/compiler/core.sublib

stipulate
    package ncf =  nextcode_form;                       # nextcode_form         is from   src/lib/compiler/back/top/nextcode/nextcode-form.pkg
    package nt  =  note;                                # note                  is from   src/lib/src/note.pkg
herein

    # This api must be compatible with
    #
    #     src/lib/compiler/back/low/heapcleaner-safety/per-codetemp-heapcleaner-info-template.api
    #
    # This api is implemented (only) in
    #
    #     src/lib/compiler/back/low/main/nextcode/per-codetemp-heapcleaner-info.pkg
    #
    api Per_Codetemp_Heapcleaner_Info {
        #
        Type = Int;

        Heapcleaner_Info                                                                        # Might rename to Heapcleaner_Data since 'data' is a word and 'info' is not. :-)  XXX SUCKO FIXME
          # 
          = CONST   multiword_int::Int                                                          # Integer constant.
          | NONREF  Ref( ncf::Type )                                                            # Non-reference value.
          | HC_REF  Ref( ncf::Type )                                                            # A reference, pointer to a heapchunk.
          | PLUS    (Type, Heapcleaner_Info, Heapcleaner_Info)                                  # Address arithmetic +
          | MINUS   (Type, Heapcleaner_Info, Heapcleaner_Info)                                  # Address arithmetic -
          | HEAP_ALLOCATION_POINTER                                                             # Mythryl heap-allocation pointer -- we allot heap memory just by advancing this pointer.
          | HEAP_ALLOCATION_LIMIT                                                               # Mythryl heap-allocation limit   -- we may not allot memory beyond this point.
          | BOT
          | TOP
          ;

        top:   Heapcleaner_Info; 
        bot:   Heapcleaner_Info; 
        const: multiword_int::Int -> Heapcleaner_Info; 

        ====     : (Heapcleaner_Info, Heapcleaner_Info) -> Bool;
        join:      (Heapcleaner_Info, Heapcleaner_Info) -> Heapcleaner_Info;
        meet:      (Heapcleaner_Info, Heapcleaner_Info) -> Heapcleaner_Info;

        to_string:  Heapcleaner_Info -> String;


        # Base types 
        #
        i31_type:       Heapcleaner_Info;                                                               # tagged integers
        i32_type:       Heapcleaner_Info;                                                               # untagged integers
        #
        f64_type:       Heapcleaner_Info;                                                               # unboxed real
        f32_type:       Heapcleaner_Info;                                                               # unused
        #
        ptr_type:       Heapcleaner_Info;                                                               # tagged heapchunks
        int_type:       Heapcleaner_Info;                                                               # machine integers aka I32

        add:       (Type, Heapcleaner_Info, Heapcleaner_Info) -> Heapcleaner_Info;
        sub:       (Type, Heapcleaner_Info, Heapcleaner_Info) -> Heapcleaner_Info;

        is_recoverable:  Heapcleaner_Info -> Bool;

        exception HCTYPE Heapcleaner_Info;

        cleaner_type:  nt::Notekind(  Heapcleaner_Info );

    };
end;

## Changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext